Questions tagged [shapes]

Questions related to drawing or defining shapes.

A shape is a geometric representation of some object, defined by the external boundaries which encompass the object.

For 2-D shapes like the circle, , and rectangle their shape is constructed of lines connected together.

3-D shapes are defined by a 2-D which envelopes the interior 3-D volume.

4362 questions
29
votes
3 answers

Drawing a rounded hollow thumb over arc

I want to create a rounded graph that will display a range of values from my app. The values can be classified to 3 categories: low, mid, high - that are represented by 3 colors: blue, green and red (respectively). Above this range, I want to show…
limlim
  • 3,115
  • 2
  • 34
  • 46
29
votes
1 answer

Change shape solid color at runtime inside Drawable xml used as background

I've a Drawable xml file (background.xml): ...........
ʞᴉɯ
  • 5,376
  • 7
  • 52
  • 89
28
votes
6 answers

How to create a resizable rectangle with user touch events on Android?

I want to create a rectangular shape that will be resized with the touches of the user. Below image is a good example of what i want to do: Is there any example like that? What do I need to study to implement this? Thanks in advance,
ipman
  • 1,212
  • 2
  • 21
  • 29
28
votes
2 answers

Android - how to define ShapeDrawables programmatically?

What I'm trying to achieve is to use a Drawable with a couple of layers inside it, but control some values at runtime such as the startColor for the gradient. Here's what I have in my_layered_shape.xml:
Carl Whalley
  • 3,011
  • 8
  • 33
  • 48
28
votes
5 answers

Android Drawable: Specifying shape width in percent in the XML file?

I'm trying to create a simple Drawable that I want to set as the background for a view (using setBackgroundDrawable). I simply want to divide the background of the drawable into 2 equal rectangles (50% - 50%), the first want filled with black, the…
TechAurelian
  • 5,561
  • 5
  • 50
  • 65
28
votes
7 answers

Android: how to create 3 vertical dots?

For example, in Google Play, each item in the lists had a 3 vertical dots in the right top corner to show a popup menu. What is the best way to create this 3 dots ? Thank you so much guys!
anthony
  • 7,653
  • 8
  • 49
  • 101
27
votes
3 answers

Android Shape Line

I have the following code:
Gerardo
  • 5,800
  • 11
  • 66
  • 94
27
votes
3 answers

How to create a right facing arrow (chevron) using XML shapes in android?

How to create a right facing arrow using xml shapes in android like this??
Sajal
  • 1,452
  • 2
  • 14
  • 17
26
votes
2 answers

How to put a in a in Android?

I'm trying to make customizable icons in Android. I made the vector element, but now I want to give it a rounded background, so I tried to place it within a rounded shape. Like this: