Questions tagged [shapedrawable]

99 questions
0
votes
0 answers

How does this Mediapipe/OpenCV code detect shape drawing through hand detection?

Apologies if i format this wrong its my first question! but I'm new to Mediapipe and OpenCV and I am trying to figure out a snippet of code. It seems to run the webcam and hand detection fine however it does not output any shape or text in the…
0
votes
0 answers

How to create custom ShapeDrawable in Android

I am working with ShapeDrawables in Android (Kotlin), specifically Circles and Squares that are moving on canvas. But I need other shapes (like triangle, or hexagon), which I failed to create. I am creating those shapes using: val shapeDrawable =…
0
votes
2 answers

How to create a ring (round) ShapeDrawable

I need to set a round shape on top of an ImageView Here is what I've tried so far: float[] outerR = new float[]{8, 8, 8, 8, 8, 8, 8, 8}; RoundRectShape roundrect = new RoundRectShape(outerR, null, null); ShapeDrawable drawable = new…
justmee
  • 355
  • 2
  • 14
0
votes
1 answer

Is it possible to specify border in android button with keeping its background?

Is it possible to specify border in android button in its Activity? I want keep button png background and add specify border to that and remove it or change color of that dynamically. A puzzle board consists of a few buttons in order to be…
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
0 answers

Drawing Custom Drawable Shapes in android

Hi Guys I'm new in android development and i want to create a custom shape like the one shown in the below image. I want to know if this can be achieved using xml markup or what is the right way to do it?
0
votes
1 answer

drawing a pop-up with ShapeDrawable (Android)

I want to achieve something like this: Is it possible with shapedrawable? how do I place the "triangle" part beneath the rectangle?
BVtp
  • 2,308
  • 2
  • 29
  • 68
0
votes
1 answer
0
votes
0 answers

Create complex drawable dynamically

I want to create the following drawable dinamically to use it inside a Circle Progress bar:
MarcForn
  • 3,321
  • 7
  • 25
  • 39
0
votes
1 answer

Altered GradientDrawable gets unwantedly reused in different places

I have a ShapeDrawable drawable/my_shape.xml
OneWorld
  • 17,512
  • 21
  • 86
  • 136
0
votes
1 answer

ShapeDrawable with black border on top

I'm trying to create a ShapeDrawable for the background of my table cells. At the moment, I have a white rectangle with a 1px black border:
Nat
  • 53
  • 1
  • 1
  • 6
0
votes
3 answers

Replaced drawable images in the custom listAdapter in android changes after scrolling the listview. Why?

I use the CustomBaseAdapter to represent the list in the listView. The MainActivity is shown in the first image below in the link image which contains the custom listView adapter. And now when i click one of the items at the position number [4] the…
0
votes
1 answer

Android Canvas for 2 coloured background

I want to achieve below meter by use of canvas . As you can see the black portion has 2 colors in it . I am able to set color of the black moving image using shape drawable. Code and image that I have achieved so far is given below. How can I have…
Payal
  • 903
  • 1
  • 9
  • 28
0
votes
0 answers

adding a dynamic drawable background to textView

I want to add dynamic background using drawable to a textView. I want the resulting textView to have the anything similar with the following background. This exact image doesn't matter. I just want to learn how to code this. Is there any way of…
harsh_v
  • 3,193
  • 3
  • 34
  • 53
0
votes
3 answers

Android drawable background doesn't show on devices

I want to give to a TextView a background. This background (classement_background.xml) is a drawable located in res/drawable. Here's its code :