diff options
| author | Ruben Brunk <rubenbrunk@google.com> | 2012-10-17 00:40:35 -0700 |
|---|---|---|
| committer | Ruben Brunk <rubenbrunk@google.com> | 2012-10-17 16:35:19 -0700 |
| commit | 63926d2ed2ca2921de8dca9b3a52c1d64d8afc46 (patch) | |
| tree | 622434bf86adac2d37e6288d38ab138d27bdb019 | |
| parent | 43b906d81caa4379eae1a1643194c8b3d34b1ad5 (diff) | |
| download | android_packages_apps_Gallery2-63926d2ed2ca2921de8dca9b3a52c1d64d8afc46.tar.gz android_packages_apps_Gallery2-63926d2ed2ca2921de8dca9b3a52c1d64d8afc46.tar.bz2 android_packages_apps_Gallery2-63926d2ed2ca2921de8dca9b3a52c1d64d8afc46.zip | |
Added support for crop actions. Changed overflow menu to use new editor.
Bug: 7281479
Bug: 7337191
Change-Id: I91055c972666e4c2d605903646b55d8c67ae87f3
| -rw-r--r-- | AndroidManifest.xml | 7 | ||||
| -rw-r--r-- | src/com/android/gallery3d/app/PhotoPage.java | 8 | ||||
| -rw-r--r-- | src/com/android/gallery3d/filtershow/FilterShowActivity.java | 7 |
3 files changed, 19 insertions, 3 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index b62fe470f..58c47fb0d 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -255,6 +255,13 @@ <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="image/*" /> </intent-filter> + <intent-filter android:label="@string/crop_label"> + <action android:name="com.android.camera.action.CROP" /> + <data android:mimeType="image/*" /> + <category android:name="android.intent.category.DEFAULT" /> + <category android:name="android.intent.category.ALTERNATIVE" /> + <category android:name="android.intent.category.SELECTED_ALTERNATIVE" /> + </intent-filter> </activity> <uses-library android:name="com.google.android.media.effects" 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() { |
