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

Commit cd30839e authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Set BubbleBarCaptionView to the status bar color in onTaskInfoChanged." into main

parents 2f44e9bd acd4a2d0
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -298,7 +298,6 @@ public class BubbleBarAnimationHelper {
        final float endTx = toBbev.getTranslationX();
        final float startTx = getSwitchAnimationInitialTx(endTx);
        toBbev.getHandleView().setAlpha(0f);
        toBbev.getHandleView().setHandleInitialColor(fromBbev.getHandleView().getHandleColor());

        AnimatorSet switchAnim = new AnimatorSet();
        switchAnim.playTogether(
+6 −2
Original line number Diff line number Diff line
@@ -394,9 +394,13 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView
        if (!isValidToBubble(taskInfo)) {
            Toast.makeText(mContext, R.string.bubble_not_supported_text, Toast.LENGTH_SHORT).show();
        } else if (mCaptionView != null && taskInfo != null && taskInfo.taskDescription != null) {
            final int statusBarColor = taskInfo.taskDescription.getStatusBarColor();
            final int bgColor = taskInfo.taskDescription.getBackgroundColor();
            if (Color.alpha(bgColor) != 0) {
                // Set the caption's color to the color override of the task if not transparent.
            if (Color.alpha(statusBarColor) != 0) {
                // Set the caption's color to the color of the status bar if not transparent.
                mCaptionView.setBackgroundColor(statusBarColor);
            } else if (Color.alpha(bgColor) != 0) {
                // Otherwise, use the background color of the task if it's not transparent.
                mCaptionView.setBackgroundColor(bgColor);
            }
        }
+0 −10
Original line number Diff line number Diff line
@@ -131,16 +131,6 @@ public class BubbleBarHandleView extends View {
        invalidate();
    }

    /**
     * Set initial color for the handle. Takes effect if the
     * {@link #updateHandleColor(boolean, boolean)} has not been called.
     */
    public void setHandleInitialColor(@ColorInt int color) {
        if (color != mHandleColor) {
            setHandleColor(color);
        }
    }

    /**
     * Updates the handle color.
     *
+0 −6
Original line number Diff line number Diff line
@@ -64,10 +64,4 @@ public class BubbleBarHandleViewTest extends ShellTestCase {
        assertEquals(handleColor,
                ContextCompat.getColor(mContext, R.color.bubble_bar_expanded_view_handle_light));
    }

    @Test
    public void testSetHandleInitialColor_beforeUpdateHandleColor_updatesColor() {
        mHandleView.setHandleInitialColor(Color.RED);
        assertThat(mHandleView.getHandleColor()).isEqualTo(Color.RED);
    }
}