summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2013-02-15 01:29:31 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-02-15 01:29:32 +0000
commit098f37afd29e0d61ae32a23ae65e1e0d2cd533ec (patch)
treeca965e41b7f5dc1e70a2801c0de3bf08f49eb03b /src
parentc551fcd76cbbf0611f365bbe2b86c87c6226b348 (diff)
parent6a2dbeb43aa74dd16b290bacd52632452aea35ec (diff)
downloadandroid_packages_apps_Snap-098f37afd29e0d61ae32a23ae65e1e0d2cd533ec.tar.gz
android_packages_apps_Snap-098f37afd29e0d61ae32a23ae65e1e0d2cd533ec.tar.bz2
android_packages_apps_Snap-098f37afd29e0d61ae32a23ae65e1e0d2cd533ec.zip
Merge "Fixed crop display for setting contacts/wallpapers." into gb-ub-photos-bryce
Diffstat (limited to 'src')
-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);
}
};