Loading packages/SystemUI/shared/res/values/ids.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright (C) 2023 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. --> <resources> <!-- ID of the smartspace card view. --> <item type="id" name="bc_smartspace_view" /> <!-- ID of the smartspace date view. --> <item type="id" name="date_smartspace_view" /> <!-- ID of the smartspace weather view. --> <item type="id" name="weather_smartspace_view" /> </resources> packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSmartspaceViewBinder.kt +8 −4 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.res.R import com.android.systemui.shared.R as sharedR import kotlinx.coroutines.launch object KeyguardSmartspaceViewBinder { Loading Loading @@ -69,9 +70,10 @@ object KeyguardSmartspaceViewBinder { smartspaceViewModel.isSmartspaceEnabled && smartspaceViewModel.isDateWeatherDecoupled ) { val dateView = constraintLayout.requireViewById<View>(smartspaceViewModel.dateId) val dateView = constraintLayout.requireViewById<View>(sharedR.id.date_smartspace_view) val weatherView = constraintLayout.requireViewById<View>(smartspaceViewModel.weatherId) constraintLayout.requireViewById<View>(sharedR.id.weather_smartspace_view) addView(weatherView) addView(dateView) } Loading @@ -88,8 +90,10 @@ object KeyguardSmartspaceViewBinder { smartspaceViewModel.isSmartspaceEnabled && smartspaceViewModel.isDateWeatherDecoupled ) { val dateView = smartspaceViewModel.dateView val weatherView = smartspaceViewModel.weatherView val dateView = constraintLayout.requireViewById<View>(sharedR.id.date_smartspace_view) val weatherView = constraintLayout.requireViewById<View>(sharedR.id.weather_smartspace_view) removeView(weatherView) removeView(dateView) } Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodBurnInSection.kt +2 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.systemui.keyguard.shared.model.KeyguardSection import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.res.R import com.android.systemui.shared.R as sharedR import javax.inject.Inject /** Adds a layer to group elements for translation for burn-in preventation */ Loading Loading @@ -87,7 +88,7 @@ constructor( burnInLayer.apply { if (smartspaceViewModel.isSmartspaceEnabled) { val smartspaceView = constraintLayout.requireViewById<View>(smartspaceViewModel.smartspaceViewId) constraintLayout.requireViewById<View>(sharedR.id.bc_smartspace_view) addView(smartspaceView) } } Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodNotificationIconsSection.kt +2 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import com.android.systemui.keyguard.shared.KeyguardShadeMigrationNssl import com.android.systemui.keyguard.shared.model.KeyguardSection import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.res.R import com.android.systemui.shared.R as sharedR import com.android.systemui.statusbar.notification.icon.ui.viewbinder.AlwaysOnDisplayNotificationIconViewStore import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerViewBinder import com.android.systemui.statusbar.notification.icon.ui.viewbinder.StatusBarIconViewBindingFailureTracker Loading Loading @@ -117,7 +118,7 @@ constructor( } constraintSet.apply { if (migrateClocksToBlueprint()) { connect(nicId, TOP, smartspaceViewModel.smartspaceViewId, BOTTOM, bottomMargin) connect(nicId, TOP, sharedR.id.bc_smartspace_view, BOTTOM, bottomMargin) setGoneMargin(nicId, BOTTOM, bottomMargin) } else { connect(nicId, TOP, R.id.keyguard_status_view, topAlignment, bottomMargin) Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/ClockSection.kt +8 −4 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor import com.android.systemui.keyguard.shared.model.KeyguardSection import com.android.systemui.keyguard.ui.binder.KeyguardClockViewBinder import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.plugins.clocks.ClockController import com.android.systemui.plugins.clocks.ClockFaceLayout import com.android.systemui.res.R Loading @@ -55,7 +54,6 @@ open class ClockSection constructor( private val clockInteractor: KeyguardClockInteractor, protected val keyguardClockViewModel: KeyguardClockViewModel, private val smartspaceViewModel: KeyguardSmartspaceViewModel, private val context: Context, private val splitShadeStateController: SplitShadeStateController, ) : KeyguardSection() { Loading Loading @@ -119,8 +117,8 @@ constructor( com.android.systemui.customization.R.dimen.small_clock_padding_top ) + context.resources.getDimensionPixelSize(R.dimen.keyguard_smartspace_top_offset) largeClockTopMargin += smartspaceViewModel.getDimen(DATE_WEATHER_VIEW_HEIGHT) largeClockTopMargin += smartspaceViewModel.getDimen(ENHANCED_SMARTSPACE_HEIGHT) largeClockTopMargin += getDimen(DATE_WEATHER_VIEW_HEIGHT) largeClockTopMargin += getDimen(ENHANCED_SMARTSPACE_HEIGHT) if (!keyguardClockViewModel.useLargeClock) { largeClockTopMargin -= context.resources.getDimensionPixelSize( Loading Loading @@ -163,6 +161,12 @@ constructor( } } private fun getDimen(name: String): Int { val res = context.packageManager.getResourcesForApplication(context.packageName) val id = res.getIdentifier(name, "dimen", context.packageName) return res.getDimensionPixelSize(id) } companion object { private const val DATE_WEATHER_VIEW_HEIGHT = "date_weather_view_height" private const val ENHANCED_SMARTSPACE_HEIGHT = "enhanced_smartspace_height" Loading Loading
packages/SystemUI/shared/res/values/ids.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright (C) 2023 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. --> <resources> <!-- ID of the smartspace card view. --> <item type="id" name="bc_smartspace_view" /> <!-- ID of the smartspace date view. --> <item type="id" name="date_smartspace_view" /> <!-- ID of the smartspace weather view. --> <item type="id" name="weather_smartspace_view" /> </resources>
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSmartspaceViewBinder.kt +8 −4 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.res.R import com.android.systemui.shared.R as sharedR import kotlinx.coroutines.launch object KeyguardSmartspaceViewBinder { Loading Loading @@ -69,9 +70,10 @@ object KeyguardSmartspaceViewBinder { smartspaceViewModel.isSmartspaceEnabled && smartspaceViewModel.isDateWeatherDecoupled ) { val dateView = constraintLayout.requireViewById<View>(smartspaceViewModel.dateId) val dateView = constraintLayout.requireViewById<View>(sharedR.id.date_smartspace_view) val weatherView = constraintLayout.requireViewById<View>(smartspaceViewModel.weatherId) constraintLayout.requireViewById<View>(sharedR.id.weather_smartspace_view) addView(weatherView) addView(dateView) } Loading @@ -88,8 +90,10 @@ object KeyguardSmartspaceViewBinder { smartspaceViewModel.isSmartspaceEnabled && smartspaceViewModel.isDateWeatherDecoupled ) { val dateView = smartspaceViewModel.dateView val weatherView = smartspaceViewModel.weatherView val dateView = constraintLayout.requireViewById<View>(sharedR.id.date_smartspace_view) val weatherView = constraintLayout.requireViewById<View>(sharedR.id.weather_smartspace_view) removeView(weatherView) removeView(dateView) } Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodBurnInSection.kt +2 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.systemui.keyguard.shared.model.KeyguardSection import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.res.R import com.android.systemui.shared.R as sharedR import javax.inject.Inject /** Adds a layer to group elements for translation for burn-in preventation */ Loading Loading @@ -87,7 +88,7 @@ constructor( burnInLayer.apply { if (smartspaceViewModel.isSmartspaceEnabled) { val smartspaceView = constraintLayout.requireViewById<View>(smartspaceViewModel.smartspaceViewId) constraintLayout.requireViewById<View>(sharedR.id.bc_smartspace_view) addView(smartspaceView) } } Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodNotificationIconsSection.kt +2 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import com.android.systemui.keyguard.shared.KeyguardShadeMigrationNssl import com.android.systemui.keyguard.shared.model.KeyguardSection import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.res.R import com.android.systemui.shared.R as sharedR import com.android.systemui.statusbar.notification.icon.ui.viewbinder.AlwaysOnDisplayNotificationIconViewStore import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerViewBinder import com.android.systemui.statusbar.notification.icon.ui.viewbinder.StatusBarIconViewBindingFailureTracker Loading Loading @@ -117,7 +118,7 @@ constructor( } constraintSet.apply { if (migrateClocksToBlueprint()) { connect(nicId, TOP, smartspaceViewModel.smartspaceViewId, BOTTOM, bottomMargin) connect(nicId, TOP, sharedR.id.bc_smartspace_view, BOTTOM, bottomMargin) setGoneMargin(nicId, BOTTOM, bottomMargin) } else { connect(nicId, TOP, R.id.keyguard_status_view, topAlignment, bottomMargin) Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/ClockSection.kt +8 −4 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor import com.android.systemui.keyguard.shared.model.KeyguardSection import com.android.systemui.keyguard.ui.binder.KeyguardClockViewBinder import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.plugins.clocks.ClockController import com.android.systemui.plugins.clocks.ClockFaceLayout import com.android.systemui.res.R Loading @@ -55,7 +54,6 @@ open class ClockSection constructor( private val clockInteractor: KeyguardClockInteractor, protected val keyguardClockViewModel: KeyguardClockViewModel, private val smartspaceViewModel: KeyguardSmartspaceViewModel, private val context: Context, private val splitShadeStateController: SplitShadeStateController, ) : KeyguardSection() { Loading Loading @@ -119,8 +117,8 @@ constructor( com.android.systemui.customization.R.dimen.small_clock_padding_top ) + context.resources.getDimensionPixelSize(R.dimen.keyguard_smartspace_top_offset) largeClockTopMargin += smartspaceViewModel.getDimen(DATE_WEATHER_VIEW_HEIGHT) largeClockTopMargin += smartspaceViewModel.getDimen(ENHANCED_SMARTSPACE_HEIGHT) largeClockTopMargin += getDimen(DATE_WEATHER_VIEW_HEIGHT) largeClockTopMargin += getDimen(ENHANCED_SMARTSPACE_HEIGHT) if (!keyguardClockViewModel.useLargeClock) { largeClockTopMargin -= context.resources.getDimensionPixelSize( Loading Loading @@ -163,6 +161,12 @@ constructor( } } private fun getDimen(name: String): Int { val res = context.packageManager.getResourcesForApplication(context.packageName) val id = res.getIdentifier(name, "dimen", context.packageName) return res.getDimensionPixelSize(id) } companion object { private const val DATE_WEATHER_VIEW_HEIGHT = "date_weather_view_height" private const val ENHANCED_SMARTSPACE_HEIGHT = "enhanced_smartspace_height" Loading