Skip to content
Snippets Groups Projects
Commit 7db3e06e authored by Robert Stone's avatar Robert Stone Committed by Nicolas Pomepuy
Browse files

Add extension to convert from boolean to integer

parent a2561409
No related branches found
No related tags found
1 merge request!1034Update shuffle strategy and android auto behavior
......@@ -55,6 +55,8 @@ fun View?.setGone() = setVisibility(View.GONE)
val Int.dp: Int get() = (this * Resources.getSystem().displayMetrics.density).toInt()
val Int.px: Int get() = (this / Resources.getSystem().displayMetrics.density).toInt()
fun Boolean.toInt() = if (this) 1 else 0
fun CoroutineScope.conflatedActor(time: Long = 2000L, action: suspend () -> Unit) = actor<Unit>(capacity = Channel.CONFLATED) {
for (evt in channel) {
action()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment