Skip to main content

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.

layerdrawable
0 votes
0 answers
18 views

4 images in a LayerDrawable display - only one is displayed

I can't manage to display 4 images in a LayerDrawable. Only one is always displayed. Here is the main code for it private fun getClusterIcon(cluster: Cluster<Store>): BitmapDescriptor? { ...
Captai-N's user avatar
  • 1,392
2 votes
1 answer
965 views

Layer Drawable/Layer list is not drawing shapes on top of each other

I'm trying to create a circle button with a yellow ring around it. I'm trying to use layer list as a drawable resource file and to have the circle button in the background and the ring on top. However,...
SmallGrammer's user avatar
  • 1,233
1 vote
1 answer
167 views

layer-list drawable gets automatically converted to BitmapDrawable

I have created a layer list drawable of 3 bitmap drawables in xml. When I try to retrieve that drawable in java code, I receive a BitmapDrawable object, not a LayerDrawable object. Here is my layer-...
Mina Nazmy Moneer's user avatar
0 votes
2 answers
244 views

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....
Jaimin Modi's user avatar
  • 1,631
0 votes
0 answers
70 views

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 ...
Amol's user avatar
  • 1
2 votes
2 answers
223 views

How to create simple layer drawable in button

I am trying to better understand how layer drawables work within a buttons drawable(s). I am trying to draw 2 simple colored boxes, one without insets so that it fills the entire button drawable area....
lostintranslation's user avatar
6 votes
3 answers
5k views

Drawable already belongs to another owner but does not expose a constant state

Error: Invalid drawable added to LayerDrawable! Drawable already belongs to another owner but does not expose a constant state. I suddenly noticed this error today, and I'm not sure if it was because ...
eckc's user avatar
  • 588
3 votes
1 answer
249 views

MenuItem.setIcon throws NullPointerException when using BottomNavigationBar

I swapped out the drawer-navigation with a bottomnavigationbar and found out that I couldn't use actionviews any longer, which is why I used LayerDrawables for my icons. final Menu menu = ...
TormundThunderfist's user avatar
0 votes
2 answers
93 views

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 ...
valdvit's user avatar
  • 267
9 votes
1 answer
13k views

How to make a circular drawable with stroke, programmatically?

Background I'm trying to have a filled circle, with a stroke of certain color and width, and an image inside. This can easily be done in XML, as such (this is just a sample) : <layer-list xmlns:...
android developer's user avatar
19 votes
2 answers
13k views

How to merge two Drawables dynamically in Android?

so I have two different Drawables which I need to merge and get a single Drawable at runtime. I want the first Drawable to be at the top and the other one at the bottom. I came across LayerDrawable ...
akshayt23's user avatar
  • 2,903
0 votes
1 answer
762 views

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,...
Jacob's user avatar
  • 373
3 votes
1 answer
1k views

Exception from LayerDrawable

I've an android app that using android support library version 23.2.1 and everything is working fine. However, I've updated the android support library version to 25.2.0 yesterday and realize some of ...
Bryanleesh's user avatar
16 votes
0 answers
368 views

LayerDrawable addLayer in < API level 23

Is there a way add a layer to a LayerDrawable on API < 23? Do I have to create a new LayerDrawable using the constructor just adding the new layer?
Veneet Reddy's user avatar
  • 2,817
3 votes
2 answers
1k views

Android translucent status bar but non-translucent navigation bar (if present)

I'm trying to create splash screen for android application with this article: Splash Screens the Right Way. As article says, I created LayerDrawable with two layers: background bitmap and logo (also ...
ibogolyubskiy's user avatar

15 30 50 per page