summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2012-12-17 17:54:16 -0800
committerRuben Brunk <rubenbrunk@google.com>2012-12-17 17:54:16 -0800
commit2b5021d525229c759f0b57b8a607520d081a3084 (patch)
tree7e50db20de89f070c396ffbea7e8112f911f47f2
parentfdc55e32bb4643ca7a3637045b975d94b25f3714 (diff)
downloadandroid_packages_apps_Snap-2b5021d525229c759f0b57b8a607520d081a3084.tar.gz
android_packages_apps_Snap-2b5021d525229c759f0b57b8a607520d081a3084.tar.bz2
android_packages_apps_Snap-2b5021d525229c759f0b57b8a607520d081a3084.zip
Disabled further filters after Tiny Planet.
Bug: 7407176 Temporary fix. We need to handle filters changing the image geometry properly. Change-Id: I405b83acddec4e3b88a8a1d70dc534df15c37f1c
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java23
-rw-r--r--src/com/android/gallery3d/filtershow/PanelController.java14
2 files changed, 36 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index c1e4f6add..ff78bd1b9 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -231,6 +231,11 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
mGeometryButton = (ImageButton) findViewById(R.id.geometryButton);
mColorsButton = (ImageButton) findViewById(R.id.colorsButton);
+ mBottomPanelButtons.add(mFxButton);
+ mBottomPanelButtons.add(mBorderButton);
+ mBottomPanelButtons.add(mGeometryButton);
+ mBottomPanelButtons.add(mColorsButton);
+
mImageShow.setImageLoader(mImageLoader);
mImageCurves.setImageLoader(mImageLoader);
mImageCurves.setMaster(mImageShow);
@@ -796,6 +801,22 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
}
}
+ public void disableFilterButtons() {
+ for (ImageButton b : mBottomPanelButtons) {
+ b.setEnabled(false);
+ b.setClickable(false);
+ b.setAlpha(0.4f);
+ }
+ }
+
+ public void enableFilterButtons() {
+ for (ImageButton b : mBottomPanelButtons) {
+ b.setEnabled(true);
+ b.setClickable(true);
+ b.setAlpha(1.0f);
+ }
+ }
+
// //////////////////////////////////////////////////////////////////////////////
// imageState panel...
@@ -877,7 +898,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
invalidateOptionsMenu();
}
- private void resetHistory() {
+ void resetHistory() {
mNullFxFilter.onClick(mNullFxFilter);
mNullBorderFilter.onClick(mNullBorderFilter);
diff --git a/src/com/android/gallery3d/filtershow/PanelController.java b/src/com/android/gallery3d/filtershow/PanelController.java
index 52bf98aa7..e92c54936 100644
--- a/src/com/android/gallery3d/filtershow/PanelController.java
+++ b/src/com/android/gallery3d/filtershow/PanelController.java
@@ -56,6 +56,7 @@ public class PanelController implements OnClickListener {
private static int HORIZONTAL_MOVE = 1;
private static final int ANIM_DURATION = 200;
private static final String LOGTAG = "PanelController";
+ private boolean mDisableFilterButtons = false;
class Panel {
private final View mView;
@@ -345,6 +346,10 @@ public class PanelController implements OnClickListener {
mCurrentImage.resetParameter();
mCurrentImage.select();
}
+ if (mDisableFilterButtons) {
+ mActivity.enableFilterButtons();
+ mDisableFilterButtons = false;
+ }
}
public boolean onBackPressed() {
@@ -356,6 +361,11 @@ public class PanelController implements OnClickListener {
mMasterImage.onItemClick(position);
showPanel(mCurrentPanel);
mCurrentImage.select();
+ if (mDisableFilterButtons) {
+ mActivity.enableFilterButtons();
+ mActivity.resetHistory();
+ mDisableFilterButtons = false;
+ }
return false;
}
@@ -593,6 +603,10 @@ public class PanelController implements OnClickListener {
String ename = mCurrentImage.getContext().getString(R.string.tinyplanet);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
+ if (!mDisableFilterButtons) {
+ mActivity.disableFilterButtons();
+ mDisableFilterButtons = true;
+ }
break;
}
case R.id.straightenButton: {