Skip to content

Commit

Permalink
Adds AutoDispose and adds dummy kotlin file
Browse files Browse the repository at this point in the history
  • Loading branch information
Aritra Roy committed Apr 19, 2018
1 parent 2dddcdc commit 9d0eea2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -274,6 +274,7 @@ Remixer is a framework to iterate quickly on UI changes by allowing you to adjus

### Utilities (Advanced)

* [AutoDispose](https://github.com/uber/AutoDispose) - Automatic binding+disposal of RxJava 2 streams
* [Android KTX](https://github.com/android/android-ktx) - A set of Kotlin extensions for Android app development
* [EventBus](https://github.com/greenrobot/EventBus) - Android optimized event bus that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality
* [JavaPoet](https://github.com/square/javapoet) - A Java API for generating .java source files.
Expand Down
19 changes: 19 additions & 0 deletions others/VersionExtensions.kt
@@ -0,0 +1,19 @@
package com.aritraroy.utils

import android.os.Build

inline fun supportsKitKat(code: () -> Unit) {
supportsVersion(code, 19)
}

inline fun supportsLollipop(code: () -> Unit) {
if (Build.VERSION.SDK_INT >= 21) {
code.invoke()
}
}

inline fun supportsVersion(code: () -> Unit, sdk: Int) {
if (Build.VERSION.SDK_INT >= sdk) {
code.invoke()
}
}

0 comments on commit 9d0eea2

Please sign in to comment.