diff --git a/automotive/src/main/assets/alfa_2_0_gme_aa.properties b/automotive/src/main/assets/alfa_2_0_gme_aa.properties index 009b53d5..7e331149 100644 --- a/automotive/src/main/assets/alfa_2_0_gme_aa.properties +++ b/automotive/src/main/assets/alfa_2_0_gme_aa.properties @@ -101,3 +101,5 @@ profile_8.pref.giulia.max_pids_in_column.2="1" #batch profile_8.pref.adapter.batch.enabled=true profile_8.pref.adapter.batch.size="3" + +profile_8.pref.aa.theme.dynamic-selector.enabled=true \ No newline at end of file diff --git a/automotive/src/main/assets/alfa_2_0_gme_aa_stn.properties b/automotive/src/main/assets/alfa_2_0_gme_aa_stn.properties index 051d44a3..35b8cc4e 100644 --- a/automotive/src/main/assets/alfa_2_0_gme_aa_stn.properties +++ b/automotive/src/main/assets/alfa_2_0_gme_aa_stn.properties @@ -107,4 +107,6 @@ profile_9.pref.adapter.batch.enabled=true profile_9.pref.adapter.batch.size="10" #stn setting -profile_9.pref.adapter.stn.enabled=true \ No newline at end of file +profile_9.pref.adapter.stn.enabled=true + +profile_9.pref.aa.theme.dynamic-selector.enabled=true \ No newline at end of file diff --git a/automotive/src/main/java/org/obd/graphs/aa/CarSettings.kt b/automotive/src/main/java/org/obd/graphs/aa/CarSettings.kt index ba969b41..fb669135 100644 --- a/automotive/src/main/java/org/obd/graphs/aa/CarSettings.kt +++ b/automotive/src/main/java/org/obd/graphs/aa/CarSettings.kt @@ -48,13 +48,15 @@ internal class CarSettings : ScreenSettings { ) } - override fun dynamicSelectorChangedEvent(dynamicMode: DynamicSelectorMode) { - when (dynamicMode) { - DynamicSelectorMode.NORMAL -> Prefs.updateInt(PREF_THEME_PROGRESS_BAR_COLOR, COLOR_DYNAMIC_SELECTOR_NORMAL) - DynamicSelectorMode.SPORT -> Prefs.updateInt(PREF_THEME_PROGRESS_BAR_COLOR, COLOR_DYNAMIC_SELECTOR_SPORT) - DynamicSelectorMode.ECO -> Prefs.updateInt(PREF_THEME_PROGRESS_BAR_COLOR, COLOR_DYNAMIC_SELECTOR_ECO) - DynamicSelectorMode.RACE -> Prefs.updateInt(PREF_THEME_PROGRESS_BAR_COLOR, COLOR_DYNAMIC_SELECTOR_RACE) - } + override fun dynamicSelectorChangedEvent(dynamicSelectorMode: DynamicSelectorMode) { + if (isDynamicSelectorThemeEnabled()) { + when (dynamicSelectorMode) { + DynamicSelectorMode.NORMAL -> Prefs.updateInt(PREF_THEME_PROGRESS_BAR_COLOR, COLOR_DYNAMIC_SELECTOR_NORMAL) + DynamicSelectorMode.SPORT -> Prefs.updateInt(PREF_THEME_PROGRESS_BAR_COLOR, COLOR_DYNAMIC_SELECTOR_SPORT) + DynamicSelectorMode.ECO -> Prefs.updateInt(PREF_THEME_PROGRESS_BAR_COLOR, COLOR_DYNAMIC_SELECTOR_ECO) + DynamicSelectorMode.RACE -> Prefs.updateInt(PREF_THEME_PROGRESS_BAR_COLOR, COLOR_DYNAMIC_SELECTOR_RACE) + } + } } override fun applyVirtualScreen1() = applyVirtualScreen(VIRTUAL_SCREEN_1) diff --git a/datalogger/src/main/java/org/obd/graphs/bl/datalogger/DynamicSelectorModeEvenEmitter.kt b/datalogger/src/main/java/org/obd/graphs/bl/datalogger/DynamicSelectorModeEventEmitter.kt similarity index 94% rename from datalogger/src/main/java/org/obd/graphs/bl/datalogger/DynamicSelectorModeEvenEmitter.kt rename to datalogger/src/main/java/org/obd/graphs/bl/datalogger/DynamicSelectorModeEventEmitter.kt index d9ecacc0..01da56f6 100644 --- a/datalogger/src/main/java/org/obd/graphs/bl/datalogger/DynamicSelectorModeEvenEmitter.kt +++ b/datalogger/src/main/java/org/obd/graphs/bl/datalogger/DynamicSelectorModeEventEmitter.kt @@ -5,12 +5,11 @@ import org.obd.metrics.api.model.ObdMetric private const val DYNAMIC_SELECTOR_PID_ID = 7036L -internal class DynamicSelectorModeEvenEmitter() { +internal class DynamicSelectorModeEventEmitter { private var currentMode = -1 fun postValue(obdMetric: ObdMetric) { if (isDynamicSelectorPID(obdMetric)) { - if (currentMode != obdMetric.value) { currentMode = obdMetric.value.toInt() when (obdMetric.value.toInt()) { diff --git a/datalogger/src/main/java/org/obd/graphs/bl/datalogger/MetricsObserver.kt b/datalogger/src/main/java/org/obd/graphs/bl/datalogger/MetricsObserver.kt index f53a2407..39c20dcc 100644 --- a/datalogger/src/main/java/org/obd/graphs/bl/datalogger/MetricsObserver.kt +++ b/datalogger/src/main/java/org/obd/graphs/bl/datalogger/MetricsObserver.kt @@ -8,7 +8,7 @@ import org.obd.metrics.api.model.ReplyObserver internal class MetricsObserver : ReplyObserver>() { internal val metrics: MutableLiveData = MutableLiveData() - private val dynamicSelectorModeEvenEmitter = DynamicSelectorModeEvenEmitter() + private val dynamicSelectorModeEvenEmitter = DynamicSelectorModeEventEmitter() fun reset() { metrics.postValue(null) }