Accessibility fixes and updates

> Adding custom actions on the page indicator to go to overview mode
> Disabling custom actions on the first page
> Disabling 'move page left' on the second page

Change-Id: Ib8154f70cb3f93e663a881357c6c46c33253887f
This commit is contained in:
Sunny Goyal
2016-06-16 12:29:03 -07:00
parent 8e6a800480
commit d0a6ae7f64
8 changed files with 114 additions and 83 deletions
@@ -28,6 +28,7 @@ import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.config.FeatureFlags;
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public class OverviewScreenAccessibilityDelegate extends AccessibilityDelegate {
@@ -88,7 +89,9 @@ public class OverviewScreenAccessibilityDelegate extends AccessibilityDelegate {
if (index < mWorkspace.getChildCount() - 1) {
info.addAction(mActions.get(MOVE_FORWARD));
}
if (index > mWorkspace.numCustomPages()) {
int startIndex = mWorkspace.numCustomPages() + (FeatureFlags.QSB_ON_FIRST_SCREEN ? 1 : 0);
if (index > startIndex) {
info.addAction(mActions.get(MOVE_BACKWARD));
}
}