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

Rounded Corners and Borders in Android Studio

I want to add rounded corners and borders to a textview. But only the top corners should be rounded and the bottom should be without border. Already found this: https://www.android-examples.com/add-rounded-border-to-textview-programmatically/ But…
user12885406
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
7 answers

View with round corners not smooth

Have a look at my code below. ShapeDrawable shapeDrawable = new ShapeDrawable(new RectShape()); shapeDrawable.getPaint().setColor(Color.parseColor("#5a2705")); shapeDrawable.getPaint().setStyle(Style.STROKE); …
Goofy
  • 6,098
  • 17
  • 90
  • 156
3
votes
1 answer

Message Bubble Custom Drawable

I will share the image below that I want to develop my message bubble in Native Android I have written some code in Custom Drawable XML please have a look and I will share the image what it looks like, first see the code:
3
votes
3 answers

How do I use a floating action button as a square?

There are tons of SO threads saying their button is appearing as a square do to a bug Floating Action Button with square shape Square FloatingActionButton with Android Design Library Floating Action Button appearing as a square However my goal is to…
3
votes
1 answer

Custom border layout contains half of a circle

I need create xml with two layout title and description. In title layout I need add border have half of circle in bottom left and right, and with description layout border have half of circle in top left and right. Here is my design I can do it…
Hoa.Tran
  • 935
  • 10
  • 26
3
votes
1 answer

How to give Material Button ShapeAppearance seperate to Edittext Shape Appearance?

In android, you could setup a theme with ShapeAppearance.MaterialComponents.SmallComponent so if I set,