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
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 relative to the position of another view

I'm trying to draw a line under a TextView (creating a rubber bridge score sheet, where the lines in question mirror the dotted lines here). I can't figure out how to get the position of the bottommost TextView and use those numbers to create a line…
sam
  • 97
  • 9
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
1 answer

in ShapeDrawable it sets color values of last JSON arrays

In my application I am using listview and I am also doing json parsing.,as per color code i am getting it and set it as ShapeDrawable with round,but the issue is i am getting values of last color code arrays in my every listitem,following is my json…
0
votes
0 answers

Many object references of ShapeDrawable

I'm trying to make three seperate bars "float" down the screen, but for some reason, only one is visible. Here is my code: // initialized the bar ShapeDrawable barShape = new ShapeDrawable(new…
ElectronicGeek
  • 3,312
  • 2
  • 23
  • 35
0
votes
1 answer

How to add button to top left corner in an android shape?

I have created a shape in my Android project and I would like to add a button on the top left corner. This is my shape:
user2586419
0
votes
1 answer

Shape gradient not smooth on some devices

I'm trying to add gradient above text using ShapeDrawable. The goal is to fade text on the left and right side of the screen. The layout is following:
pvshnik
  • 1,760
  • 3
  • 12
  • 14
-1
votes
1 answer

How to make a semicircular Hole in a rectangle side?

I need to make a rectangle which has a circle hole in middle something like this
amirhesni
  • 441
  • 1
  • 6
  • 22
-1
votes
2 answers

Android - Is this mandatory to create each shape in separate xml file?

Let say i want these shapes in my project, like rectangle, ring and oval: Which means i should have three xml files for each shape. So, as far as i know we create separate xml file for each shape. Is this mandatory to create each shape in separate…
-1
votes
1 answer

creating a custom drawable shape

I want to create the shape rectangle as shown below the Image. what am I supposed to do? with best regards.
fardad
  • 57
  • 2
  • 11
-2
votes
3 answers
-4
votes
1 answer

How can I create a custom background

I Want to create a custom background with shadows like given image
1 2 3 4 5 6
7