OSDN Git Service

Fix bug 5021359 - show app icon for collapsible action views.
authorAdam Powell <adamp@google.com>
Sat, 16 Jul 2011 03:17:25 +0000 (20:17 -0700)
committerAdam Powell <adamp@google.com>
Sat, 16 Jul 2011 03:17:25 +0000 (20:17 -0700)
Also fix a bug with initial enabled state of the app-home button.

Change-Id: I7eac4932deeced3ac209ad899922ac90f40c87e6

core/java/com/android/internal/app/ActionBarImpl.java
core/java/com/android/internal/widget/ActionBarView.java

index cf5666c..f0a9441 100644 (file)
@@ -159,10 +159,8 @@ public class ActionBarImpl extends ActionBar {
 
         // Older apps get the home button interaction enabled by default.
         // Newer apps need to enable it explicitly.
-        if (mContext.getApplicationInfo().targetSdkVersion <
-                Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
-            setHomeButtonEnabled(true);
-        }
+        setHomeButtonEnabled(mContext.getApplicationInfo().targetSdkVersion <
+                Build.VERSION_CODES.ICE_CREAM_SANDWICH);
     }
 
     public void onConfigurationChanged(Configuration newConfig) {
index 58043c9..6bb40a4 100644 (file)
@@ -1272,7 +1272,7 @@ public class ActionBarView extends AbsActionBarView {
         @Override
         public boolean expandItemActionView(MenuBuilder menu, MenuItemImpl item) {
             mExpandedActionView = item.getActionView();
-            mExpandedHomeLayout.setIcon(item.getIcon());
+            mExpandedHomeLayout.setIcon(mIcon.getConstantState().newDrawable(getResources()));
             mCurrentExpandedItem = item;
             if (mExpandedActionView.getParent() != ActionBarView.this) {
                 addView(mExpandedActionView);