Change color of seamless chip border

The border should be fixed at #FFFFFF @15%.

Test: manual
Fixes: 159359398
Change-Id: Ie423e1ba8b7317e167d3b498ba9112ed4cada822
This commit is contained in:
Fabian Kozynski
2020-06-22 12:18:06 -04:00
parent 6a75f1332f
commit 349967a098
4 changed files with 28 additions and 10 deletions

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2020 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/media_seamless_border">
<item android:id="@android:id/background">
<shape
android:color="@android:color/transparent">
<stroke android:width="1dp" android:color="@color/media_seamless_border"/>
<corners android:radius="24dp"/>
</shape>
</item>
</ripple>

View File

@@ -94,7 +94,7 @@
android:id="@+id/media_seamless"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:foreground="@*android:drawable/media_seamless_background"
android:foreground="@drawable/qs_media_seamless_background"
android:background="@drawable/qs_media_light_source"
android:orientation="horizontal"
android:forceHasOverlappingRendering="false"

View File

@@ -248,6 +248,7 @@
<color name="media_secondary_text">#99ffffff</color> <!-- 60% -->
<color name="media_seekbar_progress">#c0ffffff</color>
<color name="media_disabled">#80ffffff</color>
<color name="media_seamless_border">#26ffffff</color> <!-- 15% -->
<!-- controls -->
<color name="control_primary_text">#E6FFFFFF</color>

View File

@@ -20,13 +20,10 @@ import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.Outline;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.Icon;
import android.graphics.drawable.RippleDrawable;
import android.media.session.MediaController;
import android.media.session.MediaSession;
import android.media.session.PlaybackState;
@@ -258,12 +255,6 @@ public class MediaControlPanel {
ImageView iconView = mViewHolder.getSeamlessIcon();
TextView deviceName = mViewHolder.getSeamlessText();
// Update the outline color
RippleDrawable bkgDrawable = (RippleDrawable) mViewHolder.getSeamless().getForeground();
GradientDrawable rect = (GradientDrawable) bkgDrawable.getDrawable(0);
rect.setStroke(2, deviceName.getCurrentTextColor());
rect.setColor(Color.TRANSPARENT);
final MediaDeviceData device = data.getDevice();
final int seamlessId = mViewHolder.getSeamless().getId();
final int seamlessFallbackId = mViewHolder.getSeamlessFallback().getId();