Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c16ba8cd authored by Filip Gruszczyński's avatar Filip Gruszczyński
Browse files

Passing and using defStyle in ViewGroup initFromAttributes.

Change-Id: I2104037d6f701aa3a27bf09226aca171ec77495d
parent b971b89c
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -463,13 +463,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
    public ViewGroup(Context context, AttributeSet attrs) {
        super(context, attrs);
        initViewGroup();
        initFromAttributes(context, attrs);
        initFromAttributes(context, attrs, 0);
    }

    public ViewGroup(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        initViewGroup();
        initFromAttributes(context, attrs);
        initFromAttributes(context, attrs, defStyle);
    }

    private boolean debugDraw() {
@@ -499,9 +499,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        mPersistentDrawingCache = PERSISTENT_SCROLLING_CACHE;
    }

    private void initFromAttributes(Context context, AttributeSet attrs) {
        TypedArray a = context.obtainStyledAttributes(attrs,
                R.styleable.ViewGroup);
    private void initFromAttributes(Context context, AttributeSet attrs, int defStyle) {
        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ViewGroup, defStyle, 0);

        final int N = a.getIndexCount();
        for (int i = 0; i < N; i++) {