Loading packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardSliceViewControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ public class KeyguardSliceViewControllerTest extends SysuiTestCase { when(mView.getContext()).thenReturn(mContext); mController = new KeyguardSliceViewController(mHandler, mBgHandler, mView, mActivityStarter, mConfigurationController, mDumpManager, mDisplayTracker); mDisplayTracker, null, null); mController.setupUri(KeyguardSliceProvider.KEYGUARD_SLICE_URI); } Loading packages/SystemUI/res/values-uk/cm_strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -56,4 +56,6 @@ <string name="vpn_credentials_username">Користувацьке ім\'я</string> <string name="vpn_credentials_password">Пароль</string> <string name="vpn_credentials_dialog_connect">З\'єднатись</string> <string name="screenshot_delete_label">Видалити</string> <string name="screenshot_delete_description">Видалити знімок екрана</string> </resources> packages/SystemUI/src/com/android/keyguard/KeyguardSliceViewController.java +35 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.keyguard; import static android.app.slice.Slice.HINT_LIST_ITEM; import static com.android.systemui.util.kotlin.JavaAdapterKt.collectFlow; import android.app.PendingIntent; import android.net.Uri; import android.os.Handler; Loading @@ -43,11 +45,17 @@ import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dump.DumpManager; import com.android.systemui.keyguard.KeyguardSliceProvider; import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.power.domain.interactor.PowerInteractor; import com.android.systemui.power.shared.model.ScreenPowerState; import com.android.systemui.settings.DisplayTracker; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.util.ViewController; import kotlin.coroutines.CoroutineContext; import kotlin.coroutines.EmptyCoroutineContext; import java.io.PrintWriter; import java.util.List; import java.util.Map; Loading @@ -71,6 +79,8 @@ public class KeyguardSliceViewController extends ViewController<KeyguardSliceVie private Uri mKeyguardSliceUri; private Slice mSlice; private Map<View, PendingIntent> mClickActions; private KeyguardInteractor mKeyguardInteractor; private PowerInteractor mPowerInteractor; ConfigurationController.ConfigurationListener mConfigurationListener = new ConfigurationController.ConfigurationListener() { Loading Loading @@ -110,7 +120,9 @@ public class KeyguardSliceViewController extends ViewController<KeyguardSliceVie ActivityStarter activityStarter, ConfigurationController configurationController, DumpManager dumpManager, DisplayTracker displayTracker) { DisplayTracker displayTracker, KeyguardInteractor keyguardInteractor, PowerInteractor powerInteractor) { super(keyguardSliceView); mHandler = handler; mBgHandler = bgHandler; Loading @@ -118,6 +130,28 @@ public class KeyguardSliceViewController extends ViewController<KeyguardSliceVie mConfigurationController = configurationController; mDumpManager = dumpManager; mDisplayTracker = displayTracker; mKeyguardInteractor = keyguardInteractor; mPowerInteractor = powerInteractor; } @Override public void onInit() { setupUri(null); startCoroutines(EmptyCoroutineContext.INSTANCE); } void startCoroutines(CoroutineContext context) { collectFlow(mView, mKeyguardInteractor.getDozeTimeTick(), (Long millis) -> { refresh(); }, context); collectFlow(mView, mPowerInteractor.getScreenPowerState(), (ScreenPowerState powerState) -> { if (powerState == ScreenPowerState.SCREEN_TURNING_ON) { refresh(); } }, context); } @Override Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt +5 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,7 @@ object KeyguardRootViewBinder { viewModel.alpha(viewState).collect { alpha -> view.alpha = alpha childViews[burnInLayerId]?.alpha = alpha childViews[sliceViewId]?.alpha = alpha } } Loading @@ -186,6 +187,7 @@ object KeyguardRootViewBinder { // need to add translation to it here same as translationX viewModel.translationY.collect { y -> childViews[burnInLayerId]?.translationY = y childViews[sliceViewId]?.translationY = y childViews[largeClockId]?.translationY = y if (com.android.systemui.shared.Flags.clockReactiveSmartspaceLayout()) { childViews[largeClockDateId]?.translationY = y Loading @@ -202,6 +204,7 @@ object KeyguardRootViewBinder { state.isToOrFrom(KeyguardState.AOD) -> { // Large Clock is not translated in the x direction childViews[burnInLayerId]?.translationX = px childViews[sliceViewId]?.translationX = px childViews[aodPromotedNotificationId]?.translationX = px childViews[aodNotificationIconContainerId]?.translationX = px } Loading Loading @@ -259,6 +262,7 @@ object KeyguardRootViewBinder { launch { viewModel.burnInLayerVisibility.collect { visibility -> childViews[burnInLayerId]?.visibility = visibility childViews[sliceViewId]?.visibility = visibility } } Loading Loading @@ -579,6 +583,7 @@ object KeyguardRootViewBinder { } private val burnInLayerId = R.id.burn_in_layer private val sliceViewId = R.id.keyguard_slice_view private val aodPromotedNotificationId = AodPromotedNotificationSection.viewId private val aodNotificationIconContainerId = R.id.aod_notification_icon_container private val largeClockId = customR.id.lockscreen_clock_view_large Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/ClockSection.kt +3 −1 Original line number Diff line number Diff line Loading @@ -206,10 +206,12 @@ constructor( if (com.android.systemui.shared.Flags.clockReactiveSmartspaceLayout()) { keyguardClockViewModel.getLargeClockTopMargin() + getDimen(ENHANCED_SMARTSPACE_HEIGHT) } else { } else if (smartspaceViewModel.isSmartspaceEnabled) { keyguardClockViewModel.getLargeClockTopMargin() + getDimen(DATE_WEATHER_VIEW_HEIGHT) + getDimen(ENHANCED_SMARTSPACE_HEIGHT) } else { keyguardClockViewModel.getLargeClockTopMargin() } connect( customR.id.lockscreen_clock_view_large, Loading Loading
packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardSliceViewControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ public class KeyguardSliceViewControllerTest extends SysuiTestCase { when(mView.getContext()).thenReturn(mContext); mController = new KeyguardSliceViewController(mHandler, mBgHandler, mView, mActivityStarter, mConfigurationController, mDumpManager, mDisplayTracker); mDisplayTracker, null, null); mController.setupUri(KeyguardSliceProvider.KEYGUARD_SLICE_URI); } Loading
packages/SystemUI/res/values-uk/cm_strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -56,4 +56,6 @@ <string name="vpn_credentials_username">Користувацьке ім\'я</string> <string name="vpn_credentials_password">Пароль</string> <string name="vpn_credentials_dialog_connect">З\'єднатись</string> <string name="screenshot_delete_label">Видалити</string> <string name="screenshot_delete_description">Видалити знімок екрана</string> </resources>
packages/SystemUI/src/com/android/keyguard/KeyguardSliceViewController.java +35 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.keyguard; import static android.app.slice.Slice.HINT_LIST_ITEM; import static com.android.systemui.util.kotlin.JavaAdapterKt.collectFlow; import android.app.PendingIntent; import android.net.Uri; import android.os.Handler; Loading @@ -43,11 +45,17 @@ import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dump.DumpManager; import com.android.systemui.keyguard.KeyguardSliceProvider; import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.power.domain.interactor.PowerInteractor; import com.android.systemui.power.shared.model.ScreenPowerState; import com.android.systemui.settings.DisplayTracker; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.util.ViewController; import kotlin.coroutines.CoroutineContext; import kotlin.coroutines.EmptyCoroutineContext; import java.io.PrintWriter; import java.util.List; import java.util.Map; Loading @@ -71,6 +79,8 @@ public class KeyguardSliceViewController extends ViewController<KeyguardSliceVie private Uri mKeyguardSliceUri; private Slice mSlice; private Map<View, PendingIntent> mClickActions; private KeyguardInteractor mKeyguardInteractor; private PowerInteractor mPowerInteractor; ConfigurationController.ConfigurationListener mConfigurationListener = new ConfigurationController.ConfigurationListener() { Loading Loading @@ -110,7 +120,9 @@ public class KeyguardSliceViewController extends ViewController<KeyguardSliceVie ActivityStarter activityStarter, ConfigurationController configurationController, DumpManager dumpManager, DisplayTracker displayTracker) { DisplayTracker displayTracker, KeyguardInteractor keyguardInteractor, PowerInteractor powerInteractor) { super(keyguardSliceView); mHandler = handler; mBgHandler = bgHandler; Loading @@ -118,6 +130,28 @@ public class KeyguardSliceViewController extends ViewController<KeyguardSliceVie mConfigurationController = configurationController; mDumpManager = dumpManager; mDisplayTracker = displayTracker; mKeyguardInteractor = keyguardInteractor; mPowerInteractor = powerInteractor; } @Override public void onInit() { setupUri(null); startCoroutines(EmptyCoroutineContext.INSTANCE); } void startCoroutines(CoroutineContext context) { collectFlow(mView, mKeyguardInteractor.getDozeTimeTick(), (Long millis) -> { refresh(); }, context); collectFlow(mView, mPowerInteractor.getScreenPowerState(), (ScreenPowerState powerState) -> { if (powerState == ScreenPowerState.SCREEN_TURNING_ON) { refresh(); } }, context); } @Override Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt +5 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,7 @@ object KeyguardRootViewBinder { viewModel.alpha(viewState).collect { alpha -> view.alpha = alpha childViews[burnInLayerId]?.alpha = alpha childViews[sliceViewId]?.alpha = alpha } } Loading @@ -186,6 +187,7 @@ object KeyguardRootViewBinder { // need to add translation to it here same as translationX viewModel.translationY.collect { y -> childViews[burnInLayerId]?.translationY = y childViews[sliceViewId]?.translationY = y childViews[largeClockId]?.translationY = y if (com.android.systemui.shared.Flags.clockReactiveSmartspaceLayout()) { childViews[largeClockDateId]?.translationY = y Loading @@ -202,6 +204,7 @@ object KeyguardRootViewBinder { state.isToOrFrom(KeyguardState.AOD) -> { // Large Clock is not translated in the x direction childViews[burnInLayerId]?.translationX = px childViews[sliceViewId]?.translationX = px childViews[aodPromotedNotificationId]?.translationX = px childViews[aodNotificationIconContainerId]?.translationX = px } Loading Loading @@ -259,6 +262,7 @@ object KeyguardRootViewBinder { launch { viewModel.burnInLayerVisibility.collect { visibility -> childViews[burnInLayerId]?.visibility = visibility childViews[sliceViewId]?.visibility = visibility } } Loading Loading @@ -579,6 +583,7 @@ object KeyguardRootViewBinder { } private val burnInLayerId = R.id.burn_in_layer private val sliceViewId = R.id.keyguard_slice_view private val aodPromotedNotificationId = AodPromotedNotificationSection.viewId private val aodNotificationIconContainerId = R.id.aod_notification_icon_container private val largeClockId = customR.id.lockscreen_clock_view_large Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/ClockSection.kt +3 −1 Original line number Diff line number Diff line Loading @@ -206,10 +206,12 @@ constructor( if (com.android.systemui.shared.Flags.clockReactiveSmartspaceLayout()) { keyguardClockViewModel.getLargeClockTopMargin() + getDimen(ENHANCED_SMARTSPACE_HEIGHT) } else { } else if (smartspaceViewModel.isSmartspaceEnabled) { keyguardClockViewModel.getLargeClockTopMargin() + getDimen(DATE_WEATHER_VIEW_HEIGHT) + getDimen(ENHANCED_SMARTSPACE_HEIGHT) } else { keyguardClockViewModel.getLargeClockTopMargin() } connect( customR.id.lockscreen_clock_view_large, Loading