Light mode card background color
This commit is contained in:
parent
6ca6db85c4
commit
9f21ea33f5
1 changed files with 11 additions and 2 deletions
|
|
@ -6,6 +6,7 @@ import android.os.Build
|
|||
import androidx.core.content.ContextCompat
|
||||
import com.google.android.material.color.MaterialColors
|
||||
import io.heckel.ntfy.R
|
||||
import io.heckel.ntfy.util.isDarkThemeOn
|
||||
|
||||
class Colors {
|
||||
companion object {
|
||||
|
|
@ -30,11 +31,19 @@ class Colors {
|
|||
}
|
||||
|
||||
fun cardBackgroundColor(context: Context): Int {
|
||||
return MaterialColors.getColor(context, R.attr.colorSurfaceContainer, Color.WHITE)
|
||||
return if (isDarkThemeOn(context)) {
|
||||
MaterialColors.getColor(context, R.attr.colorSurfaceContainer, Color.GRAY)
|
||||
} else {
|
||||
MaterialColors.getColor(context, R.attr.colorSurface, Color.WHITE)
|
||||
}
|
||||
}
|
||||
|
||||
fun cardSelectedBackgroundColor(context: Context): Int {
|
||||
return MaterialColors.getColor(context, R.attr.colorSurfaceContainerHigh, Color.GRAY)
|
||||
return if (isDarkThemeOn(context)) {
|
||||
MaterialColors.getColor(context, R.attr.colorSurfaceContainerHigh, Color.GRAY)
|
||||
} else {
|
||||
MaterialColors.getColor(context, R.attr.colorSurfaceContainerHighest, Color.GRAY)
|
||||
}
|
||||
}
|
||||
|
||||
fun statusBarNormal(context: Context, dynamicColors: Boolean, darkMode: Boolean): Int {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue