Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2259b0e4 authored by BK Choi's avatar BK Choi Committed by Android (Google) Code Review
Browse files

Merge "UX polishing for profile switcher. - Adjust the badge size. - Add badge...

Merge "UX polishing for profile switcher. - Adjust the badge size. - Add badge to 'Add profile' button." into sc-v2-dev
parents 76dcbc6f c58a05d9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 -->
+14 −0
Original line number Diff line number Diff line
@@ -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());