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

layerlist drawable is not changed with imageview on click

I am setting a layer list to an imageview with drawable programatically in android My custom Drawable is as follows, package cl.tk.ui.iBAPView; import android.content.Context; import android.graphics.Bitmap; import…
1
vote
2 answers

LayerDrawable remove a layer

How can a layer be removed from LayerDrawable? addLayer can be used to add a layer, but I don't see a function that can be used to remove a layer. https://developer.android.com/reference/android/graphics/drawable/LayerDrawable.html
edA-qa mort-ora-y
  • 30,295
  • 39
  • 137
  • 267
1
vote
1 answer

How to combine shape drawable and drawable into single drawable

I am generating shape drawable and drawable runtime in android programmatically. What all I need is to combine two drawable into single drawable. I tried to implement through following methods, but nothing seems to work out. Sample code to combine…
1
vote
1 answer

LayerDrawable: can this be done more efficiently?

I have an ImageView, full width, and width:height = 3:1, let's call it 1200 x 400. I want to show two Drawables in the ImageView, both of which are only known at runtime. One of the drawables should be placed into the ImageView according to…
mathheadinclouds
  • 3,507
  • 2
  • 27
  • 37
1
vote
1 answer

Why dynamically created SeekBar is not with my color?

I have to create SeekBar with primary and secondary progress at runtime. Looking at tileify function for how should I treat LayerDrawable, and progress_horizontal_holo_dark.xml for proper IDs, i came up with following: // parent view …
milosjovac
  • 71
  • 1
  • 8
1
vote
0 answers

BitmapDrawable doesn't scale correctly in a LayerDrawable

I'm working on a blackjack game. I'm trying to display a player's hand using a layerdrawable. However, the card images aren't scaling correctly. They are far too wide. I've put my code below. Basically, I put a Bitmap into a BitmapDrawable which I…
user3522492
  • 125
  • 10
1
vote
0 answers

How to measure setLayerInset method's parameter of LayerDrawable

I am using the blow code but not understand what parameter should i set in setLayerInset.According to my experiment i used the blow parameter to set drawable ans draw border over this drawable. The problem is what i am facing now my layout is…
Akanksha Rathore
  • 3,603
  • 3
  • 31
  • 47
1
vote
0 answers

Android java No package identifier when getting value for resource number

I got an error in my logs so instead of layer-drawable I see no image. 12-07 12:45:42.988: W/ResourceType(19347): No package identifier when getting value for resource number 0x0000000d 12-07 12:45:42.990: W/ImageView(19347): Unable to find…
Vlad Alexeev
  • 2,072
  • 6
  • 29
  • 59
1
vote
0 answers

ProgressBar not an instance of LayerDrawable

I am trying to implement my own custom progressbar using 9 patch images. I am looking at the Sound ProgressBar example. http://www.jagsaund.com/blog/2011/11/6/customizing-your-progress-bar-part-one.html I have two problems that I have been unable…
ahmad
  • 2,149
  • 4
  • 21
  • 38
1
vote
3 answers

LayerDrawable OutOfMemoryError

I need to load 20+ images on top of each other to form an interactive map where each layer can be turned on and off. I decided to use a LayerDrawable for this, but I keep getting an OutOfMemoryError. Even after I set Large Heap to true, it'll be…
ZhaoYiLi
  • 173
  • 1
  • 10
0
votes
2 answers

Kotlin - Issue in converting Kotlin method to java for LayerDrawable

Below is the converted java function from Kotlin code funcion. @RequiresApi(api = Build.VERSION_CODES.M) public void setWhiteNavigationBar(@NonNull Dialog dialog) { Window window = dialog.getWindow(); if (window != null) { …
Jaimin Modi
  • 1,530
  • 4
  • 20
  • 72
0
votes
0 answers

how to "get" an upper layer from an existing (layerDrawable) background of an imagebutton?

I am creating an android app for playing Chess. I have used layerDrawable to display 2 layers of background (one layer to display a square of the Chessboard and another for the piece on it). But the problem is when I want to move the piece from…
Amol
  • 1
  • 1
0
votes
2 answers

Displaying a stack of images

Given: A number of images (10 - 15) residing in assets folder (as practice shows, the better approach is to keep high-resolution images in assets) Android UI thread (caching drawables in advance is already made in a background thread) The issue:…
krsnk
  • 267
  • 1
  • 10
0
votes
1 answer

Setting Foreground of AppCompatImageView programatically Android API 19

I'm currently creating a menu that lets users select an AppCompatImageView in a GridLayout and will show that the view is selected by placing a checkmark icon in the foreground of the image. In api 23, I can do this by simply calling…
Jacob
  • 363
  • 4
  • 12
0
votes
0 answers

access Menu in a private method

I'm adding a badge to an icon in Toolbar. I used onCreateOptionMenu to inflate the icon in toolbar. I need to used the Menu on a button click to use LayerDrawable for adding badge to the icon. I found that you can access Menu like this. But when I…
Somnath Pal
  • 137
  • 1
  • 4
  • 10