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
60
questions
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? {
...
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,...
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-...
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....
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 ...
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....
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 ...
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 = ...
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 ...
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:...
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 ...
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,...
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 ...
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?
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 ...