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
3
votes
2 answers

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 bitmap). Logo need to be located at the bottom of…
ibogolyubskiy
  • 2,271
  • 3
  • 26
  • 52
3
votes
0 answers

Why layer drawable image get stretched When making a drawable using multiple layers

I have made an image by combining multiple images putting one over another Using LayerDrawable But the final image is getting streched Here is my code for making a layerdrawable Bitmap mainBitmap; Resources r = getResources(); Drawable[] layers…
Sandeep dhiman
  • 1,863
  • 2
  • 17
  • 22
3
votes
3 answers

android shape xml rotated drawable change color programmatically

This is a xml for triangle shape:
skhizein
  • 437
  • 1
  • 9
  • 15
3
votes
1 answer

Custom LayerDrawable: onStateChange never called

I extended the LayerDrawable to automatically change the Alpha Value when pressed my ImageButtons: protected class CustomDrawable extends LayerDrawable { protected int _pressedAlpha = 60; public CustomDrawable(Drawable d) { …
knete
  • 113
  • 1
  • 7
3
votes
1 answer

Issue with adding a StateListDrawable with LayerDrawable to a Button programmatically

I hope anybody can help me with this frustrating issue I am currently experiencing: I try to programmatically add a StateListDrawable to one of my buttons: final Button btn_footer = (Button)findViewById(R.id.btn_footer); btn_footer.setBackground(new…
AustrianDude
  • 226
  • 2
  • 16
3
votes
0 answers

How to alter LayerDrawable within ImageView?

I'm adding a couple of ImageView to a LinearLayout programmatically, those ImageView have its src set to R.drawable.rectangle. I'm trying to create a rectangle with solid color that has a border only to the left. R.drawable.rectangle looks like…
maraujop
  • 4,472
  • 2
  • 36
  • 40
2
votes
2 answers

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. And one with some inset. ColorDrawable…
lostintranslation
  • 23,756
  • 50
  • 159
  • 262
2
votes
0 answers

Facing Error while saving Layer Drawable

I am beginner and i'm trying to create an app like retrica or other apps like it. But i'm facing some problems like saving an image from imageview.i'm using layerdrawable to implement frames,clip_arts and filters etc. i'm getting error 08-12…
2
votes
0 answers

Android Development - How to convert LayerDrawable to Drawable or Bitmap

I'm coding a simple app which takes two images 1)Photo and 2)Filter(Image file) and then Filter will be applied on the photo. But I also want to save the Image in internal storage after the images are overlapped. As you can see in below code, in…
2
votes
0 answers

How can I change ALL bitmaps on a layer-list programmatically?

Here is the layer-list, named index.xml:
Sina001
  • 21
  • 3
2
votes
1 answer

Why is the color transition animation wrong when ViewPager scroll left?

I put a ViewPager with transparent background over another background view, and when the ViewPager scrolls, I change the background view's color with a smooth color transition, for example: On page 1, the background is RED. When ViewPager scrolls…
NeoWang
  • 17,361
  • 24
  • 78
  • 126
2
votes
0 answers

Java Android - LayerDrawable doesn't show

I got a very strange case - I got 2 LayerDrawables to show progress of downloading and progress of audio playback. here's free_downloads.xml :
Vlad Alexeev
  • 2,072
  • 6
  • 29
  • 59
1
vote
1 answer

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, no matter what I try, the ring isn't being…
SmallGrammer
  • 893
  • 9
  • 19
1
vote
1 answer

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-list drawable XML code:
1
vote
1 answer

LayerDrawable change together

I have a magic problem. All instance of LayerDrawable change together. I have several typical Views. So to done my task i decide "I will be used "Composite view". I got a problem: When i change visibility on one Layer drawable< the change on…
Vitaliy Ptitsin
  • 329
  • 1
  • 5
  • 14