Loading res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -100,4 +100,6 @@ <item type="id" name="action_add_to_workspace" /> <item type="id" name="action_move" /> <item type="id" name="action_move_to_workspace" /> <item type="id" name="action_move_screen_backwards" /> <item type="id" name="action_move_screen_forwards" /> </resources> res/values/strings.xml +9 −0 Original line number Diff line number Diff line Loading @@ -243,4 +243,13 @@ <!-- Accessibility action to move an item from folder to workspace. [CHAR_LIMIT=30] [DO NOT TRANSLATE] --> <string name="action_move_to_workspace">Move to home screen</string> <!-- Accessibility action to move an homescreen to the left. [CHAR_LIMIT=30] [DO NOT TRANSLATE] --> <string name="action_move_screen_left">Move screen to left</string> <!-- Accessibility action to move an homescreen to the right. [CHAR_LIMIT=30] [DO NOT TRANSLATE] --> <string name="action_move_screen_right">Move screen to right</string> <!-- Accessibility confirmation when a screen was moved [DO NOT TRANSLATE] --> <string name="screen_moved">Screen moved</string> </resources> src/com/android/launcher3/PagedView.java +3 −3 Original line number Diff line number Diff line Loading @@ -559,7 +559,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc /** * Sets the current page. */ void setCurrentPage(int currentPage) { public void setCurrentPage(int currentPage) { if (!mScroller.isFinished()) { abortScrollerAnimation(true); } Loading Loading @@ -2535,7 +2535,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc } } protected void onStartReordering() { public void onStartReordering() { // Set the touch state to reordering (allows snapping to pages, dragging a child, etc.) mTouchState = TOUCH_STATE_REORDERING; mIsReordering = true; Loading @@ -2555,7 +2555,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc } } protected void onEndReordering() { public void onEndReordering() { mIsReordering = false; } Loading src/com/android/launcher3/Workspace.java +50 −9 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ import com.android.launcher3.Launcher.LauncherOverlay; import com.android.launcher3.LauncherAccessibilityDelegate.AccessibilityDragSource; import com.android.launcher3.LauncherSettings.Favorites; import com.android.launcher3.UninstallDropTarget.UninstallSource; import com.android.launcher3.accessibility.OverviewScreenAccessibilityDelegate; import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.util.LongArrayMap; import com.android.launcher3.util.Thunk; Loading Loading @@ -277,6 +278,8 @@ public class Workspace extends SmoothPagedView // Handles workspace state transitions private WorkspaceStateTransitionAnimation mStateTransitionAnimation; private AccessibilityDelegate mPagesAccessibilityDelegate; private final Runnable mBindPages = new Runnable() { @Override public void run() { Loading Loading @@ -2000,14 +2003,14 @@ public class Workspace extends SmoothPagedView range[1] = Math.max(0, end); } protected void onStartReordering() { public void onStartReordering() { super.onStartReordering(); showOutlines(); // Reordering handles its own animations, disable the automatic ones. disableLayoutTransitions(); } protected void onEndReordering() { public void onEndReordering() { super.onEndReordering(); if (mLauncher.isWorkspaceLoading()) { Loading Loading @@ -2068,12 +2071,46 @@ public class Workspace extends SmoothPagedView return mState; } private void updateAccessibilityFlags() { public void updateAccessibilityFlags() { if (Utilities.isLmpOrAbove()) { int total = getPageCount(); for (int i = numCustomPages(); i < total; i++) { updateAccessibilityFlags((CellLayout) getPageAt(i), i); } if (mState == State.NORMAL) { setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); } else { setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES); } } else { int accessible = mState == State.NORMAL ? IMPORTANT_FOR_ACCESSIBILITY_NO : IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS; setImportantForAccessibility(accessible); } } private void updateAccessibilityFlags(CellLayout page, int pageNo) { if (mState == State.OVERVIEW) { page.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES); page.getShortcutsAndWidgets().setImportantForAccessibility( IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); page.setContentDescription(getPageDescription(pageNo)); if (mPagesAccessibilityDelegate == null) { mPagesAccessibilityDelegate = new OverviewScreenAccessibilityDelegate(this); } page.setAccessibilityDelegate(mPagesAccessibilityDelegate); } else { int accessible = mState == State.NORMAL ? IMPORTANT_FOR_ACCESSIBILITY_NO : IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS; page.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); page.getShortcutsAndWidgets().setImportantForAccessibility(accessible); page.setContentDescription(null); page.setAccessibilityDelegate(null); } } @Override public void onLauncherTransitionPrepare(Launcher l, boolean animated, boolean toWorkspace) { Loading Loading @@ -4460,11 +4497,15 @@ public class Workspace extends SmoothPagedView } protected String getCurrentPageDescription() { int page = (mNextPage != INVALID_PAGE) ? mNextPage : mCurrentPage; int delta = numCustomPages(); if (hasCustomContent() && getNextPage() == 0) { return mCustomContentDescription; } int page = (mNextPage != INVALID_PAGE) ? mNextPage : mCurrentPage; return getPageDescription(page); } private String getPageDescription(int page) { int delta = numCustomPages(); return String.format(getContext().getString(R.string.workspace_scroll_format), page + 1 - delta, getChildCount() - delta); } Loading src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +15 −2 Original line number Diff line number Diff line Loading @@ -24,8 +24,11 @@ import android.animation.ValueAnimator; import android.content.Context; import android.content.res.Resources; import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.DecelerateInterpolator; import com.android.launcher3.util.Thunk; import java.util.HashMap; Loading Loading @@ -190,7 +193,7 @@ public class WorkspaceStateTransitionAnimation { final HashMap<View, Integer> layerViews) { AccessibilityManager am = (AccessibilityManager) mLauncher.getSystemService(Context.ACCESSIBILITY_SERVICE); boolean accessibilityEnabled = am.isEnabled(); final boolean accessibilityEnabled = am.isEnabled(); // Reinitialize animation arrays for the current workspace state reinitializeAnimationArrays(); Loading Loading @@ -301,7 +304,7 @@ public class WorkspaceStateTransitionAnimation { } final View searchBar = mLauncher.getOrCreateQsbBar(); final View overviewPanel = mLauncher.getOverviewPanel(); final ViewGroup overviewPanel = mLauncher.getOverviewPanel(); final View hotseat = mLauncher.getHotseat(); final View pageIndicator = mWorkspace.getPageIndicator(); if (animated) { Loading Loading @@ -424,6 +427,11 @@ public class WorkspaceStateTransitionAnimation { @Override public void onAnimationEnd(Animator animation) { mStateAnimator = null; if (accessibilityEnabled && overviewPanel.getVisibility() == View.VISIBLE) { overviewPanel.getChildAt(0).performAccessibilityAction( AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null); } } }); } else { Loading @@ -443,6 +451,11 @@ public class WorkspaceStateTransitionAnimation { mWorkspace.setScaleX(mNewScale); mWorkspace.setScaleY(mNewScale); mWorkspace.setTranslationY(finalWorkspaceTranslationY); if (accessibilityEnabled && overviewPanel.getVisibility() == View.VISIBLE) { overviewPanel.getChildAt(0).performAccessibilityAction( AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null); } } if (stateIsNormal) { Loading Loading
res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -100,4 +100,6 @@ <item type="id" name="action_add_to_workspace" /> <item type="id" name="action_move" /> <item type="id" name="action_move_to_workspace" /> <item type="id" name="action_move_screen_backwards" /> <item type="id" name="action_move_screen_forwards" /> </resources>
res/values/strings.xml +9 −0 Original line number Diff line number Diff line Loading @@ -243,4 +243,13 @@ <!-- Accessibility action to move an item from folder to workspace. [CHAR_LIMIT=30] [DO NOT TRANSLATE] --> <string name="action_move_to_workspace">Move to home screen</string> <!-- Accessibility action to move an homescreen to the left. [CHAR_LIMIT=30] [DO NOT TRANSLATE] --> <string name="action_move_screen_left">Move screen to left</string> <!-- Accessibility action to move an homescreen to the right. [CHAR_LIMIT=30] [DO NOT TRANSLATE] --> <string name="action_move_screen_right">Move screen to right</string> <!-- Accessibility confirmation when a screen was moved [DO NOT TRANSLATE] --> <string name="screen_moved">Screen moved</string> </resources>
src/com/android/launcher3/PagedView.java +3 −3 Original line number Diff line number Diff line Loading @@ -559,7 +559,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc /** * Sets the current page. */ void setCurrentPage(int currentPage) { public void setCurrentPage(int currentPage) { if (!mScroller.isFinished()) { abortScrollerAnimation(true); } Loading Loading @@ -2535,7 +2535,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc } } protected void onStartReordering() { public void onStartReordering() { // Set the touch state to reordering (allows snapping to pages, dragging a child, etc.) mTouchState = TOUCH_STATE_REORDERING; mIsReordering = true; Loading @@ -2555,7 +2555,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc } } protected void onEndReordering() { public void onEndReordering() { mIsReordering = false; } Loading
src/com/android/launcher3/Workspace.java +50 −9 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ import com.android.launcher3.Launcher.LauncherOverlay; import com.android.launcher3.LauncherAccessibilityDelegate.AccessibilityDragSource; import com.android.launcher3.LauncherSettings.Favorites; import com.android.launcher3.UninstallDropTarget.UninstallSource; import com.android.launcher3.accessibility.OverviewScreenAccessibilityDelegate; import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.util.LongArrayMap; import com.android.launcher3.util.Thunk; Loading Loading @@ -277,6 +278,8 @@ public class Workspace extends SmoothPagedView // Handles workspace state transitions private WorkspaceStateTransitionAnimation mStateTransitionAnimation; private AccessibilityDelegate mPagesAccessibilityDelegate; private final Runnable mBindPages = new Runnable() { @Override public void run() { Loading Loading @@ -2000,14 +2003,14 @@ public class Workspace extends SmoothPagedView range[1] = Math.max(0, end); } protected void onStartReordering() { public void onStartReordering() { super.onStartReordering(); showOutlines(); // Reordering handles its own animations, disable the automatic ones. disableLayoutTransitions(); } protected void onEndReordering() { public void onEndReordering() { super.onEndReordering(); if (mLauncher.isWorkspaceLoading()) { Loading Loading @@ -2068,12 +2071,46 @@ public class Workspace extends SmoothPagedView return mState; } private void updateAccessibilityFlags() { public void updateAccessibilityFlags() { if (Utilities.isLmpOrAbove()) { int total = getPageCount(); for (int i = numCustomPages(); i < total; i++) { updateAccessibilityFlags((CellLayout) getPageAt(i), i); } if (mState == State.NORMAL) { setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); } else { setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES); } } else { int accessible = mState == State.NORMAL ? IMPORTANT_FOR_ACCESSIBILITY_NO : IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS; setImportantForAccessibility(accessible); } } private void updateAccessibilityFlags(CellLayout page, int pageNo) { if (mState == State.OVERVIEW) { page.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES); page.getShortcutsAndWidgets().setImportantForAccessibility( IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); page.setContentDescription(getPageDescription(pageNo)); if (mPagesAccessibilityDelegate == null) { mPagesAccessibilityDelegate = new OverviewScreenAccessibilityDelegate(this); } page.setAccessibilityDelegate(mPagesAccessibilityDelegate); } else { int accessible = mState == State.NORMAL ? IMPORTANT_FOR_ACCESSIBILITY_NO : IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS; page.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); page.getShortcutsAndWidgets().setImportantForAccessibility(accessible); page.setContentDescription(null); page.setAccessibilityDelegate(null); } } @Override public void onLauncherTransitionPrepare(Launcher l, boolean animated, boolean toWorkspace) { Loading Loading @@ -4460,11 +4497,15 @@ public class Workspace extends SmoothPagedView } protected String getCurrentPageDescription() { int page = (mNextPage != INVALID_PAGE) ? mNextPage : mCurrentPage; int delta = numCustomPages(); if (hasCustomContent() && getNextPage() == 0) { return mCustomContentDescription; } int page = (mNextPage != INVALID_PAGE) ? mNextPage : mCurrentPage; return getPageDescription(page); } private String getPageDescription(int page) { int delta = numCustomPages(); return String.format(getContext().getString(R.string.workspace_scroll_format), page + 1 - delta, getChildCount() - delta); } Loading
src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +15 −2 Original line number Diff line number Diff line Loading @@ -24,8 +24,11 @@ import android.animation.ValueAnimator; import android.content.Context; import android.content.res.Resources; import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.DecelerateInterpolator; import com.android.launcher3.util.Thunk; import java.util.HashMap; Loading Loading @@ -190,7 +193,7 @@ public class WorkspaceStateTransitionAnimation { final HashMap<View, Integer> layerViews) { AccessibilityManager am = (AccessibilityManager) mLauncher.getSystemService(Context.ACCESSIBILITY_SERVICE); boolean accessibilityEnabled = am.isEnabled(); final boolean accessibilityEnabled = am.isEnabled(); // Reinitialize animation arrays for the current workspace state reinitializeAnimationArrays(); Loading Loading @@ -301,7 +304,7 @@ public class WorkspaceStateTransitionAnimation { } final View searchBar = mLauncher.getOrCreateQsbBar(); final View overviewPanel = mLauncher.getOverviewPanel(); final ViewGroup overviewPanel = mLauncher.getOverviewPanel(); final View hotseat = mLauncher.getHotseat(); final View pageIndicator = mWorkspace.getPageIndicator(); if (animated) { Loading Loading @@ -424,6 +427,11 @@ public class WorkspaceStateTransitionAnimation { @Override public void onAnimationEnd(Animator animation) { mStateAnimator = null; if (accessibilityEnabled && overviewPanel.getVisibility() == View.VISIBLE) { overviewPanel.getChildAt(0).performAccessibilityAction( AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null); } } }); } else { Loading @@ -443,6 +451,11 @@ public class WorkspaceStateTransitionAnimation { mWorkspace.setScaleX(mNewScale); mWorkspace.setScaleY(mNewScale); mWorkspace.setTranslationY(finalWorkspaceTranslationY); if (accessibilityEnabled && overviewPanel.getVisibility() == View.VISIBLE) { overviewPanel.getChildAt(0).performAccessibilityAction( AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null); } } if (stateIsNormal) { Loading