diff options
| author | 2020-05-29 18:41:03 -0400 | |
|---|---|---|
| committer | 2020-06-01 15:09:35 -0400 | |
| commit | e21bf0f4d982ada28eef23e62464a77e0836a6c2 (patch) | |
| tree | 0507d0320811fccd1bfb710741da156771a6f3cb | |
| parent | af9a747e333a1f5ca8f2df8945ca9357d4b337c9 (diff) | |
Update dismiss appearance and add scrim per UX mocks.
Test: manual
Bug: 154936763
Change-Id: Iabbd2b659859bc1bec6d1de6b720ee1cd75462c5
7 files changed, 67 insertions, 33 deletions
diff --git a/packages/SystemUI/res/drawable/dismiss_circle_background.xml b/packages/SystemUI/res/drawable/dismiss_circle_background.xml index e311c520d3d6..7809c8398c2d 100644 --- a/packages/SystemUI/res/drawable/dismiss_circle_background.xml +++ b/packages/SystemUI/res/drawable/dismiss_circle_background.xml @@ -21,8 +21,8 @@ <stroke android:width="1dp" - android:color="#66FFFFFF" /> + android:color="#AAFFFFFF" /> - <solid android:color="#B3000000" /> + <solid android:color="#77000000" /> </shape>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/dismiss_target_x.xml b/packages/SystemUI/res/drawable/dismiss_target_x.xml deleted file mode 100644 index 3672efffe139..000000000000 --- a/packages/SystemUI/res/drawable/dismiss_target_x.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2020 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. - --> - -<!-- 'X' icon. --> -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="24.0dp" - android:height="24.0dp" - android:viewportWidth="24.0" - android:viewportHeight="24.0"> - <path - android:pathData="M19.000000,6.400000l-1.400000,-1.400000 -5.600000,5.600000 -5.600000,-5.600000 -1.400000,1.400000 5.600000,5.600000 -5.600000,5.600000 1.400000,1.400000 5.600000,-5.600000 5.600000,5.600000 1.400000,-1.400000 -5.600000,-5.600000z" - android:fillColor="#FFFFFFFF" - android:strokeColor="#FF000000"/> -</vector>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/floating_dismiss_gradient.xml b/packages/SystemUI/res/drawable/floating_dismiss_gradient.xml new file mode 100644 index 000000000000..8f7fb1011cf4 --- /dev/null +++ b/packages/SystemUI/res/drawable/floating_dismiss_gradient.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2020 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<shape + xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <gradient + android:angle="270" + android:startColor="#00000000" + android:endColor="#77000000" + android:type="linear" /> +</shape>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/floating_dismiss_gradient_transition.xml b/packages/SystemUI/res/drawable/floating_dismiss_gradient_transition.xml new file mode 100644 index 000000000000..6a0695e817c7 --- /dev/null +++ b/packages/SystemUI/res/drawable/floating_dismiss_gradient_transition.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2020 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<transition xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:drawable="@color/transparent" /> + <item android:drawable="@drawable/floating_dismiss_gradient" /> +</transition>
\ No newline at end of file diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 7f1763d2dec1..c79153a424e2 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -973,7 +973,9 @@ <dimen name="recents_quick_scrub_onboarding_margin_start">8dp</dimen> <!-- The height of the gradient indicating the dismiss edge when moving a PIP. --> - <dimen name="floating_dismiss_gradient_height">176dp</dimen> + <dimen name="floating_dismiss_gradient_height">250dp</dimen> + + <dimen name="floating_dismiss_bottom_margin">50dp</dimen> <!-- The bottom margin of the PIP drag to dismiss info text shown when moving a PIP. --> <dimen name="pip_dismiss_text_bottom_margin">24dp</dimen> diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java index 239132ea292b..760b701d200b 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java @@ -47,6 +47,7 @@ import android.graphics.PointF; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Region; +import android.graphics.drawable.TransitionDrawable; import android.os.Bundle; import android.provider.Settings; import android.util.Log; @@ -133,6 +134,9 @@ public class BubbleStackView extends FrameLayout /** Percent to darken the bubbles when they're in the dismiss target. */ private static final float DARKEN_PERCENT = 0.3f; + /** Duration of the dismiss scrim fading in/out. */ + private static final int DISMISS_TRANSITION_DURATION_MS = 200; + /** How long to wait, in milliseconds, before hiding the flyout. */ @VisibleForTesting static final int FLYOUT_HIDE_AFTER = 5000; @@ -741,7 +745,7 @@ public class BubbleStackView extends FrameLayout final View targetView = new DismissCircleView(context); final FrameLayout.LayoutParams newParams = new FrameLayout.LayoutParams(targetSize, targetSize); - newParams.gravity = Gravity.CENTER; + newParams.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL; targetView.setLayoutParams(newParams); mDismissTargetAnimator = PhysicsAnimator.getInstance(targetView); @@ -750,9 +754,16 @@ public class BubbleStackView extends FrameLayout MATCH_PARENT, getResources().getDimensionPixelSize(R.dimen.floating_dismiss_gradient_height), Gravity.BOTTOM)); + + final int bottomMargin = + getResources().getDimensionPixelSize(R.dimen.floating_dismiss_bottom_margin); + mDismissTargetContainer.setPadding(0, 0, 0, bottomMargin); + mDismissTargetContainer.setClipToPadding(false); mDismissTargetContainer.setClipChildren(false); mDismissTargetContainer.addView(targetView); mDismissTargetContainer.setVisibility(View.INVISIBLE); + mDismissTargetContainer.setBackgroundResource( + R.drawable.floating_dismiss_gradient_transition); addView(mDismissTargetContainer); // Start translated down so the target springs up. @@ -1856,6 +1867,9 @@ public class BubbleStackView extends FrameLayout mDismissTargetContainer.setZ(Short.MAX_VALUE - 1); mDismissTargetContainer.setVisibility(VISIBLE); + ((TransitionDrawable) mDismissTargetContainer.getBackground()).startTransition( + DISMISS_TRANSITION_DURATION_MS); + mDismissTargetAnimator.cancel(); mDismissTargetAnimator .spring(DynamicAnimation.TRANSLATION_Y, 0f, mDismissTargetSpring) @@ -1873,6 +1887,9 @@ public class BubbleStackView extends FrameLayout mShowingDismiss = false; + ((TransitionDrawable) mDismissTargetContainer.getBackground()).reverseTransition( + DISMISS_TRANSITION_DURATION_MS); + mDismissTargetAnimator .spring(DynamicAnimation.TRANSLATION_Y, mDismissTargetContainer.getHeight(), mDismissTargetSpring) diff --git a/packages/SystemUI/src/com/android/systemui/util/DismissCircleView.java b/packages/SystemUI/src/com/android/systemui/util/DismissCircleView.java index 6c3538cb6142..a31ea7c3ab17 100644 --- a/packages/SystemUI/src/com/android/systemui/util/DismissCircleView.java +++ b/packages/SystemUI/src/com/android/systemui/util/DismissCircleView.java @@ -40,7 +40,7 @@ public class DismissCircleView extends FrameLayout { setBackground(res.getDrawable(R.drawable.dismiss_circle_background)); - mIconView.setImageDrawable(res.getDrawable(R.drawable.dismiss_target_x)); + mIconView.setImageDrawable(res.getDrawable(R.drawable.ic_close_white)); addView(mIconView); setViewSizes(); |