adjust the dialog background color as appropriate

This commit is contained in:
tibbi 2016-12-14 23:16:58 +01:00
parent 4629fec8f8
commit fc15d0a582

View file

@ -2,6 +2,7 @@ package com.simplemobiletools.commons.dialogs
import android.app.AlertDialog
import android.content.Context
import android.graphics.drawable.ColorDrawable
import com.simplemobiletools.commons.R
import com.simplemobiletools.commons.helpers.BaseConfig
@ -31,12 +32,14 @@ class ConfirmationDialog(context: Context, message: String = "", messageId: Int
if (negative != 0)
builder.setNegativeButton(negative, null)
val primaryColor = BaseConfig.newInstance(context).primaryColor
val baseConfig = BaseConfig.newInstance(context)
val primaryColor = baseConfig.primaryColor
dialog = builder.create().apply {
setCanceledOnTouchOutside(true)
show()
getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(primaryColor)
getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(primaryColor)
window.setBackgroundDrawable(ColorDrawable(baseConfig.backgroundColor))
}
}