Merge "Bouncer - Portrait user switcher tweaks" into tm-dev

This commit is contained in:
TreeHugger Robot
2022-03-02 18:36:57 +00:00
committed by Android (Google) Code Review
7 changed files with 15 additions and 6 deletions

View File

@@ -17,10 +17,8 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:paddingMode="stack"
android:paddingStart="24dp"
android:paddingEnd="44dp"
android:paddingLeft="0dp"
android:paddingRight="0dp">
android:paddingStart="0dp"
android:paddingEnd="0dp">
<item>
<shape android:shape="rectangle">
<solid android:color="?androidprv:attr/colorSurface" />

View File

@@ -26,4 +26,6 @@
<!-- The size of PIN text in the PIN unlock method. -->
<integer name="scaled_password_text_size">26</integer>
<dimen name="bouncer_user_switcher_y_trans">@dimen/status_bar_height</dimen>
</resources>

View File

@@ -117,6 +117,8 @@
<dimen name="bouncer_user_switcher_popup_divider_height">4dp</dimen>
<dimen name="bouncer_user_switcher_item_padding_vertical">10dp</dimen>
<dimen name="bouncer_user_switcher_item_padding_horizontal">12dp</dimen>
<dimen name="bouncer_user_switcher_header_padding_end">44dp</dimen>
<dimen name="bouncer_user_switcher_y_trans">0dp</dimen>
<!-- 2 * the margin + size should equal the plus_margin -->
<dimen name="user_switcher_icon_large_margin">16dp</dimen>

View File

@@ -155,6 +155,7 @@
<style name="Bouncer.UserSwitcher.Spinner.Header">
<item name="android:background">@drawable/bouncer_user_switcher_header_bg</item>
<item name="android:textSize">@dimen/bouncer_user_switcher_header_text_size</item>
<item name="android:paddingEnd">@dimen/bouncer_user_switcher_header_padding_end</item>
</style>
<style name="Bouncer.UserSwitcher.Spinner.Item">

View File

@@ -19,4 +19,5 @@
<dimen name="status_view_margin_horizontal">62dp</dimen>
<dimen name="keyguard_clock_top_margin">40dp</dimen>
<dimen name="keyguard_status_view_bottom_margin">40dp</dimen>
<dimen name="bouncer_user_switcher_y_trans">20dp</dimen>
</resources>

View File

@@ -24,4 +24,5 @@
<dimen name="notification_panel_margin_horizontal">120dp</dimen>
<dimen name="keyguard_clock_top_margin">80dp</dimen>
<dimen name="keyguard_status_view_bottom_margin">80dp</dimen>
<dimen name="bouncer_user_switcher_y_trans">90dp</dimen>
</resources>

View File

@@ -973,18 +973,22 @@ public class KeyguardSecurityContainer extends FrameLayout {
@Override
public void updateSecurityViewLocation() {
int yTrans = mResources.getDimensionPixelSize(R.dimen.bouncer_user_switcher_y_trans);
if (mResources.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
updateViewGravity(mViewFlipper, Gravity.CENTER_HORIZONTAL);
updateViewGravity(mUserSwitcherViewGroup, Gravity.CENTER_HORIZONTAL);
mUserSwitcherViewGroup.setTranslationY(0);
mUserSwitcherViewGroup.setTranslationY(yTrans);
mViewFlipper.setTranslationY(-yTrans);
} else {
updateViewGravity(mViewFlipper, Gravity.RIGHT | Gravity.BOTTOM);
updateViewGravity(mUserSwitcherViewGroup, Gravity.LEFT | Gravity.CENTER_VERTICAL);
// Attempt to reposition a bit higher to make up for this frame being a bit lower
// on the device
int yTrans = mResources.getDimensionPixelSize(R.dimen.status_bar_height);
mUserSwitcherViewGroup.setTranslationY(-yTrans);
mViewFlipper.setTranslationY(0);
}
}