The text contrast of "disconnected" in Switch media output panel is insufficient.

-Apply generic color "textColorSecondary"

Bug: 151050490
Test: manual
Change-Id: Id5e967faab6dedb25607f8afb12acbf338211144
This commit is contained in:
Tim Peng
2020-03-10 14:57:00 +08:00
committed by tim peng
parent af4d55e7dd
commit 1a5b896dc2

View File

@@ -24,7 +24,6 @@ import static com.android.settings.slices.CustomSliceRegistry.MEDIA_OUTPUT_SLICE
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.text.SpannableString; import android.text.SpannableString;
@@ -179,7 +178,9 @@ public class MediaOutputSlice implements CustomSliceable {
&& !device.isConnected()) { && !device.isConnected()) {
final SpannableString spannableTitle = new SpannableString( final SpannableString spannableTitle = new SpannableString(
mContext.getString(R.string.media_output_disconnected_status, deviceName)); mContext.getString(R.string.media_output_disconnected_status, deviceName));
spannableTitle.setSpan(new ForegroundColorSpan(Color.GRAY), deviceName.length(), spannableTitle.setSpan(new ForegroundColorSpan(
Utils.getColorAttrDefaultColor(mContext, android.R.attr.textColorSecondary)),
deviceName.length(),
spannableTitle.length(), SPAN_EXCLUSIVE_EXCLUSIVE); spannableTitle.length(), SPAN_EXCLUSIVE_EXCLUSIVE);
rowBuilder.setTitle(spannableTitle); rowBuilder.setTitle(spannableTitle);
rowBuilder.setPrimaryAction(SliceAction.create(broadcastAction, deviceIcon, rowBuilder.setPrimaryAction(SliceAction.create(broadcastAction, deviceIcon,