mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
show the editor draw canvas only when appropriate
This commit is contained in:
@ -180,6 +180,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||
private fun loadDefaultImageView() {
|
||||
default_image_view.beVisible()
|
||||
crop_image_view.beGone()
|
||||
editor_draw_canvas.beGone()
|
||||
|
||||
val options = RequestOptions()
|
||||
.skipMemoryCache(true)
|
||||
@ -219,6 +220,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||
|
||||
private fun loadCropImageView() {
|
||||
default_image_view.beGone()
|
||||
editor_draw_canvas.beGone()
|
||||
crop_image_view.apply {
|
||||
beVisible()
|
||||
setOnCropImageCompleteListener(this@EditActivity)
|
||||
@ -233,6 +235,12 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadDrawCanvas() {
|
||||
default_image_view.beGone()
|
||||
crop_image_view.beGone()
|
||||
editor_draw_canvas.beVisible()
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.N)
|
||||
private fun saveImage() {
|
||||
var inputStream: InputStream? = null
|
||||
@ -388,6 +396,8 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||
loadCropImageView()
|
||||
} else if (default_image_view.isGone() && currPrimaryAction == PRIMARY_ACTION_FILTER) {
|
||||
loadDefaultImageView()
|
||||
} else if (editor_draw_canvas.isGone() && currPrimaryAction == PRIMARY_ACTION_DRAW) {
|
||||
loadDrawCanvas()
|
||||
}
|
||||
|
||||
arrayOf(bottom_primary_filter, bottom_primary_crop_rotate, bottom_primary_draw).forEach {
|
||||
|
@ -0,0 +1,9 @@
|
||||
package com.simplemobiletools.gallery.pro.views
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
|
||||
class EditorDrawCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) {
|
||||
|
||||
}
|
Reference in New Issue
Block a user