android-selector-chapek
介绍:
一个根据资源文件名自动生成相应drawable selector的Android Studio插件。
运行效果:
使用说明:
如何安装
-
in Android Studio:
Preferences→Plugins→Browse repositories
and search forSelectorChapek
or
-
download it and install via
Preferences→Plugins→Install plugin from disk
如何使用
右击你的资源文件,比如'drawable-xhdpi'
在弹出的菜单中选择'Generate Android Selectors'
所有的selector将自动出现在你的drawable目录!
命名规范
为了插件能工作,资源文件需要取恰当的名字。插件支持在文件名任意位置带有后缀的png或者.9图片。
文件名到drawable状态的映射
File name suffix | Drawable state |
---|---|
_normal | (default state) |
_pressed | state_pressed |
_focused | state_focused |
_disabled | state_enabled (false) |
_checked | state_checked |
_selected | state_selected |
_hovered | state_hovered |
_checkable | state_checkable |
_activated | state_activated |
_windowfocused | state_window_focused |
已下载
0