Loading packages/SystemUI/res-keyguard/layout/keyguard_bouncer.xml +0 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ android:clipToPadding="false"> <include style="@style/BouncerSecurityContainer" layout="@layout/keyguard_host_view" android:layout_width="match_parent" android:layout_height="wrap_content" /> Loading packages/SystemUI/res-keyguard/values-sw600dp/styles.xml→packages/SystemUI/res-keyguard/values-sw600dp/integers.xml +9 −7 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2014 The Android Open Source Project ~ Copyright (C) 2021 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 @@ -11,11 +12,12 @@ ~ 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 ~ limitations under the License. --> <resources> <style name="BouncerSecurityContainer"> <item name="android:layout_gravity">center</item> </style> <!-- This needs to be specified in an integer, rather than a style, as it can change in response to device config changes, and we need to be able to change it without re-inflation. 0x11 = center --> <integer name="keyguard_host_view_gravity">0x11</integer> </resources> packages/SystemUI/res-keyguard/values/integers.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2021 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> <!-- This needs to be specified in an integer, rather than a style, as it can change in response to device config changes, and we need to be able to change it without re-inflation. 0x50 = bottom, 0x01 = center_horizontal --> <integer name="keyguard_host_view_gravity">0x51</integer> </resources> packages/SystemUI/res-keyguard/values/styles.xml +0 −4 Original line number Diff line number Diff line Loading @@ -100,10 +100,6 @@ <item name="android:shadowRadius">?attr/shadowRadius</item> </style> <style name="BouncerSecurityContainer"> <item name="android:layout_gravity">center_horizontal|bottom</item> </style> <style name="PasswordTheme" parent="Theme.SystemUI"> <item name="android:textColor">?android:attr/textColorPrimary</item> <item name="android:colorControlNormal">?android:attr/textColorPrimary</item> Loading packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java +21 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.view.KeyEvent; import android.view.View; import android.view.View.OnKeyListener; import android.view.ViewTreeObserver; import android.widget.FrameLayout; import com.android.keyguard.KeyguardSecurityContainer.SecurityCallback; import com.android.keyguard.KeyguardSecurityModel.SecurityMode; Loading Loading @@ -180,6 +181,7 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView> /** Initialize the Controller. */ public void onInit() { mKeyguardSecurityContainerController.init(); updateResources(); } @Override Loading Loading @@ -467,5 +469,23 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView> mSecurityCallback.finish(strongAuth, currentUser); } /** * Apply keyguard configuration from the currently active resources. This can be called when the * device configuration changes, to re-apply some resources that are qualified on the device * configuration. */ public void updateResources() { int gravity = mView.getResources().getInteger(R.integer.keyguard_host_view_gravity); // Android SysUI uses a FrameLayout as the top-level, but Auto uses RelativeLayout. // We're just changing the gravity here though (which can't be applied to RelativeLayout), // so only attempt the update if mView is inside a FrameLayout. if (mView.getLayoutParams() instanceof FrameLayout.LayoutParams) { FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mView.getLayoutParams(); if (lp.gravity != gravity) { lp.gravity = gravity; mView.setLayoutParams(lp); } } } } Loading
packages/SystemUI/res-keyguard/layout/keyguard_bouncer.xml +0 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ android:clipToPadding="false"> <include style="@style/BouncerSecurityContainer" layout="@layout/keyguard_host_view" android:layout_width="match_parent" android:layout_height="wrap_content" /> Loading
packages/SystemUI/res-keyguard/values-sw600dp/styles.xml→packages/SystemUI/res-keyguard/values-sw600dp/integers.xml +9 −7 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2014 The Android Open Source Project ~ Copyright (C) 2021 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 @@ -11,11 +12,12 @@ ~ 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 ~ limitations under the License. --> <resources> <style name="BouncerSecurityContainer"> <item name="android:layout_gravity">center</item> </style> <!-- This needs to be specified in an integer, rather than a style, as it can change in response to device config changes, and we need to be able to change it without re-inflation. 0x11 = center --> <integer name="keyguard_host_view_gravity">0x11</integer> </resources>
packages/SystemUI/res-keyguard/values/integers.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2021 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> <!-- This needs to be specified in an integer, rather than a style, as it can change in response to device config changes, and we need to be able to change it without re-inflation. 0x50 = bottom, 0x01 = center_horizontal --> <integer name="keyguard_host_view_gravity">0x51</integer> </resources>
packages/SystemUI/res-keyguard/values/styles.xml +0 −4 Original line number Diff line number Diff line Loading @@ -100,10 +100,6 @@ <item name="android:shadowRadius">?attr/shadowRadius</item> </style> <style name="BouncerSecurityContainer"> <item name="android:layout_gravity">center_horizontal|bottom</item> </style> <style name="PasswordTheme" parent="Theme.SystemUI"> <item name="android:textColor">?android:attr/textColorPrimary</item> <item name="android:colorControlNormal">?android:attr/textColorPrimary</item> Loading
packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java +21 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.view.KeyEvent; import android.view.View; import android.view.View.OnKeyListener; import android.view.ViewTreeObserver; import android.widget.FrameLayout; import com.android.keyguard.KeyguardSecurityContainer.SecurityCallback; import com.android.keyguard.KeyguardSecurityModel.SecurityMode; Loading Loading @@ -180,6 +181,7 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView> /** Initialize the Controller. */ public void onInit() { mKeyguardSecurityContainerController.init(); updateResources(); } @Override Loading Loading @@ -467,5 +469,23 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView> mSecurityCallback.finish(strongAuth, currentUser); } /** * Apply keyguard configuration from the currently active resources. This can be called when the * device configuration changes, to re-apply some resources that are qualified on the device * configuration. */ public void updateResources() { int gravity = mView.getResources().getInteger(R.integer.keyguard_host_view_gravity); // Android SysUI uses a FrameLayout as the top-level, but Auto uses RelativeLayout. // We're just changing the gravity here though (which can't be applied to RelativeLayout), // so only attempt the update if mView is inside a FrameLayout. if (mView.getLayoutParams() instanceof FrameLayout.LayoutParams) { FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mView.getLayoutParams(); if (lp.gravity != gravity) { lp.gravity = gravity; mView.setLayoutParams(lp); } } } }