0

I've seen different approaches on how to design a view with rounded corners. However, what if I want to make this kind of view reactive and change the radius of some of its corners at some point? In another words, I would like to be able to modify corner radius of each corner programatically. As an example, I want to be able to make top-left corner of the view rectangular on some event and then make it rounded again on another one.

I know that maybe there are out-of-box solutions, but I am deeply interested in implementing it myself.

It would be great if at some point I am able to write something like myView.topLeftCornerRadius = 10f

Steyrix
  • 2,796
  • 1
  • 9
  • 23
  • Check https://stackoverflow.com/questions/59046711/android-is-there-a-simple-way-to-create-rounded-corners-for-a-view-without-havi/59054785#59054785 – Gabriele Mariotti Apr 30 '21 at 09:16
  • @GabrieleMariotti that is a good one and I have already had a look on it. But maybe is there a way to implement such drawable/view without using material? – Steyrix Apr 30 '21 at 09:19
  • Is there a specific reason to avoid the use of the material components? Nowaday the great majority of apps use it – Gabriele Mariotti Apr 30 '21 at 09:35
  • @GabrieleMariotti not a great reason, but it is simply a research interest. I most likely will be using material for this, on another hand It would be great if I was with provided some knowledge about how to do it myself – Steyrix Apr 30 '21 at 09:38

0 Answers0