Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds AutoDispose and adds dummy kotlin file
- Loading branch information
Aritra Roy
committed
Apr 19, 2018
1 parent
2dddcdc
commit 9d0eea2
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
} | ||
} |