mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
open the image editor at pressing Rotate / crop
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
package com.simplemobiletools.gallery.activities;
|
package com.simplemobiletools.gallery.activities;
|
||||||
|
|
||||||
import android.app.WallpaperManager;
|
import android.app.WallpaperManager;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
@ -46,6 +47,7 @@ public class ViewPagerActivity extends SimpleActivity
|
|||||||
@BindView(R.id.undo_delete) View mUndoBtn;
|
@BindView(R.id.undo_delete) View mUndoBtn;
|
||||||
@BindView(R.id.view_pager) MyViewPager mPager;
|
@BindView(R.id.view_pager) MyViewPager mPager;
|
||||||
|
|
||||||
|
private static final int EDIT_IMAGE = 1;
|
||||||
private static ActionBar mActionbar;
|
private static ActionBar mActionbar;
|
||||||
private static List<Medium> mMedia;
|
private static List<Medium> mMedia;
|
||||||
private static String mPath;
|
private static String mPath;
|
||||||
@ -161,6 +163,7 @@ public class ViewPagerActivity extends SimpleActivity
|
|||||||
editMedium();
|
editMedium();
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_crop_rotate:
|
case R.id.menu_crop_rotate:
|
||||||
|
openEditor();
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
@ -174,6 +177,12 @@ public class ViewPagerActivity extends SimpleActivity
|
|||||||
adapter.confChanged(mPos);
|
adapter.confChanged(mPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void openEditor() {
|
||||||
|
final Intent intent = new Intent(getApplicationContext(), EditActivity.class);
|
||||||
|
intent.setData(Uri.fromFile(getCurrentFile()));
|
||||||
|
startActivityForResult(intent, EDIT_IMAGE);
|
||||||
|
}
|
||||||
|
|
||||||
private void setAsWallpaper() {
|
private void setAsWallpaper() {
|
||||||
final Bitmap bitmap = BitmapFactory.decodeFile(getCurrentFile().getAbsolutePath());
|
final Bitmap bitmap = BitmapFactory.decodeFile(getCurrentFile().getAbsolutePath());
|
||||||
final WallpaperManager wallpaperManager = WallpaperManager.getInstance(getApplicationContext());
|
final WallpaperManager wallpaperManager = WallpaperManager.getInstance(getApplicationContext());
|
||||||
|
Reference in New Issue
Block a user