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

Commit 61665726 authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "Update header color for all bubbles"

parents 11ed72c5 76e803db
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -381,10 +381,18 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
    }

    /**
     * Update bubble expanded view header when user toggles dark mode.
     * Update header color when user toggles dark mode.
     */
    void updateHeaderColor() {
        mHeaderView.setBackgroundColor(mContext.getColor(R.attr.colorAccent));
        TypedArray ta = mContext.obtainStyledAttributes(
                new int[] {android.R.attr.colorBackgroundFloating, android.R.attr.colorForeground});
        int bgColor = ta.getColor(0, Color.WHITE /* default */);
        int btnColor = ta.getColor(1, Color.BLACK /* default */);
        ta.recycle();

        mHeaderView.setBackgroundColor(bgColor);
        mSettingsIcon.setColorFilter(btnColor);
        mDeepLinkIcon.setColorFilter(btnColor);
    }

    private void updateHeaderView() {
+2 −3
Original line number Diff line number Diff line
@@ -270,8 +270,8 @@ public class BubbleStackView extends FrameLayout {
     * Handle config changes.
     */
    public void onConfigChanged() {
        if (mExpandedBubble != null) {
            mExpandedBubble.expandedView.updateHeaderColor();
        for (Bubble b: mBubbleData.getBubbles()) {
            b.expandedView.updateHeaderColor();
        }
    }

@@ -856,7 +856,6 @@ public class BubbleStackView extends FrameLayout {

    private void applyCurrentState() {
        Log.d(TAG, "applyCurrentState: mIsExpanded=" + mIsExpanded);

        mExpandedViewContainer.setVisibility(mIsExpanded ? VISIBLE : GONE);
        if (mIsExpanded) {
            // First update the view so that it calculates a new height (ensuring the y position