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

Commit d0507ffd authored by Mykola Podolian's avatar Mykola Podolian Committed by Android (Google) Code Review
Browse files

Merge "Made expanded bubble "Manage" button update on theme change." into main

parents 53770b50 0c112eb6
Loading
Loading
Loading
Loading
+41 −27
Original line number Original line Diff line number Diff line
@@ -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(),
@@ -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()
@@ -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;
@@ -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) {