mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 13:08:00 +01:00
reordering some EditActivity functions
This commit is contained in:
parent
62502f3722
commit
b2686a3097
1 changed files with 26 additions and 26 deletions
|
@ -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() {
|
private fun initEditActivity() {
|
||||||
if (intent.data == null) {
|
if (intent.data == null) {
|
||||||
toast(R.string.invalid_image_path)
|
toast(R.string.invalid_image_path)
|
||||||
|
@ -154,32 +180,6 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||||
updateAspectRatio(config.lastEditorCropAspectRatio)
|
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() {
|
private fun loadDefaultImageView() {
|
||||||
default_image_view.beVisible()
|
default_image_view.beVisible()
|
||||||
crop_image_view.beGone()
|
crop_image_view.beGone()
|
||||||
|
|
Loading…
Reference in a new issue