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

Commit 18c02ba5 authored by Mady Mellor's avatar Mady Mellor
Browse files

Add an option to bubbles to move them to fullscreen

Add a flagged menu item to bubble bar to move the bubble to fullscreen

Flag: com.android.wm.shell.enable_bubble_to_fullscreen
Test: manual - turn on flag, make a bubble, open the manage menu
               and move it to fullscreen (with taskview CL)
Bug: 363326492
Bug: 342245211
Change-Id: I91866c42df8775b58ea2d4ad44492b10d4394976
parent 127b3a42
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -155,6 +155,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>
    <!-- Text used to move the bubble to fullscreen. [CHAR LIMIT=30] -->
    <string name="bubble_fullscreen_text">Move to fullscreen</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]-->
+7 −0
Original line number Diff line number Diff line
@@ -228,6 +228,13 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView
            public void onDismissBubble(Bubble bubble) {
                mManager.dismissBubble(bubble, Bubbles.DISMISS_USER_GESTURE);
            }

            @Override
            public void onMoveToFullscreen(Bubble bubble) {
                if (mTaskView != null) {
                    mTaskView.moveToFullscreen();
                }
            }
        });
        mHandleView.setOnClickListener(view -> {
            mMenuViewController.showMenu(true /* animated */);
+21 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.view.ViewGroup;
import androidx.dynamicanimation.animation.DynamicAnimation;
import androidx.dynamicanimation.animation.SpringForce;

import com.android.wm.shell.Flags;
import com.android.wm.shell.R;
import com.android.wm.shell.bubbles.Bubble;
import com.android.wm.shell.shared.animation.PhysicsAnimator;
@@ -219,6 +220,21 @@ class BubbleBarMenuViewController {
                }
        ));

        if (Flags.enableBubbleAnything() || Flags.enableBubbleToFullscreen()) {
            menuActions.add(new BubbleBarMenuView.MenuAction(
                    Icon.createWithResource(resources,
                            R.drawable.desktop_mode_ic_handle_menu_fullscreen),
                    resources.getString(R.string.bubble_fullscreen_text),
                    tintColor,
                    view -> {
                        hideMenu(true /* animated */);
                        if (mListener != null) {
                            mListener.onMoveToFullscreen(bubble);
                        }
                    }
            ));
        }

        return menuActions;
    }

@@ -249,5 +265,10 @@ class BubbleBarMenuViewController {
         * Dismiss bubble and remove it from the bubble stack
         */
        void onDismissBubble(Bubble bubble);

        /**
         * Move the bubble to fullscreen.
         */
        void onMoveToFullscreen(Bubble bubble);
    }
}