https://github.com/blipinsk/intdefs
Android constants wrapped in @IntDef annotations
https://github.com/blipinsk/intdefs
android annotations
Last synced: 6 months ago
JSON representation
Android constants wrapped in @IntDef annotations
- Host: GitHub
- URL: https://github.com/blipinsk/intdefs
- Owner: blipinsk
- License: apache-2.0
- Created: 2016-10-01T13:21:19.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-01T21:47:11.000Z (about 9 years ago)
- Last Synced: 2025-03-24T06:11:18.884Z (7 months ago)
- Topics: android, annotations
- Language: Java
- Homepage:
- Size: 1.72 MB
- Stars: 17
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
IntDefs
=======
Android constants wrapped in `@IntDef` annotations.Not all of the constants... just the ones that would usually be used in `switch` statements.

Usage
=====
Currently there are 3 annotations implemented in the library:
1. `@Visibility`
* `View.VISIBLE`
* `View.INVISIBLE`
* `View.GONE`2. `@MotionEventAction`
* `MotionEvent.ACTION_DOWN`
* `MotionEvent.ACTION_UP`
* `MotionEvent.ACTION_MOVE`
* `MotionEvent.ACTION_CANCEL`
* `MotionEvent.ACTION_OUTSIDE`
* `MotionEvent.ACTION_POINTER_DOWN`
* `MotionEvent.ACTION_POINTER_UP`
* `MotionEvent.ACTION_HOVER_MOVE` (from `intdefs-v14`)
* `MotionEvent.ACTION_SCROLL` (from `intdefs-v14`)
* `MotionEvent.ACTION_HOVER_ENTER` (from `intdefs-v14`)
* `MotionEvent.ACTION_HOVER_EXIT` (from `intdefs-v14`)
* `MotionEvent.ACTION_BUTTON_PRESS` (from `intdefs-v23`)
* `MotionEvent.ACTION_BUTTON_RELEASE` (from `intdefs-v23`)
3. `@MotionEventAction_Simple`
* `MotionEvent.ACTION_DOWN`
* `MotionEvent.ACTION_UP`
* `MotionEvent.ACTION_MOVE`
* `MotionEvent.ACTION_CANCEL`
Add the annotation to a variable or to the method (result of the method to be exact) to specify the possible values for it.Including In Your Project
-------------------------1. If your `minSdk` is 23 or higher use this:
```xml
dependencies {
compile 'com.bartoszlipinski.intdefs:intdefs-v23:1.0.0'
}
```
2. Otherwise if your `minSdk` is 14 or higher use this:```xml
dependencies {
compile 'com.bartoszlipinski.intdefs:intdefs-v14:1.0.0'
}
```
3. Otherwise if your `minSdk` is 9 or higher use this:```xml
dependencies {
compile 'com.bartoszlipinski.intdefs:intdefs-v9:1.0.0'
}
```Contributions
-------------
If you think another set of constants should be included in the library, issues and pull requests are welcome.Developed by
============
* Bartosz LipińskiLicense
=======Copyright 2016 Bartosz Lipiński
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.