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
2
votes
2 answers

How to make rounded corners for Toolbar?

I've seen other answers and they all apply to actionbars not toolbars and they require creating new shapes. Is there a simple way to do this using the styles.xml?
2
votes
4 answers

How to create corner radius in top left and bottom right in android?

How to create a corner radius in the top left and bottom right in android? Like this My code is
2
votes
7 answers

android:How to make triangular layout

I want to make custom Info window for google map I can make it but I am not able to make triangle bellow layout. I can add image there but layout have shadow on outer line. Anyone suggest me what to do. how to make portion inside red area. as you…
Mukesh Y.
  • 869
  • 1
  • 16
  • 36
2
votes
1 answer

create drawable shape of right angled triangle

I am trying to find out how to use drawable xml () to create a right angled triangle like below (but fill with color without the black line): I try to think from the angle of halving a rectangle from diagonal line, but still...can't find how…
Leem.fin
  • 40,781
  • 83
  • 202
  • 354
2
votes
2 answers

Cut part of XML shape

I have a rectangle shape view in XML:
blackJack
  • 380
  • 3
  • 21
2
votes
2 answers

Custom shape(rounded square) drawable android

I want custom shape border like the one shown below: This is what i have tried so far:
2
votes
1 answer

Android: multiple dashed line background using Shape Drawable

Is there a way to use a shape drawable or something comparable to create a dashed background for a view? Ideally, I'd like something like this (with different colors of course). Ignore the blue border, I'd just like the redlines ideally repeating as…
adrian
  • 2,326
  • 2
  • 32
  • 48
2
votes
1 answer

How to implement this control layout in Android?

I have several items I want to display. All the items have a title and subtitle. When I think about it's quite similar to bubbles in WhatsApp or Facebook. I guess these are implemented as 9-patch-drawables. My background is like a circle and…
Martin H.
  • 1,086
  • 1
  • 17
  • 28
1
vote
1 answer

square icon with rounded corners in an Android app

The following kotlin code is used to display a square icon in an Android app. But I would also like to set rounded corners to it; and this is where things go wrong. Any tip would be welcome as what to do to get the rounded corners working. val…
Michel
  • 10,303
  • 17
  • 82
  • 179
1
vote
2 answers

change the background color of textview according to textview shape when click on text view

I have three Material text views, I want to change the background color of the text view according to the text view shape. I tried multiple options but it goes outside of text view shape. I have round corners text view but color fill like a simple…
1
vote
1 answer

MaterialTextView shapeAppearanceOverlay not working

I am trying to achieve a simple rounded corner layout with a colored background on two specific MaterialTextViews. Codes are below:
1
vote
1 answer

how to make an Angled cuts top app bar using material design?

I found this guideline in material design io site, could anyone share your idea, how to make this using material design, not 3rd party plugin. Trying to reproduce using cut shape & an overlapping bottom sheet of Material Design, I looking standard…
1
vote
3 answers

XML Drawable creates an unintended line in the middle of my transparent ring shape

I'm trying to create a hollow circle in xml, using the ring shape in xml. However I end up getting a line that seems to showcase the radius of the circle, starting from the middle of the ring and going to the right. xml code for the shape I'm trying…
1
vote
1 answer

Can we create multiple shapes in one xml file and point them within this single file?

For example to create a button whose button_normal state shows some different style and button_pressed state shows some different style, we create three files: button_normal.xml
1
vote
3 answers

How to covert imageview into different shape?

Actually I wanna convert the image into the mentioned shape in picture . I've tried a lot of similar questions in SO but none of them were helpful. You may advise to use drawable in foreground of imageView but I've gotta set the foreground…
Srinivas Nahak
  • 1,846
  • 4
  • 20
  • 45