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

Commit 6340b539 authored by Ivan Tkachenko's avatar Ivan Tkachenko Committed by Automerger Merge Worker
Browse files

Merge "Remove conversation related options in bubble manage menu" into udc-dev...

Merge "Remove conversation related options in bubble manage menu" into udc-dev am: 61e0c88a am: ec01e2fb

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



Change-Id: Ic0e9733aec58a32bf75db6c8899a7cf93d6303b7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents d08369ea ec01e2fb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -63,11 +63,11 @@
            android:tint="@color/bubbles_icon_tint"/>

        <TextView
            android:id="@+id/bubble_manage_menu_dont_bubble_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault"
            android:text="@string/bubbles_dont_bubble_conversation" />
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault" />

    </LinearLayout>

+2 −0
Original line number Diff line number Diff line
@@ -146,6 +146,8 @@
    <string name="bubbles_app_settings"><xliff:g id="notification_title" example="Android Messages">%1$s</xliff:g> settings</string>
    <!-- Text used for the bubble dismiss area. Bubbles dragged to, or flung towards, this area will go away. [CHAR LIMIT=30] -->
    <string name="bubble_dismiss_text">Dismiss bubble</string>
    <!-- Button text to stop an app from bubbling [CHAR LIMIT=60]-->
    <string name="bubbles_dont_bubble">Don\u2019t bubble</string>
    <!-- Button text to stop a conversation from bubbling [CHAR LIMIT=60]-->
    <string name="bubbles_dont_bubble_conversation">Don\u2019t bubble conversation</string>
    <!-- Title text for the bubbles feature education cling shown when a bubble is on screen for the first time. [CHAR LIMIT=60]-->
+26 −2
Original line number Diff line number Diff line
@@ -844,6 +844,8 @@ public class BubbleStackView extends FrameLayout
    private DismissView mDismissView;

    private ViewGroup mManageMenu;
    private TextView mManageDontBubbleText;
    private ViewGroup mManageSettingsView;
    private ImageView mManageSettingsIcon;
    private TextView mManageSettingsText;
    private boolean mShowingManage = false;
@@ -1217,7 +1219,11 @@ public class BubbleStackView extends FrameLayout
                    mUnbubbleConversationCallback.accept(mBubbleData.getSelectedBubble().getKey());
                });

        mManageMenu.findViewById(R.id.bubble_manage_menu_settings_container).setOnClickListener(
        mManageDontBubbleText = mManageMenu
                .findViewById(R.id.bubble_manage_menu_dont_bubble_text);

        mManageSettingsView = mManageMenu.findViewById(R.id.bubble_manage_menu_settings_container);
        mManageSettingsView.setOnClickListener(
                view -> {
                    showManageMenu(false /* show */);
                    final BubbleViewProvider bubble = mBubbleData.getSelectedBubble();
@@ -2868,10 +2874,19 @@ public class BubbleStackView extends FrameLayout
        // name and icon.
        if (show) {
            final Bubble bubble = mBubbleData.getBubbleInStackWithKey(mExpandedBubble.getKey());
            if (bubble != null) {
            if (bubble != null && !bubble.isAppBubble()) {
                // Setup options for non app bubbles
                mManageDontBubbleText.setText(R.string.bubbles_dont_bubble_conversation);
                mManageSettingsIcon.setImageBitmap(bubble.getRawAppBadge());
                mManageSettingsText.setText(getResources().getString(
                        R.string.bubbles_app_settings, bubble.getAppName()));
                mManageSettingsView.setVisibility(VISIBLE);
            } else {
                // Setup options for app bubbles
                mManageDontBubbleText.setText(R.string.bubbles_dont_bubble);
                // App bubbles are not notification based
                // so we don't show the option to go to notification settings
                mManageSettingsView.setVisibility(GONE);
            }
        }

@@ -2936,6 +2951,15 @@ public class BubbleStackView extends FrameLayout
        }
    }

    /**
     * Checks whether manage menu notification settings action is available and visible
     * Used for testing
     */
    @VisibleForTesting
    public boolean isManageMenuSettingsVisible() {
        return mManageSettingsView != null && mManageSettingsView.getVisibility() == VISIBLE;
    }

    private void updateExpandedBubble() {
        if (DEBUG_BUBBLE_STACK_VIEW) {
            Log.d(TAG, "updateExpandedBubble()");
+18 −0
Original line number Diff line number Diff line
@@ -1245,6 +1245,24 @@ public class BubblesTest extends SysuiTestCase {
        // Show the menu
        stackView.showManageMenu(true);
        assertSysuiStates(true /* stackExpanded */, true /* mangeMenuExpanded */);
        assertTrue(stackView.isManageMenuSettingsVisible());
    }

    @Test
    public void testShowManageMenuChangesSysuiState_appBubble() {
        mBubbleController.showOrHideAppBubble(mAppBubbleIntent, mUser0);
        assertTrue(mBubbleController.hasBubbles());

        // Expand the stack
        BubbleStackView stackView = mBubbleController.getStackView();
        mBubbleData.setExpanded(true);
        assertStackExpanded();
        assertSysuiStates(true /* stackExpanded */, false /* mangeMenuExpanded */);

        // Show the menu
        stackView.showManageMenu(true);
        assertSysuiStates(true /* stackExpanded */, true /* mangeMenuExpanded */);
        assertFalse(stackView.isManageMenuSettingsVisible());
    }

    @Test