File outputFile = FileUtils.genEditFile();
try {
Intent intent = new ImageEditorIntentBuilder(this, root, outputFile.getAbsolutePath())
.withAddText() // Add the features you need
.withPaintFeature()
.withFilterFeature()
.withRotateFeature()
.withCropFeature()
.withBrightnessFeature()
.withSaturationFeature()
.withBeautyFeature()
.withStickerFeature()
.forcePortrait(true) // Add this to force portrait mode (It's set to false by default)
.setSupportActionBarVisibility(false) // To hide app's default action bar
.build();
EditImageActivity.start(ImagePriview.this, intent, PHOTO_EDITOR_REQUEST_CODE);
} catch (Exception e) {
Log.e("Demo App", e.getMessage()); // This could throw if either sourcePath or outputPath is blank or Null
}
than cretate FileUtils Class:
public class FileUtils {
public static final String FOLDER_NAME = "Destination File Name";
File outputFile = FileUtils.genEditFile(); try { Intent intent = new ImageEditorIntentBuilder(this, root, outputFile.getAbsolutePath()) .withAddText() // Add the features you need .withPaintFeature() .withFilterFeature() .withRotateFeature() .withCropFeature() .withBrightnessFeature() .withSaturationFeature() .withBeautyFeature() .withStickerFeature() .forcePortrait(true) // Add this to force portrait mode (It's set to false by default) .setSupportActionBarVisibility(false) // To hide app's default action bar .build(); EditImageActivity.start(ImagePriview.this, intent, PHOTO_EDITOR_REQUEST_CODE); } catch (Exception e) { Log.e("Demo App", e.getMessage()); // This could throw if either
sourcePath
oroutputPath
is blank or Null }than cretate FileUtils Class:
public class FileUtils { public static final String FOLDER_NAME = "Destination File Name";
File baseDir; if (android.os.Build.VERSION.SDK_INT < 8) { baseDir = Environment.getExternalStorageDirectory(); } else { baseDir = Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); } if (baseDir == null) return Environment.getExternalStorageDirectory(); File aviaryFolder = new File(baseDir, FOLDER_NAME); if (aviaryFolder.exists()) return aviaryFolder; if (aviaryFolder.isFile()) aviaryFolder.delete(); if (aviaryFolder.mkdirs()) return aviaryFolder; return Environment.getExternalStorageDirectory(); }
}
fileutility.zip
Originally posted by @ravi-savaj in https://github.com/iamutkarshtiwari/Ananas/issues/75#issuecomment-733580130