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

Commit 0a725830 authored by Alex Shabalin's avatar Alex Shabalin
Browse files

Fix title font weight for a 2-line device item.

Flag: EXEMPT bugfix
Bug: 390277743
Test: atest SystemUIGoogleRoboRNGTests:MediaOutputAdapterScreenshotTest
Change-Id: Ide79d384cd78f58ee0a2cf2dc4346aa61532b172
parent 3e99e02e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
                        updateEndClickAreaAsSessionEditing(device,
                                isHost ? R.drawable.media_output_status_edit_session
                                        : R.drawable.ic_sound_bars_anim);
                        setTwoLineLayout(device, null /* title */, true /* bFocused */,
                        setTwoLineLayout(device, null /* title */,
                                true /* showSeekBar */, false /* showProgressBar */,
                                true /* showSubtitle */, false /* showStatus */,
                                true /* showEndTouchArea */, false /* isFakeActive */);
@@ -214,7 +214,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
                        updateTwoLineLayoutContentAlpha(
                                updateClickActionBasedOnSelectionBehavior(device)
                                        ? DEVICE_CONNECTED_ALPHA : DEVICE_DISCONNECTED_ALPHA);
                        setTwoLineLayout(device, currentlyConnected /* bFocused */,
                        setTwoLineLayout(device,
                                currentlyConnected  /* showSeekBar */,
                                false /* showProgressBar */, true /* showSubtitle */,
                                deviceStatusIcon != null /* showStatus */,
@@ -225,7 +225,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
                    updateConnectionFailedStatusIcon();
                    mSubTitleText.setText(R.string.media_output_dialog_connect_failed);
                    updateFullItemClickListener(v -> onItemClick(v, device));
                    setTwoLineLayout(device, false /* bFocused */, false /* showSeekBar */,
                    setTwoLineLayout(device, false /* showSeekBar */,
                            false /* showProgressBar */, true /* showSubtitle */,
                            true /* showStatus */, false /*isFakeActive*/);
                } else if (device.getState() == MediaDeviceState.STATE_GROUPING) {
+3 −8
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.animation.ValueAnimator;
import android.app.WallpaperColors;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Typeface;
import android.graphics.drawable.ClipDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
@@ -233,14 +232,14 @@ public abstract class MediaOutputBaseAdapter extends
                    : mController.getItemMarginEndDefault();
        }

        void setTwoLineLayout(MediaDevice device, boolean bFocused, boolean showSeekBar,
        void setTwoLineLayout(MediaDevice device, boolean showSeekBar,
                boolean showProgressBar, boolean showSubtitle, boolean showStatus,
                boolean isFakeActive) {
            setTwoLineLayout(device, null, bFocused, showSeekBar, showProgressBar, showSubtitle,
            setTwoLineLayout(device, null, showSeekBar, showProgressBar, showSubtitle,
                    showStatus, false, isFakeActive);
        }

        void setTwoLineLayout(MediaDevice device, CharSequence title, boolean bFocused,
        void setTwoLineLayout(MediaDevice device, CharSequence title,
                boolean showSeekBar, boolean showProgressBar, boolean showSubtitle,
                boolean showStatus , boolean showEndTouchArea, boolean isFakeActive) {
            mTitleText.setVisibility(View.GONE);
@@ -271,10 +270,6 @@ public abstract class MediaOutputBaseAdapter extends
            mSubTitleText.setVisibility(showSubtitle ? View.VISIBLE : View.GONE);
            mTwoLineTitleText.setTranslationY(0);
            mTwoLineTitleText.setText(device == null ? title : getItemTitle(device));
            mTwoLineTitleText.setTypeface(Typeface.create(mContext.getString(
                            bFocused ? com.android.internal.R.string.config_headlineFontFamilyMedium
                                    : com.android.internal.R.string.config_headlineFontFamily),
                    Typeface.NORMAL));
        }

        void updateSeekbarProgressBackground() {