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

How to use a custom shape as a frame to an ImageView android

I'm trying to add a hexagonal custom frame to an ImageView. Approach I tried : Created a hexagon shape in drawable folder. drawable/ic_hexagon.xml file
Choxmi
  • 1,584
  • 4
  • 29
  • 47
1
vote
2 answers

Setting NavigationView's list divider height

I got a NavigationView which I'm trying to set a custom list divider to. I have made the file "drawer_list_divider.xml":
CodeMonkey
  • 11,196
  • 30
  • 112
  • 203
1
vote
1 answer

How to set gradiant color for stroke in shape in Android

I want create custom background and i want create this in drawable folder. For this background i write below codes :
user7624048
1
vote
2 answers

How to create a custom shape for a Button

How to create a custom shape for a Button? Can I set different colors to button background colors for many conditions.Any help will be appreciated.Thanks.
Htoo Aung Hlaing
  • 2,173
  • 15
  • 26
1
vote
0 answers

Make gradient look the same on different screens

I have defined gradient drawable for my app's navigation drawer's header, side_nav_bar.xml:
1
vote
1 answer

Dynamically draw outline oval over a view

I am working with a custom UI element highlights.So I need to draw a half ellipse like shape over a particular view on runtime. For example: I have to draw a yellow color half ellipse over a white ellipse. Help will be appreciated.
Aman Jain
  • 2,975
  • 1
  • 20
  • 35
1
vote
1 answer

how to draw a trapezium for android shape?

edited part of the question I want to draw a trapezium shape to apply for a Linear-layout. so far I've done following. But I want to only to appear the trapezium. other parts must be not visible. thank you. i dont want the othe parts except…
Neshan Manilka
  • 64
  • 1
  • 2
  • 10
1
vote
1 answer

Android Ring Shape with divisions

I need to create circular shape with gaps. I'm creating a Progress Bar which will represent clock. 12 gaps each assigned to hours. this is exactly the thing I want to achieve. (Outer ring on Death Star) here is my code so far: in…
CBeTJlu4ok
  • 1,072
  • 4
  • 18
  • 51
1
vote
0 answers

Animate pie diagram as a background of TextView from one state to another

I am setting the background of a TextViewin android as a pie diagram. I have used a LayerDrawable of ArcShape(s) to do so and set it as the background. Here is the code for that: final ShapeDrawable arcGreen = new ShapeDrawable(new ArcShape(-90,…
Swapnil
  • 1,870
  • 2
  • 23
  • 48
1
vote
1 answer

How to create this particular shape with xml in Android?

I want create one shape such as below image, but I want create this with XML codes (in drawable) and I do not want create this with 9.patch images! How can I create this shape with xml code?
Mohammad Nouri
  • 2,245
  • 4
  • 17
  • 34
1
vote
1 answer

How to create this shape in Android

I want create shape such as this image : But i do not want use 9 pach png image, i want create this shape in drawable folder. How can i create this? Any help could be appreciated! Thanks
F_Feed
  • 125
  • 1
  • 1
  • 8
1
vote
0 answers

android how to apply shape and selector simultaneously

I have been reading other posts where the solution is apparently given. However, the solution doesn't work for me. I would have commented in that post, but I cannot do it with my reputation. The issue is described here. Basicly I want to use two…
Daniel Reina
  • 5,764
  • 1
  • 37
  • 50
1
vote
2 answers

Icon image in circle shape is blurry

I have created circle shape drawables that contain png icons. As per the Android Material guidelines the diameter of the circle is 40dp and the icon is 24dp. Initially I did not set any values for left, right, top and bottom as I assumed the…