Questions tagged [android-drawable]

In Android, a Drawable is a general abstraction for "something that can be drawn."

2993 questions
158
votes
5 answers

Storing R.drawable IDs in XML array

I would like to store drawable resources' ID in the form of R.drawable.* inside an array using an XML values file, and then retrieve the array in my activity. Any ideas of how to achieve this?
gammaraptor
  • 1,886
  • 3
  • 14
  • 16
152
votes
26 answers

How to fix: android.app.RemoteServiceException: Bad notification posted from package *: Couldn't create icon: StatusBarIcon

I'm seeing the following exception in crash logs: android.app.RemoteServiceException: Bad notification posted from package com.my.package: Couldn't create icon: StatusBarIcon(pkg=com.my.package user=0 id=0x7f02015d level=0 visible=true num=0 ) …
139
votes
16 answers

Style bottom Line in Android

I need to create an android shape so that only the bottom has stroke (a dashed line). When I try the following, the stroke bisects the shape right through the center. Does anyone know how to get it right? the stroke needs to be the bottom…
Cote Mounyo
  • 13,817
  • 23
  • 66
  • 87
130
votes
8 answers

Progress bar with rounded corners?

I am trying to achieve this progress bar design: The current code that I have produces this: This is the code:
Georgi Koemdzhiev
  • 11,421
  • 18
  • 62
  • 126
121
votes
4 answers

How to center vector drawable in layer-list without scaling

I am attempting to use a VectorDrawable in a LayerList without scaling the vector. For example:
ashughes
  • 7,155
  • 9
  • 48
  • 54
114
votes
7 answers

Drawable image on a canvas

How can I get an image to a canvas in order to draw on that image?
Lana
  • 1,161
  • 3
  • 8
  • 5
109
votes
10 answers

how to change a drawableLeft icon size on a button?

I added some icons on 4 buttons and they look so big next to the button. So how can I resize them? I used drawableLeft on the buttons to add icons. The drawables are called deal, trophy, puzzle and megaphone. The icons are too big. The…
Arda Çebi
  • 1,705
  • 4
  • 15
  • 27
103
votes
8 answers

Open-sided Android stroke?

Is it possible to create an Android shape object with stroke on only certain sides? Eg I have: Which is similar to this…
Reed Morse
  • 1,398
  • 2
  • 10
  • 17
102
votes
5 answers

How to reference style attributes from a drawable?

I want to have 2 selectable themes for my application. In order to do that, I defined some attributes, like this: Then, I created both themes, like this: