From 0f534f3cf4213cc8f8ffdcf3b56bb6d0c11b2ed1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 27 Dec 2016 00:03:34 +0100 Subject: [PATCH] use the dialog background color as is, without modifying it --- .../simplemobiletools/commons/extensions/Context.kt | 12 +----------- commons/src/main/res/values/colors.xml | 1 - 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt index f10709bc2..351cc58dd 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt @@ -1,9 +1,7 @@ package com.simplemobiletools.commons.extensions import android.content.Context -import android.graphics.Color import android.graphics.drawable.ColorDrawable -import android.graphics.drawable.Drawable import android.support.v7.app.AlertDialog import android.view.LayoutInflater import android.view.View @@ -23,14 +21,6 @@ fun Context.toast(msg: String, length: Int = Toast.LENGTH_SHORT) = Toast.makeTex fun Context.getSharedPrefs() = getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE) -fun Context.getDialogBackgroundColor(backgroundColor: Int): Drawable { - return ColorDrawable(if (backgroundColor.getContrastColor() == Color.WHITE) { - resources.getColor(R.color.dark_dialog_background) - } else { - backgroundColor - }) -} - fun Context.updateTextColors(viewGroup: ViewGroup, tmpTextColor: Int = 0, tmpAccentColor: Int = 0) { val baseConfig = BaseConfig.newInstance(this) val textColor = if (tmpTextColor == 0) baseConfig.textColor else tmpTextColor @@ -85,6 +75,6 @@ fun Context.setupDialogStuff(view: View, dialog: AlertDialog, titleId: Int = 0) getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(primaryColor) getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(primaryColor) getButton(AlertDialog.BUTTON_NEUTRAL).setTextColor(primaryColor) - window.setBackgroundDrawable(context.getDialogBackgroundColor(baseConfig.backgroundColor)) + window.setBackgroundDrawable(ColorDrawable(baseConfig.backgroundColor)) } } diff --git a/commons/src/main/res/values/colors.xml b/commons/src/main/res/values/colors.xml index 94af80d5e..9c6fda918 100644 --- a/commons/src/main/res/values/colors.xml +++ b/commons/src/main/res/values/colors.xml @@ -7,7 +7,6 @@ #08000000 #44888888 #44cccccc - #ff424242 #FF6D6D6D