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

Commit 49251170 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add popup item content to id/content where applicable"

parents 2438977f d6558622
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ public class ListMenuItemView extends LinearLayout
    private TextView mShortcutView;
    private ImageView mSubMenuArrowView;
    private ImageView mGroupDivider;
    private LinearLayout mContent;

    private Drawable mBackground;
    private int mTextAppearance;
@@ -114,6 +115,8 @@ public class ListMenuItemView extends LinearLayout
            mSubMenuArrowView.setImageDrawable(mSubMenuArrow);
        }
        mGroupDivider = findViewById(com.android.internal.R.id.group_divider);

        mContent = findViewById(com.android.internal.R.id.content);
    }

    public void initialize(MenuItemImpl itemData, int menuType) {
@@ -131,6 +134,18 @@ public class ListMenuItemView extends LinearLayout
        setContentDescription(itemData.getContentDescription());
    }

    private void addContentView(View v) {
        addContentView(v, -1);
    }

    private void addContentView(View v, int index) {
        if (mContent != null) {
            mContent.addView(v, index);
        } else {
            addView(v, index);
        }
    }

    public void setForceShowIcon(boolean forceShow) {
        mPreserveIconSpacing = mForceShowIcon = forceShow;
    }
@@ -270,7 +285,7 @@ public class ListMenuItemView extends LinearLayout
        LayoutInflater inflater = getInflater();
        mIconView = (ImageView) inflater.inflate(com.android.internal.R.layout.list_menu_item_icon,
                this, false);
        addView(mIconView, 0);
        addContentView(mIconView, 0);
    }

    private void insertRadioButton() {
@@ -278,7 +293,7 @@ public class ListMenuItemView extends LinearLayout
        mRadioButton =
                (RadioButton) inflater.inflate(com.android.internal.R.layout.list_menu_item_radio,
                this, false);
        addView(mRadioButton);
        addContentView(mRadioButton);
    }

    private void insertCheckBox() {
@@ -286,7 +301,7 @@ public class ListMenuItemView extends LinearLayout
        mCheckBox =
                (CheckBox) inflater.inflate(com.android.internal.R.layout.list_menu_item_checkbox,
                this, false);
        addView(mCheckBox);
        addContentView(mCheckBox);
    }

    public boolean prefersCondensedTitle() {
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
    <!-- The title and summary have some gap between them,
    and this 'group' should be centered vertically. -->
    <LinearLayout
        android:id="@+id/content"
        android:layout_width="wrap_content"
        android:layout_height="?attr/dropdownListPreferredItemHeight"
        android:paddingEnd="16dip"