Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inmite/android-selector-chapek
Android Studio plugin which automatically generates drawable selectors from appropriately named resources.
https://github.com/inmite/android-selector-chapek
Last synced: 10 days ago
JSON representation
Android Studio plugin which automatically generates drawable selectors from appropriately named resources.
- Host: GitHub
- URL: https://github.com/inmite/android-selector-chapek
- Owner: inmite
- License: apache-2.0
- Created: 2013-08-19T17:19:49.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-03-14T08:58:35.000Z (over 8 years ago)
- Last Synced: 2024-10-15T11:03:55.573Z (25 days ago)
- Language: Java
- Size: 816 KB
- Stars: 1,574
- Watchers: 57
- Forks: 198
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-android-tools - Android Selector Chapek - Android Studio plugin which automatically generates drawable selectors from appropriately named resources (Intellij Plugin)
- awesome-android-tips - android-selector-chapek
- awesome - android-selector-chapek - Android Studio plugin which automatically generates drawable selectors from appropriately named resources. (etc)
- awesome - android-selector-chapek - Android Studio plugin which automatically generates drawable selectors from appropriately named resources. (etc)
README
# SelectorChapek for Android
This Android Studio plugin automatically generates drawable selectors from appropriately named Android resources.
## How to install it:
- in Android Studio: go to `Preferences→Plugins→Browse repositories` and search for `SelectorChapek`
_or_
- [download it](http://plugins.jetbrains.com/plugin/7298) and install via `Preferences→Plugins→Install plugin from disk`
## How to use it:
1) Right-click folder with your resources e.g 'drawable-xhdpi'
![](img/select_folder.png)
2) Select 'Generate Android Selectors'
![](img/select_option.png)
3) All selectors _automagically_ appear in the 'drawable' folder!
![](img/selectors_generated.png)
## Naming convention:
In order of plugin to work, resources need to be appropriately named. The plugin supports png or nine-patch files with certain suffices anywhere in the file name. You can also combine any suffixes together.### Mapping
| 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 |## Wishlist
- UI which will tell you which selectors will be generated
- possibility to change naming mapping_Pull requests are welcomed!_
## Why 'Chapek'?
[Karel Čapek](http://en.wikipedia.org/wiki/Karel_%C4%8Capek) was a famous Czech writer, inventor of the word 'robot'. The word comes from Czech word 'robota', which means 'hard manual labor'. As with Čapek's robots, this plugin will remove your unnecessary manual labor.
See [**our other Czech personalities**](http://inmite.github.io) who help with [#AndroidDev](https://plus.google.com/s/%23AndroidDev).