summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorJohn Hoford <hoford@google.com>2013-04-20 08:12:48 -0700
committerJohn Hoford <hoford@google.com>2013-04-23 19:19:09 -0700
commitdcd31fe8f7bc219b4e8f7608a6d5ad016da0f885 (patch)
tree4318a5b94eb2fc369ed3b6cee6d7f8dca04ddd37 /src/com/android
parentf9ff7ffe2004ed2077f38a91dafb213495e5bf70 (diff)
downloadandroid_packages_apps_Snap-dcd31fe8f7bc219b4e8f7608a6d5ad016da0f885.tar.gz
android_packages_apps_Snap-dcd31fe8f7bc219b4e8f7608a6d5ad016da0f885.tar.bz2
android_packages_apps_Snap-dcd31fe8f7bc219b4e8f7608a6d5ad016da0f885.zip
Fix local adjust
bug:8655977 Change-Id: I0aa4ac30de077663f52418528757a842372e0fc2
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/gallery3d/filtershow/controller/ActionSlider.java29
-rw-r--r--src/com/android/gallery3d/filtershow/controller/BasicParameterStyle.java2
-rw-r--r--src/com/android/gallery3d/filtershow/controller/ParameterActionAndInt.java8
-rw-r--r--src/com/android/gallery3d/filtershow/editors/Editor.java12
-rw-r--r--src/com/android/gallery3d/filtershow/editors/ParametricEditor.java4
5 files changed, 35 insertions, 20 deletions
diff --git a/src/com/android/gallery3d/filtershow/controller/ActionSlider.java b/src/com/android/gallery3d/filtershow/controller/ActionSlider.java
index 6ed2467de..f80a1cacb 100644
--- a/src/com/android/gallery3d/filtershow/controller/ActionSlider.java
+++ b/src/com/android/gallery3d/filtershow/controller/ActionSlider.java
@@ -27,7 +27,8 @@ import com.android.gallery3d.filtershow.editors.Editor;
public class ActionSlider extends TitledSlider {
private static final String LOGTAG = "ActionSlider";
- ImageButton mActionButton;
+ ImageButton mLeftButton;
+ ImageButton mRightButton;
public ActionSlider() {
mLayoutID = R.layout.filtershow_control_action_slider;
}
@@ -35,22 +36,36 @@ public class ActionSlider extends TitledSlider {
@Override
public void setUp(ViewGroup container, Parameter parameter, Editor editor) {
super.setUp(container, parameter, editor);
- mActionButton = (ImageButton) mTopView.findViewById(R.id.actionButton);
- mActionButton.setOnClickListener(new OnClickListener() {
+ mLeftButton = (ImageButton) mTopView.findViewById(R.id.leftActionButton);
+ mLeftButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
- ((ParameterActionAndInt) mParameter).fireAction();
+ ((ParameterActionAndInt) mParameter).fireLeftAction();
}
});
+
+ mRightButton = (ImageButton) mTopView.findViewById(R.id.rightActionButton);
+ mRightButton.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ ((ParameterActionAndInt) mParameter).fireRightAction();
+ }
+ });
+ updateUI();
}
@Override
public void updateUI() {
super.updateUI();
- if (mActionButton != null) {
- int iconId = ((ParameterActionAndInt) mParameter).getActionIcon();
- mActionButton.setImageResource(iconId);
+ if (mLeftButton != null) {
+ int iconId = ((ParameterActionAndInt) mParameter).getLeftIcon();
+ mLeftButton.setImageResource(iconId);
+ }
+ if (mRightButton != null) {
+ int iconId = ((ParameterActionAndInt) mParameter).getRightIcon();
+ mRightButton.setImageResource(iconId);
}
}
}
diff --git a/src/com/android/gallery3d/filtershow/controller/BasicParameterStyle.java b/src/com/android/gallery3d/filtershow/controller/BasicParameterStyle.java
index 633e41ff6..072edd72a 100644
--- a/src/com/android/gallery3d/filtershow/controller/BasicParameterStyle.java
+++ b/src/com/android/gallery3d/filtershow/controller/BasicParameterStyle.java
@@ -92,8 +92,6 @@ public class BasicParameterStyle implements ParameterStyles {
@Override
public void getIcon(int index, RenderingRequestCaller caller) {
- Log.v(LOGTAG, "############ " + ID + " getIcon " + index);
-
mEditor.computeIcon(index, caller);
}
diff --git a/src/com/android/gallery3d/filtershow/controller/ParameterActionAndInt.java b/src/com/android/gallery3d/filtershow/controller/ParameterActionAndInt.java
index 04567e28c..8a05c3aa6 100644
--- a/src/com/android/gallery3d/filtershow/controller/ParameterActionAndInt.java
+++ b/src/com/android/gallery3d/filtershow/controller/ParameterActionAndInt.java
@@ -19,7 +19,11 @@ package com.android.gallery3d.filtershow.controller;
public interface ParameterActionAndInt extends ParameterInteger {
static String sParameterType = "ParameterActionAndInt";
- public void fireAction();
+ public void fireLeftAction();
- public int getActionIcon();
+ public int getLeftIcon();
+
+ public void fireRightAction();
+
+ public int getRightIcon();
}
diff --git a/src/com/android/gallery3d/filtershow/editors/Editor.java b/src/com/android/gallery3d/filtershow/editors/Editor.java
index 1e239e632..dc13b3e37 100644
--- a/src/com/android/gallery3d/filtershow/editors/Editor.java
+++ b/src/com/android/gallery3d/filtershow/editors/Editor.java
@@ -64,13 +64,7 @@ public class Editor implements OnSeekBarChangeListener, SwapButton.SwapButtonLis
}
public String calculateUserMessage(Context context, String effectName, Object parameterValue) {
- String apply = "";
- if (mShowParameter == SHOW_VALUE_INT) {
- apply += " " + effectName + " " + parameterValue;
- } else {
- apply += " " + effectName;
- }
- return apply;
+ return effectName + " " + parameterValue;
}
protected Editor(int id) {
@@ -214,7 +208,9 @@ public class Editor implements OnSeekBarChangeListener, SwapButton.SwapButtonLis
public void commitLocalRepresentation() {
ImagePreset preset = MasterImage.getImage().getPreset();
preset.updateFilterRepresentation(getLocalRepresentation());
- mPanelController.onNewValue(-1);
+ if (mPanelController != null) {
+ mPanelController.onNewValue(-1);
+ }
}
/**
diff --git a/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java b/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java
index e49f6cd15..33ed143bd 100644
--- a/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java
+++ b/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java
@@ -198,7 +198,9 @@ public class ParametricEditor extends Editor {
public void commitLocalRepresentation() {
super.commitLocalRepresentation();
FilterRepresentation rep = getLocalRepresentation();
- mPanelController.onNewValue(-1);
+ if (mPanelController != null) {
+ mPanelController.onNewValue(-1);
+ }
}
@Override