Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 570 Bytes

File metadata and controls

28 lines (23 loc) · 570 Bytes

Core Common

SdkVersion

A simple class for defining branching depending on the current version of the SDK. SdkVersion api designed in DSL style.

How to use:

 withVersion(Build.VERSION_CODES.LOLLIPOP) {
        higherOrEqual {
            doSomeThing()
        }
        lower {
           doSomeThingElse()
        }
    }

Also contains methods

 inline fun higher(function: () -> Unit): SdkVersion
 inline fun lowerOrEqual(function: () -> Unit): SdkVersion
 inline fun equal(function: () -> Unit): SdkVersion