finish the editor activity only if another editor has been picked

This commit is contained in:
tibbi 2017-06-18 20:05:47 +02:00
parent 1d04e60dff
commit 561c81dd42
1 changed files with 13 additions and 1 deletions

View File

@ -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) {