Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34262b4f authored by Amit Kumar's avatar Amit Kumar
Browse files

Fix crash when selecting any new theme and display updated theme preview

parent bc4c335c
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ class WidgetManagerImpl @Inject constructor(private val context: Context) : Widg

    override fun updateTheme() {
        val ids = AppWidgetManager.getInstance(context)
                .getAppWidgetIds(ComponentName("com.moez.QKSMS", "com.moez.QKSMS.feature.widget.WidgetProvider"))
                .getAppWidgetIds(ComponentName(context, "com.moez.QKSMS.feature.widget.WidgetProvider"))

        val intent = Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, ids)

+3 −0
Original line number Diff line number Diff line
@@ -53,6 +53,9 @@ class SettingsPresenter @Inject constructor(
    init {
        newState { copy(theme = colors.theme().theme) }

        disposables += prefs.theme().asObservable()
                .subscribe { color -> newState { copy(theme = color) } }

        val nightModeLabels = context.resources.getStringArray(R.array.night_modes)
        disposables += prefs.nightMode.asObservable()
                .subscribe { nightMode ->