mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-03-11 14:10:06 +01:00
Apply internal cropping when sharing an image
This commit is contained in:
parent
6e5802f021
commit
f196e111c7
1 changed files with 2 additions and 7 deletions
|
@ -51,7 +51,7 @@ import org.fossify.gallery.models.FilterItem
|
|||
import java.io.*
|
||||
import kotlin.math.max
|
||||
|
||||
class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener {
|
||||
class EditActivity : SimpleActivity() {
|
||||
companion object {
|
||||
init {
|
||||
System.loadLibrary("NativeImageProcessor")
|
||||
|
@ -256,7 +256,6 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
|||
binding.editorDrawCanvas.beGone()
|
||||
binding.cropImageView.apply {
|
||||
beVisible()
|
||||
setOnCropImageCompleteListener(this@EditActivity)
|
||||
setImageUriAsync(uri)
|
||||
guidelines = CropImageView.Guidelines.ON
|
||||
|
||||
|
@ -405,7 +404,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
|||
binding.cropImageView.isVisible() -> {
|
||||
isSharingBitmap = true
|
||||
runOnUiThread {
|
||||
binding.cropImageView.croppedImageAsync()
|
||||
cropImageAsync()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -817,10 +816,6 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
|||
}
|
||||
}
|
||||
|
||||
override fun onCropImageComplete(view: CropImageView, result: CropImageView.CropResult) {
|
||||
onCropImageComplete(result.bitmap, result.error)
|
||||
}
|
||||
|
||||
private fun onCropImageComplete(bitmap: Bitmap?, error: Exception?) {
|
||||
if (error == null && bitmap != null) {
|
||||
setOldExif()
|
||||
|
|
Loading…
Add table
Reference in a new issue