Search in sources :

Example 1 with CircleFramedDrawable

use of com.android.settingslib.drawable.CircleFramedDrawable in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SettingsHomepageActivity method getCircularUserIcon.

private Drawable getCircularUserIcon(Context context) {
    Bitmap bitmapUserIcon = mUserManager.getUserIcon(UserHandle.myUserId());
    if (bitmapUserIcon == null) {
        // get default user icon.
        final Drawable defaultUserIcon = UserIcons.getDefaultUserIcon(context.getResources(), UserHandle.myUserId(), false);
        bitmapUserIcon = UserIcons.convertToBitmap(defaultUserIcon);
    }
    Drawable drawableUserIcon = new CircleFramedDrawable(bitmapUserIcon, (int) context.getResources().getDimension(R.dimen.circle_avatar_size));
    return drawableUserIcon;
}
Also used : Bitmap(android.graphics.Bitmap) Drawable(android.graphics.drawable.Drawable) CircleFramedDrawable(com.android.settingslib.drawable.CircleFramedDrawable) BitmapDrawable(android.graphics.drawable.BitmapDrawable) CircleFramedDrawable(com.android.settingslib.drawable.CircleFramedDrawable)

Aggregations

Bitmap (android.graphics.Bitmap)1 BitmapDrawable (android.graphics.drawable.BitmapDrawable)1 Drawable (android.graphics.drawable.Drawable)1 CircleFramedDrawable (com.android.settingslib.drawable.CircleFramedDrawable)1