Loading packages/SystemUI/res/drawable/media_carousel_settings_bg.xml 0 → 100644 +22 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright (C) 2025 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. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > <size android:height="40dp" android:width="40dp" /> <solid android:color="@*android:color/surface_effect_1" /> <corners android:radius="20dp" /> </shape> No newline at end of file packages/SystemUI/res/layout/media_carousel_settings_button.xml +30 −13 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2020 The Android Open Source Project <?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright (C) 2025 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. Loading @@ -14,7 +13,25 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" android:id="@+id/settings_cog_layout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="invisible" android:forceHasOverlappingRendering="false"> <View android:id="@+id/background" android:layout_width="48dp" android:layout_height="48dp" android:layout_marginStart="2dp" android:layout_marginEnd="2dp" android:layout_gravity="center" android:background="@drawable/media_carousel_settings_bg" /> <ImageView android:id="@+id/settings_cog" android:layout_width="wrap_content" android:layout_height="wrap_content" Loading @@ -24,6 +41,6 @@ android:paddingBottom="20dp" android:paddingTop="20dp" android:src="@drawable/ic_settings" android:tint="@color/notification_gear_color" android:visibility="invisible" android:forceHasOverlappingRendering="false"/> android:tint="@androidprv:color/materialColorOnSurface" /> </FrameLayout> packages/SystemUI/res/layout/media_carousel_settings_button_legacy.xml 0 → 100644 +29 −0 Original line number Diff line number Diff line <?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. --> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/settings_cog" android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/controls_media_settings_button" android:paddingStart="30dp" android:paddingEnd="30dp" android:paddingBottom="20dp" android:paddingTop="20dp" android:src="@drawable/ic_settings" android:tint="@color/notification_gear_color" android:visibility="invisible" android:forceHasOverlappingRendering="false"/> packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt +20 −7 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import com.android.keyguard.KeyguardUpdateMonitor import com.android.keyguard.KeyguardUpdateMonitorCallback import com.android.media.flags.Flags.enableSuggestedDeviceApi import com.android.systemui.Dumpable import com.android.systemui.Flags import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Background Loading Loading @@ -197,7 +198,7 @@ constructor( val mediaFrame: ViewGroup @VisibleForTesting lateinit var settingsButton: ImageView lateinit var settingsButton: View private set private val mediaContent: ViewGroup Loading Loading @@ -485,8 +486,14 @@ constructor( private fun inflateSettingsButton() { val settings = if (Flags.mediaControlsUiUpdate()) { LayoutInflater.from(context) .inflate(R.layout.media_carousel_settings_button, mediaFrame, false) as ImageView .inflate(R.layout.media_carousel_settings_button, mediaFrame, false) as ViewGroup } else { LayoutInflater.from(context) .inflate(R.layout.media_carousel_settings_button_legacy, mediaFrame, false) } if (this::settingsButton.isInitialized) { mediaFrame.removeView(settingsButton) } Loading Loading @@ -1113,11 +1120,17 @@ constructor( // communal for aesthetic and accessibility purposes since the background of // Glanceable Hub is a dynamic color. if (desiredLocation == MediaHierarchyManager.LOCATION_COMMUNAL_HUB) { settingsButton.setColorFilter( settingsButton .requireViewById<ImageView>(R.id.settings_cog) .setColorFilter( context.getColor(com.android.internal.R.color.materialColorOnPrimary) ) } else { settingsButton.setColorFilter(context.getColor(R.color.notification_gear_color)) settingsButton .requireViewById<ImageView>(R.id.settings_cog) .setColorFilter( context.getColor(com.android.internal.R.color.materialColorOnSurface) ) } val shouldCloseGuts = Loading Loading
packages/SystemUI/res/drawable/media_carousel_settings_bg.xml 0 → 100644 +22 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright (C) 2025 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. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > <size android:height="40dp" android:width="40dp" /> <solid android:color="@*android:color/surface_effect_1" /> <corners android:radius="20dp" /> </shape> No newline at end of file
packages/SystemUI/res/layout/media_carousel_settings_button.xml +30 −13 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2020 The Android Open Source Project <?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright (C) 2025 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. Loading @@ -14,7 +13,25 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" android:id="@+id/settings_cog_layout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="invisible" android:forceHasOverlappingRendering="false"> <View android:id="@+id/background" android:layout_width="48dp" android:layout_height="48dp" android:layout_marginStart="2dp" android:layout_marginEnd="2dp" android:layout_gravity="center" android:background="@drawable/media_carousel_settings_bg" /> <ImageView android:id="@+id/settings_cog" android:layout_width="wrap_content" android:layout_height="wrap_content" Loading @@ -24,6 +41,6 @@ android:paddingBottom="20dp" android:paddingTop="20dp" android:src="@drawable/ic_settings" android:tint="@color/notification_gear_color" android:visibility="invisible" android:forceHasOverlappingRendering="false"/> android:tint="@androidprv:color/materialColorOnSurface" /> </FrameLayout>
packages/SystemUI/res/layout/media_carousel_settings_button_legacy.xml 0 → 100644 +29 −0 Original line number Diff line number Diff line <?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. --> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/settings_cog" android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/controls_media_settings_button" android:paddingStart="30dp" android:paddingEnd="30dp" android:paddingBottom="20dp" android:paddingTop="20dp" android:src="@drawable/ic_settings" android:tint="@color/notification_gear_color" android:visibility="invisible" android:forceHasOverlappingRendering="false"/>
packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt +20 −7 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import com.android.keyguard.KeyguardUpdateMonitor import com.android.keyguard.KeyguardUpdateMonitorCallback import com.android.media.flags.Flags.enableSuggestedDeviceApi import com.android.systemui.Dumpable import com.android.systemui.Flags import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Background Loading Loading @@ -197,7 +198,7 @@ constructor( val mediaFrame: ViewGroup @VisibleForTesting lateinit var settingsButton: ImageView lateinit var settingsButton: View private set private val mediaContent: ViewGroup Loading Loading @@ -485,8 +486,14 @@ constructor( private fun inflateSettingsButton() { val settings = if (Flags.mediaControlsUiUpdate()) { LayoutInflater.from(context) .inflate(R.layout.media_carousel_settings_button, mediaFrame, false) as ImageView .inflate(R.layout.media_carousel_settings_button, mediaFrame, false) as ViewGroup } else { LayoutInflater.from(context) .inflate(R.layout.media_carousel_settings_button_legacy, mediaFrame, false) } if (this::settingsButton.isInitialized) { mediaFrame.removeView(settingsButton) } Loading Loading @@ -1113,11 +1120,17 @@ constructor( // communal for aesthetic and accessibility purposes since the background of // Glanceable Hub is a dynamic color. if (desiredLocation == MediaHierarchyManager.LOCATION_COMMUNAL_HUB) { settingsButton.setColorFilter( settingsButton .requireViewById<ImageView>(R.id.settings_cog) .setColorFilter( context.getColor(com.android.internal.R.color.materialColorOnPrimary) ) } else { settingsButton.setColorFilter(context.getColor(R.color.notification_gear_color)) settingsButton .requireViewById<ImageView>(R.id.settings_cog) .setColorFilter( context.getColor(com.android.internal.R.color.materialColorOnSurface) ) } val shouldCloseGuts = Loading