From bccfe95597760bbdf75eaabc1a55791ae8e7103b Mon Sep 17 00:00:00 2001 From: Skalii Date: Thu, 11 Mar 2021 15:25:17 +0200 Subject: [PATCH] fix toggle button display after rotate screen p.3 --- .../osmand/plus/liveupdates/LiveUpdatesFragmentNew.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragmentNew.java b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragmentNew.java index ba48b27df1..2ab25f1696 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragmentNew.java @@ -80,6 +80,7 @@ import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceTimeOfDayT import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceUpdateFrequency; import static net.osmand.plus.liveupdates.LiveUpdatesHelper.runLiveUpdate; import static net.osmand.plus.liveupdates.LiveUpdatesHelper.setAlarmForPendingIntent; +import static net.osmand.plus.liveupdates.LiveUpdatesSettingsDialogFragmentNew.getTertiaryTextColorId; import static net.osmand.plus.monitoring.TripRecordingActiveBottomSheet.getActiveTextColorId; import static net.osmand.plus.monitoring.TripRecordingActiveBottomSheet.getOsmandIconColorId; import static net.osmand.plus.monitoring.TripRecordingActiveBottomSheet.getSecondaryIconColorId; @@ -520,8 +521,12 @@ public class LiveUpdatesFragmentNew extends BaseOsmAndDialogFragment implements boolean liveUpdateOn = settings.IS_LIVE_UPDATES_ON.get(); CommonPreference localUpdateOn = preferenceForLocalIndex(item, settings); // IncrementalChangesManager changesManager = app.getResourceManager().getChangesManager(); - UiUtilities.setupCompoundButton(option, nightMode, CompoundButtonType.GLOBAL); option.setChecked(localUpdateOn.get()); + if (!liveUpdateOn && localUpdateOn.get()) { + UiUtilities.setupCompoundButton(nightMode, ContextCompat.getColor(app, getTertiaryTextColorId(nightMode)), option); + } else { + UiUtilities.setupCompoundButton(option, nightMode, CompoundButtonType.GLOBAL); + } title.setText(getNameToDisplay(item, app));