In Android, a Drawable is a general abstraction for "something that can be drawn."
Questions tagged [android-drawable]
2993 questions
1
vote
5 answers
how to use drawable to compatible with all screen sizes (idpi, mdpi, hdpi, xhdpi, xxhdpi)
Hello I am new in android programing so I want to know:
How to use drawable to compatible with all screen sizes (idpi, mdpi, hdpi, xhdpi, xxhdpi)
Actually I am confused about drawable screen sizes compatibility with all screen sizes
so I want to…

user3441251
- 27
- 2
- 7
1
vote
2 answers
Passing Drawables between Activities
I am trying to pass a drawable between activities. I am unsure as to whether I can just get a drawables resourceID from an alertdialog and pass that value as an Int to another activity.
I have explored changing the drawable to a bitmap, and I have…

Coova
- 1,818
- 5
- 36
- 63
1
vote
2 answers
How to create a xml drawable like this
I need to create a drawable with a 3dp height line/rectangle on top, a black rectangle with 70% opacity and 2dp height line/rectangle on the bottom. How can I do this?
Here is the code I'm using:

juliano.net
- 7,982
- 13
- 70
- 164
1
vote
3 answers
Trouble while settings drawable images in Arraylist in android
I want to set images in Array list from drawable here is my code
private ArrayList timeNames = new ArrayList();
timeNames.add(R.drawable.azaan_fajar_eng);
timeNames.add(R.drawable.azaan_fajar_eng1);
…

user3409263
- 117
- 1
- 4
- 11
1
vote
1 answer
How to get x & y of a bitmap, the position of bitmap in the screen
I have a bitmap image that moves along a path, all I want is to be able to retrieve the x and y of the bitmap while it moving along the path.
thanks

Ofcourse
- 617
- 1
- 7
- 19
1
vote
1 answer
Using Drawables inside an Dialog
I am running into an issue and don't know the best way to use a set of drawables inside an AlertDialog. The AlertDialog is presented when a user presses a button and is prompted to choose from a list of drawables.
Currently it shows Buttons I have…

Coova
- 1,818
- 5
- 36
- 63
1
vote
1 answer
Starred feature with onClick
Hello i have one imageView on my view. In my activity i create in onCreate an ArrayList, where if you click on the imageView, a name will be added. So if the list contains this name, the filled star image will be loaded from the drawable folder. And…

mcjonesman
- 27
- 6
1
vote
2 answers
How to use BitmapDrawable's constructor/ Making a temporary load image?
Here it says this
BitmapDrawable()
This constructor was deprecated in API level 4. Use BitmapDrawable(android.content.res.Resources, android.graphics.Bitmap) instead to specify a bitmap to draw with and ensure the correct density is set.
I'm…

Shishi
- 601
- 2
- 8
- 27
1
vote
0 answers
Android RadialGradient is getting corrupted
I am drawing a radial gradient as a glow effect for selection. Everything was working until I drew another circle on top of the gradient. First off, here is my gradient and code:
Radial gradient. Note that the size and position are set dynamically,…

Mark Herscher
- 1,761
- 2
- 19
- 32
1
vote
1 answer
How to change background of date in calendarview
I am using calendarviewand what I want to change is the background view of date,now suppose if user has clicked on 15th December so after clicking on it a image which is stored in drawable folder should appear instead of 15th. Is there any method…

pushpendra chauhan
- 2,205
- 3
- 20
- 29
1
vote
2 answers
circular layout design in Android ui
I am trying to design ui part in android which hold a logo in the center of the layout.and every image take a certain distance and take position respect radius with making circle and another image take same and some far than the one..just like…

Dhiman
- 146
- 1
- 5
- 21
1
vote
1 answer
Change color of button on toggle
I have an image button (star) which is used to mark something as favorite. I envision that when the user clicks on the star, the star will turn yellow. When they click on an already yellow start, it will go back to normal.
Transition from one color…

birdy
- 9,286
- 24
- 107
- 171
1
vote
1 answer
Combine background color and texture for Android view
For various Views in Android, I use a simple background color so far. But in order to make it more interesting, I'd like to add a texture or noise to the background.
Finding background patterns is easy. And making them into a tiled BitmapDrawable to…

caw
- 30,999
- 61
- 181
- 291
1
vote
1 answer
Load drawable from arraylist using Lazy Image Loader or Universal Image Loader
I just want to ask, is that possible to load drawable from arraylist inside arrays.xml using Lazy Image Loader or Universal Image Loader?
First load arraylist of drawable
....
ArrayList sample_list = new…

user3273595
- 83
- 1
- 1
- 10
1
vote
0 answers
Android Drawable Cascade Rectangle and add Bitmap
I am new to use Android XML drawables. I am trying to define a simple drawable layerlist that has a gray stroke outer rectangle with a white stroke inner rectangle. The two rectangles should all have stroke width = 1 and the inner rectangle should…

Allan Jiang
- 11,063
- 27
- 104
- 165