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

Commit 30fd086f authored by Mady Mellor's avatar Mady Mellor Committed by Android (Google) Code Review
Browse files

Merge changes I91866c42,I27436024,I506f7421 into main

* changes:
  Add an option to bubbles to move them to fullscreen
  Add an option to move tasks in TaskView to fullscreen
  Add a flag for moving bubbles to fullscreen
parents 1b6dd331 18c02ba5
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -138,3 +138,10 @@ flag {
        purpose: PURPOSE_BUGFIX
        purpose: PURPOSE_BUGFIX
    }
    }
}
}

flag {
   name: "enable_bubble_to_fullscreen"
   namespace: "multitasking"
   description: "Enable an option to move bubbles to fullscreen"
   bug: "363326492"
}
+2 −0
Original line number Original line 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>
    <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>
    <!-- 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]-->
    <!-- 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]-->
+7 −0
Original line number Original line Diff line number Diff line
@@ -228,6 +228,13 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView
            public void onDismissBubble(Bubble bubble) {
            public void onDismissBubble(Bubble bubble) {
                mManager.dismissBubble(bubble, Bubbles.DISMISS_USER_GESTURE);
                mManager.dismissBubble(bubble, Bubbles.DISMISS_USER_GESTURE);
            }
            }

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


import com.android.wm.shell.Flags;
import com.android.wm.shell.R;
import com.android.wm.shell.R;
import com.android.wm.shell.bubbles.Bubble;
import com.android.wm.shell.bubbles.Bubble;
import com.android.wm.shell.shared.animation.PhysicsAnimator;
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;
        return menuActions;
    }
    }


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

        /**
         * Move the bubble to fullscreen.
         */
        void onMoveToFullscreen(Bubble bubble);
    }
    }
}
}
+7 −0
Original line number Original line Diff line number Diff line
@@ -118,6 +118,13 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
        mTaskViewTaskController.startShortcutActivity(shortcut, options, launchBounds);
        mTaskViewTaskController.startShortcutActivity(shortcut, options, launchBounds);
    }
    }


    /**
     * Moves the current task in taskview out of the view and back to fullscreen.
     */
    public void moveToFullscreen() {
        mTaskViewTaskController.moveToFullscreen();
    }

    @Override
    @Override
    public void onTaskAppeared(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash) {
    public void onTaskAppeared(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash) {
        if (mTaskViewTaskController.isUsingShellTransitions()) {
        if (mTaskViewTaskController.isUsingShellTransitions()) {
Loading