reordering some EditActivity functions

This commit is contained in:
tibbi 2019-01-14 14:02:03 +01:00
parent 62502f3722
commit b2686a3097

View file

@ -99,6 +99,32 @@ 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)
return true
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.save_as -> saveImage()
R.id.edit -> editWith()
else -> return super.onOptionsItemSelected(item)
}
return true
}
private fun initEditActivity() {
if (intent.data == null) {
toast(R.string.invalid_image_path)
@ -154,32 +180,6 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
updateAspectRatio(config.lastEditorCropAspectRatio)
}
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)
return true
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.save_as -> saveImage()
R.id.edit -> editWith()
else -> return super.onOptionsItemSelected(item)
}
return true
}
private fun loadDefaultImageView() {
default_image_view.beVisible()
crop_image_view.beGone()