Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d1ed7a4 authored by Mady Mellor's avatar Mady Mellor Committed by Automerger Merge Worker
Browse files

Merge changes I500c566e,I4b5ffc26 into sc-v2-dev am: 81ce27f8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15440807

Change-Id: I16d4d764895a3d2c3f8725e0949559398b164011
parents 72383815 81ce27f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -18,7 +18,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    android:shape="rectangle">
    <solid
    <solid
        android:color="@android:color/system_neutral1_900"
        android:color="@android:color/system_neutral1_800"
        />
        />
    <corners android:radius="20dp" />
    <corners android:radius="20dp" />


+4 −3
Original line number Original line Diff line number Diff line
@@ -20,9 +20,10 @@
    android:id="@+id/settings_button"
    android:id="@+id/settings_button"
    android:layout_gravity="start"
    android:layout_gravity="start"
    android:layout_width="wrap_content"
    android:layout_width="wrap_content"
    android:layout_height="40dp"
    android:layout_height="@dimen/bubble_manage_button_height"
    android:layout_marginTop="8dp"
    android:layout_marginStart="@dimen/bubble_manage_button_margin"
    android:layout_marginBottom="8dp"
    android:layout_marginTop="@dimen/bubble_manage_button_margin"
    android:layout_marginBottom="@dimen/bubble_manage_button_margin"
    android:focusable="true"
    android:focusable="true"
    android:text="@string/manage_bubbles_text"
    android:text="@string/manage_bubbles_text"
    android:textSize="@*android:dimen/text_size_body_2_material"
    android:textSize="@*android:dimen/text_size_body_2_material"
+7 −1
Original line number Original line Diff line number Diff line
@@ -100,6 +100,8 @@
    <dimen name="bubble_flyout_space_from_bubble">8dp</dimen>
    <dimen name="bubble_flyout_space_from_bubble">8dp</dimen>
    <!-- How much space to leave between the flyout text and the avatar displayed in the flyout. -->
    <!-- How much space to leave between the flyout text and the avatar displayed in the flyout. -->
    <dimen name="bubble_flyout_avatar_message_space">6dp</dimen>
    <dimen name="bubble_flyout_avatar_message_space">6dp</dimen>
    <!-- If the screen percentage is smaller than this, we'll use this value instead.  -->
    <dimen name="bubbles_flyout_min_width_large_screen">200dp</dimen>
    <!-- Padding between status bar and bubbles when displayed in expanded state -->
    <!-- Padding between status bar and bubbles when displayed in expanded state -->
    <dimen name="bubble_padding_top">16dp</dimen>
    <dimen name="bubble_padding_top">16dp</dimen>
    <!-- Space between bubbles when expanded. -->
    <!-- Space between bubbles when expanded. -->
@@ -149,7 +151,11 @@
    <!-- Extra padding around the dismiss target for bubbles -->
    <!-- Extra padding around the dismiss target for bubbles -->
    <dimen name="bubble_dismiss_slop">16dp</dimen>
    <dimen name="bubble_dismiss_slop">16dp</dimen>
    <!-- Height of button allowing users to adjust settings for bubbles. -->
    <!-- Height of button allowing users to adjust settings for bubbles. -->
    <dimen name="bubble_manage_button_height">56dp</dimen>
    <dimen name="bubble_manage_button_height">36dp</dimen>
    <!-- Height of manage button including margins. -->
    <dimen name="bubble_manage_button_total_height">68dp</dimen>
    <!-- The margin around the outside of the manage button. -->
    <dimen name="bubble_manage_button_margin">16dp</dimen>
    <!-- Height of an item in the bubble manage menu. -->
    <!-- Height of an item in the bubble manage menu. -->
    <dimen name="bubble_menu_item_height">60dp</dimen>
    <dimen name="bubble_menu_item_height">60dp</dimen>
    <!-- Padding applied to the bubble manage menu. -->
    <!-- Padding applied to the bubble manage menu. -->
+4 −0
Original line number Original line Diff line number Diff line
@@ -735,6 +735,10 @@ public class BubbleExpandedView extends LinearLayout {
        mManageButton.getBoundsOnScreen(rect);
        mManageButton.getBoundsOnScreen(rect);
    }
    }


    public int getManageButtonMargin() {
        return ((LinearLayout.LayoutParams) mManageButton.getLayoutParams()).getMarginStart();
    }

    /**
    /**
     * Cleans up anything related to the task and {@code TaskView}. If this view should be reused
     * Cleans up anything related to the task and {@code TaskView}. If this view should be reused
     * after this method is called, then
     * after this method is called, then
+12 −15
Original line number Original line Diff line number Diff line
@@ -56,9 +56,6 @@ import com.android.wm.shell.common.TriangleShape;
 * transform into the 'new' dot, which is used during flyout dismiss animations/gestures.
 * transform into the 'new' dot, which is used during flyout dismiss animations/gestures.
 */
 */
public class BubbleFlyoutView extends FrameLayout {
public class BubbleFlyoutView extends FrameLayout {
    /** Max width of the flyout, in terms of percent of the screen width. */
    private static final float FLYOUT_MAX_WIDTH_PERCENT = .6f;

