Added flags "Show seconds" and "Use theme color" for clock widgets (#673)
* Added flags for use seconds and use theme color for clock widget, and "Display" clock style. Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx> * Separator in "Display" clock changed to vector for consistency. Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx> * "Use theme color" is now false by default. Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx> * Added padding for all clocks. Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx> * FIX: "Show seconds" was default true on VM, glitching the clock widget when first loaded. Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx> * Clock time is now provided for a variable component as needed, splitting the current time provider by two. Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx> * Compact mode is also considered for second/minute provider. Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx> * Yet another tweak to Orbit clock colors. Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx> * Separator flicker is now synced with second change for Display clock. Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx> * Update libraries * Update IDEA Kotlin file * Disable seconds by default * Swap order of clock widget preferences * Invert themed orbit clock colors * Rename display clock style to 7 segment * Make watch face names localizable --------- Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx> Co-authored-by: MM20 <15646950+MM2-0@users.noreply.github.com>
This commit is contained in:
co-authored by
MM20
parent
dae97d47fb
commit
1a20458904
+6
-1
@@ -27,6 +27,8 @@ data class LauncherSettingsData(
|
||||
val clockWidgetCompact: Boolean = false,
|
||||
val clockWidgetStyle: ClockWidgetStyle = ClockWidgetStyle.Digital1(),
|
||||
val clockWidgetColors: ClockWidgetColors = ClockWidgetColors.Auto,
|
||||
val clockWidgetShowSeconds: Boolean = false,
|
||||
val clockWidgetUseThemeColor: Boolean = false,
|
||||
val clockWidgetAlarmPart: Boolean = true,
|
||||
val clockWidgetBatteryPart: Boolean = true,
|
||||
val clockWidgetMusicPart: Boolean = true,
|
||||
@@ -189,7 +191,6 @@ sealed interface ClockWidgetStyle {
|
||||
@Serializable
|
||||
enum class Variant {
|
||||
Default,
|
||||
MDY,
|
||||
OnePlus,
|
||||
}
|
||||
}
|
||||
@@ -210,6 +211,10 @@ sealed interface ClockWidgetStyle {
|
||||
@SerialName("binary")
|
||||
data object Binary : ClockWidgetStyle
|
||||
|
||||
@Serializable
|
||||
@SerialName("segment")
|
||||
data object Segment : ClockWidgetStyle
|
||||
|
||||
@Serializable
|
||||
@SerialName("empty")
|
||||
data object Empty : ClockWidgetStyle
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ class Migration1(
|
||||
LegacySettings.ClockWidgetSettings.ClockStyle.AnalogClock -> ClockWidgetStyle.Analog
|
||||
LegacySettings.ClockWidgetSettings.ClockStyle.EmptyClock -> ClockWidgetStyle.Empty
|
||||
LegacySettings.ClockWidgetSettings.ClockStyle.DigitalClock1_MDY -> ClockWidgetStyle.Digital1(
|
||||
variant = ClockWidgetStyle.Digital1.Variant.MDY
|
||||
variant = ClockWidgetStyle.Digital1.Variant.Default
|
||||
)
|
||||
|
||||
LegacySettings.ClockWidgetSettings.ClockStyle.DigitalClock1_Outlined -> ClockWidgetStyle.Digital1(
|
||||
|
||||
+20
-2
@@ -96,12 +96,30 @@ class ClockWidgetSettings internal constructor(
|
||||
}
|
||||
}
|
||||
|
||||
val color
|
||||
get() = launcherDataStore.data.map { it.clockWidgetColors }
|
||||
|
||||
fun setColor(color: ClockWidgetColors) {
|
||||
launcherDataStore.update {
|
||||
it.copy(clockWidgetColors = color)
|
||||
}
|
||||
}
|
||||
|
||||
val color
|
||||
get() = launcherDataStore.data.map { it.clockWidgetColors }
|
||||
val showSeconds
|
||||
get() = launcherDataStore.data.map { it.clockWidgetShowSeconds }
|
||||
|
||||
fun setShowSeconds(enabled: Boolean) {
|
||||
launcherDataStore.update {
|
||||
it.copy(clockWidgetShowSeconds = enabled)
|
||||
}
|
||||
}
|
||||
|
||||
val useThemeColor
|
||||
get() = launcherDataStore.data.map { it.clockWidgetUseThemeColor }
|
||||
|
||||
fun setUseThemeColor(enabled: Boolean) {
|
||||
launcherDataStore.update {
|
||||
it.copy(clockWidgetUseThemeColor = enabled)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user