diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-06-04 21:27:15 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-06-04 21:27:15 +0200 |
commit | b96e61f904fb54222438a80971d7f031c562d457 (patch) | |
tree | 766fac0ee3ee38b3d67e520acec3ae047c448361 /src/main | |
parent | 23dab500cbecb185be0f361d839a4b8f66114144 (diff) |
use also rounded avatars in widget
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/AvatarService.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/services/AvatarService.java b/src/main/java/de/pixart/messenger/services/AvatarService.java index d734d6f39..06b0e1f5f 100644 --- a/src/main/java/de/pixart/messenger/services/AvatarService.java +++ b/src/main/java/de/pixart/messenger/services/AvatarService.java @@ -8,6 +8,7 @@ import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; +import android.graphics.RectF; import android.graphics.Typeface; import android.net.Uri; import android.support.annotation.Nullable; @@ -120,9 +121,10 @@ public class AvatarService implements OnAdvancedStreamFeaturesLoaded { private void drawAvatar(Bitmap bitmap, Canvas canvas, Paint paint) { final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); + final RectF rectF = new RectF(rect); paint.setAntiAlias(true); canvas.drawARGB(0, 0, 0, 0); - canvas.drawCircle(bitmap.getWidth() / 2, bitmap.getHeight() / 2, bitmap.getWidth() / 2, paint); + canvas.drawRoundRect(rectF, 5, 5, paint); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); canvas.drawBitmap(bitmap, rect, rect, paint); } |