Loading packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt +1 −7 Original line number Diff line number Diff line Loading @@ -127,7 +127,6 @@ class MediaCarouselController @Inject constructor( private val visualStabilityCallback: OnReorderingAllowedListener private var needsReordering: Boolean = false private var keysNeedRemoval = mutableSetOf<String>() private var bgColor = getBackgroundColor() protected var shouldScrollToActivePlayer: Boolean = false private var isRtl: Boolean = false set(value) { Loading Loading @@ -488,7 +487,7 @@ class MediaCarouselController @Inject constructor( val lp = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) newRecs.recommendationViewHolder?.recommendations?.setLayoutParams(lp) newRecs.bindRecommendation(data.copy(backgroundColor = bgColor)) newRecs.bindRecommendation(data) val curVisibleMediaKey = MediaPlayerData.playerKeys() .elementAtOrNull(mediaCarouselScrollHandler.visibleMediaIndex) MediaPlayerData.addMediaRecommendation(key, data, newRecs, shouldPrioritize, systemClock) Loading Loading @@ -534,7 +533,6 @@ class MediaCarouselController @Inject constructor( } private fun recreatePlayers() { bgColor = getBackgroundColor() pageIndicator.tintList = ColorStateList.valueOf(R.color.material_dynamic_neutral_variant80) MediaPlayerData.mediaData().forEach { (key, data, isSsMediaRec) -> Loading @@ -554,10 +552,6 @@ class MediaCarouselController @Inject constructor( } } private fun getBackgroundColor(): Int { return context.getColor(R.color.material_dynamic_secondary95) } private fun updatePageIndicator() { val numPages = mediaContent.getChildCount() pageIndicator.setNumPages(numPages) Loading packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java +7 −2 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import androidx.constraintlayout.widget.ConstraintSet; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.logging.InstanceId; import com.android.settingslib.Utils; import com.android.settingslib.widget.AdaptiveIcon; import com.android.systemui.ActivityIntentHelper; import com.android.systemui.R; Loading Loading @@ -953,11 +954,11 @@ public class MediaControlPanel { } mSmartspaceId = SmallHash.hash(data.getTargetId()); int backgroundColor = data.getBackgroundColor(); mPackageName = data.getPackageName(); mInstanceId = data.getInstanceId(); TransitionLayout recommendationCard = mRecommendationViewHolder.getRecommendations(); recommendationCard.setBackgroundTintList(ColorStateList.valueOf(backgroundColor)); recommendationCard.setBackgroundTintList( Utils.getColorAttr(mContext, com.android.internal.R.attr.colorSurface)); List<SmartspaceAction> mediaRecommendationList = data.getRecommendations(); if (mediaRecommendationList == null || mediaRecommendationList.isEmpty()) { Loading Loading @@ -1057,6 +1058,8 @@ public class MediaControlPanel { TextView titleView = mRecommendationViewHolder.getMediaTitles().get(uiComponentIndex); titleView.setText(title); titleView.setTextColor(Utils.getColorAttrDefaultColor( mContext, com.android.internal.R.attr.textColorPrimary)); // TODO(b/223603970): If none of them have titles, should we then hide the views? // Set up subtitle Loading @@ -1067,6 +1070,8 @@ public class MediaControlPanel { boolean shouldShowSubtitleText = !TextUtils.isEmpty(title); CharSequence subtitleText = shouldShowSubtitleText ? subtitle : ""; subtitleView.setText(subtitleText); subtitleView.setTextColor(Utils.getColorAttrDefaultColor( mContext, com.android.internal.R.attr.textColorSecondary)); // TODO(b/223603970): If none of them have subtitles, should we then hide the views? uiComponentIndex++; Loading packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt +0 −2 Original line number Diff line number Diff line Loading @@ -110,7 +110,6 @@ internal val EMPTY_SMARTSPACE_MEDIA_DATA = SmartspaceMediaData( cardAction = null, recommendations = emptyList(), dismissIntent = null, backgroundColor = 0, headphoneConnectionTimeMillis = 0, instanceId = InstanceId.fakeInstanceId(-1)) Loading Loading @@ -1228,7 +1227,6 @@ class MediaDataManager( cardAction = target.baseAction, recommendations = target.iconGrid, dismissIntent = dismissIntent, backgroundColor = 0, headphoneConnectionTimeMillis = target.creationTimeMillis, instanceId = logger.getNewInstanceId()) } Loading packages/SystemUI/src/com/android/systemui/media/SmartspaceMediaData.kt +0 −4 Original line number Diff line number Diff line Loading @@ -50,10 +50,6 @@ data class SmartspaceMediaData( * Intent for the user's initiated dismissal. */ val dismissIntent: Intent?, /** * View's background color. */ val backgroundColor: Int, /** * The timestamp in milliseconds that headphone is connected. */ Loading packages/SystemUI/tests/src/com/android/systemui/media/MediaDataManagerTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -510,7 +510,6 @@ class MediaDataManagerTest : SysuiTestCase() { cardAction = mediaSmartspaceBaseAction, recommendations = listOf(mediaRecommendationItem), dismissIntent = DISMISS_INTENT, backgroundColor = 0, headphoneConnectionTimeMillis = 1234L, instanceId = InstanceId.fakeInstanceId(instanceId))), eq(false)) Loading Loading
packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt +1 −7 Original line number Diff line number Diff line Loading @@ -127,7 +127,6 @@ class MediaCarouselController @Inject constructor( private val visualStabilityCallback: OnReorderingAllowedListener private var needsReordering: Boolean = false private var keysNeedRemoval = mutableSetOf<String>() private var bgColor = getBackgroundColor() protected var shouldScrollToActivePlayer: Boolean = false private var isRtl: Boolean = false set(value) { Loading Loading @@ -488,7 +487,7 @@ class MediaCarouselController @Inject constructor( val lp = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) newRecs.recommendationViewHolder?.recommendations?.setLayoutParams(lp) newRecs.bindRecommendation(data.copy(backgroundColor = bgColor)) newRecs.bindRecommendation(data) val curVisibleMediaKey = MediaPlayerData.playerKeys() .elementAtOrNull(mediaCarouselScrollHandler.visibleMediaIndex) MediaPlayerData.addMediaRecommendation(key, data, newRecs, shouldPrioritize, systemClock) Loading Loading @@ -534,7 +533,6 @@ class MediaCarouselController @Inject constructor( } private fun recreatePlayers() { bgColor = getBackgroundColor() pageIndicator.tintList = ColorStateList.valueOf(R.color.material_dynamic_neutral_variant80) MediaPlayerData.mediaData().forEach { (key, data, isSsMediaRec) -> Loading @@ -554,10 +552,6 @@ class MediaCarouselController @Inject constructor( } } private fun getBackgroundColor(): Int { return context.getColor(R.color.material_dynamic_secondary95) } private fun updatePageIndicator() { val numPages = mediaContent.getChildCount() pageIndicator.setNumPages(numPages) Loading
packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java +7 −2 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import androidx.constraintlayout.widget.ConstraintSet; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.logging.InstanceId; import com.android.settingslib.Utils; import com.android.settingslib.widget.AdaptiveIcon; import com.android.systemui.ActivityIntentHelper; import com.android.systemui.R; Loading Loading @@ -953,11 +954,11 @@ public class MediaControlPanel { } mSmartspaceId = SmallHash.hash(data.getTargetId()); int backgroundColor = data.getBackgroundColor(); mPackageName = data.getPackageName(); mInstanceId = data.getInstanceId(); TransitionLayout recommendationCard = mRecommendationViewHolder.getRecommendations(); recommendationCard.setBackgroundTintList(ColorStateList.valueOf(backgroundColor)); recommendationCard.setBackgroundTintList( Utils.getColorAttr(mContext, com.android.internal.R.attr.colorSurface)); List<SmartspaceAction> mediaRecommendationList = data.getRecommendations(); if (mediaRecommendationList == null || mediaRecommendationList.isEmpty()) { Loading Loading @@ -1057,6 +1058,8 @@ public class MediaControlPanel { TextView titleView = mRecommendationViewHolder.getMediaTitles().get(uiComponentIndex); titleView.setText(title); titleView.setTextColor(Utils.getColorAttrDefaultColor( mContext, com.android.internal.R.attr.textColorPrimary)); // TODO(b/223603970): If none of them have titles, should we then hide the views? // Set up subtitle Loading @@ -1067,6 +1070,8 @@ public class MediaControlPanel { boolean shouldShowSubtitleText = !TextUtils.isEmpty(title); CharSequence subtitleText = shouldShowSubtitleText ? subtitle : ""; subtitleView.setText(subtitleText); subtitleView.setTextColor(Utils.getColorAttrDefaultColor( mContext, com.android.internal.R.attr.textColorSecondary)); // TODO(b/223603970): If none of them have subtitles, should we then hide the views? uiComponentIndex++; Loading
packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt +0 −2 Original line number Diff line number Diff line Loading @@ -110,7 +110,6 @@ internal val EMPTY_SMARTSPACE_MEDIA_DATA = SmartspaceMediaData( cardAction = null, recommendations = emptyList(), dismissIntent = null, backgroundColor = 0, headphoneConnectionTimeMillis = 0, instanceId = InstanceId.fakeInstanceId(-1)) Loading Loading @@ -1228,7 +1227,6 @@ class MediaDataManager( cardAction = target.baseAction, recommendations = target.iconGrid, dismissIntent = dismissIntent, backgroundColor = 0, headphoneConnectionTimeMillis = target.creationTimeMillis, instanceId = logger.getNewInstanceId()) } Loading
packages/SystemUI/src/com/android/systemui/media/SmartspaceMediaData.kt +0 −4 Original line number Diff line number Diff line Loading @@ -50,10 +50,6 @@ data class SmartspaceMediaData( * Intent for the user's initiated dismissal. */ val dismissIntent: Intent?, /** * View's background color. */ val backgroundColor: Int, /** * The timestamp in milliseconds that headphone is connected. */ Loading
packages/SystemUI/tests/src/com/android/systemui/media/MediaDataManagerTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -510,7 +510,6 @@ class MediaDataManagerTest : SysuiTestCase() { cardAction = mediaSmartspaceBaseAction, recommendations = listOf(mediaRecommendationItem), dismissIntent = DISMISS_INTENT, backgroundColor = 0, headphoneConnectionTimeMillis = 1234L, instanceId = InstanceId.fakeInstanceId(instanceId))), eq(false)) Loading