Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardBlueprintInteractorTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() { testScope.runTest { val blueprintId by collectLastValue(underTest.blueprintId) kosmos.shadeRepository.setShadeLayoutWide(true) clockRepository.setCurrentClock(clockController) configurationRepository.onConfigurationChange() runCurrent() Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/view/layout/sections/SmartspaceSectionTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ class SmartspaceSectionTest : SysuiTestCase() { private val clockShouldBeCentered = MutableStateFlow(false) private val hasCustomWeatherDataDisplay = MutableStateFlow(false) private val shouldDateWeatherBeBelowSmallClock = MutableStateFlow(true) private val isWeatherVisibleFlow = MutableStateFlow(false) private val isShadeLayoutWide = MutableStateFlow(false) Loading @@ -95,6 +96,8 @@ class SmartspaceSectionTest : SysuiTestCase() { .thenReturn(dateView) whenever(keyguardClockViewModel.hasCustomWeatherDataDisplay) .thenReturn(hasCustomWeatherDataDisplay) whenever(keyguardClockViewModel.shouldDateWeatherBeBelowSmallClock) .thenReturn(shouldDateWeatherBeBelowSmallClock) whenever(keyguardClockViewModel.clockShouldBeCentered).thenReturn(clockShouldBeCentered) whenever(keyguardSmartspaceViewModel.isSmartspaceEnabled).thenReturn(true) whenever(keyguardSmartspaceViewModel.isWeatherVisible).thenReturn(isWeatherVisibleFlow) Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardClockViewModelTest.kt +115 −0 Original line number Diff line number Diff line Loading @@ -16,9 +16,13 @@ package com.android.systemui.keyguard.ui.viewmodel import android.content.res.Configuration import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.platform.test.flag.junit.FlagsParameterization import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.ui.data.repository.fakeConfigurationRepository import com.android.systemui.coroutines.collectLastValue import com.android.systemui.flags.DisableSceneContainer import com.android.systemui.flags.EnableSceneContainer Loading Loading @@ -64,6 +68,8 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() @Mock private lateinit var largeClock: ClockFaceController @Mock private lateinit var smallClock: ClockFaceController @Mock private lateinit var mockConfiguration: Configuration private var config = ClockConfig("TEST", "Test", "") private var faceConfig = ClockFaceConfig() Loading @@ -80,6 +86,7 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() whenever(clockController.config).thenAnswer { config } whenever(largeClock.config).thenAnswer { faceConfig } whenever(smallClock.config).thenAnswer { faceConfig } kosmos.fakeConfigurationRepository.onConfigurationChange(mockConfiguration) } @Test Loading Loading @@ -268,6 +275,114 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() assertThat(underTest.getSmallClockTopMargin()).isEqualTo(expected) } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_smartspacelayoutflag_off_true() = testScope.runTest { val result by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result).isTrue() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_defaultFontAndDisplaySize_shadeLayoutNotWide_false() = testScope.runTest { kosmos.shadeRepository.setShadeLayoutWide(false) val fontScale = 1.0f val screenWidthDp = 347 mockConfiguration.fontScale = fontScale mockConfiguration.screenWidthDp = screenWidthDp val result by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result).isFalse() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_variousFontAndDisplaySize_shadeLayoutNotWide_false() = testScope.runTest { kosmos.shadeRepository.setShadeLayoutWide(false) mockConfiguration.fontScale = 1.0f mockConfiguration.screenWidthDp = 347 val result1 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result1).isFalse() mockConfiguration.fontScale = 1.2f mockConfiguration.screenWidthDp = 347 val result2 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result2).isFalse() mockConfiguration.fontScale = 1.7f mockConfiguration.screenWidthDp = 412 val result3 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result3).isFalse() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_variousFontAndDisplaySize_shadeLayoutWide_false() = testScope.runTest { kosmos.shadeRepository.setShadeLayoutWide(true) mockConfiguration.fontScale = 1.0f mockConfiguration.screenWidthDp = 694 val result1 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result1).isFalse() mockConfiguration.fontScale = 1.2f mockConfiguration.screenWidthDp = 694 val result2 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result2).isFalse() mockConfiguration.fontScale = 1.7f mockConfiguration.screenWidthDp = 824 val result3 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result3).isFalse() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_variousFontAndDisplaySize_shadeLayoutNotWide_true() = testScope.runTest { kosmos.shadeRepository.setShadeLayoutWide(false) mockConfiguration.fontScale = 1.0f mockConfiguration.screenWidthDp = 310 val result1 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result1).isTrue() mockConfiguration.fontScale = 1.5f mockConfiguration.screenWidthDp = 347 val result2 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result2).isTrue() mockConfiguration.fontScale = 2.0f mockConfiguration.screenWidthDp = 411 val result3 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result3).isTrue() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_variousFontAndDisplaySize_shadeLayoutWide_true() = testScope.runTest { kosmos.shadeRepository.setShadeLayoutWide(true) mockConfiguration.fontScale = 1.0f mockConfiguration.screenWidthDp = 620 val result1 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result1).isTrue() mockConfiguration.fontScale = 1.5f mockConfiguration.screenWidthDp = 694 val result2 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result2).isTrue() mockConfiguration.fontScale = 2.0f mockConfiguration.screenWidthDp = 822 val result3 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result3).isTrue() } companion object { private const val KEYGUARD_STATUS_BAR_HEIGHT = 20 Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardSmartspaceViewModelTest.kt +0 −71 Original line number Diff line number Diff line Loading @@ -16,9 +16,6 @@ package com.android.systemui.keyguard.ui.viewmodel import android.content.res.Configuration import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase Loading Loading @@ -47,7 +44,6 @@ class KeyguardSmartspaceViewModelTest : SysuiTestCase() { val kosmos = testKosmos() val testScope = kosmos.testScope val underTest = kosmos.keyguardSmartspaceViewModel @Mock private lateinit var mockConfiguration: Configuration @Mock(answer = Answers.RETURNS_DEEP_STUBS) private lateinit var clockController: ClockController Loading Loading @@ -122,71 +118,4 @@ class KeyguardSmartspaceViewModelTest : SysuiTestCase() { assertThat(isShadeLayoutWide).isFalse() } } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_smartspacelayoutflag_off_true() { val result = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result).isTrue() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_defaultFontAndDisplaySize_false() { val fontScale = 1.0f val screenWidthDp = 347 mockConfiguration.fontScale = fontScale mockConfiguration.screenWidthDp = screenWidthDp val result = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result).isFalse() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_variousFontAndDisplaySize_false() { mockConfiguration.fontScale = 1.0f mockConfiguration.screenWidthDp = 347 val result1 = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result1).isFalse() mockConfiguration.fontScale = 1.2f mockConfiguration.screenWidthDp = 347 val result2 = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result2).isFalse() mockConfiguration.fontScale = 1.7f mockConfiguration.screenWidthDp = 412 val result3 = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result3).isFalse() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_variousFontAndDisplaySize_true() { mockConfiguration.fontScale = 1.0f mockConfiguration.screenWidthDp = 310 val result1 = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result1).isTrue() mockConfiguration.fontScale = 1.5f mockConfiguration.screenWidthDp = 347 val result2 = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result2).isTrue() mockConfiguration.fontScale = 2.0f mockConfiguration.screenWidthDp = 411 val result3 = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result3).isTrue() } } packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSmartspaceViewBinder.kt +3 −1 Original line number Diff line number Diff line Loading @@ -143,7 +143,9 @@ object KeyguardSmartspaceViewBinder { view.top = (clockBounds.bottom + yBuffer + offset).toInt() view.bottom = view.top + viewHeight } } else if (!clockViewModel.dateWeatherBelowSmallClock()) { } else if ( !clockViewModel.shouldDateWeatherBeBelowSmallClock.value ) { keyguardRootView.findViewById<View>(smallViewId)?.let { view -> val viewWidth = view.width if (view.isLayoutRtl()) { Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardBlueprintInteractorTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() { testScope.runTest { val blueprintId by collectLastValue(underTest.blueprintId) kosmos.shadeRepository.setShadeLayoutWide(true) clockRepository.setCurrentClock(clockController) configurationRepository.onConfigurationChange() runCurrent() Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/view/layout/sections/SmartspaceSectionTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ class SmartspaceSectionTest : SysuiTestCase() { private val clockShouldBeCentered = MutableStateFlow(false) private val hasCustomWeatherDataDisplay = MutableStateFlow(false) private val shouldDateWeatherBeBelowSmallClock = MutableStateFlow(true) private val isWeatherVisibleFlow = MutableStateFlow(false) private val isShadeLayoutWide = MutableStateFlow(false) Loading @@ -95,6 +96,8 @@ class SmartspaceSectionTest : SysuiTestCase() { .thenReturn(dateView) whenever(keyguardClockViewModel.hasCustomWeatherDataDisplay) .thenReturn(hasCustomWeatherDataDisplay) whenever(keyguardClockViewModel.shouldDateWeatherBeBelowSmallClock) .thenReturn(shouldDateWeatherBeBelowSmallClock) whenever(keyguardClockViewModel.clockShouldBeCentered).thenReturn(clockShouldBeCentered) whenever(keyguardSmartspaceViewModel.isSmartspaceEnabled).thenReturn(true) whenever(keyguardSmartspaceViewModel.isWeatherVisible).thenReturn(isWeatherVisibleFlow) Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardClockViewModelTest.kt +115 −0 Original line number Diff line number Diff line Loading @@ -16,9 +16,13 @@ package com.android.systemui.keyguard.ui.viewmodel import android.content.res.Configuration import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.platform.test.flag.junit.FlagsParameterization import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.ui.data.repository.fakeConfigurationRepository import com.android.systemui.coroutines.collectLastValue import com.android.systemui.flags.DisableSceneContainer import com.android.systemui.flags.EnableSceneContainer Loading Loading @@ -64,6 +68,8 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() @Mock private lateinit var largeClock: ClockFaceController @Mock private lateinit var smallClock: ClockFaceController @Mock private lateinit var mockConfiguration: Configuration private var config = ClockConfig("TEST", "Test", "") private var faceConfig = ClockFaceConfig() Loading @@ -80,6 +86,7 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() whenever(clockController.config).thenAnswer { config } whenever(largeClock.config).thenAnswer { faceConfig } whenever(smallClock.config).thenAnswer { faceConfig } kosmos.fakeConfigurationRepository.onConfigurationChange(mockConfiguration) } @Test Loading Loading @@ -268,6 +275,114 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() assertThat(underTest.getSmallClockTopMargin()).isEqualTo(expected) } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_smartspacelayoutflag_off_true() = testScope.runTest { val result by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result).isTrue() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_defaultFontAndDisplaySize_shadeLayoutNotWide_false() = testScope.runTest { kosmos.shadeRepository.setShadeLayoutWide(false) val fontScale = 1.0f val screenWidthDp = 347 mockConfiguration.fontScale = fontScale mockConfiguration.screenWidthDp = screenWidthDp val result by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result).isFalse() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_variousFontAndDisplaySize_shadeLayoutNotWide_false() = testScope.runTest { kosmos.shadeRepository.setShadeLayoutWide(false) mockConfiguration.fontScale = 1.0f mockConfiguration.screenWidthDp = 347 val result1 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result1).isFalse() mockConfiguration.fontScale = 1.2f mockConfiguration.screenWidthDp = 347 val result2 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result2).isFalse() mockConfiguration.fontScale = 1.7f mockConfiguration.screenWidthDp = 412 val result3 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result3).isFalse() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_variousFontAndDisplaySize_shadeLayoutWide_false() = testScope.runTest { kosmos.shadeRepository.setShadeLayoutWide(true) mockConfiguration.fontScale = 1.0f mockConfiguration.screenWidthDp = 694 val result1 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result1).isFalse() mockConfiguration.fontScale = 1.2f mockConfiguration.screenWidthDp = 694 val result2 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result2).isFalse() mockConfiguration.fontScale = 1.7f mockConfiguration.screenWidthDp = 824 val result3 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result3).isFalse() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_variousFontAndDisplaySize_shadeLayoutNotWide_true() = testScope.runTest { kosmos.shadeRepository.setShadeLayoutWide(false) mockConfiguration.fontScale = 1.0f mockConfiguration.screenWidthDp = 310 val result1 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result1).isTrue() mockConfiguration.fontScale = 1.5f mockConfiguration.screenWidthDp = 347 val result2 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result2).isTrue() mockConfiguration.fontScale = 2.0f mockConfiguration.screenWidthDp = 411 val result3 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result3).isTrue() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_variousFontAndDisplaySize_shadeLayoutWide_true() = testScope.runTest { kosmos.shadeRepository.setShadeLayoutWide(true) mockConfiguration.fontScale = 1.0f mockConfiguration.screenWidthDp = 620 val result1 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result1).isTrue() mockConfiguration.fontScale = 1.5f mockConfiguration.screenWidthDp = 694 val result2 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result2).isTrue() mockConfiguration.fontScale = 2.0f mockConfiguration.screenWidthDp = 822 val result3 by collectLastValue(underTest.shouldDateWeatherBeBelowSmallClock) assertThat(result3).isTrue() } companion object { private const val KEYGUARD_STATUS_BAR_HEIGHT = 20 Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardSmartspaceViewModelTest.kt +0 −71 Original line number Diff line number Diff line Loading @@ -16,9 +16,6 @@ package com.android.systemui.keyguard.ui.viewmodel import android.content.res.Configuration import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase Loading Loading @@ -47,7 +44,6 @@ class KeyguardSmartspaceViewModelTest : SysuiTestCase() { val kosmos = testKosmos() val testScope = kosmos.testScope val underTest = kosmos.keyguardSmartspaceViewModel @Mock private lateinit var mockConfiguration: Configuration @Mock(answer = Answers.RETURNS_DEEP_STUBS) private lateinit var clockController: ClockController Loading Loading @@ -122,71 +118,4 @@ class KeyguardSmartspaceViewModelTest : SysuiTestCase() { assertThat(isShadeLayoutWide).isFalse() } } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_smartspacelayoutflag_off_true() { val result = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result).isTrue() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_defaultFontAndDisplaySize_false() { val fontScale = 1.0f val screenWidthDp = 347 mockConfiguration.fontScale = fontScale mockConfiguration.screenWidthDp = screenWidthDp val result = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result).isFalse() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_variousFontAndDisplaySize_false() { mockConfiguration.fontScale = 1.0f mockConfiguration.screenWidthDp = 347 val result1 = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result1).isFalse() mockConfiguration.fontScale = 1.2f mockConfiguration.screenWidthDp = 347 val result2 = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result2).isFalse() mockConfiguration.fontScale = 1.7f mockConfiguration.screenWidthDp = 412 val result3 = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result3).isFalse() } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_SMARTSPACE_LAYOUT) fun dateWeatherBelowSmallClock_variousFontAndDisplaySize_true() { mockConfiguration.fontScale = 1.0f mockConfiguration.screenWidthDp = 310 val result1 = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result1).isTrue() mockConfiguration.fontScale = 1.5f mockConfiguration.screenWidthDp = 347 val result2 = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result2).isTrue() mockConfiguration.fontScale = 2.0f mockConfiguration.screenWidthDp = 411 val result3 = KeyguardSmartspaceViewModel.dateWeatherBelowSmallClock(mockConfiguration, false) assertThat(result3).isTrue() } }
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSmartspaceViewBinder.kt +3 −1 Original line number Diff line number Diff line Loading @@ -143,7 +143,9 @@ object KeyguardSmartspaceViewBinder { view.top = (clockBounds.bottom + yBuffer + offset).toInt() view.bottom = view.top + viewHeight } } else if (!clockViewModel.dateWeatherBelowSmallClock()) { } else if ( !clockViewModel.shouldDateWeatherBeBelowSmallClock.value ) { keyguardRootView.findViewById<View>(smallViewId)?.let { view -> val viewWidth = view.width if (view.isLayoutRtl()) { Loading