Add greetings as glance provider
This commit is contained in:
@ -13,4 +13,5 @@ object Actions {
|
||||
const val ACTION_GO_TO_PREVIOUS_EVENT = "com.tommasoberlose.anotherwidget.action.GO_TO_PREVIOUS_EVENT"
|
||||
const val ACTION_REPORT_CRASH = "com.tommasoberlose.anotherwidget.action.REPORT_CRASH"
|
||||
const val ACTION_CLEAR_NOTIFICATION = "com.tommasoberlose.anotherwidget.action.CLEAR_NOTIFICATION"
|
||||
const val ACTION_UPDATE_GREETINGS = "com.tommasoberlose.anotherwidget.action.UPDATE_GREETINGS"
|
||||
}
|
@ -61,6 +61,20 @@ object Constants {
|
||||
}
|
||||
}
|
||||
|
||||
enum class GlanceNotificationTimer(val value: Int) {
|
||||
HALF_MINUTE(0),
|
||||
ONE_MINUTE(1),
|
||||
FIVE_MINUTES(2),
|
||||
TEN_MINUTES(3),
|
||||
FIFTEEN_MINUTES(4),
|
||||
WHEN_DISMISSED(5);
|
||||
|
||||
companion object {
|
||||
private val map = values().associateBy(GlanceNotificationTimer::value)
|
||||
fun fromInt(type: Int) = map[type]
|
||||
}
|
||||
}
|
||||
|
||||
enum class WeatherIconPack(val value: Int) {
|
||||
DEFAULT(0),
|
||||
MINIMAL(1),
|
||||
|
@ -125,6 +125,7 @@ object Preferences : KotprefModel() {
|
||||
var showDailySteps by booleanPref(default = false)
|
||||
var showGreetings by booleanPref(default = false)
|
||||
var showNotifications by booleanPref(default = false)
|
||||
var hideNotificationAfter by intPref(default = Constants.GlanceNotificationTimer.ONE_MINUTE.value)
|
||||
|
||||
var lastNotificationId by intPref(default = -1)
|
||||
var lastNotificationTitle by stringPref(default = "")
|
||||
|
Reference in New Issue
Block a user