Loading packages/SystemUI/res-keyguard/values-sw600dp-land/integers.xml 0 → 100644 +20 −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> <!-- Invisibility to use for the date & weather view when it is disabled by a clock --> <integer name="keyguard_date_weather_view_invisibility">8</integer> </resources> packages/SystemUI/res-keyguard/values/integers.xml +3 −0 Original line number Diff line number Diff line Loading @@ -27,4 +27,7 @@ 0x50 = bottom, 0x01 = center_horizontal --> <integer name="keyguard_host_view_one_handed_gravity">0x51</integer> <!-- Invisibility to use for the date & weather view when it is disabled by a clock --> <integer name="keyguard_date_weather_view_invisibility">4</integer> </resources> packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +9 −2 Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS private int mKeyguardSmallClockTopMargin = 0; private int mKeyguardLargeClockTopMargin = 0; private int mKeyguardDateWeatherViewInvisibility = View.INVISIBLE; private final ClockRegistry.ClockChangeListener mClockChangedListener; private ViewGroup mStatusArea; Loading Loading @@ -201,6 +202,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mView.getResources().getDimensionPixelSize(R.dimen.keyguard_clock_top_margin); mKeyguardLargeClockTopMargin = mView.getResources().getDimensionPixelSize(R.dimen.keyguard_large_clock_top_margin); mKeyguardDateWeatherViewInvisibility = mView.getResources().getInteger(R.integer.keyguard_date_weather_view_invisibility); if (mOnlyClock) { View ksv = mView.findViewById(R.id.keyguard_slice_view); Loading Loading @@ -335,7 +338,10 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mView.getResources().getDimensionPixelSize(R.dimen.keyguard_clock_top_margin); mKeyguardLargeClockTopMargin = mView.getResources().getDimensionPixelSize(R.dimen.keyguard_large_clock_top_margin); mKeyguardDateWeatherViewInvisibility = mView.getResources().getInteger(R.integer.keyguard_date_weather_view_invisibility); mView.updateClockTargetRegions(); setDateWeatherVisibility(); } Loading Loading @@ -497,8 +503,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS private void setDateWeatherVisibility() { if (mDateWeatherView != null) { mUiExecutor.execute(() -> { mDateWeatherView.setVisibility( clockHasCustomWeatherDataDisplay() ? View.INVISIBLE : View.VISIBLE); mDateWeatherView.setVisibility(clockHasCustomWeatherDataDisplay() ? mKeyguardDateWeatherViewInvisibility : View.VISIBLE); }); } } Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,8 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { .thenReturn(100); when(mResources.getDimensionPixelSize(R.dimen.keyguard_large_clock_top_margin)) .thenReturn(-200); when(mResources.getInteger(R.integer.keyguard_date_weather_view_invisibility)) .thenReturn(View.INVISIBLE); when(mView.findViewById(R.id.lockscreen_clock_view_large)).thenReturn(mLargeClockFrame); when(mView.findViewById(R.id.lockscreen_clock_view)).thenReturn(mSmallClockFrame); Loading Loading
packages/SystemUI/res-keyguard/values-sw600dp-land/integers.xml 0 → 100644 +20 −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> <!-- Invisibility to use for the date & weather view when it is disabled by a clock --> <integer name="keyguard_date_weather_view_invisibility">8</integer> </resources>
packages/SystemUI/res-keyguard/values/integers.xml +3 −0 Original line number Diff line number Diff line Loading @@ -27,4 +27,7 @@ 0x50 = bottom, 0x01 = center_horizontal --> <integer name="keyguard_host_view_one_handed_gravity">0x51</integer> <!-- Invisibility to use for the date & weather view when it is disabled by a clock --> <integer name="keyguard_date_weather_view_invisibility">4</integer> </resources>
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +9 −2 Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS private int mKeyguardSmallClockTopMargin = 0; private int mKeyguardLargeClockTopMargin = 0; private int mKeyguardDateWeatherViewInvisibility = View.INVISIBLE; private final ClockRegistry.ClockChangeListener mClockChangedListener; private ViewGroup mStatusArea; Loading Loading @@ -201,6 +202,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mView.getResources().getDimensionPixelSize(R.dimen.keyguard_clock_top_margin); mKeyguardLargeClockTopMargin = mView.getResources().getDimensionPixelSize(R.dimen.keyguard_large_clock_top_margin); mKeyguardDateWeatherViewInvisibility = mView.getResources().getInteger(R.integer.keyguard_date_weather_view_invisibility); if (mOnlyClock) { View ksv = mView.findViewById(R.id.keyguard_slice_view); Loading Loading @@ -335,7 +338,10 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mView.getResources().getDimensionPixelSize(R.dimen.keyguard_clock_top_margin); mKeyguardLargeClockTopMargin = mView.getResources().getDimensionPixelSize(R.dimen.keyguard_large_clock_top_margin); mKeyguardDateWeatherViewInvisibility = mView.getResources().getInteger(R.integer.keyguard_date_weather_view_invisibility); mView.updateClockTargetRegions(); setDateWeatherVisibility(); } Loading Loading @@ -497,8 +503,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS private void setDateWeatherVisibility() { if (mDateWeatherView != null) { mUiExecutor.execute(() -> { mDateWeatherView.setVisibility( clockHasCustomWeatherDataDisplay() ? View.INVISIBLE : View.VISIBLE); mDateWeatherView.setVisibility(clockHasCustomWeatherDataDisplay() ? mKeyguardDateWeatherViewInvisibility : View.VISIBLE); }); } } Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,8 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { .thenReturn(100); when(mResources.getDimensionPixelSize(R.dimen.keyguard_large_clock_top_margin)) .thenReturn(-200); when(mResources.getInteger(R.integer.keyguard_date_weather_view_invisibility)) .thenReturn(View.INVISIBLE); when(mView.findViewById(R.id.lockscreen_clock_view_large)).thenReturn(mLargeClockFrame); when(mView.findViewById(R.id.lockscreen_clock_view)).thenReturn(mSmallClockFrame); Loading