Merge pull request #205 from qwertyfinger/feature/recent-colors

Show recent colors in color picker
This commit is contained in:
Tibor Kaputa 2021-09-23 22:39:42 +02:00 committed by GitHub
commit ffd3d68615
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -56,6 +56,6 @@ android {
} }
dependencies { dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:ac45c5e893' implementation 'com.github.SimpleMobileTools:Simple-Commons:f7575dcaa1'
implementation "androidx.print:print:1.0.0" implementation "androidx.print:print:1.0.0"
} }

View File

@ -318,7 +318,7 @@ class MainActivity : SimpleActivity(), CanvasListener {
private fun changeBackgroundClicked() { private fun changeBackgroundClicked() {
val oldColor = (my_canvas.background as ColorDrawable).color val oldColor = (my_canvas.background as ColorDrawable).color
ColorPickerDialog(this, oldColor) { wasPositivePressed, color -> ColorPickerDialog(this, oldColor, showRecentColors = true) { wasPositivePressed, color ->
if (wasPositivePressed) { if (wasPositivePressed) {
config.canvasBackgroundColor = color config.canvasBackgroundColor = color
setBackgroundColor(color) setBackgroundColor(color)
@ -479,7 +479,7 @@ class MainActivity : SimpleActivity(), CanvasListener {
} }
private fun pickColor() { private fun pickColor() {
ColorPickerDialog(this, color) { wasPositivePressed, color -> ColorPickerDialog(this, color, showRecentColors = true) { wasPositivePressed, color ->
if (wasPositivePressed) { if (wasPositivePressed) {
setColor(color) setColor(color)
} }