summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2012-10-17 16:59:08 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-10-17 16:59:08 -0700
commit02368abac6855f978b488a573e818bd378f7a8fa (patch)
treecf206def229cc3fe31d30b41d0a54edefdb5d7bd
parent813f347d2d2dd5061c0fb537ff43d5da5608faf4 (diff)
parentc4ddadd5171771e25deee9707fee802823addc1e (diff)
downloadandroid_packages_apps_Snap-02368abac6855f978b488a573e818bd378f7a8fa.tar.gz
android_packages_apps_Snap-02368abac6855f978b488a573e818bd378f7a8fa.tar.bz2
android_packages_apps_Snap-02368abac6855f978b488a573e818bd378f7a8fa.zip
am 3518ff57: Merge "Added support for crop actions. Changed overflow menu to use new editor." into gb-ub-photos-arches
* commit '3518ff575247a5ce923a0cd65fc82e046f8eaeae': Added support for crop actions. Changed overflow menu to use new editor.
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java8
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java7
2 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 169303c66..90b82cefc 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -57,6 +57,7 @@ import com.android.gallery3d.data.SecureSource;
import com.android.gallery3d.data.SnailAlbum;
import com.android.gallery3d.data.SnailItem;
import com.android.gallery3d.data.SnailSource;
+import com.android.gallery3d.filtershow.FilterShowActivity;
import com.android.gallery3d.picasasource.PicasaSource;
import com.android.gallery3d.ui.AnimationTime;
import com.android.gallery3d.ui.DetailsHelper;
@@ -995,9 +996,10 @@ public class PhotoPage extends ActivityState implements
}
case R.id.action_crop: {
Activity activity = mActivity;
- Intent intent = new Intent(CropImage.CROP_ACTION);
- intent.setClass(activity, CropImage.class);
- intent.setData(manager.getContentUri(path));
+ Intent intent = new Intent(FilterShowActivity.CROP_ACTION);
+ intent.setClass(activity, FilterShowActivity.class);
+ intent.setDataAndType(manager.getContentUri(path), current.getMimeType())
+ .setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
activity.startActivityForResult(intent, PicasaSource.isPicasaImage(current)
? REQUEST_CROP_PICASA
: REQUEST_CROP);
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 1f1ba0314..c07ef1a36 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -73,6 +73,7 @@ import java.util.Vector;
public class FilterShowActivity extends Activity implements OnItemClickListener,
OnShareTargetSelectedListener {
+ public static final String CROP_ACTION = "com.android.camera.action.CROP";
private final PanelController mPanelController = new PanelController();
private ImageLoader mImageLoader = null;
private ImageShow mImageShow = null;
@@ -344,6 +345,12 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
} else {
pickImage();
}
+
+ String action = intent.getAction();
+ if (action == CROP_ACTION){
+ mPanelController.showComponent(findViewById(R.id.cropButton));
+ }
+
}
private int getScreenImageSize() {