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

How to create an Button with an image, text, and two colours?

Here is the link to what I have in mind. https://dribbble.com/shots/1407665-Categories/attachments/204971 Is there a popular library anyone knows that can manage this, otherwise I am alright with going the customizing route. I have my 9 buttons…
0
votes
1 answer

Shape layer-list composition

My goal is to have a drawable (shape) with this result: What i tried so far: triangle.xml
Bugdr0id
  • 2,962
  • 6
  • 35
  • 59
0
votes
1 answer

Android shape -Reducing the length of the divider(line) between two items

In the image below I have two users, How do I reduce the bottom length stroke so that it only starts from "second, first".
0
votes
1 answer

RoundRectShape not drawing

I'm trying to draw a rounded rectangle on a Canvas object but nothing is showing up. I initialize the RoundRectShape like so: test = new RoundRectShape(new float[]{r, r, r, r, r, r, r, r}, new RectF(100, 100, 100, 100), null); I then call…
Ryan
  • 727
  • 2
  • 14
  • 31
0
votes
1 answer

How to get rid of shadow that appears on my button? Android

I have created a button with a Gradient Drawable. If you look at this button, it has those Extra Grey lines as pointed out by my red arrows. Those don't appear if I create a shape using XML but when i use Gradient Drawable code seen below it…
0
votes
3 answers

Android Canvas: Create RoundRectShape Object

I have created a class for a rectangle shape as it is an object in my application. However now I would like the corners to be rounded. Below you can see it's a bare bones class to create as many rectangles I want with the same attributes. public…
0
votes
2 answers

How to draw a dot circle inside a square drawable in android?

I want a small dot inside a square button , this is what i have tried till now as answered by azizbekian:
0
votes
2 answers

Android set radius programatically to ShapeDrawable

Can I set a radius programmatically to a ShapeDrawable?
IntoTheDeep
  • 4,027
  • 15
  • 39
  • 84
0
votes
1 answer

remove small part from the circle

Hi friends please help here i trying to do below shape more than three days but cant able to get it how can i do it But the Output i am getting is this one Below is my code close_drawable.xml
0
votes
1 answer

Android shape drawable color is displayed incorrectly

I'm trying to draw a simple circle and use it as a background to an ImageView the problem is the circle is drawn with different color whenever I open the application, here is my code.
Abdelrhman Talat
  • 1,205
  • 2
  • 13
  • 25
0
votes
1 answer

How can I create the following shape in Android?

I am trying to create a following shape in android. I tried following code but it's only for changing the corners
0
votes
1 answer
0
votes
0 answers

ShapeDrawable animate alpha property in Custom View

I'm having trouble with a simple alpha animation of a drawable. Bellow you have a test project which illustrates the problem. Class that holds a ShapeDrawable public class CustomDrawable { public ShapeDrawable shapeDrawable; public…
0
votes
2 answers

Change background color/drawable from the source

I have many XMLs that use background color from shape drawables like: My shape background xml is:
Snake
  • 14,228
  • 27
  • 117
  • 250
0
votes
1 answer

Drawing custom shape with dynamic content in Android

I want to create the screen above. The user can update the photo from the Camera or the Gallery and Change the color of the pin. All of this changes are automatically update in the screen. I know how to get the photo from camera or gallery, but how…