Questions tagged [shapedrawable]
99 questions
4
votes
3 answers
Android - Rounded Rectangle within Rounded Rectangle
I am currently designing a login page and I've run into a problem with using rounded rectangles. My current layout looks somewhat like this:
It's a rounded rectangle containing a smaller rounded rectangle.
As you can see, the right edges of both…

Jason L
- 1,812
- 2
- 22
- 43
3
votes
1 answer
Creating a bent line like an arc in Android using xml in drawable
What I did..
-
…

johnrao07
- 6,690
- 4
- 32
- 55
3
votes
2 answers
Replace single (black) color in ShapeDrawable with another color in Android
Let's say I have an ShapeDrawable in Android. Not a bitmap. I would like to replace single color (stroke color) in it by another color dynamically. The new desired color is not known at design time and can't be put into drawable resource.
For…

Cozzamara
- 1,318
- 1
- 14
- 22
3
votes
0 answers
Android - Applying TransitionDrawable programmatically - issue
I have trying to change background color when user select different options.
For that I am creating TransitionDrawable at runtime. Its works fine. But
my Problem is when I change my view background using setDrawableBackground(), Half of my screen…

Prakash M
- 651
- 3
- 13
3
votes
0 answers
Is a concaved corner possible with Android shape drawable?
I created a Shape drawable for the background of a button and have convexed the corners:

J4C3N-14
- 686
- 1
- 13
- 32
3
votes
4 answers
ShapeDrawable as progressDrawable for RatingBar in Android?
It seems I cannot set ShapeDrawable as progressDrawable for Ratingbar. I tried the following but…

Michael SM
- 715
- 3
- 11
- 25
3
votes
1 answer
How to set absolute (not %) position for the center of a shape drawable gradient?
I've got a shape drawable with a radial gradient inside it. The shape is a rectangle, and I'm trying to position the center of the radial gradient near the bottom right corner. I can get it in the general vicinity using the centerX and centerY…

Andy Dennie
- 6,012
- 2
- 32
- 51
2
votes
1 answer
How can I draw a Rectangle in Android, of a given size, that positions itself in the view to which it is added?
I understand how to draw I shape, I am extending the View class, and overriding the onDraw, where I create a new ShapeDrawbale (Rectangle), which I then draw to the canvas:
Rect rect = new Rect(x, y, x + width, y + height);
…

electricSunny
- 3,229
- 4
- 19
- 21
2
votes
1 answer
How to detect shapedrawable that drawn on a canvas was touched?
I draw a shapedrawables on a canvas and I want to detect on touch event what shapes has been touched. without calculating by (x,y), just automatically as exists in html..
Thanks! :)
I succeeded to draw the shapes, and read a lot about how I can…

tirgul bagrut
- 21
- 4
2
votes
1 answer
Circular Shape within Rectangle
I have the following drawable being displayed within a rectangular togglebutton:
-

zorro2b
- 2,227
- 4
- 28
- 45
2
votes
1 answer
What is wrong with my layer-list drawable?
I wanted to set a custom drawable to be the android:src of FloatingActionButton in this layout:

Solace
- 8,612
- 22
- 95
- 183
2
votes
1 answer
Resize bitmap inside a drawable layer-list not having effect
I want to resize a bitmap in a layer-list, added as an item.
This is what I have tried,
-
…

Shubham A.
- 2,446
- 4
- 36
- 68
2
votes
1 answer
Android: Blurred ShapeDrawable from a Path
I am trying to make a ShapeDrawable but when I resize it, Android draws a blurred line. I know that some example codes say this doesn't happen, so I can't understand what I am doing wrong. This is what I wrote:
Path pathTriangulo = new…

Diego Garcia
- 555
- 2
- 6
- 20
2
votes
2 answers
Android Shape Drawable changing attributes
I have several shape drawable resourses that I want use as backround for buttons and they are similar except gradient start and end color and stroke color.
The problem is that I don't want to create several similar XML files for this drawables.
I…

Mike Herasimov
- 1,319
- 3
- 14
- 31
2
votes
2 answers
Layerlist not showing items correctly Android
I've got two shape drawable xml files that I am using on imagebuttons. One contains a ring, the other contains an oval small enough to fit into the larger ring, similar to a radiobutton. In this image https://i.stack.imgur.com/Uj3aj.jpg you can see…

REAL O G
- 693
- 7
- 23