Merge "1. Avoid object allocations during draw/layout operations (preallocate and reuse instead). 2. Prevent NPE in dereferencing mDragInfo. 3. Get rid of unused variable assignments." into ub-launcher3-dorval-polish
This commit is contained in:
@@ -305,8 +305,6 @@ public class Workspace extends PagedView
|
|||||||
private boolean mForceDrawAdjacentPages = false;
|
private boolean mForceDrawAdjacentPages = false;
|
||||||
// Total over scrollX in the overlay direction.
|
// Total over scrollX in the overlay direction.
|
||||||
private float mOverlayTranslation;
|
private float mOverlayTranslation;
|
||||||
private int mFirstPageScrollX;
|
|
||||||
private boolean mIgnoreQsbScroll;
|
|
||||||
|
|
||||||
// Handles workspace state transitions
|
// Handles workspace state transitions
|
||||||
private final WorkspaceStateTransitionAnimation mStateTransitionAnimation;
|
private final WorkspaceStateTransitionAnimation mStateTransitionAnimation;
|
||||||
@@ -1739,32 +1737,6 @@ public class Workspace extends PagedView
|
|||||||
mWallpaperOffset.jumpToFinal();
|
mWallpaperOffset.jumpToFinal();
|
||||||
}
|
}
|
||||||
super.onLayout(changed, left, top, right, bottom);
|
super.onLayout(changed, left, top, right, bottom);
|
||||||
mFirstPageScrollX = getScrollForPage(0);
|
|
||||||
|
|
||||||
final LayoutTransition transition = getLayoutTransition();
|
|
||||||
// If the transition is running defer updating max scroll, as some empty pages could
|
|
||||||
// still be present, and a max scroll change could cause sudden jumps in scroll.
|
|
||||||
if (transition != null && transition.isRunning()) {
|
|
||||||
transition.addTransitionListener(new LayoutTransition.TransitionListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void startTransition(LayoutTransition transition, ViewGroup container,
|
|
||||||
View view, int transitionType) {
|
|
||||||
mIgnoreQsbScroll = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void endTransition(LayoutTransition transition, ViewGroup container,
|
|
||||||
View view, int transitionType) {
|
|
||||||
// Wait until all transitions are complete.
|
|
||||||
if (!transition.isRunning()) {
|
|
||||||
mIgnoreQsbScroll = false;
|
|
||||||
transition.removeTransitionListener(this);
|
|
||||||
mFirstPageScrollX = getScrollForPage(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
updatePageAlphaValues();
|
updatePageAlphaValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3548,7 +3520,7 @@ public class Workspace extends PagedView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((d.cancelled || (beingCalledAfterUninstall && !mUninstallSuccessful))
|
if ((d.cancelled || (beingCalledAfterUninstall && !mUninstallSuccessful))
|
||||||
&& mDragInfo.cell != null) {
|
&& mDragInfo != null && mDragInfo.cell != null) {
|
||||||
mDragInfo.cell.setVisibility(VISIBLE);
|
mDragInfo.cell.setVisibility(VISIBLE);
|
||||||
}
|
}
|
||||||
mDragInfo = null;
|
mDragInfo = null;
|
||||||
@@ -4121,8 +4093,8 @@ public class Workspace extends PagedView
|
|||||||
|
|
||||||
private boolean mRefreshPending;
|
private boolean mRefreshPending;
|
||||||
|
|
||||||
public DeferredWidgetRefresh(ArrayList<LauncherAppWidgetInfo> infos,
|
DeferredWidgetRefresh(ArrayList<LauncherAppWidgetInfo> infos,
|
||||||
LauncherAppWidgetHost host) {
|
LauncherAppWidgetHost host) {
|
||||||
mInfos = infos;
|
mInfos = infos;
|
||||||
mHost = host;
|
mHost = host;
|
||||||
mHandler = new Handler();
|
mHandler = new Handler();
|
||||||
|
|||||||
Reference in New Issue
Block a user