Skip to content

Commit 665ba31

Browse files
committed
添加back键返回主屏功能
1 parent 73de4ad commit 665ba31

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/com/android/launcher3/Launcher.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,6 +1725,8 @@ public void onBackPressed() {
17251725
} else if (isInState(SPRING_LOADED)) {
17261726
XLog.e(XLog.getTag(), XLog.TAG_GU_STATE + "is Normal----");
17271727
mStateManager.goToState(NORMAL);
1728+
} else if (mWorkspace.getNextPage() != (hasCustomContentToLeft() ? 1 : 0)) {
1729+
mWorkspace.snapToPage(hasCustomContentToLeft() ? 1 : 0);
17281730
} else {
17291731
// Back button is a no-op here, but give at least some feedback for the button press
17301732
mWorkspace.showOutlinesTemporarily();

src/com/android/launcher3/config/BaseFlags.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ abstract class BaseFlags {
6060
public static final boolean LAUNCHER3_CIRCLE_SCROLL = true;
6161

6262
// 是否开启负一屏,当LAUNCHER_OVERLAY_ENABLED = false才起作用
63-
public static final boolean CUSTOM_CONTENT_ENABLED = false;
63+
public static final boolean CUSTOM_CONTENT_ENABLED = true;
6464

6565
// 是否开启跨进程的负一屏,如果开启,则不会开启CustomContent负一屏
6666
public static final boolean LAUNCHER_OVERLAY_ENABLED = false;

0 commit comments

Comments
 (0)