Merge "Update dismiss appearance and add scrim per UX mocks." into rvc-dev am: a65d7258d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11683086 Change-Id: I553cf16bb4484e6896399e279249bb0b85aa7feb
This commit is contained in:
@@ -21,8 +21,8 @@
|
|||||||
|
|
||||||
<stroke
|
<stroke
|
||||||
android:width="1dp"
|
android:width="1dp"
|
||||||
android:color="#66FFFFFF" />
|
android:color="#AAFFFFFF" />
|
||||||
|
|
||||||
<solid android:color="#B3000000" />
|
<solid android:color="#77000000" />
|
||||||
|
|
||||||
</shape>
|
</shape>
|
||||||
@@ -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>
|
|
||||||
24
packages/SystemUI/res/drawable/floating_dismiss_gradient.xml
Normal file
24
packages/SystemUI/res/drawable/floating_dismiss_gradient.xml
Normal file
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -974,7 +974,9 @@
|
|||||||
<dimen name="recents_quick_scrub_onboarding_margin_start">8dp</dimen>
|
<dimen name="recents_quick_scrub_onboarding_margin_start">8dp</dimen>
|
||||||
|
|
||||||
<!-- The height of the gradient indicating the dismiss edge when moving a PIP. -->
|
<!-- 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. -->
|
<!-- 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>
|
<dimen name="pip_dismiss_text_bottom_margin">24dp</dimen>
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ import android.graphics.PointF;
|
|||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.RectF;
|
import android.graphics.RectF;
|
||||||
import android.graphics.Region;
|
import android.graphics.Region;
|
||||||
|
import android.graphics.drawable.TransitionDrawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.util.Log;
|
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. */
|
/** Percent to darken the bubbles when they're in the dismiss target. */
|
||||||
private static final float DARKEN_PERCENT = 0.3f;
|
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. */
|
/** How long to wait, in milliseconds, before hiding the flyout. */
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static final int FLYOUT_HIDE_AFTER = 5000;
|
static final int FLYOUT_HIDE_AFTER = 5000;
|
||||||
@@ -752,7 +756,7 @@ public class BubbleStackView extends FrameLayout
|
|||||||
final View targetView = new DismissCircleView(context);
|
final View targetView = new DismissCircleView(context);
|
||||||
final FrameLayout.LayoutParams newParams =
|
final FrameLayout.LayoutParams newParams =
|
||||||
new FrameLayout.LayoutParams(targetSize, targetSize);
|
new FrameLayout.LayoutParams(targetSize, targetSize);
|
||||||
newParams.gravity = Gravity.CENTER;
|
newParams.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;
|
||||||
targetView.setLayoutParams(newParams);
|
targetView.setLayoutParams(newParams);
|
||||||
mDismissTargetAnimator = PhysicsAnimator.getInstance(targetView);
|
mDismissTargetAnimator = PhysicsAnimator.getInstance(targetView);
|
||||||
|
|
||||||
@@ -761,9 +765,16 @@ public class BubbleStackView extends FrameLayout
|
|||||||
MATCH_PARENT,
|
MATCH_PARENT,
|
||||||
getResources().getDimensionPixelSize(R.dimen.floating_dismiss_gradient_height),
|
getResources().getDimensionPixelSize(R.dimen.floating_dismiss_gradient_height),
|
||||||
Gravity.BOTTOM));
|
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.setClipChildren(false);
|
||||||
mDismissTargetContainer.addView(targetView);
|
mDismissTargetContainer.addView(targetView);
|
||||||
mDismissTargetContainer.setVisibility(View.INVISIBLE);
|
mDismissTargetContainer.setVisibility(View.INVISIBLE);
|
||||||
|
mDismissTargetContainer.setBackgroundResource(
|
||||||
|
R.drawable.floating_dismiss_gradient_transition);
|
||||||
addView(mDismissTargetContainer);
|
addView(mDismissTargetContainer);
|
||||||
|
|
||||||
// Start translated down so the target springs up.
|
// Start translated down so the target springs up.
|
||||||
@@ -1884,6 +1895,9 @@ public class BubbleStackView extends FrameLayout
|
|||||||
mDismissTargetContainer.setZ(Short.MAX_VALUE - 1);
|
mDismissTargetContainer.setZ(Short.MAX_VALUE - 1);
|
||||||
mDismissTargetContainer.setVisibility(VISIBLE);
|
mDismissTargetContainer.setVisibility(VISIBLE);
|
||||||
|
|
||||||
|
((TransitionDrawable) mDismissTargetContainer.getBackground()).startTransition(
|
||||||
|
DISMISS_TRANSITION_DURATION_MS);
|
||||||
|
|
||||||
mDismissTargetAnimator.cancel();
|
mDismissTargetAnimator.cancel();
|
||||||
mDismissTargetAnimator
|
mDismissTargetAnimator
|
||||||
.spring(DynamicAnimation.TRANSLATION_Y, 0f, mDismissTargetSpring)
|
.spring(DynamicAnimation.TRANSLATION_Y, 0f, mDismissTargetSpring)
|
||||||
@@ -1901,6 +1915,9 @@ public class BubbleStackView extends FrameLayout
|
|||||||
|
|
||||||
mShowingDismiss = false;
|
mShowingDismiss = false;
|
||||||
|
|
||||||
|
((TransitionDrawable) mDismissTargetContainer.getBackground()).reverseTransition(
|
||||||
|
DISMISS_TRANSITION_DURATION_MS);
|
||||||
|
|
||||||
mDismissTargetAnimator
|
mDismissTargetAnimator
|
||||||
.spring(DynamicAnimation.TRANSLATION_Y, mDismissTargetContainer.getHeight(),
|
.spring(DynamicAnimation.TRANSLATION_Y, mDismissTargetContainer.getHeight(),
|
||||||
mDismissTargetSpring)
|
mDismissTargetSpring)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class DismissCircleView extends FrameLayout {
|
|||||||
|
|
||||||
setBackground(res.getDrawable(R.drawable.dismiss_circle_background));
|
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);
|
addView(mIconView);
|
||||||
|
|
||||||
setViewSizes();
|
setViewSizes();
|
||||||
|
|||||||
Reference in New Issue
Block a user