summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Workspace.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-10-04 16:50:57 -0700
committerSunny Goyal <sunnygoyal@google.com>2017-10-05 09:58:13 -0700
commitba47faae6a84231e01af3f5147ddf05a2dabe216 (patch)
treeef89277c3c378d01a026fc064e6a9c45a9e20be4 /src/com/android/launcher3/Workspace.java
parent0474222c2545f448ceb9dc116240e1ea1bc543b3 (diff)
downloadandroid_packages_apps_Trebuchet-ba47faae6a84231e01af3f5147ddf05a2dabe216.tar.gz
android_packages_apps_Trebuchet-ba47faae6a84231e01af3f5147ddf05a2dabe216.tar.bz2
android_packages_apps_Trebuchet-ba47faae6a84231e01af3f5147ddf05a2dabe216.zip
Moving widget reinflation to push model
Instead of checking every widget, a widget which needs reinflation would post a callback on launcher avoiding unnecessary loops in onResume Bug: 67305604 Change-Id: I53e08d6f4795f7b716a9debca5c0c68dd25a7afe
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-rw-r--r--src/com/android/launcher3/Workspace.java24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index b80bdc0c9..7297ee12e 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1043,30 +1043,6 @@ public class Workspace extends PagedView
return super.onInterceptTouchEvent(ev);
}
- protected void reinflateWidgetsIfNecessary() {
- final int clCount = getChildCount();
- for (int i = 0; i < clCount; i++) {
- CellLayout cl = (CellLayout) getChildAt(i);
- ShortcutAndWidgetContainer swc = cl.getShortcutsAndWidgets();
- final int itemCount = swc.getChildCount();
- for (int j = 0; j < itemCount; j++) {
- View v = swc.getChildAt(j);
-
- if (v instanceof LauncherAppWidgetHostView
- && v.getTag() instanceof LauncherAppWidgetInfo) {
- LauncherAppWidgetInfo info = (LauncherAppWidgetInfo) v.getTag();
- LauncherAppWidgetHostView lahv = (LauncherAppWidgetHostView) v;
- if (lahv.isReinflateRequired(mLauncher.getOrientation())) {
- // Remove and rebind the current widget (which was inflated in the wrong
- // orientation), but don't delete it from the database
- mLauncher.removeItem(lahv, info, false /* deleteFromDb */);
- mLauncher.bindAppWidget(info);
- }
- }
- }
- }
- }
-
@Override
protected void determineScrollingStart(MotionEvent ev) {
if (!isFinishedSwitchingState()) return;