summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/PanelController.java
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2012-10-22 03:50:38 -0700
committerRuben Brunk <rubenbrunk@google.com>2012-10-23 16:44:29 -0700
commit95a94afb783be6f01dac6c6c99ab3716cc456ca7 (patch)
tree8872ae4a923b243627cb27dea544a82426d82ecd /src/com/android/gallery3d/filtershow/PanelController.java
parent70d8bce63b966a00447f8dbd1736fe26a62b07ac (diff)
downloadandroid_packages_apps_Snap-95a94afb783be6f01dac6c6c99ab3716cc456ca7.tar.gz
android_packages_apps_Snap-95a94afb783be6f01dac6c6c99ab3716cc456ca7.tar.bz2
android_packages_apps_Snap-95a94afb783be6f01dac6c6c99ab3716cc456ca7.zip
Reworked crop/transform UI.
Bug: 7385644 Bug: 7378335 Bug: 7366075 Change-Id: Iee7e0a0741b69269b08726bad45e29d86834054e
Diffstat (limited to 'src/com/android/gallery3d/filtershow/PanelController.java')
-rw-r--r--src/com/android/gallery3d/filtershow/PanelController.java79
1 files changed, 5 insertions, 74 deletions
diff --git a/src/com/android/gallery3d/filtershow/PanelController.java b/src/com/android/gallery3d/filtershow/PanelController.java
index 2bf95e759..8f1bdb416 100644
--- a/src/com/android/gallery3d/filtershow/PanelController.java
+++ b/src/com/android/gallery3d/filtershow/PanelController.java
@@ -139,14 +139,7 @@ public class PanelController implements OnClickListener {
private boolean mShowParameterValue = false;
private View mAspectButton = null;
private View mCurvesButton = null;
- private int mCurrentAspectButton = 0;
- private static final int NUMBER_OF_ASPECT_BUTTONS = 6;
- private static final int ASPECT_NONE = 0;
- private static final int ASPECT_1TO1 = 1;
- private static final int ASPECT_5TO7 = 2;
- private static final int ASPECT_4TO6 = 3;
- private static final int ASPECT_16TO9 = 4;
- private static final int ASPECT_ORIG = 5;
+ boolean firstTimeCropDisplayed = true;
public UtilityPanel(Context context, View view, View textView,
View aspectButton, View curvesButton) {
@@ -198,69 +191,6 @@ public class PanelController implements OnClickListener {
imageCrop.invalidate();
}
- public void nextAspectButton() {
- if (mAspectButton instanceof ImageButtonTitle
- && mCurrentImage instanceof ImageCrop) {
- switch (mCurrentAspectButton) {
- case ASPECT_NONE:
- ((ImageButtonTitle) mAspectButton).setText(mContext
- .getString(R.string.aspect)
- + " "
- + mContext.getString(R.string.aspect1to1_effect));
- ((ImageCrop) mCurrentImage).apply(1, 1);
- break;
- case ASPECT_1TO1:
- ((ImageButtonTitle) mAspectButton).setText(mContext
- .getString(R.string.aspect)
- + " "
- + mContext.getString(R.string.aspect5to7_effect));
- ((ImageCrop) mCurrentImage).apply(7, 5);
- break;
- case ASPECT_5TO7:
- ((ImageButtonTitle) mAspectButton).setText(mContext
- .getString(R.string.aspect)
- + " "
- + mContext.getString(R.string.aspect4to6_effect));
- ((ImageCrop) mCurrentImage).apply(6, 4);
- break;
- case ASPECT_4TO6:
- ((ImageButtonTitle) mAspectButton).setText(mContext
- .getString(R.string.aspect)
- + " "
- + mContext.getString(R.string.aspect9to16_effect));
- ((ImageCrop) mCurrentImage).apply(16, 9);
- break;
- case ASPECT_16TO9:
- ((ImageButtonTitle) mAspectButton).setText(mContext
- .getString(R.string.aspect)
- + " "
- + mContext.getString(R.string.aspectOriginal_effect));
- ((ImageCrop) mCurrentImage).applyOriginal();
- break;
- case ASPECT_ORIG:
- ((ImageButtonTitle) mAspectButton).setText(mContext
- .getString(R.string.aspect)
- + " "
- + mContext.getString(R.string.aspectNone_effect));
- ((ImageCrop) mCurrentImage).applyClear();
- break;
- default:
- ((ImageButtonTitle) mAspectButton).setText(mContext
- .getString(R.string.aspect)
- + " "
- + mContext.getString(R.string.aspectNone_effect));
- ((ImageCrop) mCurrentImage).applyClear();
- mCurrentAspectButton = ASPECT_NONE;
- break;
- }
- mCurrentAspectButton = (mCurrentAspectButton + 1) % NUMBER_OF_ASPECT_BUTTONS;
- }
- }
-
- void setCurrentAspectButton(int n) {
- mCurrentAspectButton = n;
- }
-
public void showAspectButtons() {
if (mAspectButton != null)
mAspectButton.setVisibility(View.VISIBLE);
@@ -653,8 +583,10 @@ public class PanelController implements OnClickListener {
String ename = mCurrentImage.getContext().getString(R.string.crop);
mUtilityPanel.setEffectName(ename);
mUtilityPanel.setShowParameter(false);
- mUtilityPanel.setCurrentAspectButton(-1);
- mUtilityPanel.nextAspectButton();
+ if (mCurrentImage instanceof ImageCrop && mUtilityPanel.firstTimeCropDisplayed){
+ ((ImageCrop) mCurrentImage).applyOriginal();
+ mUtilityPanel.firstTimeCropDisplayed = false;
+ }
mUtilityPanel.showAspectButtons();
break;
}
@@ -760,7 +692,6 @@ public class PanelController implements OnClickListener {
break;
}
case R.id.aspect: {
- mUtilityPanel.nextAspectButton();
mUtilityPanel.showAspectButtons();
break;
}