Search in sources :

Example 1 with PhotoCropActivity

use of org.telegram.ui.PhotoCropActivity in project Telegram-FOSS by Telegram-FOSS-Team.

the class ImageUpdater method startCrop.

private void startCrop(String path, Uri uri) {
    AndroidUtilities.runOnUIThread(() -> {
        try {
            LaunchActivity activity = (LaunchActivity) parentFragment.getParentActivity();
            if (activity == null) {
                return;
            }
            Bundle args = new Bundle();
            if (path != null) {
                args.putString("photoPath", path);
            } else if (uri != null) {
                args.putParcelable("photoUri", uri);
            }
            PhotoCropActivity photoCropActivity = new PhotoCropActivity(args);
            photoCropActivity.setDelegate(this);
            activity.presentFragment(photoCropActivity);
        } catch (Exception e) {
            FileLog.e(e);
            Bitmap bitmap = ImageLoader.loadBitmap(path, uri, 800, 800, true);
            processBitmap(bitmap, null);
        }
    });
}
Also used : Bitmap(android.graphics.Bitmap) Bundle(android.os.Bundle) LaunchActivity(org.telegram.ui.LaunchActivity) PhotoCropActivity(org.telegram.ui.PhotoCropActivity)

Aggregations

Bitmap (android.graphics.Bitmap)1 Bundle (android.os.Bundle)1 LaunchActivity (org.telegram.ui.LaunchActivity)1 PhotoCropActivity (org.telegram.ui.PhotoCropActivity)1