2022-02-08 12:35:36 +13:00
|
|
|
package io.heckel.ntfy.ui
|
|
|
|
|
|
|
|
import android.content.Context
|
2022-04-28 12:58:23 +12:00
|
|
|
import androidx.core.content.ContextCompat
|
2022-02-08 12:35:36 +13:00
|
|
|
import io.heckel.ntfy.R
|
|
|
|
import io.heckel.ntfy.util.isDarkThemeOn
|
|
|
|
|
|
|
|
class Colors {
|
|
|
|
companion object {
|
|
|
|
const val refreshProgressIndicator = R.color.teal
|
2022-11-27 07:52:52 +13:00
|
|
|
|
|
|
|
fun notificationIcon(context: Context): Int {
|
|
|
|
return if (isDarkThemeOn(context)) R.color.teal_light else R.color.teal
|
|
|
|
}
|
2022-02-08 12:35:36 +13:00
|
|
|
|
|
|
|
fun itemSelectedBackground(context: Context): Int {
|
2022-04-30 03:29:56 +12:00
|
|
|
return if (isDarkThemeOn(context)) R.color.black_800b else R.color.gray_400
|
2022-02-08 12:35:36 +13:00
|
|
|
}
|
|
|
|
|
2022-06-06 10:22:26 +12:00
|
|
|
fun cardBackground(context: Context): Int {
|
|
|
|
return if (isDarkThemeOn(context)) R.color.black_800b else R.color.white
|
|
|
|
}
|
|
|
|
|
2022-04-30 03:29:56 +12:00
|
|
|
fun cardSelectedBackground(context: Context): Int {
|
|
|
|
return if (isDarkThemeOn(context)) R.color.black_700b else R.color.gray_500
|
|
|
|
}
|
|
|
|
|
2022-06-06 10:22:26 +12:00
|
|
|
fun cardBackgroundColor(context: Context): Int {
|
|
|
|
return ContextCompat.getColor(context, cardBackground(context))
|
|
|
|
}
|
|
|
|
|
2022-04-30 03:29:56 +12:00
|
|
|
fun cardSelectedBackgroundColor(context: Context): Int {
|
|
|
|
return ContextCompat.getColor(context, cardSelectedBackground(context))
|
2022-04-28 12:58:23 +12:00
|
|
|
}
|
|
|
|
|
2022-02-08 12:35:36 +13:00
|
|
|
fun statusBarNormal(context: Context): Int {
|
2022-04-30 03:29:56 +12:00
|
|
|
return if (isDarkThemeOn(context)) R.color.black_900 else R.color.teal
|
2022-02-08 12:35:36 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
fun statusBarActionMode(context: Context): Int {
|
2022-04-30 03:29:56 +12:00
|
|
|
return if (isDarkThemeOn(context)) R.color.black_900 else R.color.teal_dark
|
2022-02-08 12:35:36 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
fun dangerText(context: Context): Int {
|
|
|
|
return if (isDarkThemeOn(context)) R.color.red_light else R.color.red_dark
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|