OSDN Git Service

fix RTL menu issues
[android-x86/packages-apps-Gallery2.git] / src / com / android / gallery3d / filtershow / editors / Editor.java
index d5717d0..e3eec39 100644 (file)
@@ -19,6 +19,7 @@ package com.android.gallery3d.filtershow.editors;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.util.AttributeSet;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuItem;
@@ -95,13 +96,12 @@ public class Editor implements OnSeekBarChangeListener, SwapButton.SwapButtonLis
         mEditTitle = editTitle;
         mFilterTitle = stateButton;
         mButton = editTitle;
-        MasterImage.getImage().resetGeometryImages();
-        setMenuIcon(true);
+        MasterImage.getImage().resetGeometryImages(false);
         setUtilityPanelUI(actionButton, editControl);
     }
 
     public boolean showsPopupIndicator() {
-        return true;
+        return false;
     }
 
     /**
@@ -127,12 +127,7 @@ public class Editor implements OnSeekBarChangeListener, SwapButton.SwapButtonLis
         }
 
         if (mButton != null) {
-            if (showsPopupIndicator()) {
-                mButton.setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0,
-                        R.drawable.filtershow_menu_marker, 0);
-            } else {
-                mButton.setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, 0, 0);
-            }
+            setMenuIcon(showsPopupIndicator());
         }
     }
 
@@ -242,7 +237,7 @@ public class Editor implements OnSeekBarChangeListener, SwapButton.SwapButtonLis
         }
         if (mChangesGeometry) {
             // Regenerate both the filtered and the geometry-only bitmaps
-            MasterImage.getImage().resetGeometryImages();
+            MasterImage.getImage().resetGeometryImages(true);
         }
         // Regenerate the filtered bitmap.
         MasterImage.getImage().invalidateFiltersOnly();
@@ -282,7 +277,7 @@ public class Editor implements OnSeekBarChangeListener, SwapButton.SwapButtonLis
     }
 
     public void openUtilityPanel(LinearLayout mAccessoryViewList) {
-        setMenuIcon(false);
+        setMenuIcon(showsPopupIndicator());
         if (mImageShow != null) {
             mImageShow.openUtilityPanel(mAccessoryViewList);
         }
@@ -290,7 +285,7 @@ public class Editor implements OnSeekBarChangeListener, SwapButton.SwapButtonLis
 
     protected void setMenuIcon(boolean on) {
         mEditTitle.setCompoundDrawablesRelativeWithIntrinsicBounds(
-                0, 0, on ? R.drawable.filtershow_menu_marker : 0, 0);
+                0, 0, on ? R.drawable.filtershow_menu_marker_rtl : 0, 0);
     }
 
     protected void createMenu(int[] strId, View button) {
@@ -328,5 +323,8 @@ public class Editor implements OnSeekBarChangeListener, SwapButton.SwapButtonLis
     }
 
     public void detach() {
+        if (mImageShow != null) {
+            mImageShow.detach();
+        }
     }
 }