Loading res/values/config.xml +0 −2 Original line number Diff line number Diff line Loading @@ -50,8 +50,6 @@ <!-- Out of 100, the percent to shrink the workspace during spring loaded mode. --> <integer name="config_workspaceSpringLoadShrinkPercentage">90</integer> <!-- Out of 100, the percent to shrink the workspace during overview mode. --> <integer name="config_workspaceOverviewShrinkPercentage">70</integer> <!-- This constant stores the ratio of the all apps button drawable which is used for internal (baked-in) padding --> Loading src/com/android/launcher3/DeviceProfile.java +1 −1 Original line number Diff line number Diff line Loading @@ -570,7 +570,7 @@ public class DeviceProfile { } } int getOverviewModeButtonBarHeight() { public int getOverviewModeButtonBarHeight() { int zoneHeight = (int) (overviewModeIconZoneRatio * availableHeightPx); return Utilities.boundToRange(zoneHeight, overviewModeMinIconZoneHeightPx, Loading src/com/android/launcher3/Launcher.java +10 −50 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.launcher3; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_NEXT_FRAME; import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_DELAY; import static com.android.launcher3.logging.LoggerUtils.newContainerTarget; Loading Loading @@ -47,7 +50,6 @@ import android.content.IntentFilter; import android.content.IntentSender; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.database.sqlite.SQLiteDatabase; import android.graphics.Point; Loading Loading @@ -264,10 +266,6 @@ public class Launcher extends BaseActivity private PopupDataProvider mPopupDataProvider; // Determines how long to wait after a rotation before restoring the screen orientation to // match the sensor state. private static final int RESTORE_SCREEN_ORIENTATION_DELAY = 500; private final ArrayList<Integer> mSynchronouslyBoundPages = new ArrayList<>(); // We only want to get the SharedPreferences once since it does an FS stat each time we get Loading @@ -291,18 +289,8 @@ public class Launcher extends BaseActivity public ViewGroupFocusHelper mFocusHandler; private boolean mRotationEnabled = false; private boolean mAppLaunchSuccess; @Thunk void setOrientation() { if (mRotationEnabled) { unlockScreenOrientation(true); } else { setRequestedOrientation( ActivityInfo.SCREEN_ORIENTATION_NOSENSOR); } } private RotationPrefChangeHandler mRotationPrefChangeHandler; @Override Loading Loading @@ -416,7 +404,8 @@ public class Launcher extends BaseActivity // On large interfaces, or on devices that a user has specifically enabled screen rotation, // we want the screen to auto-rotate based on the current orientation setOrientation(); setRequestedOrientation(mRotationEnabled ? SCREEN_ORIENTATION_UNSPECIFIED : SCREEN_ORIENTATION_NOSENSOR); setContentView(mLauncherView); Loading Loading @@ -1896,11 +1885,8 @@ public class Launcher extends BaseActivity AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(this); if (topView != null) { topView.onBackPressed(); } else if (isInState(LauncherState.ALL_APPS)) { ued.logActionCommand(Action.Command.BACK, ContainerType.ALLAPPS); showWorkspace(true); } else if (isInState(LauncherState.OVERVIEW)) { ued.logActionCommand(Action.Command.BACK, ContainerType.OVERVIEW); } else if (!isInState(LauncherState.NORMAL)) { ued.logActionCommand(Action.Command.BACK, mWorkspace.getState().containerType); showWorkspace(true); } else { // Back button is a no-op here, but give at least some feedback for the button press Loading Loading @@ -2381,7 +2367,7 @@ public class Launcher extends BaseActivity if (!mDragController.isDragging()) { if (itemUnderLongClick == null) { // User long pressed on empty space if (isInState(LauncherState.OVERVIEW)) { if (mWorkspace.isPageRearrangeEnabled()) { mWorkspace.startReordering(v); getUserEventDispatcher().logActionOnContainer(Action.Touch.LONGPRESS, Action.Direction.NONE, ContainerType.OVERVIEW); Loading Loading @@ -2544,15 +2530,6 @@ public class Launcher extends BaseActivity return; } // Lock the orientation: if (mRotationEnabled) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED); } // Prevent any Un/InstallShortcutReceivers from updating the db while we are // in spring loaded mode InstallShortcutReceiver.enableInstallQueue(InstallShortcutReceiver.FLAG_DRAG_AND_DROP); mStateTransitionAnimation.startAnimationToWorkspace( LauncherState.SPRING_LOADED, true /* animated */, null /* onCompleteRunnable */); Loading @@ -2565,13 +2542,6 @@ public class Launcher extends BaseActivity public void exitSpringLoadedDragMode(int delay, final Runnable onCompleteRunnable) { if (!isInState(LauncherState.SPRING_LOADED)) return; // Unlock rotation lock unlockScreenOrientation(false); // Re-enable any Un/InstallShortcutReceiver and now process any queued items InstallShortcutReceiver.disableAndFlushInstallQueue( InstallShortcutReceiver.FLAG_DRAG_AND_DROP, this); if (mExitSpringLoadedModeRunnable != null) { mHandler.removeCallbacks(mExitSpringLoadedModeRunnable); } Loading Loading @@ -3333,18 +3303,8 @@ public class Launcher extends BaseActivity mModel.refreshAndBindWidgetsAndShortcuts(packageUser); } public void unlockScreenOrientation(boolean immediate) { if (mRotationEnabled) { if (immediate) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } else { mHandler.postDelayed(new Runnable() { public void run() { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } }, RESTORE_SCREEN_ORIENTATION_DELAY); } } public boolean isRotationEnabled () { return mRotationEnabled; } private void markAppsViewShown() { Loading src/com/android/launcher3/LauncherState.java +14 −10 Original line number Diff line number Diff line Loading @@ -19,9 +19,9 @@ import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_AUTO; import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS; import static com.android.launcher3.LauncherAnimUtils.ALL_APPS_TRANSITION_MS; import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS; import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_TRANSITION_MS; import com.android.launcher3.states.OverviewState; import com.android.launcher3.states.SpringLoadedState; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; import java.util.Arrays; Loading @@ -40,19 +40,15 @@ public class LauncherState { private static final LauncherState[] sAllStates = new LauncherState[4]; public static LauncherState NORMAL = new LauncherState(0, ContainerType.WORKSPACE, public static final LauncherState NORMAL = new LauncherState(0, ContainerType.WORKSPACE, 0, FLAG_DO_NOT_RESTORE); public static LauncherState ALL_APPS = new LauncherState(1, ContainerType.ALLAPPS, public static final LauncherState ALL_APPS = new LauncherState(1, ContainerType.ALLAPPS, ALL_APPS_TRANSITION_MS, FLAG_DISABLE_ACCESSIBILITY); public static LauncherState SPRING_LOADED = new LauncherState(2, ContainerType.WORKSPACE, SPRING_LOADED_TRANSITION_MS, FLAG_SHOW_SCRIM | FLAG_MULTI_PAGE | FLAG_DISABLE_ACCESSIBILITY | FLAG_DO_NOT_RESTORE); public static final LauncherState SPRING_LOADED = new SpringLoadedState(2); public static LauncherState OVERVIEW = new LauncherState(3, ContainerType.OVERVIEW, OVERVIEW_TRANSITION_MS, FLAG_SHOW_SCRIM | FLAG_MULTI_PAGE | FLAG_HIDE_HOTSEAT | FLAG_DO_NOT_RESTORE); public static final LauncherState OVERVIEW = new OverviewState(3); public final int ordinal; Loading Loading @@ -101,4 +97,12 @@ public class LauncherState { public static LauncherState[] values() { return Arrays.copyOf(sAllStates, sAllStates.length); } public float[] getWorkspaceScaleAndTranslation(Launcher launcher) { return new float[] {1, 0}; } public void onStateEnabled(Launcher launcher) { } public void onStateDisabled(Launcher launcher) { } } src/com/android/launcher3/PagedView.java +2 −3 Original line number Diff line number Diff line Loading @@ -1341,12 +1341,11 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc /** * return true if freescroll has been enabled, false otherwise */ public boolean enableFreeScroll() { protected void enableFreeScroll() { setEnableFreeScroll(true); return true; } public void disableFreeScroll() { protected void disableFreeScroll() { setEnableFreeScroll(false); } Loading Loading
res/values/config.xml +0 −2 Original line number Diff line number Diff line Loading @@ -50,8 +50,6 @@ <!-- Out of 100, the percent to shrink the workspace during spring loaded mode. --> <integer name="config_workspaceSpringLoadShrinkPercentage">90</integer> <!-- Out of 100, the percent to shrink the workspace during overview mode. --> <integer name="config_workspaceOverviewShrinkPercentage">70</integer> <!-- This constant stores the ratio of the all apps button drawable which is used for internal (baked-in) padding --> Loading
src/com/android/launcher3/DeviceProfile.java +1 −1 Original line number Diff line number Diff line Loading @@ -570,7 +570,7 @@ public class DeviceProfile { } } int getOverviewModeButtonBarHeight() { public int getOverviewModeButtonBarHeight() { int zoneHeight = (int) (overviewModeIconZoneRatio * availableHeightPx); return Utilities.boundToRange(zoneHeight, overviewModeMinIconZoneHeightPx, Loading
src/com/android/launcher3/Launcher.java +10 −50 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.launcher3; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_NEXT_FRAME; import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_DELAY; import static com.android.launcher3.logging.LoggerUtils.newContainerTarget; Loading Loading @@ -47,7 +50,6 @@ import android.content.IntentFilter; import android.content.IntentSender; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.database.sqlite.SQLiteDatabase; import android.graphics.Point; Loading Loading @@ -264,10 +266,6 @@ public class Launcher extends BaseActivity private PopupDataProvider mPopupDataProvider; // Determines how long to wait after a rotation before restoring the screen orientation to // match the sensor state. private static final int RESTORE_SCREEN_ORIENTATION_DELAY = 500; private final ArrayList<Integer> mSynchronouslyBoundPages = new ArrayList<>(); // We only want to get the SharedPreferences once since it does an FS stat each time we get Loading @@ -291,18 +289,8 @@ public class Launcher extends BaseActivity public ViewGroupFocusHelper mFocusHandler; private boolean mRotationEnabled = false; private boolean mAppLaunchSuccess; @Thunk void setOrientation() { if (mRotationEnabled) { unlockScreenOrientation(true); } else { setRequestedOrientation( ActivityInfo.SCREEN_ORIENTATION_NOSENSOR); } } private RotationPrefChangeHandler mRotationPrefChangeHandler; @Override Loading Loading @@ -416,7 +404,8 @@ public class Launcher extends BaseActivity // On large interfaces, or on devices that a user has specifically enabled screen rotation, // we want the screen to auto-rotate based on the current orientation setOrientation(); setRequestedOrientation(mRotationEnabled ? SCREEN_ORIENTATION_UNSPECIFIED : SCREEN_ORIENTATION_NOSENSOR); setContentView(mLauncherView); Loading Loading @@ -1896,11 +1885,8 @@ public class Launcher extends BaseActivity AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(this); if (topView != null) { topView.onBackPressed(); } else if (isInState(LauncherState.ALL_APPS)) { ued.logActionCommand(Action.Command.BACK, ContainerType.ALLAPPS); showWorkspace(true); } else if (isInState(LauncherState.OVERVIEW)) { ued.logActionCommand(Action.Command.BACK, ContainerType.OVERVIEW); } else if (!isInState(LauncherState.NORMAL)) { ued.logActionCommand(Action.Command.BACK, mWorkspace.getState().containerType); showWorkspace(true); } else { // Back button is a no-op here, but give at least some feedback for the button press Loading Loading @@ -2381,7 +2367,7 @@ public class Launcher extends BaseActivity if (!mDragController.isDragging()) { if (itemUnderLongClick == null) { // User long pressed on empty space if (isInState(LauncherState.OVERVIEW)) { if (mWorkspace.isPageRearrangeEnabled()) { mWorkspace.startReordering(v); getUserEventDispatcher().logActionOnContainer(Action.Touch.LONGPRESS, Action.Direction.NONE, ContainerType.OVERVIEW); Loading Loading @@ -2544,15 +2530,6 @@ public class Launcher extends BaseActivity return; } // Lock the orientation: if (mRotationEnabled) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED); } // Prevent any Un/InstallShortcutReceivers from updating the db while we are // in spring loaded mode InstallShortcutReceiver.enableInstallQueue(InstallShortcutReceiver.FLAG_DRAG_AND_DROP); mStateTransitionAnimation.startAnimationToWorkspace( LauncherState.SPRING_LOADED, true /* animated */, null /* onCompleteRunnable */); Loading @@ -2565,13 +2542,6 @@ public class Launcher extends BaseActivity public void exitSpringLoadedDragMode(int delay, final Runnable onCompleteRunnable) { if (!isInState(LauncherState.SPRING_LOADED)) return; // Unlock rotation lock unlockScreenOrientation(false); // Re-enable any Un/InstallShortcutReceiver and now process any queued items InstallShortcutReceiver.disableAndFlushInstallQueue( InstallShortcutReceiver.FLAG_DRAG_AND_DROP, this); if (mExitSpringLoadedModeRunnable != null) { mHandler.removeCallbacks(mExitSpringLoadedModeRunnable); } Loading Loading @@ -3333,18 +3303,8 @@ public class Launcher extends BaseActivity mModel.refreshAndBindWidgetsAndShortcuts(packageUser); } public void unlockScreenOrientation(boolean immediate) { if (mRotationEnabled) { if (immediate) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } else { mHandler.postDelayed(new Runnable() { public void run() { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } }, RESTORE_SCREEN_ORIENTATION_DELAY); } } public boolean isRotationEnabled () { return mRotationEnabled; } private void markAppsViewShown() { Loading
src/com/android/launcher3/LauncherState.java +14 −10 Original line number Diff line number Diff line Loading @@ -19,9 +19,9 @@ import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_AUTO; import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS; import static com.android.launcher3.LauncherAnimUtils.ALL_APPS_TRANSITION_MS; import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS; import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_TRANSITION_MS; import com.android.launcher3.states.OverviewState; import com.android.launcher3.states.SpringLoadedState; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; import java.util.Arrays; Loading @@ -40,19 +40,15 @@ public class LauncherState { private static final LauncherState[] sAllStates = new LauncherState[4]; public static LauncherState NORMAL = new LauncherState(0, ContainerType.WORKSPACE, public static final LauncherState NORMAL = new LauncherState(0, ContainerType.WORKSPACE, 0, FLAG_DO_NOT_RESTORE); public static LauncherState ALL_APPS = new LauncherState(1, ContainerType.ALLAPPS, public static final LauncherState ALL_APPS = new LauncherState(1, ContainerType.ALLAPPS, ALL_APPS_TRANSITION_MS, FLAG_DISABLE_ACCESSIBILITY); public static LauncherState SPRING_LOADED = new LauncherState(2, ContainerType.WORKSPACE, SPRING_LOADED_TRANSITION_MS, FLAG_SHOW_SCRIM | FLAG_MULTI_PAGE | FLAG_DISABLE_ACCESSIBILITY | FLAG_DO_NOT_RESTORE); public static final LauncherState SPRING_LOADED = new SpringLoadedState(2); public static LauncherState OVERVIEW = new LauncherState(3, ContainerType.OVERVIEW, OVERVIEW_TRANSITION_MS, FLAG_SHOW_SCRIM | FLAG_MULTI_PAGE | FLAG_HIDE_HOTSEAT | FLAG_DO_NOT_RESTORE); public static final LauncherState OVERVIEW = new OverviewState(3); public final int ordinal; Loading Loading @@ -101,4 +97,12 @@ public class LauncherState { public static LauncherState[] values() { return Arrays.copyOf(sAllStates, sAllStates.length); } public float[] getWorkspaceScaleAndTranslation(Launcher launcher) { return new float[] {1, 0}; } public void onStateEnabled(Launcher launcher) { } public void onStateDisabled(Launcher launcher) { } }
src/com/android/launcher3/PagedView.java +2 −3 Original line number Diff line number Diff line Loading @@ -1341,12 +1341,11 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc /** * return true if freescroll has been enabled, false otherwise */ public boolean enableFreeScroll() { protected void enableFreeScroll() { setEnableFreeScroll(true); return true; } public void disableFreeScroll() { protected void disableFreeScroll() { setEnableFreeScroll(false); } Loading