Merge "Add strings to announce where the app splits to" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5adb625539
@@ -100,6 +100,15 @@
|
|||||||
<!-- Accessibility action for moving docked stack divider to make the bottom screen full screen [CHAR LIMIT=NONE] -->
|
<!-- Accessibility action for moving docked stack divider to make the bottom screen full screen [CHAR LIMIT=NONE] -->
|
||||||
<string name="accessibility_action_divider_bottom_full">Bottom full screen</string>
|
<string name="accessibility_action_divider_bottom_full">Bottom full screen</string>
|
||||||
|
|
||||||
|
<!-- Accessibility label for splitting to the left drop zone [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="accessibility_split_left">Split left</string>
|
||||||
|
<!-- Accessibility label for splitting to the right drop zone [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="accessibility_split_right">Split right</string>
|
||||||
|
<!-- Accessibility label for splitting to the top drop zone [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="accessibility_split_top">Split top</string>
|
||||||
|
<!-- Accessibility label for splitting to the bottom drop zone [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="accessibility_split_bottom">Split bottom</string>
|
||||||
|
|
||||||
<!-- One-Handed Tutorial title [CHAR LIMIT=60] -->
|
<!-- One-Handed Tutorial title [CHAR LIMIT=60] -->
|
||||||
<string name="one_handed_tutorial_title">Using one-handed mode</string>
|
<string name="one_handed_tutorial_title">Using one-handed mode</string>
|
||||||
<!-- One-Handed Tutorial description [CHAR LIMIT=NONE] -->
|
<!-- One-Handed Tutorial description [CHAR LIMIT=NONE] -->
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
|||||||
|
|
||||||
import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT;
|
import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT;
|
||||||
import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT;
|
import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT;
|
||||||
|
import static com.android.wm.shell.draganddrop.DragAndDropPolicy.Target.TYPE_SPLIT_BOTTOM;
|
||||||
|
import static com.android.wm.shell.draganddrop.DragAndDropPolicy.Target.TYPE_SPLIT_LEFT;
|
||||||
|
import static com.android.wm.shell.draganddrop.DragAndDropPolicy.Target.TYPE_SPLIT_RIGHT;
|
||||||
|
import static com.android.wm.shell.draganddrop.DragAndDropPolicy.Target.TYPE_SPLIT_TOP;
|
||||||
|
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
@@ -315,6 +319,25 @@ public class DragLayout extends LinearLayout {
|
|||||||
// Switching between targets
|
// Switching between targets
|
||||||
mDropZoneView1.animateSwitch();
|
mDropZoneView1.animateSwitch();
|
||||||
mDropZoneView2.animateSwitch();
|
mDropZoneView2.animateSwitch();
|
||||||
|
// Announce for accessibility.
|
||||||
|
switch (target.type) {
|
||||||
|
case TYPE_SPLIT_LEFT:
|
||||||
|
mDropZoneView1.announceForAccessibility(
|
||||||
|
mContext.getString(R.string.accessibility_split_left));
|
||||||
|
break;
|
||||||
|
case TYPE_SPLIT_RIGHT:
|
||||||
|
mDropZoneView2.announceForAccessibility(
|
||||||
|
mContext.getString(R.string.accessibility_split_right));
|
||||||
|
break;
|
||||||
|
case TYPE_SPLIT_TOP:
|
||||||
|
mDropZoneView1.announceForAccessibility(
|
||||||
|
mContext.getString(R.string.accessibility_split_top));
|
||||||
|
break;
|
||||||
|
case TYPE_SPLIT_BOTTOM:
|
||||||
|
mDropZoneView2.announceForAccessibility(
|
||||||
|
mContext.getString(R.string.accessibility_split_bottom));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mCurrentTarget = target;
|
mCurrentTarget = target;
|
||||||
}
|
}
|
||||||
@@ -424,12 +447,10 @@ public class DragLayout extends LinearLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void animateHighlight(DragAndDropPolicy.Target target) {
|
private void animateHighlight(DragAndDropPolicy.Target target) {
|
||||||
if (target.type == DragAndDropPolicy.Target.TYPE_SPLIT_LEFT
|
if (target.type == TYPE_SPLIT_LEFT || target.type == TYPE_SPLIT_TOP) {
|
||||||
|| target.type == DragAndDropPolicy.Target.TYPE_SPLIT_TOP) {
|
|
||||||
mDropZoneView1.setShowingHighlight(true);
|
mDropZoneView1.setShowingHighlight(true);
|
||||||
mDropZoneView2.setShowingHighlight(false);
|
mDropZoneView2.setShowingHighlight(false);
|
||||||
} else if (target.type == DragAndDropPolicy.Target.TYPE_SPLIT_RIGHT
|
} else if (target.type == TYPE_SPLIT_RIGHT || target.type == TYPE_SPLIT_BOTTOM) {
|
||||||
|| target.type == DragAndDropPolicy.Target.TYPE_SPLIT_BOTTOM) {
|
|
||||||
mDropZoneView1.setShowingHighlight(false);
|
mDropZoneView1.setShowingHighlight(false);
|
||||||
mDropZoneView2.setShowingHighlight(true);
|
mDropZoneView2.setShowingHighlight(true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user