Questions tagged [layerdrawable]

A Drawable that manages an array of other Drawables. These are drawn in array order, so the element with the largest index will be drawn on top.

A Drawable that manages an array of other Drawables. These are drawn in array order, so the element with the largest index will be drawn on top.

Click Here for documentation.

59 questions
0
votes
1 answer

LayerDrawable as background drawable does not work on minSdkVersion=15 or lower

Although I couldn't find any SDK version constraints for LayerDrawable (added in API level 1), the one I am using as a background acts differently depending on the minSdkVersion: if it is 15 or lower, the background is completely black, if it is 19…
0
votes
2 answers

layerDrawable not displaying on imageButton for smaller screens

So, my general issue is that I'm trying to dynamically set imageButton images based on grabbing an 80 x 80 area of a number of 400 x 600 png Drawables, layer them, and imageButton.setImageDrawable() them into the buttons. This actually…
Darin LaSota
  • 261
  • 1
  • 3
  • 9
0
votes
0 answers

How to inflate badge counter in MenuItem using custom LayerDrawable

I was following this article. Unfortunatelly, badge isn't drawn. Of course I changed invalidateOptionsMenu method to supportInvalidateOptionsMenu method. I was checking the log, step by step and found out that draw method in custom Drawable named…
Jack Lynx
  • 216
  • 2
  • 12
0
votes
2 answers
0
votes
1 answer

Display images layer by layer in ImageView not works

In my application I have a set of drawbles. I have to show it as layer by layer. For that I am using LayerDrawble. I have used it in this way ImageView image = (ImageView)findViewById(R.id.image); Resources r =…
droidev
  • 7,352
  • 11
  • 62
  • 94
0
votes
0 answers

Glide with LayerDrawable in GestureImageView

I'm using a GestureImageView to display a map with a custom layer for the selected theme. Depending on the theme I'm loading a LayerDrawable in the GestureImageView. The way I use it, the Bitmaps are killing my memory and will throw a…
Stefan
  • 2,098
  • 2
  • 18
  • 29
0
votes
1 answer

How to set Opacity of overlay? Android LayerDrawable

layers[0] = view.getDrawable(); layers[1] = r.getDrawable(R.drawable.dr); LayerDrawable layerDrawable = new LayerDrawable(layers); int width = layerDrawable.getIntrinsicWidth(); int height =…
pmipmi
  • 109
  • 1
  • 1
  • 4
0
votes
1 answer

how to layer two buttons with graphics/color that are set programmatically

I have to layer two Buttons. The first (top) button is created like this using a .png for the icon. // create circular button and colorize View button1 = v.findViewById(bId); GradientDrawable backgroundGradient =…
droideckar
  • 1,077
  • 10
  • 20
0
votes
1 answer

How to make a LayerImageDrawable with different types of gravity

I am trying to build an image view that has two images inside of it; a photo in the background with a small indicator on top of it. However, I'm stuck in trying to get the indicator to appear in the bottom-right of the image, while the photo in the…
Erik
  • 3,598
  • 14
  • 29
0
votes
1 answer

Multiple images single view mispositioned Android

I am following the answer given here Array of images stacked next to each other, using LayerDrawable.(Displaying multiple image in single imageview) . My images are 38x38 sized. This is my code: Drawable[] layers = new…
Ssr1369
  • 348
  • 3
  • 16
0
votes
3 answers

Android button.setBackground

I want to set background for the button. With Android 4.1.2 everything works fine, but if launch with Android 4.0 I've got an error java.lang.NoSuchMethodError: android.widget.Button.setBackground with code LayerDrawable composite = new…
0
votes
0 answers

LayerDrawable goes off the screen in a ListView and doesn't draw when I scroll ListView back to it

I've a ListView and when my audio is paused I draw a LayerDrawable to show progress of how much was played. The problem is when I sroll this ListView element off the screen and get it back - I don't see any of the Image back there. This is part from…
Vlad Alexeev
  • 2,072
  • 6
  • 29
  • 59
0
votes
1 answer

Array of images stacked next to each other, using LayerDrawable.(Displaying multiple image in single imageview)

I have 5 images, I need to display this horizontally spaced one after the other. Instead of using 5 different images to display these 5 images in a LinearLayout with horizontal orientation, I would like to use a single image view. With LayerDrawable…
Jeevan
  • 8,532
  • 14
  • 49
  • 67
0
votes
1 answer

Display image after image, as in layers to create a single image

Hi I am making a hangman, and I need to show image after image each time the player fails an attempt eg head first, then the body ect. I'm doing a layerdrawable but not how to scale it to the original image, how climb as I show the image and the…
1 2 3
4