Questions tagged [android-shapedrawable]

Android Drawable object that draws primitive shapes. A ShapeDrawable takes a Shape object and manages its presence on the screen. This object can be defined in an XML file with the element.

A Drawable object that draws primitive shapes. A ShapeDrawable takes a Shape object and manages its presence on the screen. If no Shape is given, then the ShapeDrawable will default to a RectShape.

This object can be defined in an XML file with the element, that defines a geometric shape, including colors and gradients. Creates a ShapeDrawable.

Useful links

102 questions
1
vote
2 answers

How can i achieve this custom Shape in android for a textview?

How would I achieve a shape like below in Android, through an Android shape drawable:
1
vote
2 answers

How to add more than 1 shape in single xml drawable

I want to create chat bubble using xml resource but i'm not able to make triangle outside of rectangle with right edge i also tried with 9 patch image but when user enters 1 character still it width is not as wrap content. please help me i also put…
1
vote
0 answers

Is it possible to create a rectangle drawable with an upwards curve?

I am trying to create a button background using Android shape drawables. I am trying to have two curves on a rectangle with the one on top being backwards. The background also has a stroke of 3dp which prevents me from using a layer list. This is…
KevinZ
  • 756
  • 1
  • 12
  • 26
1
vote
0 answers

Make gradient look the same on different screens

I have defined gradient drawable for my app's navigation drawer's header, side_nav_bar.xml:
1
vote
1 answer

Dynamically draw outline oval over a view

I am working with a custom UI element highlights.So I need to draw a half ellipse like shape over a particular view on runtime. For example: I have to draw a yellow color half ellipse over a white ellipse. Help will be appreciated.
Aman Jain
  • 2,975
  • 1
  • 20
  • 35
1
vote
0 answers

Draw shape with inverted round corners "tunnel like style"

How to draw the part I marked with the arrow? Beneath you see other parts I already drew. The surrounding space must be transparent.
OneWorld
  • 17,512
  • 21
  • 86
  • 136
1
vote
3 answers

Android Custom shape for EditText

I am trying to create a custom design for EditText. See the attached image below, I am trying to achieve this using a custom shape like the one defined below.
Zach
  • 9,989
  • 19
  • 70
  • 107
1
vote
1 answer

Can't draw a line?

I want to draw a line as ImageView's background.But it doesn't work?
Egos Zhang
  • 1,334
  • 10
  • 18
1
vote
0 answers

Android: OvalShape Drawable clipped at edges

I'm trying to create a OvalShape Drawable with border. To give it an elevated effect, I'm adding shadows around the border. Relevant code: class Badge extends ShapeDrawable{ void Badge(){ borderPaint = new Paint(); …
PsyGik
  • 3,535
  • 1
  • 27
  • 44
1
vote
1 answer

Line shape doesn't appear in Android API 21

I'm trying to make a line shape in Android. It works fine in all Android versions except API 21.
mnagy
  • 1,085
  • 1
  • 17
  • 36
1
vote
0 answers

Changing the color of a ShapeDrawable ImageView in a GridLayout

I have a GridLayout with 16 dots, which are ImageViews created from ShapeDrawables. How can I set the color of these without creating a new ShapeDrawable? Here's most of my code: for (int i = 0; i < dotNumWidth * dotNumWidth; i++) { …
0
votes
1 answer

How to create three circles next to each other with space in-between using shapedrawables

I want to create a drawer handle with three circles with some space in between like [ o o o ] I am trying to achieve this with ShapeDrawables Here is my XML
user1743524
  • 655
  • 1
  • 7
  • 14
0
votes
1 answer

How do you make a line drawable with a gradient?

So...I wanted to add a line that looks like this line with gradient and have created a drawable
0
votes
0 answers

The border or shadow cannot be set after BottomNavigationView sets the top bulge

I set the bulge for BottomNavigationView through the set to edge method of materialShapeDrawable, because the color of the page is similar to that of BottomNavigationView, so I need to set a border or shadow on top of the control, but I can't set…