Bug 1050780 - Avoid disabled items in GeckoMenu's adapter (r=margaret)
authorLucas Rocha <lucasr@mozilla.com>
Tue, 02 Sep 2014 10:47:16 +0100
changeset 202945 8fc296b9a1df145702c2988757fa6c0a14efde36
parent 202941 c360f3d1c00d73b0c1fb0a2c0da525cb55e58b83
child 202946 00faca591549beb3b59aa0bbff054dddf14b14d9
push id27416
push userryanvm@gmail.com
push dateTue, 02 Sep 2014 17:59:34 +0000
treeherdermozilla-central@bfeddb24df7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1050780
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1050780 - Avoid disabled items in GeckoMenu's adapter (r=margaret)
mobile/android/base/menu/GeckoMenu.java
mobile/android/base/resources/drawable/action_bar_button.xml
--- a/mobile/android/base/menu/GeckoMenu.java
+++ b/mobile/android/base/menu/GeckoMenu.java
@@ -781,17 +781,19 @@ public class GeckoMenu extends ListView
         public boolean areAllItemsEnabled() {
             // Setting this to true is a workaround to fix disappearing
             // dividers in the menu (bug 963249).
             return true;
         }
 
         @Override
         public boolean isEnabled(int position) {
-            return getItem(position).isEnabled();
+            // Setting this to true is a workaround to fix disappearing
+            // dividers in the menu in L (bug 1050780).
+            return true;
         }
 
         public void addMenuItem(GeckoMenuItem menuItem) {
             if (mItems.contains(menuItem))
                 return;
 
             // Insert it in proper order.
             int index = 0;
--- a/mobile/android/base/resources/drawable/action_bar_button.xml
+++ b/mobile/android/base/resources/drawable/action_bar_button.xml
@@ -1,16 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <item android:state_pressed="true">
+    <item android:state_pressed="true"
+          android:state_enabled="true">
         <shape>
             <solid android:color="@color/highlight" />
         </shape>
     </item>
 
     <item android:state_focused="true"
           android:state_pressed="false">
         <shape>