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

Draw multi object diagram in fragment

I'd like to achieve drawing a diagram just like the image attached but I'm having trouble drawing the red vertical rectangle on the right along with putting other objects on top. The biggest concern is the to do with numerous different screen sizes…
wbk727
  • 8,017
  • 12
  • 61
  • 125
10
votes
5 answers

How to implement a PIN code screen

How to code such type of password screen design, while after inputting the password the circles should change or imageview should change..?? Login.xml
shrishyl47
  • 161
  • 1
  • 1
  • 13
10
votes
1 answer

Android drawable shape in xml - Create a transparent circle in a square

Is there a way to subtract or "cut out" a shape from another shape in xml? I'd like to create a white square with a transparent circular hole in the center... mainly because I don't want to do a bitmap manipulation to make a circular image :). Yes,…
loeschg
  • 29,961
  • 26
  • 97
  • 150
9
votes
3 answers

Android shape with gradient border and shadow

I have a png drawable for the buttons. But it image drawable has gradient and it looks bad when applying 9patch (gradient & 9patch non compatible). I want to do this with a shapes. But I can't drawing with android shapes because it's hard to me to…
Trancer
  • 765
  • 2
  • 8
  • 23
7
votes
0 answers

Android: Drawing an arrow between two Rectangle Objects

I am facing problems drawing arrows between two or more rectangle objects. I have a Array list storing several rectangles. For instance, the user have two rectangles on the canvas. Upon clicking the draw arrow button, the user would be able to…
user3306996
  • 421
  • 2
  • 4
  • 15
6
votes
2 answers

Shape dashed line, dash doesn't work

I want to make dashed line using shape. This is my XML:
Artem
  • 4,569
  • 12
  • 44
  • 86
6
votes
2 answers

Draw a custom shape in android using XML

I am adding a custom marker to the android map view. here is the image I am using for it.It looks like as more markers are placed say about 100 the entire app is getting slow. Here is the image I am using for that. Instead of using this image, I am…
Zach
  • 9,989
  • 19
  • 70
  • 107
5
votes
1 answer

Android - shape on horizontal line

I have a xml, that in this xml I adding Horizontal Line between TextViews. I add a Shape to separator but I can't see changes. main_activity.xml :
user4501847
4
votes
1 answer

Android - Background color with different color and angles

I'm trying to figure out how to create this background in xml, couldn't find anything that helped me. Ignore the circle image of the kid and the text of course, I am talking about the background itself, is there a way to create something like that…
JozeRi
  • 3,219
  • 6
  • 27
  • 45
4
votes
2 answers

Create circle inside another circle in Android

I need to create image for my camera app. I create a circle inside another circle it look fine when I see it on android studio but when run it on real device it was not same as it is. Here is image of both first one from real device and second from…
Fiverr Projects
  • 311
  • 2
  • 4
  • 13
4
votes
3 answers

How to draw a Android Shape Rectangle with variable stroke width

I want to draw a rectangle with a hole in it. I am trying to achieve this by using Shape Rectangle.
4
votes
1 answer

Reusing a border resource with multiple background colors

I currently have the following xml file in my /res/drawable folder:
Sheridan Gray
  • 698
  • 1
  • 9
  • 23
4
votes
0 answers

Button's background drawable (shape) won't show up unless app API is 20+ (Android L)

In my Android app, I'm trying to set a simple ring shape as background drawable for my Buttons. But as much as I try, the XML preview ignores the background drawable unless the API level is set to 20 (Android L) What's going on? I'm sure people used…
3
votes
1 answer

how to make android chronometer invisible and visible when clicked

I am working on app which has a titlebar with chronometer on the left and a textview centered in a RelativeLayout. RelativeLayout take height of textview and fill screen width
3
votes
0 answers

Drawing a rounded trapezoid in android xml

I want to implement this ui in android xml. I have created a list layer like this for top view:
Mohamadamin
  • 564
  • 5
  • 16
1
2
3
12 13