selector-drawable

Android Selector Drawable doesnt work with attributes

别来无恙 提交于 2019-12-18 12:05:54
问题 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 'com.android.support:cardview-v7:+' compile 'com.android.support:design:22.2.0' Here is the source code for drawable: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="?attr

Android Selector Drawable doesnt work with attributes

天大地大妈咪最大 提交于 2019-11-30 05:19:48
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 'com.android.support:cardview-v7:+' compile 'com.android.support:design:22.2.0' Here is the source code for drawable: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="?attr/colorPrimary" android:state_enabled="true" android:state_window_focused="false"/> <item android:drawable="?attr