Merge "Decouple Keyguard user switch font size from QS user switcher."

This commit is contained in:
TreeHugger Robot
2020-02-11 21:26:48 +00:00
committed by Android (Google) Code Review
5 changed files with 62 additions and 6 deletions

View File

@@ -17,7 +17,7 @@
-->
<!-- LinearLayout -->
<com.android.systemui.qs.tiles.UserDetailItemView
<com.android.systemui.statusbar.policy.KeyguardUserDetailItemView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sysui="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
@@ -34,7 +34,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="13dp"
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.UserSwitcher.UserName"
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.UserSwitcher"
/>
<com.android.systemui.statusbar.phone.UserAvatarView android:id="@+id/user_picture"
android:layout_width="@dimen/framed_avatar_size"
@@ -47,4 +47,4 @@
sysui:badgeDiameter="18dp"
sysui:badgeMargin="1dp"
sysui:frameColor="@color/qs_user_detail_avatar_frame" />
</com.android.systemui.qs.tiles.UserDetailItemView>
</com.android.systemui.statusbar.policy.KeyguardUserDetailItemView>

View File

@@ -1228,4 +1228,6 @@
<!-- Screen Record -->
<dimen name="screenrecord_dialog_padding">18dp</dimen>
<dimen name="screenrecord_logo_size">24dp</dimen>
<dimen name="kg_user_switcher_text_size">16sp</dimen>
</resources>

View File

@@ -129,11 +129,10 @@
parent="TextAppearance.StatusBar.Expanded.AboveDateTime" />
<style name="TextAppearance.StatusBar.Expanded.UserSwitcher">
<item name="android:textSize">16sp</item>
<item name="android:textSize">@dimen/kg_user_switcher_text_size</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">?android:attr/textColorSecondary</item>
</style>
<style name="TextAppearance.StatusBar.Expanded.UserSwitcher.UserName" />
<style name="TextAppearance" />

View File

@@ -128,7 +128,7 @@ public class UserDetailItemView extends LinearLayout {
@Override
protected void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
FontSizeUtils.updateFontSize(mName, R.dimen.qs_detail_item_secondary_text_size);
FontSizeUtils.updateFontSize(mName, getFontSizeDimen());
}
@Override
@@ -146,4 +146,8 @@ public class UserDetailItemView extends LinearLayout {
public boolean hasOverlappingRendering() {
return false;
}
protected int getFontSizeDimen() {
return R.dimen.qs_detail_item_secondary_text_size;
}
}

View File

@@ -0,0 +1,51 @@
/*
* Copyright (C) 2020 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.
*/
package com.android.systemui.statusbar.policy;
import android.content.Context;
import android.util.AttributeSet;
import com.android.systemui.R;
import com.android.systemui.qs.tiles.UserDetailItemView;
/**
* Displays a user on the keyguard user switcher.
*/
public class KeyguardUserDetailItemView extends UserDetailItemView {
public KeyguardUserDetailItemView(Context context) {
this(context, null);
}
public KeyguardUserDetailItemView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public KeyguardUserDetailItemView(Context context, AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}
public KeyguardUserDetailItemView(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
protected int getFontSizeDimen() {
return R.dimen.kg_user_switcher_text_size;
}
}