    /** Translation Y of fade animation. */
    /** Translation Y of fade animation. */
    private static final float FLYOUT_FADE_Y = 40f;
    private static final float FLYOUT_FADE_Y = 40f;


@@ -68,6 +65,8 @@ public class BubbleFlyoutView extends FrameLayout {
    // Whether the flyout view should show a pointer to the bubble.
    // Whether the flyout view should show a pointer to the bubble.
    private static final boolean SHOW_POINTER = false;
    private static final boolean SHOW_POINTER = false;


    private BubblePositioner mPositioner;

    private final int mFlyoutPadding;
    private final int mFlyoutPadding;
    private final int mFlyoutSpaceFromBubble;
    private final int mFlyoutSpaceFromBubble;
    private final int mPointerSize;
    private final int mPointerSize;
@@ -156,10 +155,11 @@ public class BubbleFlyoutView extends FrameLayout {
    /** Callback to run when the flyout is hidden. */
    /** Callback to run when the flyout is hidden. */
    @Nullable private Runnable mOnHide;
    @Nullable private Runnable mOnHide;


    public BubbleFlyoutView(Context context) {
    public BubbleFlyoutView(Context context, BubblePositioner positioner) {
        super(context);
        super(context);
        LayoutInflater.from(context).inflate(R.layout.bubble_flyout, this, true);
        mPositioner = positioner;


        LayoutInflater.from(context).inflate(R.layout.bubble_flyout, this, true);
        mFlyoutTextContainer = findViewById(R.id.bubble_flyout_text_container);
        mFlyoutTextContainer = findViewById(R.id.bubble_flyout_text_container);
        mSenderText = findViewById(R.id.bubble_flyout_name);
        mSenderText = findViewById(R.id.bubble_flyout_name);
        mSenderAvatar = findViewById(R.id.bubble_flyout_avatar);
        mSenderAvatar = findViewById(R.id.bubble_flyout_avatar);
@@ -230,11 +230,11 @@ public class BubbleFlyoutView extends FrameLayout {
    /*
    /*
     * Fade animation for consecutive flyouts.
     * Fade animation for consecutive flyouts.
     */
     */
    void animateUpdate(Bubble.FlyoutMessage flyoutMessage, float parentWidth, PointF stackPos,
    void animateUpdate(Bubble.FlyoutMessage flyoutMessage, PointF stackPos,
            boolean hideDot, Runnable onHide) {
            boolean hideDot, Runnable onHide) {
        mOnHide = onHide;
        mOnHide = onHide;
        final Runnable afterFadeOut = () -> {
        final Runnable afterFadeOut = () -> {
            updateFlyoutMessage(flyoutMessage, parentWidth);
            updateFlyoutMessage(flyoutMessage);
            // Wait for TextViews to layout with updated height.
            // Wait for TextViews to layout with updated height.
            post(() -> {
            post(() -> {
                fade(true /* in */, stackPos, hideDot, () -> {} /* after */);
                fade(true /* in */, stackPos, hideDot, () -> {} /* after */);
@@ -266,7 +266,7 @@ public class BubbleFlyoutView extends FrameLayout {
                .withEndAction(afterFade);
                .withEndAction(afterFade);
    }
    }


    private void updateFlyoutMessage(Bubble.FlyoutMessage flyoutMessage, float parentWidth) {
    private void updateFlyoutMessage(Bubble.FlyoutMessage flyoutMessage) {
        final Drawable senderAvatar = flyoutMessage.senderAvatar;
        final Drawable senderAvatar = flyoutMessage.senderAvatar;
        if (senderAvatar != null && flyoutMessage.isGroupChat) {
        if (senderAvatar != null && flyoutMessage.isGroupChat) {
            mSenderAvatar.setVisibility(VISIBLE);
            mSenderAvatar.setVisibility(VISIBLE);
@@ -278,8 +278,7 @@ public class BubbleFlyoutView extends FrameLayout {
            mSenderText.setTranslationX(0);
            mSenderText.setTranslationX(0);
        }
        }


        final int maxTextViewWidth =
        final int maxTextViewWidth = (int) mPositioner.getMaxFlyoutSize() - mFlyoutPadding * 2;
                (int) (parentWidth * FLYOUT_MAX_WIDTH_PERCENT) - mFlyoutPadding * 2;


        // Name visibility
        // Name visibility
        if (!TextUtils.isEmpty(flyoutMessage.senderName)) {
        if (!TextUtils.isEmpty(flyoutMessage.senderName)) {
@@ -328,22 +327,20 @@ public class BubbleFlyoutView extends FrameLayout {
    void setupFlyoutStartingAsDot(
    void setupFlyoutStartingAsDot(
            Bubble.FlyoutMessage flyoutMessage,
            Bubble.FlyoutMessage flyoutMessage,
            PointF stackPos,
            PointF stackPos,
            float parentWidth,
            boolean arrowPointingLeft,
            boolean arrowPointingLeft,
            int dotColor,
            int dotColor,
            @Nullable Runnable onLayoutComplete,
            @Nullable Runnable onLayoutComplete,
            @Nullable Runnable onHide,
            @Nullable Runnable onHide,
            float[] dotCenter,
            float[] dotCenter,
            boolean hideDot,
            boolean hideDot)  {
            BubblePositioner positioner)  {


        mBubbleSize = positioner.getBubbleSize();
        mBubbleSize = mPositioner.getBubbleSize();


        mOriginalDotSize = SIZE_PERCENTAGE * mBubbleSize;
        mOriginalDotSize = SIZE_PERCENTAGE * mBubbleSize;
        mNewDotRadius = (DOT_SCALE * mOriginalDotSize) / 2f;
        mNewDotRadius = (DOT_SCALE * mOriginalDotSize) / 2f;
        mNewDotSize = mNewDotRadius * 2f;
        mNewDotSize = mNewDotRadius * 2f;


        updateFlyoutMessage(flyoutMessage, parentWidth);
        updateFlyoutMessage(flyoutMessage);


        mArrowPointingLeft = arrowPointingLeft;
        mArrowPointingLeft = arrowPointingLeft;
        mDotColor = dotColor;
        mDotColor = dotColor;
Loading