Questions tagged [android-shape]

This is a generic shape defined in XML.

This is a generic shape defined in XML.

Reference: http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape

191 questions
3
votes
3 answers

Android drawable tooltip arrow box

I tried the below code to create a popup window with a tooltip-like arrow on top. picture attached. But I am getting something different as a result. popup inflater : LayoutInflater inflater = (LayoutInflater) …
Malhotra
  • 221
  • 3
  • 13
3
votes
1 answer

Layerlist drawable doesn't stretch nicely

I'm starting to learn android layer list and working with drawables. I'm trying to create a simple line with a circle at each end: I came up with a layerlist as shown below. It works good but the problem is when I run it on various screen sizes the…
3
votes
3 answers

How to add a icon inside a button that shape oval button

I have created a drawable button_oval.xml
Morton
  • 5,380
  • 18
  • 63
  • 118
3
votes
2 answers

Android: How to create exact material design shadow with XML drawable

I would like to make an XMl drawable file that resembles as closely as possible to the material design elevation found on Lollipop and above. I currently have a shadow that does not even come close as I have no idea what gradient I'm suppose to…
3
votes
1 answer

round the two ends of thick line with xml shape

I have a line shape, it is a thick line:
Leem.fin
  • 40,781
  • 83
  • 202
  • 354
3
votes
1 answer

How to force android:shape="oval" to remain perfect circle?

I am trying to define a circular background to be used as a background for buttons.
user6694745
3
votes
3 answers

Android oval shape 2 colors

I have a linear layout view whose background I have set to oval shape solid color. So far I have the background as circle. Now I want to achieve same i.e using shape drawable to get a circle with 2 colors. Please see attached.
Ranveer Bedaysee
  • 131
  • 1
  • 12
3
votes
1 answer

Android: How to make a drawable with a multicolor gradient?

I made this: ShapeDrawable.ShaderFactory shaderFactory = new ShapeDrawable.ShaderFactory() { @Override public Shader resize(int width, int height) { LinearGradient linearGradient = new LinearGradient(0, 0, width,…
user3290180
  • 4,260
  • 9
  • 42
  • 77
3
votes
2 answers

Hexagonal ImageView Rounded corners

Hi I want rounded corners as shown in above image. I have managed to make hexagonal ImageView. But I am not able to round the corners. Please help. I am copying the code here if anyone wants to take a look. I have tried giving the arc as used in…
Rahul Sood
  • 211
  • 1
  • 2
  • 12
3
votes
1 answer

Android set background color button pressed

I would like to change the background color of my ImageButton on pressed event. Here is what i am done :
wawanopoulos
  • 9,614
  • 31
  • 111
  • 166
2
votes
0 answers

What is default color of solid in drawable resource for shape in Android?

What is default color of solid in drawable resource for shape?? #1
aguagu
  • 83
  • 5
2
votes
3 answers

How to make round corner in both sides of stroke in shape xml

I tried to create a shape like this one:
Kingfisher Phuoc
  • 8,052
  • 9
  • 46
  • 86
2
votes
1 answer

Nested shapes in Android

I am trying to draw a shape that has three rectangular shapes: solid color gradient white line How do I do that? When I try this, it does not work. The layout has the parent color.
dropsOfJupiter
  • 6,763
  • 12
  • 47
  • 59
2
votes
1 answer

Seekbar outer shadow on progress part

I am customizing a seekbar in Android, trying to get both inner and outer shadow (bottom side) of the filled section only. i would like a result like this: At the moment, I created: the rounded borders the gradient effect the custom thumb the…
2
votes
1 answer

How do I keep a ripple effect within a view's bounds in a selector?

I am trying to figure out why my ripple effect is not conforming to the shape I have placed it in. Below is the code I am using: This is the multi-purpose button that I am setting to the background of the ImageViews
1 2
3
12 13