Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +41 −27 Original line number Original line Diff line number Diff line Loading @@ -482,11 +482,19 @@ public class BubbleExpandedView extends LinearLayout { mPointerWidth, mPointerHeight, true /* pointLeft */)); mPointerWidth, mPointerHeight, true /* pointLeft */)); mRightPointer = new ShapeDrawable(TriangleShape.createHorizontal( mRightPointer = new ShapeDrawable(TriangleShape.createHorizontal( mPointerWidth, mPointerHeight, false /* pointLeft */)); mPointerWidth, mPointerHeight, false /* pointLeft */)); if (mPointerView != null) { updatePointerViewIfExists(); updatePointerView(); updateManageButtonIfExists(); } } if (mManageButton != null) { /** * Reinflate manage button if {@link #mManageButton} is initialized. * Does nothing otherwise. */ private void updateManageButtonIfExists() { if (mManageButton == null) { return; } int visibility = mManageButton.getVisibility(); int visibility = mManageButton.getVisibility(); removeView(mManageButton); removeView(mManageButton); ContextThemeWrapper ctw = new ContextThemeWrapper(getContext(), ContextThemeWrapper ctw = new ContextThemeWrapper(getContext(), Loading @@ -507,7 +515,6 @@ public class BubbleExpandedView extends LinearLayout { setTouchDelegate(new TouchDelegate(r, mManageButton)); setTouchDelegate(new TouchDelegate(r, mManageButton)); }); }); } } } void updateFontSize() { void updateFontSize() { final float fontSize = mContext.getResources() final float fontSize = mContext.getResources() Loading Loading @@ -548,11 +555,18 @@ public class BubbleExpandedView extends LinearLayout { if (mTaskView != null) { if (mTaskView != null) { mTaskView.setCornerRadius(mCornerRadius); mTaskView.setCornerRadius(mCornerRadius); } } updatePointerView(); updatePointerViewIfExists(); updateManageButtonIfExists(); } } /** Updates the size and visuals of the pointer. **/ /** private void updatePointerView() { * Updates the size and visuals of the pointer if {@link #mPointerView} is initialized. * Does nothing otherwise. */ private void updatePointerViewIfExists() { if (mPointerView == null) { return; } LayoutParams lp = (LayoutParams) mPointerView.getLayoutParams(); LayoutParams lp = (LayoutParams) mPointerView.getLayoutParams(); if (mCurrentPointer == mLeftPointer || mCurrentPointer == mRightPointer) { if (mCurrentPointer == mLeftPointer || mCurrentPointer == mRightPointer) { lp.width = mPointerHeight; lp.width = mPointerHeight; Loading Loading @@ -1055,7 +1069,7 @@ public class BubbleExpandedView extends LinearLayout { // Post because we need the width of the view // Post because we need the width of the view post(() -> { post(() -> { mCurrentPointer = showVertically ? onLeft ? mLeftPointer : mRightPointer : mTopPointer; mCurrentPointer = showVertically ? onLeft ? mLeftPointer : mRightPointer : mTopPointer; updatePointerView(); updatePointerViewIfExists(); if (showVertically) { if (showVertically) { mPointerPos.y = bubbleCenter - (mPointerWidth / 2f); mPointerPos.y = bubbleCenter - (mPointerWidth / 2f); if (!isRtl) { if (!isRtl) { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +41 −27 Original line number Original line Diff line number Diff line Loading @@ -482,11 +482,19 @@ public class BubbleExpandedView extends LinearLayout { mPointerWidth, mPointerHeight, true /* pointLeft */)); mPointerWidth, mPointerHeight, true /* pointLeft */)); mRightPointer = new ShapeDrawable(TriangleShape.createHorizontal( mRightPointer = new ShapeDrawable(TriangleShape.createHorizontal( mPointerWidth, mPointerHeight, false /* pointLeft */)); mPointerWidth, mPointerHeight, false /* pointLeft */)); if (mPointerView != null) { updatePointerViewIfExists(); updatePointerView(); updateManageButtonIfExists(); } } if (mManageButton != null) { /** * Reinflate manage button if {@link #mManageButton} is initialized. * Does nothing otherwise. */ private void updateManageButtonIfExists() { if (mManageButton == null) { return; } int visibility = mManageButton.getVisibility(); int visibility = mManageButton.getVisibility(); removeView(mManageButton); removeView(mManageButton); ContextThemeWrapper ctw = new ContextThemeWrapper(getContext(), ContextThemeWrapper ctw = new ContextThemeWrapper(getContext(), Loading @@ -507,7 +515,6 @@ public class BubbleExpandedView extends LinearLayout { setTouchDelegate(new TouchDelegate(r, mManageButton)); setTouchDelegate(new TouchDelegate(r, mManageButton)); }); }); } } } void updateFontSize() { void updateFontSize() { final float fontSize = mContext.getResources() final float fontSize = mContext.getResources() Loading Loading @@ -548,11 +555,18 @@ public class BubbleExpandedView extends LinearLayout { if (mTaskView != null) { if (mTaskView != null) { mTaskView.setCornerRadius(mCornerRadius); mTaskView.setCornerRadius(mCornerRadius); } } updatePointerView(); updatePointerViewIfExists(); updateManageButtonIfExists(); } } /** Updates the size and visuals of the pointer. **/ /** private void updatePointerView() { * Updates the size and visuals of the pointer if {@link #mPointerView} is initialized. * Does nothing otherwise. */ private void updatePointerViewIfExists() { if (mPointerView == null) { return; } LayoutParams lp = (LayoutParams) mPointerView.getLayoutParams(); LayoutParams lp = (LayoutParams) mPointerView.getLayoutParams(); if (mCurrentPointer == mLeftPointer || mCurrentPointer == mRightPointer) { if (mCurrentPointer == mLeftPointer || mCurrentPointer == mRightPointer) { lp.width = mPointerHeight; lp.width = mPointerHeight; Loading Loading @@ -1055,7 +1069,7 @@ public class BubbleExpandedView extends LinearLayout { // Post because we need the width of the view // Post because we need the width of the view post(() -> { post(() -> { mCurrentPointer = showVertically ? onLeft ? mLeftPointer : mRightPointer : mTopPointer; mCurrentPointer = showVertically ? onLeft ? mLeftPointer : mRightPointer : mTopPointer; updatePointerView(); updatePointerViewIfExists(); if (showVertically) { if (showVertically) { mPointerPos.y = bubbleCenter - (mPointerWidth / 2f); mPointerPos.y = bubbleCenter - (mPointerWidth / 2f); if (!isRtl) { if (!isRtl) { Loading