OSDN Git Service

Hides popup indicator on some editors
authornicolasroard <nicolasroard@google.com>
Tue, 26 Mar 2013 04:40:08 +0000 (21:40 -0700)
committernicolasroard <nicolasroard@google.com>
Tue, 26 Mar 2013 04:40:08 +0000 (21:40 -0700)
Change-Id: I88f17b9352c582f26f09a74db9d91e1fb81dbeae

src/com/android/gallery3d/filtershow/editors/Editor.java
src/com/android/gallery3d/filtershow/editors/EditorFlip.java
src/com/android/gallery3d/filtershow/editors/EditorRotate.java
src/com/android/gallery3d/filtershow/editors/EditorStraighten.java

index af974b9..69266ff 100644 (file)
 package com.android.gallery3d.filtershow.editors;
 
 import android.content.Context;
+import android.graphics.drawable.Drawable;
 import android.text.Html;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.View;
 import android.view.ViewGroup;
-import android.widget.FrameLayout;
-import android.widget.LinearLayout;
-import android.widget.PopupMenu;
-import android.widget.SeekBar;
+import android.widget.*;
 import android.widget.SeekBar.OnSeekBarChangeListener;
 
 import com.android.gallery3d.R;
@@ -85,6 +83,10 @@ public class Editor implements OnSeekBarChangeListener {
         return true;
     }
 
+    public boolean showsPopupIndicator() {
+        return true;
+    }
+
     /**
      * @param actionButton the would be the area for menu etc
      * @param editControl this is the black area for sliders etc
@@ -97,6 +99,14 @@ public class Editor implements OnSeekBarChangeListener {
         } else {
             mSeekBar.setVisibility(View.INVISIBLE);
         }
+        Button button = (Button) actionButton.findViewById(R.id.applyEffect);
+        if (button != null) {
+            if (showsPopupIndicator()) {
+                button.setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, R.drawable.filtershow_menu_marker, 0);
+            } else {
+                button.setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, 0, 0);
+            }
+        }
     }
 
     @Override
index 6642ce0..c996dcb 100644 (file)
@@ -62,4 +62,9 @@ public class EditorFlip extends Editor implements EditorInfo {
     public boolean showsSeekBar() {
         return false;
     }
+
+    @Override
+    public boolean showsPopupIndicator() {
+        return false;
+    }
 }
index 6bf1953..e495558 100644 (file)
@@ -62,4 +62,9 @@ public class EditorRotate extends Editor implements EditorInfo {
     public boolean showsSeekBar() {
         return false;
     }
+
+    @Override
+    public boolean showsPopupIndicator() {
+        return false;
+    }
 }
index 5b65129..3c0c017 100644 (file)
@@ -17,6 +17,7 @@
 package com.android.gallery3d.filtershow.editors;
 
 import android.content.Context;
+import android.view.View;
 import android.widget.FrameLayout;
 
 import com.android.gallery3d.R;
@@ -73,4 +74,9 @@ public class EditorStraighten extends Editor implements EditorInfo {
     public boolean showsSeekBar() {
         return false;
     }
+
+    @Override
+    public boolean showsPopupIndicator() {
+        return false;
+    }
 }