From 863828763a4c94f44b67bc4aac0d2cde8b458797 Mon Sep 17 00:00:00 2001 From: Winson Date: Tue, 19 Apr 2016 10:41:40 -0700 Subject: Disallowing scrim activity from setting TaskDescription. Bug: 28248314 Change-Id: Ifa2ed84a0a772ed3636ec4a8b94a165aebeb7049 --- .../android/systemui/stackdivider/ForcedResizableInfoActivity.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/ForcedResizableInfoActivity.java b/packages/SystemUI/src/com/android/systemui/stackdivider/ForcedResizableInfoActivity.java index 177296bc8c03..18834edaff05 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/ForcedResizableInfoActivity.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/ForcedResizableInfoActivity.java @@ -18,6 +18,7 @@ package com.android.systemui.stackdivider; import android.annotation.Nullable; import android.app.Activity; +import android.app.ActivityManager; import android.os.Bundle; import android.view.KeyEvent; import android.view.MotionEvent; @@ -75,4 +76,9 @@ public class ForcedResizableInfoActivity extends Activity implements OnTouchList finish(); return true; } + + @Override + public void setTaskDescription(ActivityManager.TaskDescription taskDescription) { + // Do nothing + } } -- cgit v1.2.3-59-g8ed1b From 0a461f0111287a0c0b77dd7ec0454b40195c8d88 Mon Sep 17 00:00:00 2001 From: Winson Date: Tue, 19 Apr 2016 10:51:12 -0700 Subject: Ensure that the drag view is not dimmed. - When picking up a task view to dock it, we should animate remove the dim on the task view so that when you drop it, there is no jump from the dimmed version to non-dimmed app. Bug: 27154882 Change-Id: Ifa1493227593dd950e49650b69f178cef82bc82e --- .../SystemUI/src/com/android/systemui/recents/views/TaskStackView.java | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java index 6176d99a7c17..33d3dc06724e 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java @@ -1765,6 +1765,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal mTmpTransform, null); mTmpTransform.scale = finalScale; mTmpTransform.translationZ = mLayoutAlgorithm.mMaxTranslationZ + 1; + mTmpTransform.dimAlpha = 0f; updateTaskViewToTransform(event.taskView, mTmpTransform, new AnimationProps(DRAG_SCALE_DURATION, Interpolators.FAST_OUT_SLOW_IN)); } -- cgit v1.2.3-59-g8ed1b From ce9630da86342c7bf30f00d1ced34a1d051c55ba Mon Sep 17 00:00:00 2001 From: Winson Date: Tue, 19 Apr 2016 11:33:04 -0700 Subject: Tweaking accessibility actions for dock divider. - Adding tl_full/70%/50%/30%/rb_full Bug: 27724715 Change-Id: Ie3125ec81e6463696cf56640c6b86f9cfcbda945 --- .../internal/policy/DividerSnapAlgorithm.java | 8 +++ packages/SystemUI/res/values/ids.xml | 9 +-- packages/SystemUI/res/values/strings.xml | 32 +++++++---- .../android/systemui/stackdivider/DividerView.java | 67 ++++++++++++++++------ 4 files changed, 83 insertions(+), 33 deletions(-) diff --git a/core/java/com/android/internal/policy/DividerSnapAlgorithm.java b/core/java/com/android/internal/policy/DividerSnapAlgorithm.java index 669e1efb9249..b8bc1618b3a3 100644 --- a/core/java/com/android/internal/policy/DividerSnapAlgorithm.java +++ b/core/java/com/android/internal/policy/DividerSnapAlgorithm.java @@ -330,6 +330,14 @@ public class DividerSnapAlgorithm { return snapTarget; } + public boolean isFirstSplitTargetAvailable() { + return mFirstSplitTarget != mMiddleTarget; + } + + public boolean isLastSplitTargetAvailable() { + return mLastSplitTarget != mMiddleTarget; + } + /** * Cycles through all non-dismiss targets with a stepping of {@param increment}. It moves left * if {@param increment} is negative and moves right otherwise. diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml index 9697ea6f3788..94d79f27e67f 100644 --- a/packages/SystemUI/res/values/ids.xml +++ b/packages/SystemUI/res/values/ids.xml @@ -63,9 +63,10 @@ - - - - + + + + + diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index a03aa28c47c5..8e3ea4c946e0 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -1580,17 +1580,27 @@ Split-screen divider - - Move down - - - Move up - - - Move left - - - Move right + + Left full screen + + Left 70% + + Left 50% + + Left 30% + + Right full screen + + + Top full screen + + Top 70% + + Top 50% + + Top 30% + + Bottom full screen Position %1$d, %2$s. Double tap to edit. diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java index 67c4008b4dc6..277c60bbb6b6 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java @@ -154,31 +154,62 @@ public class DividerView extends FrameLayout implements OnTouchListener, public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(host, info); if (isHorizontalDivision()) { - info.addAction(new AccessibilityAction(R.id.action_move_up, - mContext.getString(R.string.accessibility_action_divider_move_up))); - info.addAction(new AccessibilityAction(R.id.action_move_down, - mContext.getString(R.string.accessibility_action_divider_move_down))); + info.addAction(new AccessibilityAction(R.id.action_move_tl_full, + mContext.getString(R.string.accessibility_action_divider_top_full))); + if (mSnapAlgorithm.isFirstSplitTargetAvailable()) { + info.addAction(new AccessibilityAction(R.id.action_move_tl_70, + mContext.getString(R.string.accessibility_action_divider_top_70))); + } + info.addAction(new AccessibilityAction(R.id.action_move_tl_50, + mContext.getString(R.string.accessibility_action_divider_top_50))); + if (mSnapAlgorithm.isLastSplitTargetAvailable()) { + info.addAction(new AccessibilityAction(R.id.action_move_tl_30, + mContext.getString(R.string.accessibility_action_divider_top_30))); + } + info.addAction(new AccessibilityAction(R.id.action_move_rb_full, + mContext.getString(R.string.accessibility_action_divider_bottom_full))); } else { - info.addAction(new AccessibilityAction(R.id.action_move_left, - mContext.getString(R.string.accessibility_action_divider_move_left))); - info.addAction(new AccessibilityAction(R.id.action_move_right, - mContext.getString(R.string.accessibility_action_divider_move_right))); + info.addAction(new AccessibilityAction(R.id.action_move_tl_full, + mContext.getString(R.string.accessibility_action_divider_left_full))); + if (mSnapAlgorithm.isFirstSplitTargetAvailable()) { + info.addAction(new AccessibilityAction(R.id.action_move_tl_70, + mContext.getString(R.string.accessibility_action_divider_left_70))); + } + info.addAction(new AccessibilityAction(R.id.action_move_tl_50, + mContext.getString(R.string.accessibility_action_divider_left_50))); + if (mSnapAlgorithm.isLastSplitTargetAvailable()) { + info.addAction(new AccessibilityAction(R.id.action_move_tl_30, + mContext.getString(R.string.accessibility_action_divider_left_30))); + } + info.addAction(new AccessibilityAction(R.id.action_move_rb_full, + mContext.getString(R.string.accessibility_action_divider_right_full))); } } @Override public boolean performAccessibilityAction(View host, int action, Bundle args) { - if (action == R.id.action_move_up || action == R.id.action_move_down - || action == R.id.action_move_left || action == R.id.action_move_right) { - int position = getCurrentPosition(); - SnapTarget currentTarget = mSnapAlgorithm.calculateSnapTarget( - position, 0 /* velocity */); - SnapTarget nextTarget = - action == R.id.action_move_up || action == R.id.action_move_left - ? mSnapAlgorithm.getPreviousTarget(currentTarget) - : mSnapAlgorithm.getNextTarget(currentTarget); + int currentPosition = getCurrentPosition(); + SnapTarget nextTarget = null; + switch (action) { + case R.id.action_move_tl_full: + nextTarget = mSnapAlgorithm.getDismissEndTarget(); + break; + case R.id.action_move_tl_70: + nextTarget = mSnapAlgorithm.getLastSplitTarget(); + break; + case R.id.action_move_tl_50: + nextTarget = mSnapAlgorithm.getMiddleTarget(); + break; + case R.id.action_move_tl_30: + nextTarget = mSnapAlgorithm.getFirstSplitTarget(); + break; + case R.id.action_move_rb_full: + nextTarget = mSnapAlgorithm.getDismissStartTarget(); + break; + } + if (nextTarget != null) { startDragging(true /* animate */, false /* touching */); - stopDragging(getCurrentPosition(), nextTarget, 250, Interpolators.FAST_OUT_SLOW_IN); + stopDragging(currentPosition, nextTarget, 250, Interpolators.FAST_OUT_SLOW_IN); return true; } return super.performAccessibilityAction(host, action, args); -- cgit v1.2.3-59-g8ed1b