Questions tagged [android-shape]

This is a generic shape defined in XML.

This is a generic shape defined in XML.

Reference: http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape

191 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
1 answer

Custom drawable background for Android EditText

I would like to create a custom drawable background for an EditText component in my Android layout. This should include a lower border spanning the entire length of the EditText, and 2 connected vertical lines at either end which take up 25% of the…
0
votes
3 answers

How to make custom rectangle shape with hex color of any color with opacity?

Is there any possibility to draw a rectangle shape with any hex color with opacity for that color for example blue_color_background.xml
0
votes
2 answers

How can make custom shape with picture (inside the shape)

I'm new in android programming and I try design this shape: check this link to see the shape that I want to design it how can make this shape, and how to put picture in the shape like Alexandria? can any one help me? plz answer with all details to…
Kirollos Mallak
  • 359
  • 4
  • 12
0
votes
0 answers

Android: Create speech popup pointing up

I need to create a speech bubble pointing up, but I'm not familiar with android shapes, so looking for examples come across with one as expected, but pointing down, and as I don't know the meaning of pivotX and pivotY, all my attempts to invert the…
Diego Perez
  • 2,188
  • 2
  • 30
  • 58
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

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
1 answer

Resizing height in Shape Drawable

I have a shape drawable resource file. it's the drawable.xml code below.
CodingBruceLee
  • 657
  • 1
  • 5
  • 19
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
1 answer

Android: drawable ring shape multi-gradient

I'm trying to achieve something like the following: the image inside is not too much of a problem, but the ring appears to be one. I was able to do this: using:
jack_the_beast
  • 1,838
  • 4
  • 34
  • 67
0
votes
1 answer

draw circle on preview view is not accurate when dimension ratio is given

I'm trying to draw a circle on previewView by setOnTouchListener as below val shape = GradientDrawable() shape.shape = GradientDrawable.OVAL shape.setColor(Color.TRANSPARENT) shape.setStroke(5,…
Vikas Acharya
  • 3,550
  • 4
  • 19
  • 52
0
votes
1 answer

Set shape as ImageView background to get top corners rounded

I'm trying to build a layout with a ConstraintLayout with rounded corners inside a ScrollView. At the top of the layout I want to place an image that should have the top corners rounded (to match the layout corners) and the bottom corners…
0
votes
0 answers

Stacking / layering background shapes on TextView

I have a simple game where a user can highlight words: Each letter is a TextView. To highlight, the background is set to a shape like: top_curve.xml The code looks like this: // Method returns a Drawable like: // return…
TomSelleck
  • 6,706
  • 22
  • 82
  • 151
0
votes
0 answers

Android ImageView shape lost when image set

I'm using the ImageView with custom shape (it works well) but lost once an image is set to that ImageView. My ImageView:
Faisal
  • 1,332
  • 2
  • 13
  • 29
0
votes
1 answer

How to put background shapes in ConstraintLayout?

I had nested LinearLayouts and after reading some doc I tried to switch to ConstraintLayout. But I did not find how to insert a view to just display a background. So far I just set the background on the layout containing the items. This is what the…