パッケージ/アプリ/Launcher3/src/com/android/launcher3/Launcher.java
方法
public void bindItems(finalList<ItemInfo> アイテム、最終ブール値 forceAnimateIcons) {
int currentScreenId =mWorkspace.getScreenIdForPageIndex(mWorkspace.getNextPage());
final int newScreenIndex =mWorkspace.getPageIndexForScreenId(newItemsScreenId);
final Runnable startBounceAnimRunnable = anim::start;
if (newItemsScreenId != currentScreenId) {
// We post the animationslightly delayed to prevent slowdowns
// when we are loading rightafter we return to launcher.
mWorkspace.postDelayed(newRunnable() {
public void run() {
if (mWorkspace != null){
AbstractFloatingView.closeAllOpenViews(Launcher.this, false);
/*/tyd.yantao20230201 avoid first load not in homePage
mWorkspace.snapToPage(newScreenIndex);
//*/
mWorkspace.postDelayed(startBounceAnimRunnable,
NEW_APPS_ANIMATION_DELAY);
}
}
}, NEW_APPS_PAGE_MOVE_DELAY);
このとき、これを入力するのは if (newItemsScreenId != currentScreenId) {、通常はこれを行うべきではないため、mWorkspace.snapToPage(newScreenIndex); は後で実行され、これは遅延スレッドにあるため、最初にメイン インターフェイス 後でサブページに移動