Minute of Pain #6: Round corners

The history

  1. How we can create telegram-like uploading progress
  2. How we can create a messenger-like image view
  • Well, I needed just to show a single image. And I thought it will be more optimal to make a simple custom ImageView rather than make a FrameLayout inheritor (CardView) with image view inside.
  • I also wanted to have a rounded stroke wrapping the image, and card view, as far as I know, didn’t allow me to do that, so even if I wanted to use it, I needed to make either custom CardView or invent some workaround (foreground for image view for instance, which is supported only from v23 or even a new third view above image view)
  • I already had custom ImageView so it was easy to add clipping to it.

The problem

Why is that? O_o

Solution

Left: GradientDrawable, Right: MaterialShapeDrawable

What’s next

Afterwords

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store