diff --git a/quickstep/res/layout/transient_taskbar.xml b/quickstep/res/layout/transient_taskbar.xml index d212ffdbbe..3c6878a6e5 100644 --- a/quickstep/res/layout/transient_taskbar.xml +++ b/quickstep/res/layout/transient_taskbar.xml @@ -41,9 +41,10 @@ @dimen/transient_taskbar_stashed_height @dimen/taskbar_stashed_handle_height 8dp + + 80dp 1dp 90dp diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt index aa2b29de39..9f14ebffff 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt @@ -19,6 +19,7 @@ import android.graphics.Canvas import android.graphics.Color import android.graphics.ColorFilter import android.graphics.Paint +import android.graphics.PixelFormat import android.graphics.drawable.Drawable import android.graphics.drawable.ShapeDrawable import com.android.app.animation.Interpolators @@ -122,14 +123,22 @@ class BubbleBarBackground(context: TaskbarActivityContext, private val backgroun // Draw background. val radius = backgroundHeight / 2f - val left = if (anchorLeft) 0f else canvas.width.toFloat() - width - val right = if (anchorLeft) width else canvas.width.toFloat() - canvas.drawRoundRect(left, 0f, right, canvas.height.toFloat(), radius, radius, paint) + val left = if (anchorLeft) 0f else bounds.width().toFloat() - width + val right = if (anchorLeft) width else bounds.width().toFloat() + canvas.drawRoundRect( + left, + pointerSize, + right, + bounds.height().toFloat(), + radius, + radius, + paint + ) if (showingArrow) { // Draw arrow. val transX = arrowPositionX - pointerSize / 2f - canvas.translate(transX, -pointerSize) + canvas.translate(transX, 0f) arrowDrawable.draw(canvas) } @@ -137,11 +146,20 @@ class BubbleBarBackground(context: TaskbarActivityContext, private val backgroun } override fun getOpacity(): Int { - return paint.alpha + return when (paint.alpha) { + 255 -> PixelFormat.OPAQUE + 0 -> PixelFormat.TRANSPARENT + else -> PixelFormat.TRANSLUCENT + } } override fun setAlpha(alpha: Int) { paint.alpha = alpha + arrowDrawable.paint.alpha = alpha + } + + override fun getAlpha(): Int { + return paint.alpha } override fun setColorFilter(colorFilter: ColorFilter?) { diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java index b6c248cb10..1f3c4839ab 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java @@ -614,7 +614,7 @@ public class BubbleBarController extends IBubblesListener.Stub { location.right = currentBarBounds.right; } final int translation = (int) abs(mBubbleStashController.getBubbleBarTranslationY()); - location.top = displaySize.y - mBarView.getHeight() - translation; + location.top = displaySize.y - currentBarBounds.height() - translation; location.bottom = displaySize.y - translation; return location; } diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java index a328c90e4f..a5da65f660 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java @@ -110,6 +110,7 @@ public class BubbleBarView extends FrameLayout { private final float mIconSize; // The elevation of the bubbles within the bar private final float mBubbleElevation; + private final int mPointerSize; // Whether the bar is expanded (i.e. the bubble activity is being displayed). private boolean mIsBarExpanded = false; @@ -166,6 +167,8 @@ public class BubbleBarView extends FrameLayout { mIconSpacing = getResources().getDimensionPixelSize(R.dimen.bubblebar_icon_spacing); mIconSize = getResources().getDimensionPixelSize(R.dimen.bubblebar_icon_size); mBubbleElevation = getResources().getDimensionPixelSize(R.dimen.bubblebar_icon_elevation); + mPointerSize = getResources().getDimensionPixelSize(R.dimen.bubblebar_pointer_size); + setClipToPadding(false); mBubbleBarBackground = new BubbleBarBackground(activityContext, @@ -214,7 +217,7 @@ public class BubbleBarView extends FrameLayout { protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); mBubbleBarBounds.left = left; - mBubbleBarBounds.top = top; + mBubbleBarBounds.top = top + mPointerSize; mBubbleBarBounds.right = right; mBubbleBarBounds.bottom = bottom; @@ -272,6 +275,7 @@ public class BubbleBarView extends FrameLayout { if (bubbleBarLocation != mBubbleBarLocation) { mBubbleBarLocation = bubbleBarLocation; onBubbleBarLocationChanged(); + invalidate(); } } @@ -344,7 +348,7 @@ public class BubbleBarView extends FrameLayout { * Updates the bounds with translation that may have been applied and returns the result. */ public Rect getBubbleBarBounds() { - mBubbleBarBounds.top = getTop() + (int) getTranslationY(); + mBubbleBarBounds.top = getTop() + (int) getTranslationY() + mPointerSize; mBubbleBarBounds.bottom = getBottom() + (int) getTranslationY(); return mBubbleBarBounds; } diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java index cc5859e1e4..d46ee4020f 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -55,6 +55,7 @@ public class BubbleBarViewController { private final TaskbarActivityContext mActivity; private final BubbleBarView mBarView; private final int mIconSize; + private final int mPointerSize; // Initialized in init. private BubbleStashController mBubbleStashController; @@ -87,6 +88,8 @@ public class BubbleBarViewController { mBubbleBarAlpha = new MultiValueAlpha(mBarView, 1 /* num alpha channels */); mBubbleBarAlpha.setUpdateVisibility(true); mIconSize = activity.getResources().getDimensionPixelSize(R.dimen.bubblebar_icon_size); + mPointerSize = activity.getResources().getDimensionPixelSize( + R.dimen.bubblebar_pointer_size); } public void init(TaskbarControllers controllers, BubbleControllers bubbleControllers) { @@ -97,9 +100,11 @@ public class BubbleBarViewController { mTaskbarInsetsController = controllers.taskbarInsetsController; mActivity.addOnDeviceProfileChangeListener(dp -> - mBarView.getLayoutParams().height = mActivity.getDeviceProfile().taskbarHeight + mBarView.getLayoutParams().height = + mActivity.getDeviceProfile().taskbarHeight + mPointerSize ); - mBarView.getLayoutParams().height = mActivity.getDeviceProfile().taskbarHeight; + mBarView.getLayoutParams().height = + mActivity.getDeviceProfile().taskbarHeight + mPointerSize; mBubbleBarScale.updateValue(1f); mBubbleClickListener = v -> onBubbleClicked(v); mBubbleBarClickListener = v -> onBubbleBarClicked();