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

android- how to make a shape drawable

I want to make a drawable like this : this is my code so far:
0
votes
3 answers

How to create a shadow border inside a LinearLayout or EditText in android?

How to add a shadow border on 4 sides of an edit text as shown in the image? Applied below code but it creates a shadow on single side only.
0
votes
1 answer

Text View surrounded by Rectangular Shape has extra space in layout

This is the question I asked earlier today: Recreate shape as in xml file by using code and set width programmatically Using the above solution provided, I was able to get the desired result but there is a small issue which I can't figure out.…
0
votes
1 answer

Recreate shape as in xml file by using code and set width programmatically

I already have shape code and now I need to draw the same programmatically and set its width according to the length of texts in an array. I am not able to reproduce the same using path data. This is the code:
0
votes
2 answers

Android creates radius for rounded corners for smaller shapes only at left

I set android:radius="20dp" but why rounded corners only at the left? Red shape should also have rounded corners at the right as well
0
votes
2 answers

ImageView/Shape Drawable not rotating in landscape

I'm using an image view with its source pointing to a shape drawable for the background for my app. I want it to look like this which is in the layout preview (blue on the top, orange on the bottom). However, whenever I run it, it looks like this.…
SmallGrammer
  • 893
  • 9
  • 19
0
votes
1 answer

How to create layout with rounded bottom left and bottom right corners?

I am trying to make a layout with rounded bottom left and right corners but none of solution is working for me. I have tried various ways like:
Cosmic Dev
  • 522
  • 6
  • 20
0
votes
3 answers

Custom EditText background white color remove

I want to remove the background white color from the editText Search bar.I want the search bar seems floating above. Please anyone help... Here is the screenshot of . search_input_style.xml
0
votes
0 answers

How to Draw a animated line on an image in Android

Screenshot of my app What i want is draw a line between 2 points on an image(please See image Attached here) When user click Ok button and this line must be not directly drawned it takes total time of 10 sec to draw(some what like google…
0
votes
0 answers

View.setPadding affects background ShapeDrawable padding

I have a custom view with a background drawable. The drawable has an inside shape with padding. No padding is applied on the view itself. Whenever I set a padding on the view programmatically using View.setPadding(left,top,right,bottom), the shape…
0
votes
0 answers

change the radius of arc in ShapeDrawable in android

I am creating an app which shows the angle of tilt of device and with that, the arc sweep shows the angle subtended. I am able to create the arc using ShapeDrawable, but not able to change the radius of this arc. Below is the code i…
Tushar Seth
  • 563
  • 7
  • 15
0
votes
1 answer

how to create inside curve using relative or linear layout in android

How to create this in android layout i tried many ways but i didn't found any method to do this
0
votes
1 answer

ShapeDrawable not working on api lower than 21

I created a shapeDrawable border_white.xml:
Saul_programa
  • 341
  • 1
  • 4
  • 13
0
votes
3 answers

how to make a shape like the picture below using a shape drawable?

I met a difficulty in Android programming, I want to make a shape like the picture "supposed.bmp" I uploaded. But I don't know how to do that, I only made one like "actual.bmp" I uploaded by the code below.
Yu Leung
  • 15
  • 6
0
votes
1 answer

Android change color of shape Instance

I have three buttons with same ripple shape. when I enter activity I change color of single buttons shape. RippleDrawable bg = (RippleDrawable) button.getBackground(); GradientDrawable gradient = (GradientDrawable)…