/Android-Versions

I got tired of writing Build.VERSION.SDK_INT >= Build.VERSION_CODES.BLAH. This shorthands it and gives easier to read methods vs long conditional statements.

Primary LanguageJavaApache License 2.0Apache-2.0

Build Status

Android Versions

Check versions without typing a bunch of easy to typo nonsense. Uses IntDef for source completion and static methods for easy to read conditionals.

Usage

Naturally describe what you would like to test much like testing frameworks.

if (Is.greaterThan(LOLLIPOP)) {
    ...
}

if (Is.lessThanOrEqual(JELLY_BEAN_MR1)) {
    ...
}

For the SDK versions you can either implement the SdkVersion interface or use the definitions directly SdkVersion.MARSHMALLOW.

Gradle

Use mavenCentral() repository.

compile 'com.ToxicBakery.android.version:versions:+@aar'