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

Commit 0b2d306e authored by Adam Powell's avatar Adam Powell
Browse files

Style new popup widgets.

Change-Id: I208ed292afd9919071778baa9ea61d7ca9e7743c
parent a29d8394
Loading
Loading
Loading
Loading
+110 −0
Original line number Diff line number Diff line
@@ -6840,6 +6840,17 @@
 visibility="public"
>
</field>
<field name="listPopupWindowStyle"
 type="int"
 transient="false"
 volatile="false"
 value="16843584"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="listPreferredItemHeight"
 type="int"
 transient="false"
@@ -7709,6 +7720,17 @@
 visibility="public"
>
</field>
<field name="popupMenuStyle"
 type="int"
 transient="false"
 volatile="false"
 value="16843585"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="popupWindowStyle"
 type="int"
 transient="false"
@@ -9744,6 +9766,17 @@
 visibility="public"
>
</field>
<field name="textAppearanceLargePopupMenu"
 type="int"
 transient="false"
 volatile="false"
 value="16843586"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="textAppearanceMedium"
 type="int"
 transient="false"
@@ -9810,6 +9843,17 @@
 visibility="public"
>
</field>
<field name="textAppearanceSmallPopupMenu"
 type="int"
 transient="false"
 volatile="false"
 value="16843587"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="textCheckMark"
 type="int"
 transient="false"
@@ -16724,6 +16768,28 @@
 visibility="public"
>
</field>
<field name="TextAppearance_Widget_PopupMenu_Large"
 type="int"
 transient="false"
 volatile="false"
 value="16973984"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="TextAppearance_Widget_PopupMenu_Small"
 type="int"
 transient="false"
 volatile="false"
 value="16973985"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="TextAppearance_Widget_TabWidget"
 type="int"
 transient="false"
@@ -17153,6 +17219,28 @@
 visibility="public"
>
</field>
<field name="Widget_ActionButton_CloseMode"
 type="int"
 transient="false"
 volatile="false"
 value="16973983"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="Widget_ActionButton_Overflow"
 type="int"
 transient="false"
 volatile="false"
 value="16973982"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="Widget_AutoCompleteTextView"
 type="int"
 transient="false"
@@ -17351,6 +17439,17 @@
 visibility="public"
>
</field>
<field name="Widget_ListPopupWindow"
 type="int"
 transient="false"
 volatile="false"
 value="16973980"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="Widget_ListView"
 type="int"
 transient="false"
@@ -17395,6 +17494,17 @@
 visibility="public"
>
</field>
<field name="Widget_PopupMenu"
 type="int"
 transient="false"
 volatile="false"
 value="16973981"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="Widget_PopupWindow"
 type="int"
 transient="false"
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ public class ListPopupWindow {
     * @param attrs Attributes from inflating parent views used to style the popup.
     */
    public ListPopupWindow(Context context, AttributeSet attrs) {
        this(context, attrs, 0, 0);
        this(context, attrs, com.android.internal.R.attr.listPopupWindowStyle, 0);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ public class MenuBuilder implements Menu {
        com.android.internal.R.layout.list_menu_item_layout,
        com.android.internal.R.layout.list_menu_item_layout,
        com.android.internal.R.layout.action_menu_item_layout,
        com.android.internal.R.layout.list_menu_item_layout,
        com.android.internal.R.layout.popup_menu_item_layout,
    };

    private static final int[]  sCategoryToOrder = new int[] {
+1 −3
Original line number Diff line number Diff line
@@ -72,9 +72,7 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On
    }

    public void show() {
        // TODO Use a style from the theme here
        mPopup = new ListPopupWindow(mContext, null, 0,
                com.android.internal.R.style.Widget_Spinner);
        mPopup = new ListPopupWindow(mContext, null, com.android.internal.R.attr.popupMenuStyle);
        mPopup.setOnItemClickListener(this);
        mPopup.setOnDismissListener(mDismissListener);

+59 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
  
          http://www.apache.org/licenses/LICENSE-2.0
  
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<com.android.internal.view.menu.ListMenuItemView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="?android:attr/listPreferredItemHeight">
    
    <!-- Icon will be inserted here. -->
    
    <!-- The title and summary have some gap between them, and this 'group' should be centered vertically. -->
    <RelativeLayout
        android:layout_width="0dip"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_marginLeft="6dip"
        android:layout_marginRight="6dip"
        android:duplicateParentState="true">
        
        <TextView 
            android:id="@+id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_alignParentLeft="true"
            android:textAppearance="?android:attr/textAppearanceLargePopupMenu"
            android:singleLine="true"
            android:duplicateParentState="true"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal" />

        <TextView
            android:id="@+id/shortcut"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/title"
            android:layout_alignParentLeft="true"
            android:textAppearance="?android:attr/textAppearanceSmallPopupMenu"
            android:singleLine="true"
            android:duplicateParentState="true" />

    </RelativeLayout>

    <!-- Checkbox, and/or radio button will be inserted here. -->
    
</com.android.internal.view.menu.ListMenuItemView>
Loading