From b2686a309780ed6b4bc9f64d74e99bb0257c8009 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 14 Jan 2019 14:02:03 +0100 Subject: [PATCH] reordering some EditActivity functions --- .../gallery/pro/activities/EditActivity.kt | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt index 0cc34a601..2520d75ae 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt @@ -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()