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
@JvmStatic | |
fun getAllChildren(v: View, recursive: Boolean, ignoredElements: List<View>): ArrayList<View> { | |
if (v !is ViewGroup || v.childCount == 0) { | |
val r = ArrayList<View>() | |
r.add(v) | |
return r | |
} else { | |
val list = ArrayList<View>() | |
list.add(v) | |
val children = v.childCount |
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
import kotlinx.coroutines.GlobalScope | |
import kotlinx.coroutines.async | |
import kotlin.coroutines.CoroutineContext | |
suspend fun <A, B> Collection<A>.parallelMap( | |
context: CoroutineContext = GlobalScope.coroutineContext, | |
block: suspend (A) -> B | |
) = map { | |
GlobalScope.async(context) { block(it) } |