From 2fecf237a3c1377c0dbef3377f37535d41dbba29 Mon Sep 17 00:00:00 2001 From: Naveen Date: Wed, 12 Oct 2022 03:14:12 +0530 Subject: [PATCH] Color the icon itself, not the background --- .../draw/pro/activities/MainActivity.kt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/draw/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/draw/pro/activities/MainActivity.kt index 6e1a342..4022c74 100644 --- a/app/src/main/kotlin/com/simplemobiletools/draw/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/draw/pro/activities/MainActivity.kt @@ -40,6 +40,7 @@ import java.io.ByteArrayOutputStream import java.io.File import java.io.OutputStream + class MainActivity : SimpleActivity(), CanvasListener { private val PICK_IMAGE_INTENT = 1 private val SAVE_IMAGE_INTENT = 2 @@ -416,16 +417,10 @@ class MainActivity : SimpleActivity(), CanvasListener { ).forEach { val view = it.first val enabled = it.second - - view.apply { - if (enabled) { - val primaryColor = getProperPrimaryColor() - background = ColorDrawable(primaryColor).apply { alpha = 220 } - applyColorFilter(primaryColor.getContrastColor()) - } else { - background = null - applyColorFilter(config.canvasBackgroundColor.getContrastColor()) - } + if (enabled) { + view.applyColorFilter(getProperPrimaryColor()) + } else { + view.applyColorFilter(config.canvasBackgroundColor.getContrastColor()) } } }