diff options
author | Ruben Brunk <rubenbrunk@google.com> | 2012-10-24 11:05:45 -0700 |
---|---|---|
committer | Ruben Brunk <rubenbrunk@google.com> | 2012-10-24 11:45:24 -0700 |
commit | eb6a24e13ab8bc6f2a70bf5e8cc70f469809acb9 (patch) | |
tree | 548d12d1d5ea33deeeb1659c1d0729af3fce90d9 | |
parent | ca05711f0e6f788f0e2937fef04599d612911ca6 (diff) | |
download | android_packages_apps_Gallery2-eb6a24e13ab8bc6f2a70bf5e8cc70f469809acb9.tar.gz android_packages_apps_Gallery2-eb6a24e13ab8bc6f2a70bf5e8cc70f469809acb9.tar.bz2 android_packages_apps_Gallery2-eb6a24e13ab8bc6f2a70bf5e8cc70f469809acb9.zip |
Took out aspect ratio switching.
Bug: 7406414
Change-Id: Iba6e59d728d6f1ce81ea62b01a86dfaa355383b9
-rw-r--r-- | res/menu/filtershow_menu_crop.xml | 13 | ||||
-rw-r--r-- | res/values/filtershow_strings.xml | 8 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/PanelController.java | 19 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java | 15 |
4 files changed, 41 insertions, 14 deletions
diff --git a/res/menu/filtershow_menu_crop.xml b/res/menu/filtershow_menu_crop.xml index dc85d6fde..f8ba3df42 100644 --- a/res/menu/filtershow_menu_crop.xml +++ b/res/menu/filtershow_menu_crop.xml @@ -6,12 +6,23 @@ android:title="@string/aspect1to1_effect"/> <item android:id="@+id/crop_menu_4to6" + android:visible="false" android:title="@string/aspect4to6_effect"/> <item + android:id="@+id/crop_menu_4to3" + android:title="@string/aspect4to3_effect"/> + <item + android:id="@+id/crop_menu_3to4" + android:title="@string/aspect3to4_effect"/> + <item android:id="@+id/crop_menu_5to7" android:title="@string/aspect5to7_effect"/> <item + android:id="@+id/crop_menu_7to5" + android:title="@string/aspect7to5_effect"/> + <item android:id="@+id/crop_menu_9to16" + android:visible="false" android:title="@string/aspect9to16_effect"/> <item android:id="@+id/crop_menu_none" @@ -21,4 +32,4 @@ android:title="@string/aspectOriginal_effect"/> </group> -</menu>
\ No newline at end of file +</menu> diff --git a/res/values/filtershow_strings.xml b/res/values/filtershow_strings.xml index 852ef7474..b04413c7d 100644 --- a/res/values/filtershow_strings.xml +++ b/res/values/filtershow_strings.xml @@ -78,10 +78,16 @@ <string name="aspect">Aspect</string> <!-- Label for the aspect 1:1 effect [CHAR LIMIT=15] --> <string name="aspect1to1_effect">1:1</string> + <!-- Label for the aspect 4:3 effect [CHAR LIMIT=15] --> + <string name="aspect4to3_effect">4:3</string> + <!-- Label for the aspect 3:4 effect [CHAR LIMIT=15] --> + <string name="aspect3to4_effect">3:4</string> <!-- Label for the aspect 4:7 effect [CHAR LIMIT=15] --> <string name="aspect4to6_effect">4:6</string> - <!-- Label for the aspect 1:1 effect [CHAR LIMIT=15] --> + <!-- Label for the aspect 5:7 effect [CHAR LIMIT=15] --> <string name="aspect5to7_effect">5:7</string> + <!-- Label for the aspect 7:5 effect [CHAR LIMIT=15] --> + <string name="aspect7to5_effect">7:5</string> <!-- Label for the aspect 1:1 effect [CHAR LIMIT=15] --> <string name="aspect9to16_effect">16:9</string> <!-- Label for the aspect None effect [CHAR LIMIT=15] --> diff --git a/src/com/android/gallery3d/filtershow/PanelController.java b/src/com/android/gallery3d/filtershow/PanelController.java index 9f5f2656a..9448b5638 100644 --- a/src/com/android/gallery3d/filtershow/PanelController.java +++ b/src/com/android/gallery3d/filtershow/PanelController.java @@ -161,19 +161,24 @@ public class PanelController implements OnClickListener { imageCrop.apply(1, 1); break; } - case R.id.crop_menu_4to6: { - button.setText(mContext.getString(R.string.aspect4to6_effect)); - imageCrop.apply(6, 4); + case R.id.crop_menu_4to3: { + button.setText(mContext.getString(R.string.aspect4to3_effect)); + imageCrop.apply(4, 3); + break; + } + case R.id.crop_menu_3to4: { + button.setText(mContext.getString(R.string.aspect3to4_effect)); + imageCrop.apply(3, 4); break; } case R.id.crop_menu_5to7: { button.setText(mContext.getString(R.string.aspect5to7_effect)); - imageCrop.apply(7, 5); + imageCrop.apply(5, 7); break; } - case R.id.crop_menu_9to16: { - button.setText(mContext.getString(R.string.aspect9to16_effect)); - imageCrop.apply(16, 9); + case R.id.crop_menu_7to5: { + button.setText(mContext.getString(R.string.aspect7to5_effect)); + imageCrop.apply(7, 5); break; } case R.id.crop_menu_none: { diff --git a/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java b/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java index cfeceb059..863191a7a 100644 --- a/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java +++ b/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java @@ -430,6 +430,16 @@ public class ImageCrop extends ImageGeometry { float deltaY = dY / scale; int select = movingEdges; if (mFixAspectRatio && (select != MOVE_BLOCK)) { + + // TODO: add in orientation change for fixed aspect + /*if (select == TOP_LEFT || select == TOP_RIGHT || + select == BOTTOM_LEFT || select == BOTTOM_RIGHT){ + RectF blank = new RectF(); + if(switchCropBounds(select, blank)){ + setCropBounds(blank); + return; + } + }*/ if (select == MOVE_LEFT) { select |= MOVE_TOP; } @@ -442,11 +452,6 @@ public class ImageCrop extends ImageGeometry { if (select == MOVE_BOTTOM) { select |= MOVE_RIGHT; } - RectF blank = new RectF(); - if(switchCropBounds(select, blank)){ - setCropBounds(blank); - return; - } } if (select == MOVE_BLOCK) { |