summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2013-02-14 16:18:22 -0800
committerRuben Brunk <rubenbrunk@google.com>2013-02-14 16:37:06 -0800
commit6a2dbeb43aa74dd16b290bacd52632452aea35ec (patch)
tree124784146d40b802eb46eed42c7db43bc5979da3 /src/com/android/gallery3d/filtershow
parent3c2fca3fe03888a3db308eea5e69b38479433706 (diff)
downloadandroid_packages_apps_Snap-6a2dbeb43aa74dd16b290bacd52632452aea35ec.tar.gz
android_packages_apps_Snap-6a2dbeb43aa74dd16b290bacd52632452aea35ec.tar.bz2
android_packages_apps_Snap-6a2dbeb43aa74dd16b290bacd52632452aea35ec.zip
Fixed crop display for setting contacts/wallpapers.
Bug: 8187056 Bug: 8196779 Bug: 8140241 Change-Id: Iaf3d113d9e53d365b73985fdc3350b627f8bda4c
Diffstat (limited to 'src/com/android/gallery3d/filtershow')
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java31
-rw-r--r--src/com/android/gallery3d/filtershow/cache/ImageLoader.java1
2 files changed, 20 insertions, 12 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 0660eda30..f7147eac1 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -88,6 +88,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
// fields for supporting crop action
public static final String CROP_ACTION = "com.android.camera.action.CROP";
private CropExtras mCropExtras = null;
+ private String mAction = "";
MasterImage mMasterImage = null;
public static final String TINY_PLANET_ACTION = "com.android.camera.action.TINY_PLANET";
@@ -146,6 +147,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
private FilterIconButton mNullBorderFilter;
private int mIconSeedSize = 140;
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -308,6 +310,8 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
+ mAction = intent.getAction();
+
if (intent.getData() != null) {
startLoadBitmap(intent.getData());
} else {
@@ -315,8 +319,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
}
// Handle behavior for various actions
- String action = intent.getAction();
- if (action.equalsIgnoreCase(CROP_ACTION)) {
+ if (mAction.equalsIgnoreCase(CROP_ACTION)) {
Bundle extras = intent.getExtras();
if (extras != null) {
mCropExtras = new CropExtras(extras.getInt(CropExtras.KEY_OUTPUT_X, 0),
@@ -345,9 +348,6 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
mPanelController.setFixedAspect(mCropExtras.getAspectX() > 0
&& mCropExtras.getAspectY() > 0);
}
- mPanelController.showComponent(findViewById(R.id.cropButton));
- } else if (action.equalsIgnoreCase(TINY_PLANET_ACTION)) {
- mPanelController.showComponent(findViewById(R.id.tinyplanetButton));
}
}
@@ -502,6 +502,13 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
}
mLoadBitmapTask = null;
+
+ if (mAction == CROP_ACTION) {
+ mPanelController.showComponent(findViewById(R.id.cropButton));
+ } else if (mAction == TINY_PLANET_ACTION) {
+ mPanelController.showComponent(findViewById(R.id.tinyplanetButton));
+ }
+
super.onPostExecute(result);
}
@@ -1037,31 +1044,31 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
private boolean mSaveToExtraUri = false;
private boolean mSaveAsWallpaper = false;
private boolean mReturnAsExtra = false;
- private boolean outputted = false;
+ private boolean mOutputted = false;
public void saveImage() {
if (mCropExtras != null) {
if (mCropExtras.getExtraOutput() != null) {
mSaveToExtraUri = true;
- outputted = true;
+ mOutputted = true;
}
if (mCropExtras.getSetAsWallpaper()) {
mSaveAsWallpaper = true;
- outputted = true;
+ mOutputted = true;
}
if (mCropExtras.getReturnData()) {
mReturnAsExtra = true;
- outputted = true;
+ mOutputted = true;
}
- if (outputted) {
+ if (mOutputted) {
mImageShow.getImagePreset().mGeoData.setUseCropExtrasFlag(true);
showSavingProgress(null);
mImageShow.returnFilteredResult(this);
}
}
- if (!outputted) {
+ if (!mOutputted) {
if (mImageShow.hasModifications()) {
// Get the name of the album, to which the image will be saved
File saveDir = SaveCopyTask.getFinalSaveDirectory(this, mImageLoader.getUri());
@@ -1111,7 +1118,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
}
public void done() {
- if (outputted) {
+ if (mOutputted) {
hideSavingProgress();
}
finish();
diff --git a/src/com/android/gallery3d/filtershow/cache/ImageLoader.java b/src/com/android/gallery3d/filtershow/cache/ImageLoader.java
index 00fcf4e19..698992ac9 100644
--- a/src/com/android/gallery3d/filtershow/cache/ImageLoader.java
+++ b/src/com/android/gallery3d/filtershow/cache/ImageLoader.java
@@ -456,6 +456,7 @@ public class ImageLoader {
Log.w(LOGTAG, "Failed to save image!");
return null;
}
+ bitmap = param.applyGeometry(bitmap);
return param.apply(bitmap);
}
};