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

Commit c7dfc839 authored by Ivan Tkachenko's avatar Ivan Tkachenko Committed by Android (Google) Code Review
Browse files

Merge "Remove don't bubble option for app bubbles" into udc-dev

parents fcea4de7 871dbfe5
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -63,11 +63,11 @@
            android:tint="@color/bubbles_icon_tint"/>
            android:tint="@color/bubbles_icon_tint"/>


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


    </LinearLayout>
    </LinearLayout>


+0 −2
Original line number Original line Diff line number Diff line
@@ -146,8 +146,6 @@
    <string name="bubbles_app_settings"><xliff:g id="notification_title" example="Android Messages">%1$s</xliff:g> settings</string>
    <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] -->
    <!-- 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>
    <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]-->
    <!-- Button text to stop a conversation from bubbling [CHAR LIMIT=60]-->
    <string name="bubbles_dont_bubble_conversation">Don\u2019t bubble conversation</string>
    <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]-->
    <!-- Title text for the bubbles feature education cling shown when a bubble is on screen for the first time. [CHAR LIMIT=60]-->
+16 −5
Original line number Original line Diff line number Diff line
@@ -842,7 +842,7 @@ public class BubbleStackView extends FrameLayout
    private DismissView mDismissView;
    private DismissView mDismissView;


    private ViewGroup mManageMenu;
    private ViewGroup mManageMenu;
    private TextView mManageDontBubbleText;
    private ViewGroup mManageDontBubbleView;
    private ViewGroup mManageSettingsView;
    private ViewGroup mManageSettingsView;
    private ImageView mManageSettingsIcon;
    private ImageView mManageSettingsIcon;
    private TextView mManageSettingsText;
    private TextView mManageSettingsText;
@@ -1217,8 +1217,8 @@ public class BubbleStackView extends FrameLayout
                    mUnbubbleConversationCallback.accept(mBubbleData.getSelectedBubble().getKey());
                    mUnbubbleConversationCallback.accept(mBubbleData.getSelectedBubble().getKey());
                });
                });


        mManageDontBubbleText = mManageMenu
        mManageDontBubbleView = mManageMenu
                .findViewById(R.id.bubble_manage_menu_dont_bubble_text);
                .findViewById(R.id.bubble_manage_menu_dont_bubble_container);


        mManageSettingsView = mManageMenu.findViewById(R.id.bubble_manage_menu_settings_container);
        mManageSettingsView = mManageMenu.findViewById(R.id.bubble_manage_menu_settings_container);
        mManageSettingsView.setOnClickListener(
        mManageSettingsView.setOnClickListener(
@@ -2890,14 +2890,16 @@ public class BubbleStackView extends FrameLayout
            final Bubble bubble = mBubbleData.getBubbleInStackWithKey(mExpandedBubble.getKey());
            final Bubble bubble = mBubbleData.getBubbleInStackWithKey(mExpandedBubble.getKey());
            if (bubble != null && !bubble.isAppBubble()) {
            if (bubble != null && !bubble.isAppBubble()) {
                // Setup options for non app bubbles
                // Setup options for non app bubbles
                mManageDontBubbleText.setText(R.string.bubbles_dont_bubble_conversation);
                mManageDontBubbleView.setVisibility(VISIBLE);
                mManageSettingsIcon.setImageBitmap(bubble.getRawAppBadge());
                mManageSettingsIcon.setImageBitmap(bubble.getRawAppBadge());
                mManageSettingsText.setText(getResources().getString(
                mManageSettingsText.setText(getResources().getString(
                        R.string.bubbles_app_settings, bubble.getAppName()));
                        R.string.bubbles_app_settings, bubble.getAppName()));
                mManageSettingsView.setVisibility(VISIBLE);
                mManageSettingsView.setVisibility(VISIBLE);
            } else {
            } else {
                // Setup options for app bubbles
                // Setup options for app bubbles
                mManageDontBubbleText.setText(R.string.bubbles_dont_bubble);
                // App bubbles have no conversations
                // so we don't show the option to not bubble conversation
                mManageDontBubbleView.setVisibility(GONE);
                // App bubbles are not notification based
                // App bubbles are not notification based
                // so we don't show the option to go to notification settings
                // so we don't show the option to go to notification settings
                mManageSettingsView.setVisibility(GONE);
                mManageSettingsView.setVisibility(GONE);
@@ -2965,6 +2967,15 @@ public class BubbleStackView extends FrameLayout
        }
        }
    }
    }


    /**
     * Checks whether manage menu don't bubble conversation action is available and visible
     * Used for testing
     */
    @VisibleForTesting
    public boolean isManageMenuDontBubbleVisible() {
        return mManageDontBubbleView != null && mManageDontBubbleView.getVisibility() == VISIBLE;
    }

    /**
    /**
     * Checks whether manage menu notification settings action is available and visible
     * Checks whether manage menu notification settings action is available and visible
     * Used for testing
     * Used for testing
+2 −0
Original line number Original line Diff line number Diff line
@@ -1257,6 +1257,7 @@ public class BubblesTest extends SysuiTestCase {
        stackView.showManageMenu(true);
        stackView.showManageMenu(true);
        assertSysuiStates(true /* stackExpanded */, true /* mangeMenuExpanded */);
        assertSysuiStates(true /* stackExpanded */, true /* mangeMenuExpanded */);
        assertTrue(stackView.isManageMenuSettingsVisible());
        assertTrue(stackView.isManageMenuSettingsVisible());
        assertTrue(stackView.isManageMenuDontBubbleVisible());
    }
    }


    @Test
    @Test
@@ -1274,6 +1275,7 @@ public class BubblesTest extends SysuiTestCase {
        stackView.showManageMenu(true);
        stackView.showManageMenu(true);
        assertSysuiStates(true /* stackExpanded */, true /* mangeMenuExpanded */);
        assertSysuiStates(true /* stackExpanded */, true /* mangeMenuExpanded */);
        assertFalse(stackView.isManageMenuSettingsVisible());
        assertFalse(stackView.isManageMenuSettingsVisible());
        assertFalse(stackView.isManageMenuDontBubbleVisible());
    }
    }


    @Test
    @Test