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
3 answers

Android Custom shape for EditText

I am trying to create a custom design for EditText. See the attached image below, I am trying to achieve this using a custom shape like the one defined below.
Zach
  • 9,989
  • 19
  • 70
  • 107
1
vote
0 answers

Android - How to reduce hoverable bounds of a ClipDrawable?

I currently have the following XML for my ClipDrawable:
Pink Jazz
  • 784
  • 4
  • 13
  • 34
1
vote
2 answers

Android make ShapeDrawable match_parent

I am trying to create a colored Circle and assign it to an ImageView for my GridView. Here is my code: ImageView ivColor; ivColor = new ImageView(MainActivity.this); ivColor.setLayoutParams(new…
TareK Khoury
  • 12,721
  • 16
  • 55
  • 78
1
vote
2 answers

Custom edit text with different view on different state in android

My edit text now looks like this (like its background) http://prntscr.com/843323 and this is the code
user5134138
1
vote
1 answer

Triangle shape using xml in Android

I a created triangle shape following this post
Ravi Sharma
  • 873
  • 7
  • 24
1
vote
0 answers

Android make custom edittext with shape

how can i make this custom edittext using shape please ? http://www.noelshack.com/2015-15-1428418773-form3.png I've tried android:drawableLeft but the result's not matching rectangle_shape.xml
JossVamos
  • 11
  • 2
1
vote
1 answer

Android: shape corners radius does not work on tablet

I need a rounded corner on top left and top bottom corners. So I have the shape xml that is set to the button as background.
1
vote
1 answer

creating custom shape / drawable - 6 sided button

Is it possible to create a completely custom shape in xml? I'm trying to create a button which looks like this: http://s11.postimg.org/e4izrlgrj/image.png (a mockup i did in photoshop) I need to be able to create the outline shape and the small blue…
Steven Yates
  • 2,400
  • 3
  • 30
  • 58
1
vote
1 answer

Triangle Shape - How does it work?

I found several answers to How to draw a triangle shape in Android in the resources files. But I don't found any to explain how I can change the triangle rotation. Example that I found:
jobernas
  • 686
  • 1
  • 12
  • 24
1
vote
1 answer

BaseAdapter elements margin

I try to apply a margin to my elements from BaseAdapter. I tried several things. I'm a bit dissapointed that I cannot just add a margin to my drawable.xml "background". (Activity - Layout) ItemsView.xml
codepleb
  • 10,086
  • 14
  • 69
  • 111
1
vote
0 answers

How to transform these shapes from xml to java code?

I'm searching on google how to transform these shapes to java code but I can't find the way, also I checked the documentation and nothing... These are the shapes: shape1.xml:
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
1
vote
2 answers

View background with cut off corner and border

I am trying to make an Android View with a background like this: I have figured out that the easiest way, properly is to make two shapes on top of each other with different background colors: The height of the is different for each element, so I…
Morten Holmgaard
  • 7,484
  • 8
  • 63
  • 85
0
votes
1 answer

How do you make a line drawable with a gradient?

So...I wanted to add a line that looks like this line with gradient and have created a drawable
0
votes
0 answers

android shape within selector not working

I am trying to change the color and shape of the checkbox with the below code. The below code changes color of checkbox but does not change the shape of the button. What changes need to be done?
0
votes
0 answers

How to custom android shape

I know this can be done by android xml, what should I do to make the left part bulge? I have already tried the following code, but it only give me this:
Hhry
  • 823
  • 1
  • 8
  • 19