From 2e8db7df9157e5875f933c6e847b58ee20ea457e Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Thu, 23 Feb 2023 12:26:41 -0800 Subject: Make sim pin views more responsive Port over the constraint layout logic from the pin view to the sim pin and sim puk view. I also reduced the sim icon to be a static 40x40 dp and added a top margin to the password text view. Also add some refinements to numpad jank. Firstly, ensure that we set the corner radius correctly upon every layout. Secondly, re-enable auto resize. There was an issue with this api (b/261552438) but this shouldn't be an issue anymore because we are resetting the bouncer view everytime upon show. Fixes: 257213890 Test: open sim pin and sim puk view from foldable device. Instead of adding an esim, which isn't possible on my device, I hard coded the logic for the view to show up. I tested on various orientations and display sizes. Test: open/close bouncer a bunch of times and change orientation a bunch of times on foldable. Change-Id: I56966ea64e03155b05db9e7f5886f14ac127949f --- .../drawable-hdpi/ic_lockscreen_sim.png | Bin 4083 -> 0 bytes .../drawable-mdpi/ic_lockscreen_sim.png | Bin 2602 -> 0 bytes .../drawable-xhdpi/ic_lockscreen_sim.png | Bin 5201 -> 0 bytes .../res-keyguard/drawable/ic_lockscreen_sim.png | Bin 0 -> 4083 bytes .../res-keyguard/layout/keyguard_num_pad_key.xml | 4 +- .../res-keyguard/layout/keyguard_sim_pin_view.xml | 341 ++++++++++----------- .../res-keyguard/layout/keyguard_sim_puk_view.xml | 301 +++++++++--------- .../src/com/android/keyguard/NumPadAnimator.java | 5 +- 8 files changed, 322 insertions(+), 329 deletions(-) delete mode 100644 packages/SystemUI/res-keyguard/drawable-hdpi/ic_lockscreen_sim.png delete mode 100644 packages/SystemUI/res-keyguard/drawable-mdpi/ic_lockscreen_sim.png delete mode 100644 packages/SystemUI/res-keyguard/drawable-xhdpi/ic_lockscreen_sim.png create mode 100644 packages/SystemUI/res-keyguard/drawable/ic_lockscreen_sim.png diff --git a/packages/SystemUI/res-keyguard/drawable-hdpi/ic_lockscreen_sim.png b/packages/SystemUI/res-keyguard/drawable-hdpi/ic_lockscreen_sim.png deleted file mode 100644 index 7cf9e3699ceb..000000000000 Binary files a/packages/SystemUI/res-keyguard/drawable-hdpi/ic_lockscreen_sim.png and /dev/null differ diff --git a/packages/SystemUI/res-keyguard/drawable-mdpi/ic_lockscreen_sim.png b/packages/SystemUI/res-keyguard/drawable-mdpi/ic_lockscreen_sim.png deleted file mode 100644 index 2e259c3e17c1..000000000000 Binary files a/packages/SystemUI/res-keyguard/drawable-mdpi/ic_lockscreen_sim.png and /dev/null differ diff --git a/packages/SystemUI/res-keyguard/drawable-xhdpi/ic_lockscreen_sim.png b/packages/SystemUI/res-keyguard/drawable-xhdpi/ic_lockscreen_sim.png deleted file mode 100644 index f4de96adae30..000000000000 Binary files a/packages/SystemUI/res-keyguard/drawable-xhdpi/ic_lockscreen_sim.png and /dev/null differ diff --git a/packages/SystemUI/res-keyguard/drawable/ic_lockscreen_sim.png b/packages/SystemUI/res-keyguard/drawable/ic_lockscreen_sim.png new file mode 100644 index 000000000000..7cf9e3699ceb Binary files /dev/null and b/packages/SystemUI/res-keyguard/drawable/ic_lockscreen_sim.png differ diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_num_pad_key.xml b/packages/SystemUI/res-keyguard/layout/keyguard_num_pad_key.xml index 411fea5dd22d..48769fdebd99 100644 --- a/packages/SystemUI/res-keyguard/layout/keyguard_num_pad_key.xml +++ b/packages/SystemUI/res-keyguard/layout/keyguard_num_pad_key.xml @@ -14,10 +14,12 @@ ~ limitations under the License --> - + diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_sim_pin_view.xml b/packages/SystemUI/res-keyguard/layout/keyguard_sim_pin_view.xml index 7db0fe908ec0..728d861ab693 100644 --- a/packages/SystemUI/res-keyguard/layout/keyguard_sim_pin_view.xml +++ b/packages/SystemUI/res-keyguard/layout/keyguard_sim_pin_view.xml @@ -1,5 +1,4 @@ - - - + + + - - - - + - - + android:gravity="center_horizontal" + android:paddingTop="@dimen/num_pad_entry_row_margin_bottom" + android:paddingBottom="@dimen/num_pad_entry_row_margin_bottom" + androidprv:layout_constraintBottom_toTopOf="@+id/flow1" + androidprv:layout_constraintEnd_toEndOf="parent" + androidprv:layout_constraintStart_toStartOf="parent" + androidprv:layout_constraintTop_toTopOf="parent"> + + + + + - - - - - - - - - - - - - - - - - - - - + androidprv:scaledTextSize="@integer/scaled_password_text_size" /> - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_sim_puk_view.xml b/packages/SystemUI/res-keyguard/layout/keyguard_sim_puk_view.xml index 422bd4c12e8e..7e24d1231aee 100644 --- a/packages/SystemUI/res-keyguard/layout/keyguard_sim_puk_view.xml +++ b/packages/SystemUI/res-keyguard/layout/keyguard_sim_puk_view.xml @@ -21,6 +21,7 @@ - - - - - + - - - + android:gravity="center_horizontal" + android:paddingTop="@dimen/num_pad_entry_row_margin_bottom" + android:paddingBottom="@dimen/num_pad_entry_row_margin_bottom" + androidprv:layout_constraintBottom_toTopOf="@+id/flow1" + androidprv:layout_constraintEnd_toEndOf="parent" + androidprv:layout_constraintStart_toStartOf="parent" + androidprv:layout_constraintTop_toTopOf="parent"> + + + + - - - - - - - - - - - - - - - - - - - - + androidprv:scaledTextSize="@integer/scaled_password_text_size" /> - + + + + + + + + + + + + + + + + + + + + + + + + + + + +