mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Merge "Avoid unnecessary predictor recreations." into ub-launcher3-rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
fcfba815af
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.android.launcher3.hybridhotseat;
|
||||
|
||||
import static com.android.launcher3.InvariantDeviceProfile.CHANGE_FLAG_GRID;
|
||||
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
|
||||
|
||||
import android.animation.Animator;
|
||||
@@ -571,8 +572,10 @@ public class HotseatPredictionController implements DragController.DragListener,
|
||||
|
||||
@Override
|
||||
public void onIdpChanged(int changeFlags, InvariantDeviceProfile profile) {
|
||||
this.mHotSeatItemsCount = profile.numHotseatIcons;
|
||||
createPredictor();
|
||||
if ((changeFlags & CHANGE_FLAG_GRID) != 0) {
|
||||
this.mHotSeatItemsCount = profile.numHotseatIcons;
|
||||
createPredictor();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -94,6 +94,7 @@ public class QuickstepLauncher extends BaseQuickstepLauncher {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (FeatureFlags.ENABLE_HYBRID_HOTSEAT.get()) {
|
||||
mHotseatPredictionController = new HotseatPredictionController(this);
|
||||
mHotseatPredictionController.createPredictor();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,14 +177,6 @@ public class QuickstepLauncher extends BaseQuickstepLauncher {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishBindingItems(int pageBoundFirst) {
|
||||
super.finishBindingItems(pageBoundFirst);
|
||||
if (mHotseatPredictionController != null) {
|
||||
mHotseatPredictionController.createPredictor();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindPredictedItems(List<AppInfo> appInfos, IntArray ranks) {
|
||||
super.bindPredictedItems(appInfos, ranks);
|
||||
|
||||
Reference in New Issue
Block a user