Merge "Use smallIcon as new layout's app icon" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5707ad03a1
@@ -575,25 +575,6 @@ public class MediaControlPanel {
|
||||
int textTertiary = com.android.settingslib.Utils.getColorAttr(mContext,
|
||||
com.android.internal.R.attr.textColorTertiary).getDefaultColor();
|
||||
|
||||
// App icon - use launcher icon
|
||||
ImageView appIconView = mMediaViewHolder.getAppIcon();
|
||||
appIconView.clearColorFilter();
|
||||
try {
|
||||
Drawable icon = mContext.getPackageManager().getApplicationIcon(
|
||||
data.getPackageName());
|
||||
appIconView.setImageDrawable(icon);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.w(TAG, "Cannot find icon for package " + data.getPackageName(), e);
|
||||
// Fall back to notification icon
|
||||
if (data.getAppIcon() != null) {
|
||||
appIconView.setImageIcon(data.getAppIcon());
|
||||
} else {
|
||||
appIconView.setImageResource(R.drawable.ic_music_note);
|
||||
}
|
||||
int color = mContext.getColor(R.color.material_dynamic_secondary10);
|
||||
appIconView.setColorFilter(color);
|
||||
}
|
||||
|
||||
// Album art
|
||||
ColorScheme colorScheme = null;
|
||||
ImageView albumView = mMediaViewHolder.getAlbumView();
|
||||
@@ -640,6 +621,25 @@ public class MediaControlPanel {
|
||||
ColorStateList.valueOf(surfaceColor));
|
||||
mMediaViewHolder.getPlayer().setBackgroundTintList(bgColorList);
|
||||
|
||||
// App icon - use notification icon
|
||||
ImageView appIconView = mMediaViewHolder.getAppIcon();
|
||||
appIconView.clearColorFilter();
|
||||
if (data.getAppIcon() != null && !data.getResumption()) {
|
||||
appIconView.setImageIcon(data.getAppIcon());
|
||||
appIconView.setColorFilter(accentPrimary);
|
||||
} else {
|
||||
// Resume players use launcher icon
|
||||
appIconView.setColorFilter(getGrayscaleFilter());
|
||||
try {
|
||||
Drawable icon = mContext.getPackageManager().getApplicationIcon(
|
||||
data.getPackageName());
|
||||
appIconView.setImageDrawable(icon);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.w(TAG, "Cannot find icon for package " + data.getPackageName(), e);
|
||||
appIconView.setImageResource(R.drawable.ic_music_note);
|
||||
}
|
||||
}
|
||||
|
||||
// Metadata text
|
||||
mMediaViewHolder.getTitleText().setTextColor(textPrimary);
|
||||
mMediaViewHolder.getArtistText().setTextColor(textSecondary);
|
||||
@@ -688,7 +688,6 @@ public class MediaControlPanel {
|
||||
mMediaViewHolder.getCancelText().setBackgroundTintList(accentColorList);
|
||||
mMediaViewHolder.getDismissText().setTextColor(textColorList);
|
||||
mMediaViewHolder.getDismissText().setBackgroundTintList(accentColorList);
|
||||
|
||||
}
|
||||
|
||||
private void setSemanticButton(final ImageButton button, MediaAction mediaAction,
|
||||
|
||||
Reference in New Issue
Block a user