Merge "UX polishing for profile switcher. - Adjust the badge size. - Add badge to 'Add profile' button." into sc-v2-dev
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
-->
|
||||
<resources>
|
||||
<dimen name="car_large_avatar_size">96dp</dimen>
|
||||
<dimen name="car_large_avatar_badge_size">32dp</dimen>
|
||||
<dimen name="car_large_avatar_badge_size">24dp</dimen>
|
||||
<!-- Application Bar -->
|
||||
<dimen name="car_app_bar_height">80dp</dimen>
|
||||
<!-- Margin -->
|
||||
|
||||
@@ -183,6 +183,20 @@ public class UserIconDrawable extends Drawable implements Drawable.Callback {
|
||||
return setBadge(badge);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the managed badge to this user icon if the device has a device owner.
|
||||
*/
|
||||
public UserIconDrawable setBadgeIfManagedDevice(Context context) {
|
||||
Drawable badge = null;
|
||||
boolean deviceOwnerExists = context.getSystemService(DevicePolicyManager.class)
|
||||
.getDeviceOwnerComponentOnAnyUser() != null;
|
||||
if (deviceOwnerExists) {
|
||||
badge = getDrawableForDisplayDensity(
|
||||
context, com.android.internal.R.drawable.ic_corp_badge_case);
|
||||
}
|
||||
return setBadge(badge);
|
||||
}
|
||||
|
||||
public void setBadgeRadius(float radius) {
|
||||
mBadgeRadius = radius;
|
||||
onBoundsChange(getBounds());
|
||||
|
||||
Reference in New Issue
Block a user