Add user button UX update

Visually align all add user/guest icons between settings and
systemui. Both areas may tint and size the icons slightly
differently. Move shared icons into SettingsLib for consistency.

Fixes: 219078700
Test: visual, use the multiple users settings page
Change-Id: I0543402697a5a5999e805e0943493c688bd94fb4
This commit is contained in:
Matt Pietal
2022-03-04 15:17:33 -05:00
parent 612b7a69dc
commit 544ab08aeb
13 changed files with 14 additions and 13 deletions

View File

@@ -22,7 +22,7 @@
android:viewportHeight="100">
<path
android:fillColor="@color/kg_user_switcher_avatar_background"
android:fillColor="@color/user_avatar_color_bg"
android:pathData="M50,50m-50,0a50,50 0,1 1,100 0a50,50 0,1 1,-100 0"/>
</vector>

View File

@@ -36,7 +36,8 @@
<color name="bt_color_bg_6">#e9d2fd</color> <!-- Material Purple 100 -->
<color name="bt_color_bg_7">#cbf0f8</color> <!-- Material Cyan 100 -->
<color name="dark_mode_icon_color_single_tone">#99000000</color>
<color name="light_mode_icon_color_single_tone">#ffffff</color>
<color name="user_avatar_color_bg">?android:attr/colorBackgroundFloating</color>
</resources>

View File

@@ -18,6 +18,6 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_activated="true"
android:color="@color/kg_user_switcher_avatar_background" />
<item android:color="@color/kg_user_switcher_avatar_background" />
android:color="@color/user_avatar_color_bg" />
<item android:color="@color/user_avatar_color_bg" />
</selector>

View File

@@ -36,7 +36,7 @@
</item>
<!-- Where the user drawable/bitmap will be placed -->
<item
android:drawable="@drawable/kg_bg_avatar"
android:drawable="@drawable/user_avatar_bg"
android:width="@dimen/bouncer_user_switcher_icon_size"
android:height="@dimen/bouncer_user_switcher_icon_size"
android:top="@dimen/user_switcher_icon_large_margin"

View File

@@ -52,7 +52,7 @@
(e.g. cannot be switched to) -->
<color name="kg_user_switcher_restricted_avatar_icon_color">@color/GM2_grey_600</color>
<!-- Color of background circle of user avatars in keyguard user switcher -->
<color name="kg_user_switcher_avatar_background">?android:attr/colorBackgroundFloating</color>
<color name="user_avatar_color_bg">?android:attr/colorBackgroundFloating</color>
<!-- Icon color for user avatars in user switcher quick settings -->
<color name="qs_user_switcher_avatar_icon_color">#3C4043</color>

View File

@@ -918,7 +918,7 @@ public class KeyguardSecurityContainer extends FrameLayout {
}
drawable.setTint(iconColor);
Drawable bg = context.getDrawable(R.drawable.kg_bg_avatar);
Drawable bg = context.getDrawable(R.drawable.user_avatar_bg);
bg.setTintBlendMode(BlendMode.DST);
bg.setTint(Utils.getColorAttrDefaultColor(context,
com.android.internal.R.attr.colorSurfaceVariant));

View File

@@ -267,7 +267,7 @@ public class KeyguardQsUserSwitchController extends ViewController<FrameLayout>
drawable = new CircleFramedDrawable(mCurrentUser.picture, avatarSize);
}
Drawable bg = mContext.getDrawable(R.drawable.kg_bg_avatar);
Drawable bg = mContext.getDrawable(R.drawable.user_avatar_bg);
drawable = new LayerDrawable(new Drawable[]{bg, drawable});
return drawable;
}

View File

@@ -540,7 +540,7 @@ public class KeyguardUserSwitcherController extends ViewController<KeyguardUserS
}
drawable.setTint(mResources.getColor(iconColorRes, mContext.getTheme()));
Drawable bg = mContext.getDrawable(R.drawable.kg_bg_avatar);
Drawable bg = mContext.getDrawable(R.drawable.user_avatar_bg);
drawable = new LayerDrawable(new Drawable[]{bg, drawable});
return drawable;
}

View File

@@ -982,9 +982,9 @@ public class UserSwitcherController implements Dumpable {
protected static Drawable getIconDrawable(Context context, UserRecord item) {
int iconRes;
if (item.isAddUser) {
iconRes = R.drawable.ic_account_circle;
} else if (item.isGuest) {
iconRes = R.drawable.ic_account_circle_filled;
} else if (item.isGuest) {
iconRes = R.drawable.ic_account_circle;
} else if (item.isAddSupervisedUser) {
iconRes = R.drawable.ic_add_supervised_user;
} else {

View File

@@ -80,8 +80,8 @@ public class NotificationUiAdjustmentTest extends SysuiTestCase {
Notification.Action firstAction =
createActionBuilder("same", R.drawable.ic_corp_icon, pendingIntent).build();
Notification.Action secondAction =
createActionBuilder("same", R.drawable.ic_account_circle, pendingIntent)
.build();
createActionBuilder("same", com.android.settingslib.R.drawable.ic_account_circle,
pendingIntent).build();
assertThat(NotificationUiAdjustment.needReinflate(
createUiAdjustmentFromSmartActions("first", Collections.singletonList(firstAction)),