use the dialog background color as is, without modifying it
This commit is contained in:
parent
567f6c14e6
commit
0f534f3cf4
2 changed files with 1 additions and 12 deletions
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
<color name="pressed_item_foreground">#08000000</color>
|
||||
<color name="activated_item_foreground">#44888888</color>
|
||||
<color name="divider_grey">#44cccccc</color>
|
||||
<color name="dark_dialog_background">#ff424242</color>
|
||||
|
||||
<!-- Color Customization -->
|
||||
<color name="default_text_color">#FF6D6D6D</color>
|
||||
|
|
Loading…
Reference in a new issue