How can I make a shape like this in Jetpack compose - android

I have tried several ways to recreate this shape but I have not succeeded in any of them.
I know it should be done on canvas and points, but my problem is the outline and the combination of points. with arching of the corners

Related

How can I make something like this in Jetpack compose

Please I have tried several ways to recreate this shape but I have not succeeded in any of them.
https://i.stack.imgur.com/1ozIP.jpg
I know it should be done on canvas and points, but my problem is the outline and the combination of points. with arching of the corners

Create curved gradients with `Paint` and `Canvas`

I am looking to dynamically create (bezier) curves in Android using Canvas and Paint. I can easily do nice curves with setStrokeWidth or doing a more complex polygon/path.
But how can I make the gradient follow the curve like in this example? LinearGradient in either direction would not give the same feel.
In some parts of the curve there is a narrower gradient as well.
Is it made by some inner shadow or maybe just redrawing lots and lots of curves?
I'm afraid curving the gradient is not possible using the built-in gradient classes (LinearGradient, RadialGradient, SweepGradient). It's possible to draw lots of curves, but that would basically mean writing the curved gradient yourself. :)
(And the shading of the surface looks a bit even more subtle to me, resembling a 3D render.)

How to draw part of space between two circles in Android

I would like to draw in Android something like shape in the picture. I have used Path.drawArc but I can't draw two arcs which are parts of cirlces with the same center. Another problem is how to draw two lines which connect these arcs. In iOS I would use bezierPathWithArcCenter:radius:startAngle:endAngle:clockwise:
How to draw shape like in the sketch?
here is simple example using canvas and bitmaps, try this example and get some idea for your requirement. image cropping and transparent

Draw a Circle With Reverse Filling in Android

Not sure how to do this, or what the right terms are for describing this, but here goes:
I want to make a closing circle animation in my android app, much like the end of this video. I'm guessing what I need to do is somehow draw a black circle but instead of filling the inside of the circle fill the outside. How exactly would I do that, given the tools I have with Android's Canvas class?
Have you tried using clipPath to achieve this?
I was working on the same kind of thing and achieved it by using clipPath of canvas.

On an android Canvas, how do I draw overlapping shapes with non-interacting alphas?

On an android Canvas, if I draw a circle with alpha 0xCC and color Color.RED and then draw another circle which partially overlaps the first circle with the same parameters, I'll end up with a venn diagram.
Here is a random example I found (just ignore the [Text] in there). I want to draw overlapping circles like in this diagram, but I don't want the center to be darker, but I do want the whole thing to have alpha so that the map underneath is visible.
Is there a way to do this directly or do I need to draw to a bitmap without alpha and then set the alpha for the whole bitmap and draw it to a canvas? (I haven't used bitmaps yet, so I am not sure how they are used yet.)
The easy way would be your suggested solution, ie. drawing all circles with no alpha to a bitmap, then draw that bitmap to another one using the desired alpha.
The hard way would be using blend modes, specifically PorterDuff.Mode in Android. An example can be found here.

Categories

Resources