Merge changes Ie7aaec55,I3053cdb6 into sc-v2-dev
* changes: Remove BUBBLE_EXPANDED state from ScrimController Manage menu changes
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:focusable="true"
|
||||
android:text="@string/manage_bubbles_text"
|
||||
|
||||
@@ -25,15 +25,15 @@
|
||||
android:id="@+id/bubble_manage_menu_dismiss_container"
|
||||
android:background="@drawable/bubble_manage_menu_row"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="@dimen/bubble_menu_item_height"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingStart="@dimen/bubble_menu_padding"
|
||||
android:paddingEnd="@dimen/bubble_menu_padding"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_width="@dimen/bubble_menu_icon_size"
|
||||
android:layout_height="@dimen/bubble_menu_icon_size"
|
||||
android:src="@drawable/ic_remove_no_shadow"
|
||||
android:tint="@color/bubbles_icon_tint"/>
|
||||
|
||||
@@ -50,15 +50,15 @@
|
||||
android:id="@+id/bubble_manage_menu_dont_bubble_container"
|
||||
android:background="@drawable/bubble_manage_menu_row"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="@dimen/bubble_menu_item_height"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingStart="@dimen/bubble_menu_padding"
|
||||
android:paddingEnd="@dimen/bubble_menu_padding"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_width="@dimen/bubble_menu_icon_size"
|
||||
android:layout_height="@dimen/bubble_menu_icon_size"
|
||||
android:src="@drawable/bubble_ic_stop_bubble"
|
||||
android:tint="@color/bubbles_icon_tint"/>
|
||||
|
||||
@@ -75,16 +75,16 @@
|
||||
android:id="@+id/bubble_manage_menu_settings_container"
|
||||
android:background="@drawable/bubble_manage_menu_row"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="@dimen/bubble_menu_item_height"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingStart="@dimen/bubble_menu_padding"
|
||||
android:paddingEnd="@dimen/bubble_menu_padding"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bubble_manage_menu_settings_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_width="@dimen/bubble_menu_icon_size"
|
||||
android:layout_height="@dimen/bubble_menu_icon_size"
|
||||
android:src="@drawable/ic_remove_no_shadow"/>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -152,6 +152,10 @@
|
||||
<dimen name="bubble_manage_button_height">56dp</dimen>
|
||||
<!-- Height of an item in the bubble manage menu. -->
|
||||
<dimen name="bubble_menu_item_height">60dp</dimen>
|
||||
<!-- Padding applied to the bubble manage menu. -->
|
||||
<dimen name="bubble_menu_padding">16dp</dimen>
|
||||
<!-- Size of the icons in the manage menu. -->
|
||||
<dimen name="bubble_menu_icon_size">24dp</dimen>
|
||||
<!-- Max width of the message bubble-->
|
||||
<dimen name="bubble_message_max_width">144dp</dimen>
|
||||
<!-- Min width of the message bubble -->
|
||||
|
||||
@@ -108,9 +108,6 @@ public class BubbleStackView extends FrameLayout
|
||||
*/
|
||||
private static final float FLYOUT_OVERSCROLL_ATTENUATION_FACTOR = 8f;
|
||||
|
||||
/** Duration of the flyout alpha animations. */
|
||||
private static final int FLYOUT_ALPHA_ANIMATION_DURATION = 100;
|
||||
|
||||
private static final int FADE_IN_DURATION = 320;
|
||||
|
||||
/** Percent to darken the bubbles when they're in the dismiss target. */
|
||||
@@ -124,6 +121,8 @@ public class BubbleStackView extends FrameLayout
|
||||
|
||||
private static final int EXPANDED_VIEW_ALPHA_ANIMATION_DURATION = 150;
|
||||
|
||||
private static final int MANAGE_MENU_SCRIM_ANIM_DURATION = 150;
|
||||
|
||||
private static final float SCRIM_ALPHA = 0.6f;
|
||||
|
||||
/**
|
||||
@@ -200,6 +199,7 @@ public class BubbleStackView extends FrameLayout
|
||||
private ExpandedAnimationController mExpandedAnimationController;
|
||||
|
||||
private View mScrim;
|
||||
private View mManageMenuScrim;
|
||||
private FrameLayout mExpandedViewContainer;
|
||||
|
||||
/** Matrix used to scale the expanded view container with a given pivot point. */
|
||||
@@ -869,6 +869,14 @@ public class BubbleStackView extends FrameLayout
|
||||
addView(mScrim);
|
||||
mScrim.setAlpha(0f);
|
||||
|
||||
mManageMenuScrim = new View(getContext());
|
||||
mManageMenuScrim.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
|
||||
mManageMenuScrim.setBackgroundDrawable(new ColorDrawable(
|
||||
getResources().getColor(android.R.color.system_neutral1_1000)));
|
||||
addView(mManageMenuScrim, new LayoutParams(MATCH_PARENT, MATCH_PARENT));
|
||||
mManageMenuScrim.setAlpha(0f);
|
||||
mManageMenuScrim.setVisibility(INVISIBLE);
|
||||
|
||||
mOrientationChangedListener =
|
||||
(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
|
||||
mPositioner.update();
|
||||
@@ -1227,6 +1235,8 @@ public class BubbleStackView extends FrameLayout
|
||||
updateExpandedViewTheme();
|
||||
mScrim.setBackgroundDrawable(new ColorDrawable(
|
||||
getResources().getColor(android.R.color.system_neutral1_1000)));
|
||||
mManageMenuScrim.setBackgroundDrawable(new ColorDrawable(
|
||||
getResources().getColor(android.R.color.system_neutral1_1000)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2511,6 +2521,24 @@ public class BubbleStackView extends FrameLayout
|
||||
return;
|
||||
}
|
||||
|
||||
if (show) {
|
||||
mManageMenuScrim.setVisibility(VISIBLE);
|
||||
mManageMenuScrim.setTranslationZ(mManageMenu.getElevation() - 1f);
|
||||
}
|
||||
Runnable endAction = () -> {
|
||||
if (!show) {
|
||||
mManageMenuScrim.setVisibility(INVISIBLE);
|
||||
mManageMenuScrim.setTranslationZ(0f);
|
||||
}
|
||||
};
|
||||
|
||||
mManageMenuScrim.animate()
|
||||
.setDuration(MANAGE_MENU_SCRIM_ANIM_DURATION)
|
||||
.setInterpolator(show ? ALPHA_IN : ALPHA_OUT)
|
||||
.alpha(show ? SCRIM_ALPHA : 0f)
|
||||
.withEndAction(endAction)
|
||||
.start();
|
||||
|
||||
// If available, update the manage menu's settings option with the expanded bubble's app
|
||||
// name and icon.
|
||||
if (show && mBubbleData.hasBubbleInStackWithKey(mExpandedBubble.getKey())) {
|
||||
|
||||
@@ -480,8 +480,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
|
||||
boolean relevantState = (mState == ScrimState.UNLOCKED
|
||||
|| mState == ScrimState.KEYGUARD
|
||||
|| mState == ScrimState.SHADE_LOCKED
|
||||
|| mState == ScrimState.PULSING
|
||||
|| mState == ScrimState.BUBBLE_EXPANDED);
|
||||
|| mState == ScrimState.PULSING);
|
||||
if (!(relevantState && mExpansionAffectsAlpha)) {
|
||||
return;
|
||||
}
|
||||
@@ -548,8 +547,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
|
||||
mQsBottomVisible = qsBottomVisible;
|
||||
boolean relevantState = (mState == ScrimState.SHADE_LOCKED
|
||||
|| mState == ScrimState.KEYGUARD
|
||||
|| mState == ScrimState.PULSING
|
||||
|| mState == ScrimState.BUBBLE_EXPANDED);
|
||||
|| mState == ScrimState.PULSING);
|
||||
if (!(relevantState && mExpansionAffectsAlpha)) {
|
||||
return;
|
||||
}
|
||||
@@ -622,7 +620,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
|
||||
return;
|
||||
}
|
||||
|
||||
if (mState == ScrimState.UNLOCKED || mState == ScrimState.BUBBLE_EXPANDED) {
|
||||
if (mState == ScrimState.UNLOCKED) {
|
||||
// Darken scrim as you pull down the shade when unlocked, unless the shade is expanding
|
||||
// because we're doing the screen off animation.
|
||||
if (!mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying()) {
|
||||
|
||||
@@ -250,23 +250,6 @@ public enum ScrimState {
|
||||
updateScrimColor(mScrimBehind, 1f /* alpha */, Color.BLACK);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Unlocked with a bubble expanded.
|
||||
*/
|
||||
BUBBLE_EXPANDED {
|
||||
@Override
|
||||
public void prepare(ScrimState previousState) {
|
||||
mFrontTint = Color.TRANSPARENT;
|
||||
mBehindTint = Color.TRANSPARENT;
|
||||
|
||||
mFrontAlpha = 0f;
|
||||
mBehindAlpha = mDefaultScrimAlpha;
|
||||
|
||||
mAnimationDuration = ScrimController.ANIMATION_DURATION;
|
||||
mBlankScreen = false;
|
||||
}
|
||||
};
|
||||
|
||||
boolean mBlankScreen = false;
|
||||
|
||||
@@ -4362,8 +4362,6 @@ public class StatusBar extends SystemUI implements
|
||||
mScrimController.transitionTo(ScrimState.AOD);
|
||||
} else if (mIsKeyguard && !unlocking) {
|
||||
mScrimController.transitionTo(ScrimState.KEYGUARD);
|
||||
} else if (mBubblesOptional.isPresent() && mBubblesOptional.get().isStackExpanded()) {
|
||||
mScrimController.transitionTo(ScrimState.BUBBLE_EXPANDED, mUnlockScrimCallback);
|
||||
} else {
|
||||
mScrimController.transitionTo(ScrimState.UNLOCKED, mUnlockScrimCallback);
|
||||
}
|
||||
|
||||
@@ -642,23 +642,6 @@ public class ScrimControllerTest extends SysuiTestCase {
|
||||
mScrimBehind, SEMI_TRANSPARENT));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transitionToBubbleExpanded() {
|
||||
mScrimController.transitionTo(ScrimState.BUBBLE_EXPANDED);
|
||||
finishAnimationsImmediately();
|
||||
|
||||
assertScrimTinted(Map.of(
|
||||
mScrimInFront, false,
|
||||
mScrimBehind, false
|
||||
));
|
||||
|
||||
// Front scrim should be transparent
|
||||
assertEquals(ScrimController.TRANSPARENT,
|
||||
mScrimInFront.getViewAlpha(), 0.0f);
|
||||
// Back scrim should be visible
|
||||
assertEquals(ScrimController.BUSY_SCRIM_ALPHA,
|
||||
mScrimBehind.getViewAlpha(), 0.0f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void scrimStateCallback() {
|
||||
@@ -1061,7 +1044,7 @@ public class ScrimControllerTest extends SysuiTestCase {
|
||||
HashSet<ScrimState> regularStates = new HashSet<>(Arrays.asList(
|
||||
ScrimState.UNINITIALIZED, ScrimState.KEYGUARD, ScrimState.BOUNCER,
|
||||
ScrimState.BOUNCER_SCRIMMED, ScrimState.BRIGHTNESS_MIRROR, ScrimState.UNLOCKED,
|
||||
ScrimState.BUBBLE_EXPANDED, ScrimState.SHADE_LOCKED, ScrimState.AUTH_SCRIMMED));
|
||||
ScrimState.SHADE_LOCKED, ScrimState.AUTH_SCRIMMED));
|
||||
|
||||
for (ScrimState state : ScrimState.values()) {
|
||||
if (!lowPowerModeStates.contains(state) && !regularStates.contains(state)) {
|
||||
|
||||
Reference in New Issue
Block a user