summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Hoford <hoford@google.com>2013-03-11 15:08:26 -0700
committerJohn Hoford <hoford@google.com>2013-03-11 16:55:12 -0700
commitaafbc72fb5aa2d67964c85b6c7c77dd00ae2c965 (patch)
treed054fa68cdee0fecd7d09998026360d8114bb1fa /src
parent5cdaca858571b568c40ea0f1139e477a51859ef3 (diff)
downloadandroid_packages_apps_Snap-aafbc72fb5aa2d67964c85b6c7c77dd00ae2c965.tar.gz
android_packages_apps_Snap-aafbc72fb5aa2d67964c85b6c7c77dd00ae2c965.tar.bz2
android_packages_apps_Snap-aafbc72fb5aa2d67964c85b6c7c77dd00ae2c965.zip
fix menus for all editors
Change-Id: I93e7eef3176b38480d55df176166646709a875fe
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/filtershow/editors/Editor.java5
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorDraw.java34
2 files changed, 10 insertions, 29 deletions
diff --git a/src/com/android/gallery3d/filtershow/editors/Editor.java b/src/com/android/gallery3d/filtershow/editors/Editor.java
index cefdfe6bf..3fd44b6fd 100644
--- a/src/com/android/gallery3d/filtershow/editors/Editor.java
+++ b/src/com/android/gallery3d/filtershow/editors/Editor.java
@@ -182,10 +182,7 @@ public class Editor implements OnSeekBarChangeListener {
}
public boolean useUtilityPanel() {
- if (mImageShow != null) {
- return mImageShow.useUtilityPanel();
- }
- return false;
+ return true;
}
public void openUtilityPanel(LinearLayout mAccessoryViewList) {
diff --git a/src/com/android/gallery3d/filtershow/editors/EditorDraw.java b/src/com/android/gallery3d/filtershow/editors/EditorDraw.java
index aa5ec61e8..1cc8aa2a3 100644
--- a/src/com/android/gallery3d/filtershow/editors/EditorDraw.java
+++ b/src/com/android/gallery3d/filtershow/editors/EditorDraw.java
@@ -18,7 +18,6 @@ package com.android.gallery3d.filtershow.editors;
import android.app.Dialog;
import android.content.Context;
-import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
@@ -37,7 +36,6 @@ import com.android.gallery3d.filtershow.filters.FilterDrawRepresentation;
import com.android.gallery3d.filtershow.filters.FilterRepresentation;
import com.android.gallery3d.filtershow.filters.ImageFilterDraw;
import com.android.gallery3d.filtershow.imageshow.ImageDraw;
-import com.android.gallery3d.filtershow.ui.FramedTextButton;
public class EditorDraw extends Editor {
private static final String LOGTAG = "EditorDraw";
@@ -57,11 +55,6 @@ public class EditorDraw extends Editor {
}
@Override
- public boolean useUtilityPanel() {
- return true;
- }
-
- @Override
public void reflectCurrentFilter() {
super.reflectCurrentFilter();
FilterRepresentation rep = getLocalRepresentation();
@@ -74,29 +67,20 @@ public class EditorDraw extends Editor {
@Override
public void openUtilityPanel(final LinearLayout accessoryViewList) {
- View view = accessoryViewList.findViewById(R.id.drawUtilityButton);
- if (view == null) {
- LayoutInflater inflater = (LayoutInflater) mImageShow.getActivity().getSystemService
- (Context.LAYOUT_INFLATER_SERVICE);
- view = inflater.inflate(R.layout.filtershow_draw_button, accessoryViewList, false);
- accessoryViewList.addView(view, view.getLayoutParams());
- view.setOnClickListener(new OnClickListener() {
+ Button view = (Button) accessoryViewList.findViewById(R.id.applyEffect);
+ view.setText(mContext.getString(R.string.draw_style));
+ view.setOnClickListener(new OnClickListener() {
@Override
- public void onClick(View arg0) {
- showPopupMenu(accessoryViewList);
- }
- });
- }
-
- if (view != null) {
- view.setVisibility(View.VISIBLE);
- }
+ public void onClick(View arg0) {
+ showPopupMenu(accessoryViewList);
+ }
+ });
}
private void showPopupMenu(LinearLayout accessoryViewList) {
- final FramedTextButton button = (FramedTextButton) accessoryViewList.findViewById(
- R.id.drawUtilityButton);
+ final Button button = (Button) accessoryViewList.findViewById(
+ R.id.applyEffect);
if (button == null) {
return;
}