summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/widget/WidgetsContainerView.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-10-12 20:49:31 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-10-19 07:42:34 +0100
commitd164b7f4abcba6cc965c2264257569f88ad5e4a5 (patch)
treed3e76ff708d2f647dcf101706ab03f5759d9ea75 /src/com/android/launcher3/widget/WidgetsContainerView.java
parent67115b1a84006374ebb1b0daf20eab95db267838 (diff)
downloadandroid_packages_apps_Trebuchet-d164b7f4abcba6cc965c2264257569f88ad5e4a5.tar.gz
android_packages_apps_Trebuchet-d164b7f4abcba6cc965c2264257569f88ad5e4a5.tar.bz2
android_packages_apps_Trebuchet-d164b7f4abcba6cc965c2264257569f88ad5e4a5.zip
Fixing static instance of Indexer being created in the model
Indexer depends on the locale and should be created when ever the config changes. Moving the widget indexing to the adapter (similar to allApps) which gets created whenever the activity is recreated. This fixes the bug where widgets indexing breaks if locale changes while launcher process is alive Also fixing the bug in widget model cloning where the HashMap was not cloning the underlying ArrayList Change-Id: I7dbe6290e73299c4c07aa7fa564077a2649e1a4c
Diffstat (limited to 'src/com/android/launcher3/widget/WidgetsContainerView.java')
-rw-r--r--src/com/android/launcher3/widget/WidgetsContainerView.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/widget/WidgetsContainerView.java b/src/com/android/launcher3/widget/WidgetsContainerView.java
index 56702cc25..2e1294251 100644
--- a/src/com/android/launcher3/widget/WidgetsContainerView.java
+++ b/src/com/android/launcher3/widget/WidgetsContainerView.java
@@ -43,9 +43,12 @@ import com.android.launcher3.Utilities;
import com.android.launcher3.WidgetPreviewLoader;
import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.graphics.LauncherIcons;
+import com.android.launcher3.model.PackageItemInfo;
+import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.model.WidgetsModel;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
+import com.android.launcher3.util.MultiHashMap;
import com.android.launcher3.util.Thunk;
/**
@@ -297,9 +300,8 @@ public class WidgetsContainerView extends BaseContainerView
/**
* Initialize the widget data model.
*/
- public void addWidgets(WidgetsModel model) {
- mRecyclerView.setWidgets(model);
- mAdapter.setWidgetsModel(model);
+ public void setWidgets(MultiHashMap<PackageItemInfo, WidgetItem> model) {
+ mAdapter.setWidgets(model);
mAdapter.notifyDataSetChanged();
View loader = getContentView().findViewById(R.id.loader);