diff options
Diffstat (limited to 'app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt')
-rw-r--r-- | app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt b/app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt index 7fff34a..18f0626 100644 --- a/app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt +++ b/app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt @@ -52,21 +52,25 @@ class PhotoEditorActivity : AppCompatActivity() { undoButton.setOnClickListener { photoEditor.undo() } redoButton.setOnClickListener { photoEditor.redo() } - photoDrawButton.setOnClickListener { + drawButton.setOnClickListener { currentlyDrawing = !currentlyDrawing photoEditor.setBrushDrawingMode(currentlyDrawing) - if (currentlyDrawing) drawColorSeekbar.visibility = View.VISIBLE + if (currentlyDrawing) colorSeekbar.visibility = View.VISIBLE else { - drawColorSeekbar.visibility = View.GONE - photoDrawButton.background = ContextCompat.getDrawable(this, R.drawable.ic_mode_edit_white_24dp) + colorSeekbar.visibility = View.GONE + drawButton.background = ContextCompat.getDrawable(this, R.drawable.ic_mode_edit_white_24dp) } } - drawColorSeekbar.setOnColorChangeListener { _, _, color -> + typeButton.setOnClickListener { + photoEditor.addText("", 123) + } + + colorSeekbar.setOnColorChangeListener { _, _, color -> if (currentlyDrawing) { photoEditor.brushColor = color - photoDrawButton.setBackgroundColor(color) + drawButton.setBackgroundColor(color) } } } |