@@ -1946,7 +1946,12 @@ private void bindAddScreens(ArrayList<Long> orderedScreenIds) {
1946
1946
@ Override
1947
1947
public void bindAppsAdded (ArrayList <Long > newScreens , ArrayList <ItemInfo > addNotAnimated ,
1948
1948
ArrayList <ItemInfo > addAnimated ) {
1949
- XLog .e (XLog .getTag (), XLog .TAG_GU + addNotAnimated .size () + " " + addAnimated .size ());
1949
+ if (addNotAnimated != null ) {
1950
+ XLog .e (XLog .getTag (), XLog .TAG_GU + addNotAnimated .size ());
1951
+ }
1952
+ if (addAnimated != null ) {
1953
+ XLog .e (XLog .getTag (), XLog .TAG_GU + addAnimated .size ());
1954
+ }
1950
1955
// Add the new screens
1951
1956
if (newScreens != null ) {
1952
1957
bindAddScreens (newScreens );
@@ -1976,7 +1981,10 @@ public void bindItems(final List<ItemInfo> items, final boolean forceAnimateIcon
1976
1981
// Get the list of added items and intersect them with the set of items here
1977
1982
final AnimatorSet anim = LauncherAnimUtils .createAnimatorSet ();
1978
1983
final Collection <Animator > bounceAnims = new ArrayList <>();
1979
- final boolean animateIcons = forceAnimateIcons && canRunNewAppsAnimation ();
1984
+ // modify by codemx.cn ---- 20200710 ---- start
1985
+ final boolean animateIcons = FeatureFlags .SCROLL_TO_LAST_PAGE_WHEN_BIND_FINISH
1986
+ && forceAnimateIcons && canRunNewAppsAnimation ();
1987
+ // modify by codemx.cn ---- 20200710 ---- start
1980
1988
Workspace workspace = mWorkspace ;
1981
1989
long newItemsScreenId = -1 ;
1982
1990
int end = items .size ();
@@ -2060,15 +2068,13 @@ public void run() {
2060
2068
if (newItemsScreenId != currentScreenId ) {
2061
2069
// We post the animation slightly delayed to prevent slowdowns
2062
2070
// when we are loading right after we return to launcher.
2063
- mWorkspace .postDelayed (new Runnable () {
2064
- public void run () {
2065
- if (mWorkspace != null ) {
2066
- AbstractFloatingView .closeAllOpenViews (Launcher .this , false );
2067
-
2068
- mWorkspace .snapToPage (newScreenIndex );
2069
- mWorkspace .postDelayed (startBounceAnimRunnable ,
2070
- NEW_APPS_ANIMATION_DELAY );
2071
- }
2071
+ mWorkspace .postDelayed (() -> {
2072
+ if (mWorkspace != null ) {
2073
+ AbstractFloatingView .closeAllOpenViews (Launcher .this , false );
2074
+
2075
+ mWorkspace .snapToPage (newScreenIndex );
2076
+ mWorkspace .postDelayed (startBounceAnimRunnable ,
2077
+ NEW_APPS_ANIMATION_DELAY );
2072
2078
}
2073
2079
}, NEW_APPS_PAGE_MOVE_DELAY );
2074
2080
} else {
@@ -2205,7 +2211,7 @@ private View inflateAppWidget(LauncherAppWidgetInfo item) {
2205
2211
*/
2206
2212
private LauncherAppWidgetInfo completeRestoreAppWidget (int appWidgetId , int finalRestoreFlag ) {
2207
2213
LauncherAppWidgetHostView view = mWorkspace .getWidgetForAppWidgetId (appWidgetId );
2208
- if (( view == null ) || !(view instanceof PendingAppWidgetHostView )) {
2214
+ if (!(view instanceof PendingAppWidgetHostView )) {
2209
2215
Log .e (TAG , "Widget update called, when the widget no longer exists." );
2210
2216
return null ;
2211
2217
}
0 commit comments