mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
finish the editor activity only if another editor has been picked
This commit is contained in:
@ -34,6 +34,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||
var resizeWidth = 0
|
||||
var resizeHeight = 0
|
||||
var isCropIntent = false
|
||||
var isEditingWithThirdParty = false
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@ -63,6 +64,17 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
isEditingWithThirdParty = false
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
if (isEditingWithThirdParty)
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.menu_editor, menu)
|
||||
menu.findItem(R.id.resize).isVisible = !isCropIntent
|
||||
@ -193,7 +205,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||
|
||||
private fun editWith() {
|
||||
openEditor(uri, true)
|
||||
finish()
|
||||
isEditingWithThirdParty = true
|
||||
}
|
||||
|
||||
private fun scanFinalPath(path: String) {
|
||||
|
Reference in New Issue
Block a user