Change crop feature
This commit is contained in:
parent
b32183668e
commit
eb81adc512
|
@ -105,7 +105,7 @@ dependencies {
|
|||
implementation 'jp.wasabeef:glide-transformations:4.0.0'
|
||||
playstoreImplementation "io.github.kobakei:ratethisapp:$ratethisappLibraryVersion"
|
||||
implementation 'ja.burhanrashid52:photoeditor:0.4.0'
|
||||
implementation 'com.github.yalantis:ucrop:2.2.3'
|
||||
api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
|
||||
|
||||
implementation "net.gotev:uploadservice:$uploadServiceVersion"
|
||||
implementation "net.gotev:uploadservice-okhttp:$uploadServiceVersion"
|
||||
|
|
|
@ -194,10 +194,8 @@
|
|||
android:label="@string/app_name"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
/>
|
||||
<activity
|
||||
android:name="com.yalantis.ucrop.UCropActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
|
||||
<activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
|
||||
android:theme="@style/Base.Theme.AppCompat"/>
|
||||
|
||||
<activity android:name="app.fedilab.android.activities.WebviewActivity"
|
||||
android:label="@string/app_name"
|
||||
|
|
|
@ -60,7 +60,7 @@ import android.widget.ImageView;
|
|||
import android.widget.TextView;
|
||||
|
||||
|
||||
import com.yalantis.ucrop.UCrop;
|
||||
import com.theartofdev.edmodo.cropper.CropImage;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -380,8 +380,9 @@ public class PhotoEditorActivity extends BaseActivity implements OnPhotoEditorL
|
|||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
case UCrop.REQUEST_CROP:
|
||||
final Uri resultUri = UCrop.getOutput(data);
|
||||
case CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE:
|
||||
CropImage.ActivityResult result = CropImage.getActivityResult(data);
|
||||
Uri resultUri = result.getUri();
|
||||
if( resultUri != null) {
|
||||
mPhotoEditorView.getSource().setImageURI(resultUri);
|
||||
mPhotoEditorView.getSource().setRotation(rotationInDegrees);
|
||||
|
@ -511,10 +512,8 @@ public class PhotoEditorActivity extends BaseActivity implements OnPhotoEditorL
|
|||
mStickerBSFragment.show(getSupportFragmentManager(), mStickerBSFragment.getTag());
|
||||
break;
|
||||
case CROP:
|
||||
String filename = System.currentTimeMillis()+"_"+Helper.getFileName(PhotoEditorActivity.this, uri);
|
||||
tempname = new SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()).format(new Date()) + filename;
|
||||
UCrop.of(uri, Uri.fromFile(new File(getCacheDir(),tempname)))
|
||||
.start(PhotoEditorActivity.this);
|
||||
CropImage.activity(uri)
|
||||
.start(this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue