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
0
votes
1 answer

Custom shape drawable android(lines only above and below a view)

I want two white lines -one on top of the view ,and the other one on the bottom the view!!! no left and right borders!!!!!
0
votes
1 answer

How to draw a circle on different screens(devices) with same diameter in Android

I'm trying to draw a circle which will have the same diameter of 2.5 inches (or any other value) in every android device, regardless of the screen size. The diameter size must be same in all the devices and below is what I have…
Terance Wijesuriya
  • 1,928
  • 9
  • 31
  • 61
0
votes
1 answer

android share bubbles triangle right

Now I have left the layout of the message, that's the code:
wpbloger
  • 169
  • 1
  • 1
  • 10
0
votes
1 answer

Why does transparent stroke display with only half of width?

I'm trying to use for displaying pressed state of the button. To do that, I use stroke with transparent color in normal state and colored one in pressed state: button.xml :
Nexen
  • 1,663
  • 4
  • 16
  • 44
0
votes
3 answers

Android edit text with custom shape

How can I edit text shape like this. I mean that right rounded corners and exact same shape. As I understood 9 patch doesn't help me with that.
Pasha Shkaran
  • 1,433
  • 2
  • 23
  • 41
0
votes
1 answer

Shadow Appearance on All Android Versions

In Lollipop we set a view's Shadow by setElevation() method. But in pre-Lollipop, it doesn't work. What is the best approach so that the View will have identical look when displayed on pre-lollipop devices and lollipop devices?
JayVDiyk
  • 4,277
  • 22
  • 70
  • 135
0
votes
1 answer

create following code xml programmatically into layerlist android

I have to set background of this to many views with different colors. but if I make it so, the xml will be around 20 files, which is huge, so I want to convert the following xml layer-list into progmatical way into fully independent module without…
0
votes
2 answers

Specify Button's Background Shape Color Outside of the Background's XML

I have a Button that uses a shape as it's background. The shape will have different color based on the state of the Button Is it possible for me to specify the color of each state inside the Button's xml? I am sorry for the newbie question. Any…
JayVDiyk
  • 4,277
  • 22
  • 70
  • 135
0
votes
0 answers

Android XML shape drawable is bogging down my UI

I'm using XML drawables and overlaying them ontop of eachother dynamically using layers. Everytime the user hits a button it overlays another image. The issue is that once I have five or ten layers of this particular XML drawable then the UI wants…
Chase Roberts
  • 9,082
  • 13
  • 73
  • 131
0
votes
1 answer

Arc Shape Background Android

I wanna create a view with Arc Shape background.. my view has weight of .3.. which makes it fill one third of my layout.. I try to set its background to an arc shape (I want it to be half oval) like this: ArcShape shape = new ArcShape(270,…
Muhammad Ashraf
  • 1,252
  • 1
  • 14
  • 32
0
votes
0 answers
0
votes
1 answer

Unexpected result on using the different shapes with an ImageButton states

My simple target is to change the background of ImageButton on different button states. So, what I have is mylayout.xml
0
votes
1 answer

drawing sloped rectangle upper edge shape as in yahoo digest news app using xml android

am trying to draw sloped rectangle upper edge shape and use it as linear layout background as in the picture: here is the link to the design am trying to achieve: http://postimg.org/image/krjwfcisz/ I tried to draw a rectangular and rotate it but…
0
votes
1 answer

Shape=ring in android not displaying

I am trying to display some text in a coloured circle, but it is not working properly. This is how I am rendering the text -
Sam
  • 4,302
  • 12
  • 40
  • 74
0
votes
1 answer

Android shape triangle with border

I've created triangle shape as in code below:
dammarpol
  • 77
  • 1
  • 13