Questions tagged [android-jetpack-compose-canvas]

79 questions
3
votes
1 answer

Rectangle border progress bar

How i Draw Rectangle progress bar as a below in photo as CircleProgress indicator in android with JetpackCompose https://drive.google.com/file/d/1SXZcBp7uAesl-i6gHqFNXNpnc54Z6vdI/view?usp=share_link CircularProgressIndicator(strokeWidth=10.dp, …
3
votes
1 answer

How to create VectorDrawable with gradient and multiple Colors with Jetpack Compose?

This is a share your knowledge, Q&A-style question inspired from this question but it enhances the answer with gradient, fill/empty animation and shimmer effect for VectorDrawables with aim as in gif below First drawable
Thracian
  • 43,021
  • 16
  • 133
  • 222
3
votes
1 answer

How to implement vertical likert scale with jetpack compose

I am attempting to create a vertical Likert scale using Jetpack Compose. Each field should include a vertical line that extends beyond its boundaries. I have also included an image to give an idea of what I am trying to achieve.
3
votes
1 answer

How to make this triangle indicator to rotate and move in android jetpack compose?

I have highlighted (red) my problem in the image; I want to animate that blue indicator triangle. The triangle is moving, but it is not properly moving. I don't know what I am missing. Timer Image with what I have achieved so far: This is my code…
3
votes
1 answer

Jetpack Compose Canvas drawText color blending?

Assume I have the following code in compose below. A background magenta circle with a text on top with a default black color. I would like to blend the text color to White when it is above the circle. Canvas( modifier = Modifier.size(256.dp), …
3
votes
3 answers

How can i draw one-sided thickening stoke on canvas in Android Jetpack Compose?

Here is my code; Box( modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center ){ Canvas( modifier = Modifier .fillMaxSize(0.5f) .border(1.dp, Color.Red) …
3
votes
2 answers

How to Center an Arc on the Canvas - Jetpack Compose?

I'm not sure how can I do the calculation in order to center this arc on the canvas? Can someone point me in the proper direction? Canvas(modifier = Modifier .background(Color.LightGray) .fillMaxWidth() .height(300.dp) ) { …
3
votes
1 answer

How to move a rectangle around a canvas in Jetpack Compose?

I have a canvas with a rectangle that I would like to be able to move around. With a Composable, I know how to use the dragging modifier as described here: https://developer.android.com/jetpack/compose/gestures#dragging But my canvas rectangle has…
2
votes
0 answers

When to redraw screen in Jetpack Compose

I have created raining animation using Sketch. The rain is then draw using this code with drawLine() with shift Offset. RaindropList is list of multiple generated raindrops with different starting coordinates. Sketch(modifier =…
2
votes
1 answer

Jetpack Compose - Draw shape with offset off-screen and use very large size

For a background element, I'm trying to simply draw a very large filled circle that is offset so that only part of it shows at the bottom. I've got it working to show the circle with an offset, but it seems to only be allowing a max width/height of…
2
votes
1 answer

Change color of text as progressbar fills jetpack Compose Android

How to change the color of the text as the progressbar fills in jetpack Compose Android enter image description here I did tried everything also gradient and also to search on internet , no results
2
votes
1 answer

How to draw image at particular position in jetpack compose

I want to draw image at specific X position where white arc ends. I draw arc with the help of this answer. Now I want to draw image above the arc. I tried this answer to draw the image, but there is no option to draw image at specific X position. So…
2
votes
1 answer

Get bitmap before using in a Composable with Coil

I'm trying to get two images from an url and then I have a Composable that needs two bitmaps to draw them in a Canvas, I've tried it but the canvas don't get painted am I missing something? val overlayImage = …
2
votes
1 answer

How to mirror a composable function made by canvas with Modifier?

Problem description I'm trying to create a component on android using Compose and Canvas that simulates a 7-segment display like this: For that, I adopted a strategy of creating only half of this component and mirroring this part that I created…
2
votes
1 answer

implement a spinning activity indicator with Jetpack Compose

This is a share your knowledge, Q&A-style inspired by this question on Reddit and the one linked to stackoverflow Result is
Thracian
  • 43,021
  • 16
  • 133
  • 222