Loading packages/SystemUI/res/layout/qs_media_panel.xml +11 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:fontFamily="@*android:string/config_bodyFontFamily" android:textColor="@color/media_primary_text" android:gravity="left" android:textSize="14sp" /> Loading @@ -58,6 +59,7 @@ android:layout_height="wrap_content" android:layout_alignParentRight="true" android:fontFamily="@*android:string/config_bodyFontFamily" android:textColor="@color/media_primary_text" android:gravity="right" android:textSize="14sp" /> </FrameLayout> Loading Loading @@ -116,6 +118,7 @@ android:layout_width="@dimen/qs_seamless_icon_size" android:layout_height="@dimen/qs_seamless_icon_size" android:layout_marginRight="8dp" android:tint="@color/media_primary_text" android:src="@*android:drawable/ic_media_seamless" /> <TextView Loading @@ -125,6 +128,7 @@ android:fontFamily="@*android:string/config_bodyFontFamily" android:singleLine="true" android:text="@*android:string/ext_media_seamless_action" android:textColor="@color/media_primary_text" android:textSize="14sp" /> </LinearLayout> Loading @@ -138,11 +142,15 @@ android:maxHeight="3dp" android:paddingTop="16dp" android:paddingBottom="16dp" android:thumbTint="@color/media_primary_text" android:progressTint="@color/media_seekbar_progress" android:progressBackgroundTint="@color/media_disabled" android:splitTrack="false" /> <!-- App name --> <TextView android:id="@+id/app_name" android:textColor="@color/media_primary_text" android:layout_width="0dp" android:layout_height="wrap_content" android:singleLine="true" Loading @@ -155,6 +163,7 @@ android:layout_height="wrap_content" android:fontFamily="@*android:string/config_headlineFontFamilyMedium" android:singleLine="true" android:textColor="@color/media_primary_text" android:textSize="18sp" /> <!-- Artist name --> Loading @@ -164,10 +173,12 @@ android:layout_height="wrap_content" android:fontFamily="@*android:string/config_bodyFontFamily" android:singleLine="true" android:textColor="@color/media_primary_text" android:textSize="14sp" /> <com.android.internal.widget.CachingIconView android:id="@+id/icon" android:tint="@color/media_primary_text" android:layout_width="16dp" android:layout_height="16dp" /> Loading packages/SystemUI/res/layout/qs_media_panel_options.xml +3 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ android:layout_height="18dp" android:id="@+id/remove_icon" android:layout_marginEnd="16dp" android:tint="@color/media_primary_text" android:src="@drawable/ic_clear"/> <TextView android:layout_width="wrap_content" Loading @@ -43,6 +44,7 @@ android:id="@+id/remove_text" android:fontFamily="@*android:string/config_headlineFontFamilyMedium" android:singleLine="true" android:textColor="@color/media_primary_text" android:text="@string/controls_media_close_session" /> </LinearLayout> <TextView Loading @@ -54,5 +56,6 @@ android:layout_gravity="end|bottom" android:gravity="bottom" android:fontFamily="@*android:string/config_headlineFontFamilyMedium" android:textColor="@android:color/white" android:text="@string/cancel" /> </LinearLayout> packages/SystemUI/res/values/colors.xml +5 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,11 @@ <color name="magnification_border_color">#FF9900</color> <!-- media --> <color name="media_primary_text">@android:color/white</color> <color name="media_seekbar_progress">#c0ffffff</color> <color name="media_disabled">#80ffffff</color> <!-- controls --> <color name="control_primary_text">#E6FFFFFF</color> <color name="control_secondary_text">#99FFFFFF</color> Loading packages/SystemUI/res/values/styles.xml +1 −0 Original line number Diff line number Diff line Loading @@ -622,6 +622,7 @@ <style name="MediaPlayer.Button" parent="@android:style/Widget.Material.Button.Borderless.Small"> <item name="android:background">@null</item> <item name="android:tint">@android:color/white</item> </style> <!-- Used to style charging animation AVD animation --> Loading packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java +11 −21 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.content.pm.ResolveInfo; import android.content.res.ColorStateList; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; Loading Loading @@ -98,7 +99,6 @@ public class MediaControlPanel { private PlayerViewHolder mViewHolder; private MediaSession.Token mToken; private MediaController mController; private int mForegroundColor; private int mBackgroundColor; private MediaDevice mDevice; protected ComponentName mServiceComponent; Loading Loading @@ -243,7 +243,6 @@ public class MediaControlPanel { return; } MediaSession.Token token = data.getToken(); mForegroundColor = data.getForegroundColor(); mBackgroundColor = data.getBackgroundColor(); if (mToken == null || !mToken.equals(token)) { if (mQSMediaBrowser != null) { Loading Loading @@ -304,24 +303,19 @@ public class MediaControlPanel { // App icon ImageView appIcon = mViewHolder.getAppIcon(); Drawable iconDrawable = data.getAppIcon().mutate(); iconDrawable.setTint(mForegroundColor); appIcon.setImageDrawable(iconDrawable); appIcon.setImageDrawable(data.getAppIcon()); // Song name TextView titleText = mViewHolder.getTitleText(); titleText.setText(data.getSong()); titleText.setTextColor(data.getForegroundColor()); // App title TextView appName = mViewHolder.getAppName(); appName.setText(data.getApp()); appName.setTextColor(mForegroundColor); // Artist name TextView artistText = mViewHolder.getArtistText(); artistText.setText(data.getArtist()); artistText.setTextColor(mForegroundColor); // Transfer chip if (mLocalMediaManager != null) { Loading @@ -329,6 +323,10 @@ public class MediaControlPanel { setVisibleAndAlpha(collapsedSet, R.id.media_seamless, true /*visible */); setVisibleAndAlpha(expandedSet, R.id.media_seamless, true /*visible */); updateDevice(mLocalMediaManager.getCurrentConnectedDevice()); if (mViewHolder.getBackground().getBackground() instanceof IlluminationDrawable) { ((IlluminationDrawable) mViewHolder.getBackground().getBackground()) .setupTouch(mViewHolder.getSeamless(), mViewHolder.getPlayer()); } mViewHolder.getSeamless().setOnClickListener(v -> { final Intent intent = new Intent() .setAction(MediaOutputSliceConstants.ACTION_MEDIA_OUTPUT) Loading Loading @@ -358,7 +356,6 @@ public class MediaControlPanel { MediaAction mediaAction = actionIcons.get(i); button.setImageDrawable(mediaAction.getDrawable()); button.setContentDescription(mediaAction.getContentDescription()); button.setImageTintList(ColorStateList.valueOf(mForegroundColor)); PendingIntent actionIntent = mediaAction.getIntent(); if (mViewHolder.getBackground().getBackground() instanceof IlluminationDrawable) { Loading Loading @@ -389,8 +386,7 @@ public class MediaControlPanel { // Seek Bar final MediaController controller = getController(); mBackgroundExecutor.execute( () -> mSeekBarViewModel.updateController(controller, data.getForegroundColor())); mBackgroundExecutor.execute(() -> mSeekBarViewModel.updateController(controller)); // Set up long press menu // TODO: b/156036025 bring back media guts Loading Loading @@ -541,32 +537,27 @@ public class MediaControlPanel { if (mViewHolder == null) { return; } ColorStateList fgTintList = ColorStateList.valueOf(mForegroundColor); ImageView iconView = mViewHolder.getSeamlessIcon(); TextView deviceName = mViewHolder.getSeamlessText(); // Update the outline color LinearLayout viewLayout = (LinearLayout) mViewHolder.getSeamless(); RippleDrawable bkgDrawable = (RippleDrawable) viewLayout.getBackground(); GradientDrawable rect = (GradientDrawable) bkgDrawable.getDrawable(0); rect.setStroke(2, mForegroundColor); rect.setColor(mBackgroundColor); ImageView iconView = mViewHolder.getSeamlessIcon(); TextView deviceName = mViewHolder.getSeamlessText(); deviceName.setTextColor(fgTintList); rect.setStroke(2, deviceName.getCurrentTextColor()); rect.setColor(Color.TRANSPARENT); if (mIsRemotePlayback) { mViewHolder.getSeamless().setEnabled(false); mViewHolder.getSeamless().setAlpha(0.38f); iconView.setImageResource(R.drawable.ic_hardware_speaker); iconView.setVisibility(View.VISIBLE); iconView.setImageTintList(fgTintList); deviceName.setText(R.string.media_seamless_remote_device); } else if (device != null) { mViewHolder.getSeamless().setEnabled(true); mViewHolder.getSeamless().setAlpha(1f); Drawable icon = device.getIcon(); iconView.setVisibility(View.VISIBLE); iconView.setImageTintList(fgTintList); if (icon instanceof AdaptiveIcon) { AdaptiveIcon aIcon = (AdaptiveIcon) icon; Loading Loading @@ -639,7 +630,6 @@ public class MediaControlPanel { mQSMediaBrowser.restart(); }); btn.setImageDrawable(mContext.getResources().getDrawable(R.drawable.lb_ic_play)); btn.setImageTintList(ColorStateList.valueOf(mForegroundColor)); setVisibleAndAlpha(expandedSet, ACTION_IDS[0], true /*visible */); setVisibleAndAlpha(collapsedSet, ACTION_IDS[0], true /*visible */); Loading Loading
packages/SystemUI/res/layout/qs_media_panel.xml +11 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:fontFamily="@*android:string/config_bodyFontFamily" android:textColor="@color/media_primary_text" android:gravity="left" android:textSize="14sp" /> Loading @@ -58,6 +59,7 @@ android:layout_height="wrap_content" android:layout_alignParentRight="true" android:fontFamily="@*android:string/config_bodyFontFamily" android:textColor="@color/media_primary_text" android:gravity="right" android:textSize="14sp" /> </FrameLayout> Loading Loading @@ -116,6 +118,7 @@ android:layout_width="@dimen/qs_seamless_icon_size" android:layout_height="@dimen/qs_seamless_icon_size" android:layout_marginRight="8dp" android:tint="@color/media_primary_text" android:src="@*android:drawable/ic_media_seamless" /> <TextView Loading @@ -125,6 +128,7 @@ android:fontFamily="@*android:string/config_bodyFontFamily" android:singleLine="true" android:text="@*android:string/ext_media_seamless_action" android:textColor="@color/media_primary_text" android:textSize="14sp" /> </LinearLayout> Loading @@ -138,11 +142,15 @@ android:maxHeight="3dp" android:paddingTop="16dp" android:paddingBottom="16dp" android:thumbTint="@color/media_primary_text" android:progressTint="@color/media_seekbar_progress" android:progressBackgroundTint="@color/media_disabled" android:splitTrack="false" /> <!-- App name --> <TextView android:id="@+id/app_name" android:textColor="@color/media_primary_text" android:layout_width="0dp" android:layout_height="wrap_content" android:singleLine="true" Loading @@ -155,6 +163,7 @@ android:layout_height="wrap_content" android:fontFamily="@*android:string/config_headlineFontFamilyMedium" android:singleLine="true" android:textColor="@color/media_primary_text" android:textSize="18sp" /> <!-- Artist name --> Loading @@ -164,10 +173,12 @@ android:layout_height="wrap_content" android:fontFamily="@*android:string/config_bodyFontFamily" android:singleLine="true" android:textColor="@color/media_primary_text" android:textSize="14sp" /> <com.android.internal.widget.CachingIconView android:id="@+id/icon" android:tint="@color/media_primary_text" android:layout_width="16dp" android:layout_height="16dp" /> Loading
packages/SystemUI/res/layout/qs_media_panel_options.xml +3 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ android:layout_height="18dp" android:id="@+id/remove_icon" android:layout_marginEnd="16dp" android:tint="@color/media_primary_text" android:src="@drawable/ic_clear"/> <TextView android:layout_width="wrap_content" Loading @@ -43,6 +44,7 @@ android:id="@+id/remove_text" android:fontFamily="@*android:string/config_headlineFontFamilyMedium" android:singleLine="true" android:textColor="@color/media_primary_text" android:text="@string/controls_media_close_session" /> </LinearLayout> <TextView Loading @@ -54,5 +56,6 @@ android:layout_gravity="end|bottom" android:gravity="bottom" android:fontFamily="@*android:string/config_headlineFontFamilyMedium" android:textColor="@android:color/white" android:text="@string/cancel" /> </LinearLayout>
packages/SystemUI/res/values/colors.xml +5 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,11 @@ <color name="magnification_border_color">#FF9900</color> <!-- media --> <color name="media_primary_text">@android:color/white</color> <color name="media_seekbar_progress">#c0ffffff</color> <color name="media_disabled">#80ffffff</color> <!-- controls --> <color name="control_primary_text">#E6FFFFFF</color> <color name="control_secondary_text">#99FFFFFF</color> Loading
packages/SystemUI/res/values/styles.xml +1 −0 Original line number Diff line number Diff line Loading @@ -622,6 +622,7 @@ <style name="MediaPlayer.Button" parent="@android:style/Widget.Material.Button.Borderless.Small"> <item name="android:background">@null</item> <item name="android:tint">@android:color/white</item> </style> <!-- Used to style charging animation AVD animation --> Loading
packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java +11 −21 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.content.pm.ResolveInfo; import android.content.res.ColorStateList; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; Loading Loading @@ -98,7 +99,6 @@ public class MediaControlPanel { private PlayerViewHolder mViewHolder; private MediaSession.Token mToken; private MediaController mController; private int mForegroundColor; private int mBackgroundColor; private MediaDevice mDevice; protected ComponentName mServiceComponent; Loading Loading @@ -243,7 +243,6 @@ public class MediaControlPanel { return; } MediaSession.Token token = data.getToken(); mForegroundColor = data.getForegroundColor(); mBackgroundColor = data.getBackgroundColor(); if (mToken == null || !mToken.equals(token)) { if (mQSMediaBrowser != null) { Loading Loading @@ -304,24 +303,19 @@ public class MediaControlPanel { // App icon ImageView appIcon = mViewHolder.getAppIcon(); Drawable iconDrawable = data.getAppIcon().mutate(); iconDrawable.setTint(mForegroundColor); appIcon.setImageDrawable(iconDrawable); appIcon.setImageDrawable(data.getAppIcon()); // Song name TextView titleText = mViewHolder.getTitleText(); titleText.setText(data.getSong()); titleText.setTextColor(data.getForegroundColor()); // App title TextView appName = mViewHolder.getAppName(); appName.setText(data.getApp()); appName.setTextColor(mForegroundColor); // Artist name TextView artistText = mViewHolder.getArtistText(); artistText.setText(data.getArtist()); artistText.setTextColor(mForegroundColor); // Transfer chip if (mLocalMediaManager != null) { Loading @@ -329,6 +323,10 @@ public class MediaControlPanel { setVisibleAndAlpha(collapsedSet, R.id.media_seamless, true /*visible */); setVisibleAndAlpha(expandedSet, R.id.media_seamless, true /*visible */); updateDevice(mLocalMediaManager.getCurrentConnectedDevice()); if (mViewHolder.getBackground().getBackground() instanceof IlluminationDrawable) { ((IlluminationDrawable) mViewHolder.getBackground().getBackground()) .setupTouch(mViewHolder.getSeamless(), mViewHolder.getPlayer()); } mViewHolder.getSeamless().setOnClickListener(v -> { final Intent intent = new Intent() .setAction(MediaOutputSliceConstants.ACTION_MEDIA_OUTPUT) Loading Loading @@ -358,7 +356,6 @@ public class MediaControlPanel { MediaAction mediaAction = actionIcons.get(i); button.setImageDrawable(mediaAction.getDrawable()); button.setContentDescription(mediaAction.getContentDescription()); button.setImageTintList(ColorStateList.valueOf(mForegroundColor)); PendingIntent actionIntent = mediaAction.getIntent(); if (mViewHolder.getBackground().getBackground() instanceof IlluminationDrawable) { Loading Loading @@ -389,8 +386,7 @@ public class MediaControlPanel { // Seek Bar final MediaController controller = getController(); mBackgroundExecutor.execute( () -> mSeekBarViewModel.updateController(controller, data.getForegroundColor())); mBackgroundExecutor.execute(() -> mSeekBarViewModel.updateController(controller)); // Set up long press menu // TODO: b/156036025 bring back media guts Loading Loading @@ -541,32 +537,27 @@ public class MediaControlPanel { if (mViewHolder == null) { return; } ColorStateList fgTintList = ColorStateList.valueOf(mForegroundColor); ImageView iconView = mViewHolder.getSeamlessIcon(); TextView deviceName = mViewHolder.getSeamlessText(); // Update the outline color LinearLayout viewLayout = (LinearLayout) mViewHolder.getSeamless(); RippleDrawable bkgDrawable = (RippleDrawable) viewLayout.getBackground(); GradientDrawable rect = (GradientDrawable) bkgDrawable.getDrawable(0); rect.setStroke(2, mForegroundColor); rect.setColor(mBackgroundColor); ImageView iconView = mViewHolder.getSeamlessIcon(); TextView deviceName = mViewHolder.getSeamlessText(); deviceName.setTextColor(fgTintList); rect.setStroke(2, deviceName.getCurrentTextColor()); rect.setColor(Color.TRANSPARENT); if (mIsRemotePlayback) { mViewHolder.getSeamless().setEnabled(false); mViewHolder.getSeamless().setAlpha(0.38f); iconView.setImageResource(R.drawable.ic_hardware_speaker); iconView.setVisibility(View.VISIBLE); iconView.setImageTintList(fgTintList); deviceName.setText(R.string.media_seamless_remote_device); } else if (device != null) { mViewHolder.getSeamless().setEnabled(true); mViewHolder.getSeamless().setAlpha(1f); Drawable icon = device.getIcon(); iconView.setVisibility(View.VISIBLE); iconView.setImageTintList(fgTintList); if (icon instanceof AdaptiveIcon) { AdaptiveIcon aIcon = (AdaptiveIcon) icon; Loading Loading @@ -639,7 +630,6 @@ public class MediaControlPanel { mQSMediaBrowser.restart(); }); btn.setImageDrawable(mContext.getResources().getDrawable(R.drawable.lb_ic_play)); btn.setImageTintList(ColorStateList.valueOf(mForegroundColor)); setVisibleAndAlpha(expandedSet, ACTION_IDS[0], true /*visible */); setVisibleAndAlpha(collapsedSet, ACTION_IDS[0], true /*visible */); Loading