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

Commit 0681c096 authored by Yorke Lee's avatar Yorke Lee
Browse files

Pass button index into inflateButton

Allow subclasses to know the index of the button in
its parent

Bug: 25451071
Change-Id: I0d43482a7f3044244651b0f106633e1aee1ccd80
parent 15971223
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ public class NavigationBarInflaterView extends FrameLayout implements TunerServi

    private void inflateButtons(String[] buttons, ViewGroup parent, boolean landscape) {
        for (int i = 0; i < buttons.length; i++) {
            inflateButton(buttons[i], parent, landscape);
            inflateButton(buttons[i], parent, landscape, i);
        }
    }

@@ -195,7 +195,8 @@ public class NavigationBarInflaterView extends FrameLayout implements TunerServi
    }

    @Nullable
    protected View inflateButton(String buttonSpec, ViewGroup parent, boolean landscape) {
    protected View inflateButton(String buttonSpec, ViewGroup parent, boolean landscape,
            int indexInParent) {
        LayoutInflater inflater = landscape ? mLandscapeInflater : mLayoutInflater;
        float size = extractSize(buttonSpec);
        String button = extractButton(buttonSpec);