Questions tagged [selector-drawable]
4 questions
13
votes
5 answers
Android Selector Drawable doesnt work with attributes
I am using attr to create a selector drawable for my project so that once i change theme colors, i dont have to make any change in the drawable file. I am using following libs:
compile 'com.android.support:appcompat-v7:+'
compile…

mudit
- 25,306
- 32
- 90
- 132
5
votes
2 answers
Ripple effect inside of a selector
I would like to achieve a ripple effect when someone presses my ImageView, but also have different drawables for other states.
I have a very simple ImageView:

gruszczy
- 40,948
- 31
- 128
- 181
1
vote
0 answers
Drawable selector loses hover state when clicking with a physical mouse
I created a custom drawable (base on a drawable selector) for a regular Button and I decided to test my app with both a physical mouse and keyboard.
That's when I noticed that every time I click the button with the physical mouse, it loses the…

carlosrafaelgn
- 831
- 1
- 16
- 19
0
votes
1 answer
How to create selector drawable from color code programmatically in android
I want to create a selector drawable with #000000 for selected and #FFFFFF for unselected state.
How can I create a drawable programmatically?
Currently I am doing it as following:
StateListDrawable states = new StateListDrawable();
ColorDrawable…

Usman Afzal
- 558
- 1
- 6
- 13