X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Futils%2FColors.java;h=588a498298054c620895d8194e2c01eb91718757;hb=d45a715886c1139da8e8bea91d374abbcffa7af2;hp=8f59c1cf23ccf0c1247cfa0b597431a9f1e3293f;hpb=da3450cd594a3f9ad6f0a76b2b2fc219949a6695;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/utils/Colors.java b/app/src/main/java/net/ktnx/mobileledger/utils/Colors.java index 8f59c1cf..588a4982 100644 --- a/app/src/main/java/net/ktnx/mobileledger/utils/Colors.java +++ b/app/src/main/java/net/ktnx/mobileledger/utils/Colors.java @@ -28,6 +28,7 @@ import net.ktnx.mobileledger.model.MobileLedgerProfile; import androidx.annotation.ColorInt; import androidx.annotation.ColorLong; +import androidx.lifecycle.MutableLiveData; import static java.lang.Math.abs; @@ -44,7 +45,7 @@ public class Colors { @ColorInt public static int primary, defaultTextColor; public static int profileThemeId = -1; - public static ObservableValue themeWatch = new ObservableValue<>(0); + public static MutableLiveData themeWatch = new MutableLiveData<>(0); public static void refreshColors(Resources.Theme theme) { TypedValue tv = new TypedValue(); theme.resolveAttribute(R.attr.table_row_dark_bg, tv, true); @@ -59,7 +60,7 @@ public class Colors { accent = tv.data; // trigger theme observers - themeWatch.notifyObservers(); + themeWatch.postValue(themeWatch.getValue()+1); } public static @ColorLong long hsvaColor(float hue, float saturation, float value, float alpha) {