diff --git a/app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java b/app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java index 14b7a12517102db2707f6a4e83e13b3fb361c6b5..1462e8adfb8a84ef87b85f149f98ea75ba6f456a 100755 --- a/app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java +++ b/app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java @@ -629,6 +629,7 @@ public class LauncherActivity extends AppCompatActivity forceRefreshSuggestedApps = true; removePackageFromLauncher(appRemoveEvent.getPackageName(), appRemoveEvent.getUserHandle()); DatabaseManager.getManager(this).saveLayouts(pages, mDock); + rebindAllWidgets(); } public void onAppChangeEvent(AppChangeEvent appChangeEvent) { @@ -1468,12 +1469,23 @@ public class LauncherActivity extends AppCompatActivity } // [[END]] + rebindWidgetHost(); + } + + private void rebindWidgetHost() { int[] widgetIds = mAppWidgetHost.getAppWidgetIds(); getCompositeDisposable().add(DatabaseManager.getManager(this).getWidgets(widgetIds) .subscribeOn(Schedulers.from(AppExecutors.getInstance().diskIO())) .observeOn(AndroidSchedulers.mainThread()).subscribe(this::bindWidgets)); } + public void rebindAllWidgets() { + if (widgetsPage != null) { + widgetContainer.removeAllViewsInLayout(); + rebindWidgetHost(); + } + } + private void bindWidgets(List widgets) { for (WidgetItem widget : widgets) { AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(widget.id);