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
1
vote
1 answer

how to create triangle gap on cardview?

how can I create a triangle gap on the bottom of a cardview like this in android studio?
1
vote
1 answer

Using a layer-list with multiple circular items

I am trying to make a shape that looks roughly like I understand that I need a layer-list with 3 items stacked on top of each other with two of them being offset from their top-left and bottom-right. Here is my code for this
Abdul Mateen
  • 1,418
  • 1
  • 14
  • 32
1
vote
2 answers

Android - spotShadowAlpha only for linearlayout

I am using the elevation attribute for my linearlayout, but the shadow is to bright. I need a darker shadow only for the linear layout. I added android:spotShadowAlpha to my styles.xml. It worked, but not only for the linear layout. Every View has a…
1
vote
2 answers

Android - What is the difference between these three xml files?

What is the difference between these three xml files in android? xml file with selector as root element
Stack Overflow
  • 1
  • 5
  • 23
  • 51
1
vote
1 answer

Can we create multiple shapes in one xml file and point them within this single file?

For example to create a button whose button_normal state shows some different style and button_pressed state shows some different style, we create three files: button_normal.xml
1
vote
3 answers

Shape's stroke doesn't appear

I defined a Drawable with a stroke but the stroke does not appear on the UI.
Michael Osofsky
  • 11,429
  • 16
  • 68
  • 113
1
vote
2 answers

How Create radial Gradiant In Android like this

I want to Create a Gradient like this but : left gradiant is my goal gradiant right gradiant is my gradiant this is my gradiant code xml :
zobydeh karimi
  • 57
  • 1
  • 2
  • 7
1
vote
1 answer

Drawing a stroked shape in a custom view

I'm trying to draw this custom shape in the custom view. I must have a stroke and fill for this shape. Now I made this with 2 shapes, but I haven't stroked of course: rect.set(0, 0, width, height); canvas.drawRoundRect(rect, cornerRadius,…
SWR
  • 73
  • 10
1
vote
2 answers

Is there any way how to create half circle as shape?

I want to create special view for my app. It is vertical dotted line and two half circles on a top and bottom. Is there any way how to create this as single shape drawable? I made dotted line, but I cant make half circle. It should looks like…
martin1337
  • 2,384
  • 6
  • 38
  • 85
1
vote
2 answers

android highlight cardview border

I'm using cards in a recycleview and would like to highlight some of them. the first thought i have is a different shadow or border with a bright color, but so far i was not able to find any properties that would adjust it this is my card…
Rafael Lima
  • 3,079
  • 3
  • 41
  • 105
1
vote
2 answers

CardView background alpha colour not working correctly

i am trying to make CardView with elevation but the issue is when i use no-alpha color like "#ffffff" it works fine but when i set some alpha color like #b0ffffffit shows another inner view with elevation like this but when i set non-alpha color…
1
vote
3 answers

Circle background for a imageview

I am trying to place three image views with circle background. I have also placed a draw with round shape. But the background is not round shows oval.
1
vote
1 answer

xml - unable to set shape as background of a TextView

I'm trying to set a transparent circle with a stroke as the background of a TextView in android:
Michele
  • 326
  • 8
  • 18
1
vote
0 answers

How to create transparent triangle with border on diagonal sides only?

I need to draw below triangle with border on diagonal sides only.
Rendy
  • 5,572
  • 15
  • 52
  • 95
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: