Loading quickstep/res/drawable/bg_bubble_dismiss_circle.xml 0 → 100644 +27 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2023 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <stroke android:width="2dp" android:color="@android:color/system_accent1_600" /> <solid android:color="@android:color/system_accent1_600" /> </shape> No newline at end of file quickstep/res/drawable/ic_bubble_dismiss_white.xml 0 → 100644 +25 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2023 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="20dp" android:height="20dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:pathData="M19.000000,6.400000l-1.400000,-1.400000 -5.600000,5.600000 -5.600000,-5.600000 -1.400000,1.400000 5.600000,5.600000 -5.600000,5.600000 1.400000,1.400000 5.600000,-5.600000 5.600000,5.600000 1.400000,-1.400000 -5.600000,-5.600000z" android:fillColor="@android:color/system_neutral1_50"/> </vector> quickstep/res/values/dimens.xml +7 −0 Original line number Diff line number Diff line Loading @@ -367,6 +367,13 @@ <dimen name="bubblebar_icon_spacing">3dp</dimen> <dimen name="bubblebar_icon_elevation">1dp</dimen> <!-- Bubble bar dismiss view --> <dimen name="bubblebar_dismiss_target_size">96dp</dimen> <dimen name="bubblebar_dismiss_target_small_size">60dp</dimen> <dimen name="bubblebar_dismiss_target_icon_size">24dp</dimen> <dimen name="bubblebar_dismiss_target_bottom_margin">50dp</dimen> <dimen name="bubblebar_dismiss_floating_gradient_height">548dp</dimen> <!-- Launcher splash screen --> <!-- Note: keep this value in sync with the WindowManager/Shell dimens.xml --> <!-- starting_surface_exit_animation_window_shift_length --> Loading quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +5 −1 Original line number Diff line number Diff line Loading @@ -90,6 +90,8 @@ import com.android.launcher3.taskbar.bubbles.BubbleBarController; import com.android.launcher3.taskbar.bubbles.BubbleBarView; import com.android.launcher3.taskbar.bubbles.BubbleBarViewController; import com.android.launcher3.taskbar.bubbles.BubbleControllers; import com.android.launcher3.taskbar.bubbles.BubbleDismissController; import com.android.launcher3.taskbar.bubbles.BubbleDragController; import com.android.launcher3.taskbar.bubbles.BubbleStashController; import com.android.launcher3.taskbar.bubbles.BubbleStashedHandleViewController; import com.android.launcher3.taskbar.overlay.TaskbarOverlayController; Loading Loading @@ -216,7 +218,9 @@ public class TaskbarActivityContext extends BaseTaskbarContext { new BubbleBarController(this, bubbleBarView), new BubbleBarViewController(this, bubbleBarView), new BubbleStashController(this), new BubbleStashedHandleViewController(this, bubbleHandleView))); new BubbleStashedHandleViewController(this, bubbleHandleView), new BubbleDragController(this), new BubbleDismissController(this, mDragLayer))); } // Construct controllers. Loading quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +45 −5 Original line number Diff line number Diff line Loading @@ -95,6 +95,8 @@ public class BubbleBarView extends FrameLayout { private View.OnClickListener mOnClickListener; private final Rect mTempRect = new Rect(); private float mRelativePivotX = 1f; private float mRelativePivotY = 1f; // An animator that represents the expansion state of the bubble bar, where 0 corresponds to the // collapsed state and 1 to the fully expanded state. Loading @@ -109,6 +111,9 @@ public class BubbleBarView extends FrameLayout { @Nullable private Consumer<String> mUpdateSelectedBubbleAfterCollapse; @Nullable private BubbleView mDraggedBubbleView; public BubbleBarView(Context context) { this(context, null); } Loading Loading @@ -181,9 +186,10 @@ public class BubbleBarView extends FrameLayout { mBubbleBarBounds.right = right; mBubbleBarBounds.bottom = bottom; // The bubble bar handle is aligned to the bottom edge of the screen so scale towards that. setPivotX(getWidth()); setPivotY(getHeight()); // The bubble bar handle is aligned according to the relative pivot, // by default it's aligned to the bottom edge of the screen so scale towards that setPivotX(mRelativePivotX * getWidth()); setPivotY(mRelativePivotY * getHeight()); // Position the views updateChildrenRenderNodeProperties(); Loading @@ -198,6 +204,32 @@ public class BubbleBarView extends FrameLayout { return mBubbleBarBounds; } /** * Set bubble bar relative pivot value for X and Y, applied as a fraction of view width/height * respectively. If the value is not in range of 0 to 1 it will be normalized. * @param x relative X pivot value in range 0..1 * @param y relative Y pivot value in range 0..1 */ public void setRelativePivot(float x, float y) { mRelativePivotX = Float.max(Float.min(x, 1), 0); mRelativePivotY = Float.max(Float.min(y, 1), 0); requestLayout(); } /** * Get current relative pivot for X axis */ public float getRelativePivotX() { return mRelativePivotX; } /** * Get current relative pivot for Y axis */ public float getRelativePivotY() { return mRelativePivotY; } // TODO: (b/280605790) animate it @Override public void addView(View child, int index, ViewGroup.LayoutParams params) { Loading Loading @@ -254,9 +286,9 @@ public class BubbleBarView extends FrameLayout { // where the bubble will end up when the animation ends final float targetX = currentWidth - expandedWidth + expandedX; bv.setTranslationX(widthState * (targetX - collapsedX) + collapsedX); // if we're fully expanded, set the z level to 0 // if we're fully expanded, set the z level to 0 or to bubble elevation if dragged if (widthState == 1f) { bv.setZ(0); bv.setZ(bv == mDraggedBubbleView ? mBubbleElevation : 0); } // When we're expanded, we're not stacked so we're not behind the stack bv.setBehindStack(false, animate); Loading Loading @@ -328,6 +360,14 @@ public class BubbleBarView extends FrameLayout { updateArrowForSelected(/* shouldAnimate= */ true); } /** * Sets the dragged bubble view to correctly apply Z order. Dragged view should appear on top */ public void setDraggedBubble(@Nullable BubbleView view) { mDraggedBubbleView = view; requestLayout(); } /** * Update the arrow position to match the selected bubble. * Loading Loading
quickstep/res/drawable/bg_bubble_dismiss_circle.xml 0 → 100644 +27 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2023 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <stroke android:width="2dp" android:color="@android:color/system_accent1_600" /> <solid android:color="@android:color/system_accent1_600" /> </shape> No newline at end of file
quickstep/res/drawable/ic_bubble_dismiss_white.xml 0 → 100644 +25 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2023 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="20dp" android:height="20dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:pathData="M19.000000,6.400000l-1.400000,-1.400000 -5.600000,5.600000 -5.600000,-5.600000 -1.400000,1.400000 5.600000,5.600000 -5.600000,5.600000 1.400000,1.400000 5.600000,-5.600000 5.600000,5.600000 1.400000,-1.400000 -5.600000,-5.600000z" android:fillColor="@android:color/system_neutral1_50"/> </vector>
quickstep/res/values/dimens.xml +7 −0 Original line number Diff line number Diff line Loading @@ -367,6 +367,13 @@ <dimen name="bubblebar_icon_spacing">3dp</dimen> <dimen name="bubblebar_icon_elevation">1dp</dimen> <!-- Bubble bar dismiss view --> <dimen name="bubblebar_dismiss_target_size">96dp</dimen> <dimen name="bubblebar_dismiss_target_small_size">60dp</dimen> <dimen name="bubblebar_dismiss_target_icon_size">24dp</dimen> <dimen name="bubblebar_dismiss_target_bottom_margin">50dp</dimen> <dimen name="bubblebar_dismiss_floating_gradient_height">548dp</dimen> <!-- Launcher splash screen --> <!-- Note: keep this value in sync with the WindowManager/Shell dimens.xml --> <!-- starting_surface_exit_animation_window_shift_length --> Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +5 −1 Original line number Diff line number Diff line Loading @@ -90,6 +90,8 @@ import com.android.launcher3.taskbar.bubbles.BubbleBarController; import com.android.launcher3.taskbar.bubbles.BubbleBarView; import com.android.launcher3.taskbar.bubbles.BubbleBarViewController; import com.android.launcher3.taskbar.bubbles.BubbleControllers; import com.android.launcher3.taskbar.bubbles.BubbleDismissController; import com.android.launcher3.taskbar.bubbles.BubbleDragController; import com.android.launcher3.taskbar.bubbles.BubbleStashController; import com.android.launcher3.taskbar.bubbles.BubbleStashedHandleViewController; import com.android.launcher3.taskbar.overlay.TaskbarOverlayController; Loading Loading @@ -216,7 +218,9 @@ public class TaskbarActivityContext extends BaseTaskbarContext { new BubbleBarController(this, bubbleBarView), new BubbleBarViewController(this, bubbleBarView), new BubbleStashController(this), new BubbleStashedHandleViewController(this, bubbleHandleView))); new BubbleStashedHandleViewController(this, bubbleHandleView), new BubbleDragController(this), new BubbleDismissController(this, mDragLayer))); } // Construct controllers. Loading
quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +45 −5 Original line number Diff line number Diff line Loading @@ -95,6 +95,8 @@ public class BubbleBarView extends FrameLayout { private View.OnClickListener mOnClickListener; private final Rect mTempRect = new Rect(); private float mRelativePivotX = 1f; private float mRelativePivotY = 1f; // An animator that represents the expansion state of the bubble bar, where 0 corresponds to the // collapsed state and 1 to the fully expanded state. Loading @@ -109,6 +111,9 @@ public class BubbleBarView extends FrameLayout { @Nullable private Consumer<String> mUpdateSelectedBubbleAfterCollapse; @Nullable private BubbleView mDraggedBubbleView; public BubbleBarView(Context context) { this(context, null); } Loading Loading @@ -181,9 +186,10 @@ public class BubbleBarView extends FrameLayout { mBubbleBarBounds.right = right; mBubbleBarBounds.bottom = bottom; // The bubble bar handle is aligned to the bottom edge of the screen so scale towards that. setPivotX(getWidth()); setPivotY(getHeight()); // The bubble bar handle is aligned according to the relative pivot, // by default it's aligned to the bottom edge of the screen so scale towards that setPivotX(mRelativePivotX * getWidth()); setPivotY(mRelativePivotY * getHeight()); // Position the views updateChildrenRenderNodeProperties(); Loading @@ -198,6 +204,32 @@ public class BubbleBarView extends FrameLayout { return mBubbleBarBounds; } /** * Set bubble bar relative pivot value for X and Y, applied as a fraction of view width/height * respectively. If the value is not in range of 0 to 1 it will be normalized. * @param x relative X pivot value in range 0..1 * @param y relative Y pivot value in range 0..1 */ public void setRelativePivot(float x, float y) { mRelativePivotX = Float.max(Float.min(x, 1), 0); mRelativePivotY = Float.max(Float.min(y, 1), 0); requestLayout(); } /** * Get current relative pivot for X axis */ public float getRelativePivotX() { return mRelativePivotX; } /** * Get current relative pivot for Y axis */ public float getRelativePivotY() { return mRelativePivotY; } // TODO: (b/280605790) animate it @Override public void addView(View child, int index, ViewGroup.LayoutParams params) { Loading Loading @@ -254,9 +286,9 @@ public class BubbleBarView extends FrameLayout { // where the bubble will end up when the animation ends final float targetX = currentWidth - expandedWidth + expandedX; bv.setTranslationX(widthState * (targetX - collapsedX) + collapsedX); // if we're fully expanded, set the z level to 0 // if we're fully expanded, set the z level to 0 or to bubble elevation if dragged if (widthState == 1f) { bv.setZ(0); bv.setZ(bv == mDraggedBubbleView ? mBubbleElevation : 0); } // When we're expanded, we're not stacked so we're not behind the stack bv.setBehindStack(false, animate); Loading Loading @@ -328,6 +360,14 @@ public class BubbleBarView extends FrameLayout { updateArrowForSelected(/* shouldAnimate= */ true); } /** * Sets the dragged bubble view to correctly apply Z order. Dragged view should appear on top */ public void setDraggedBubble(@Nullable BubbleView view) { mDraggedBubbleView = view; requestLayout(); } /** * Update the arrow position to match the selected bubble. * Loading