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

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

Merge "Revert "Bubble bar drag to dismiss"" into udc-qpr-dev

parents 7d58acf9 e7cc3997
Loading
Loading
Loading
Loading
+0 −27
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
+0 −25
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>
+0 −7
Original line number Diff line number Diff line
@@ -367,13 +367,6 @@
    <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 -->
+1 −5
Original line number Diff line number Diff line
@@ -90,8 +90,6 @@ 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;
@@ -218,9 +216,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
                    new BubbleBarController(this, bubbleBarView),
                    new BubbleBarViewController(this, bubbleBarView),
                    new BubbleStashController(this),
                    new BubbleStashedHandleViewController(this, bubbleHandleView),
                    new BubbleDragController(this),
                    new BubbleDismissController(this, mDragLayer)));
                    new BubbleStashedHandleViewController(this, bubbleHandleView)));
        }

        // Construct controllers.
+5 −45
Original line number Diff line number Diff line
@@ -95,8 +95,6 @@ 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.
@@ -111,9 +109,6 @@ public class BubbleBarView extends FrameLayout {
    @Nullable
    private Consumer<String> mUpdateSelectedBubbleAfterCollapse;

    @Nullable
    private BubbleView mDraggedBubbleView;

    public BubbleBarView(Context context) {
        this(context, null);
    }
@@ -186,10 +181,9 @@ public class BubbleBarView extends FrameLayout {
        mBubbleBarBounds.right = right;
        mBubbleBarBounds.bottom = bottom;

        // 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());
        // The bubble bar handle is aligned to the bottom edge of the screen so scale towards that.
        setPivotX(getWidth());
        setPivotY(getHeight());

        // Position the views
        updateChildrenRenderNodeProperties();
@@ -204,32 +198,6 @@ 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) {
@@ -286,9 +254,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 or to bubble elevation if dragged
                // if we're fully expanded, set the z level to 0
                if (widthState == 1f) {
                    bv.setZ(bv == mDraggedBubbleView ? mBubbleElevation : 0);
                    bv.setZ(0);
                }
                // When we're expanded, we're not stacked so we're not behind the stack
                bv.setBehindStack(false, animate);
@@ -360,14 +328,6 @@ 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