Loading packages/SystemUI/res/layout/chipbar.xml +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:textSize="@dimen/chipbar_text_size" android:textColor="@android:color/system_accent2_900" android:textColor="@color/chipbar_text_and_icon_color" android:alpha="0.0" /> Loading packages/SystemUI/res/values/colors.xml +3 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,9 @@ <color name="people_tile_background">@color/material_dynamic_secondary95</color> <!-- Chipbar --> <color name="chipbar_text_and_icon_color">@android:color/system_accent2_900</color> <!-- Internet Dialog --> <!-- Material next state on color--> <color name="settingslib_state_on_color">@color/settingslib_state_on</color> Loading packages/SystemUI/src/com/android/systemui/common/shared/model/TintedIcon.kt +2 −2 Original line number Diff line number Diff line Loading @@ -16,10 +16,10 @@ package com.android.systemui.common.shared.model import androidx.annotation.AttrRes import androidx.annotation.ColorRes /** Models an icon with a specific tint. */ data class TintedIcon( val icon: Icon, @AttrRes val tintAttr: Int?, @ColorRes val tint: Int?, ) packages/SystemUI/src/com/android/systemui/common/ui/binder/TintedIconViewBinder.kt +4 −5 Original line number Diff line number Diff line Loading @@ -17,15 +17,14 @@ package com.android.systemui.common.ui.binder import android.widget.ImageView import com.android.settingslib.Utils import com.android.systemui.common.shared.model.TintedIcon object TintedIconViewBinder { /** * Binds the given tinted icon to the view. * * [TintedIcon.tintAttr] will always be applied, meaning that if it is null, then the tint * *will* be reset to null. * [TintedIcon.tint] will always be applied, meaning that if it is null, then the tint *will* be * reset to null. */ fun bind( tintedIcon: TintedIcon, Loading @@ -33,8 +32,8 @@ object TintedIconViewBinder { ) { IconViewBinder.bind(tintedIcon.icon, view) view.imageTintList = if (tintedIcon.tintAttr != null) { Utils.getColorAttr(view.context, tintedIcon.tintAttr) if (tintedIcon.tint != null) { view.resources.getColorStateList(tintedIcon.tint, view.context.theme) } else { null } Loading packages/SystemUI/src/com/android/systemui/media/taptotransfer/common/MediaTttUtils.kt +6 −5 Original line number Diff line number Diff line Loading @@ -19,12 +19,13 @@ package com.android.systemui.media.taptotransfer.common import android.content.Context import android.content.pm.PackageManager import android.graphics.drawable.Drawable import androidx.annotation.AttrRes import androidx.annotation.ColorRes import androidx.annotation.DrawableRes import com.android.systemui.R import com.android.systemui.common.shared.model.ContentDescription import com.android.systemui.common.shared.model.Icon import com.android.systemui.common.shared.model.TintedIcon import com.android.systemui.temporarydisplay.chipbar.ChipbarInfo.Companion.DEFAULT_ICON_TINT /** Utility methods for media tap-to-transfer. */ class MediaTttUtils { Loading Loading @@ -78,7 +79,7 @@ class MediaTttUtils { return IconInfo( contentDescription, MediaTttIcon.Loaded(packageManager.getApplicationIcon(appPackageName)), tintAttr = null, tint = null, isAppIcon = true ) } catch (e: PackageManager.NameNotFoundException) { Loading @@ -96,7 +97,7 @@ class MediaTttUtils { ) }, MediaTttIcon.Resource(R.drawable.ic_cast), tintAttr = android.R.attr.textColorPrimary, tint = DEFAULT_ICON_TINT, isAppIcon = false ) } Loading @@ -107,7 +108,7 @@ class MediaTttUtils { data class IconInfo( val contentDescription: ContentDescription, val icon: MediaTttIcon, @AttrRes val tintAttr: Int?, @ColorRes val tint: Int?, /** * True if [drawable] is the app's icon, and false if [drawable] is some generic default icon. */ Loading @@ -120,7 +121,7 @@ data class IconInfo( is MediaTttIcon.Loaded -> Icon.Loaded(icon.drawable, contentDescription) is MediaTttIcon.Resource -> Icon.Resource(icon.res, contentDescription) } return TintedIcon(iconOutput, tintAttr) return TintedIcon(iconOutput, tint) } } Loading Loading
packages/SystemUI/res/layout/chipbar.xml +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:textSize="@dimen/chipbar_text_size" android:textColor="@android:color/system_accent2_900" android:textColor="@color/chipbar_text_and_icon_color" android:alpha="0.0" /> Loading
packages/SystemUI/res/values/colors.xml +3 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,9 @@ <color name="people_tile_background">@color/material_dynamic_secondary95</color> <!-- Chipbar --> <color name="chipbar_text_and_icon_color">@android:color/system_accent2_900</color> <!-- Internet Dialog --> <!-- Material next state on color--> <color name="settingslib_state_on_color">@color/settingslib_state_on</color> Loading
packages/SystemUI/src/com/android/systemui/common/shared/model/TintedIcon.kt +2 −2 Original line number Diff line number Diff line Loading @@ -16,10 +16,10 @@ package com.android.systemui.common.shared.model import androidx.annotation.AttrRes import androidx.annotation.ColorRes /** Models an icon with a specific tint. */ data class TintedIcon( val icon: Icon, @AttrRes val tintAttr: Int?, @ColorRes val tint: Int?, )
packages/SystemUI/src/com/android/systemui/common/ui/binder/TintedIconViewBinder.kt +4 −5 Original line number Diff line number Diff line Loading @@ -17,15 +17,14 @@ package com.android.systemui.common.ui.binder import android.widget.ImageView import com.android.settingslib.Utils import com.android.systemui.common.shared.model.TintedIcon object TintedIconViewBinder { /** * Binds the given tinted icon to the view. * * [TintedIcon.tintAttr] will always be applied, meaning that if it is null, then the tint * *will* be reset to null. * [TintedIcon.tint] will always be applied, meaning that if it is null, then the tint *will* be * reset to null. */ fun bind( tintedIcon: TintedIcon, Loading @@ -33,8 +32,8 @@ object TintedIconViewBinder { ) { IconViewBinder.bind(tintedIcon.icon, view) view.imageTintList = if (tintedIcon.tintAttr != null) { Utils.getColorAttr(view.context, tintedIcon.tintAttr) if (tintedIcon.tint != null) { view.resources.getColorStateList(tintedIcon.tint, view.context.theme) } else { null } Loading
packages/SystemUI/src/com/android/systemui/media/taptotransfer/common/MediaTttUtils.kt +6 −5 Original line number Diff line number Diff line Loading @@ -19,12 +19,13 @@ package com.android.systemui.media.taptotransfer.common import android.content.Context import android.content.pm.PackageManager import android.graphics.drawable.Drawable import androidx.annotation.AttrRes import androidx.annotation.ColorRes import androidx.annotation.DrawableRes import com.android.systemui.R import com.android.systemui.common.shared.model.ContentDescription import com.android.systemui.common.shared.model.Icon import com.android.systemui.common.shared.model.TintedIcon import com.android.systemui.temporarydisplay.chipbar.ChipbarInfo.Companion.DEFAULT_ICON_TINT /** Utility methods for media tap-to-transfer. */ class MediaTttUtils { Loading Loading @@ -78,7 +79,7 @@ class MediaTttUtils { return IconInfo( contentDescription, MediaTttIcon.Loaded(packageManager.getApplicationIcon(appPackageName)), tintAttr = null, tint = null, isAppIcon = true ) } catch (e: PackageManager.NameNotFoundException) { Loading @@ -96,7 +97,7 @@ class MediaTttUtils { ) }, MediaTttIcon.Resource(R.drawable.ic_cast), tintAttr = android.R.attr.textColorPrimary, tint = DEFAULT_ICON_TINT, isAppIcon = false ) } Loading @@ -107,7 +108,7 @@ class MediaTttUtils { data class IconInfo( val contentDescription: ContentDescription, val icon: MediaTttIcon, @AttrRes val tintAttr: Int?, @ColorRes val tint: Int?, /** * True if [drawable] is the app's icon, and false if [drawable] is some generic default icon. */ Loading @@ -120,7 +121,7 @@ data class IconInfo( is MediaTttIcon.Loaded -> Icon.Loaded(icon.drawable, contentDescription) is MediaTttIcon.Resource -> Icon.Resource(icon.res, contentDescription) } return TintedIcon(iconOutput, tintAttr) return TintedIcon(iconOutput, tint) } } Loading