Skip to content

Instantly share code, notes, and snippets.

💭
hacking in progress..¯¯̿̿'̿̿̿'̿̿̿)͇̿̿)̿̿̿̿ '̿̿̿̿̿̿\̵͇̿̿\=(•̪̀●́)=o/̵͇̿̿/'̿̿ ̿ ̿̿

Alex Doub alexdoub

💭
hacking in progress..¯¯̿̿'̿̿̿'̿̿̿)͇̿̿)̿̿̿̿ '̿̿̿̿̿̿\̵͇̿̿\=(•̪̀●́)=o/̵͇̿̿/'̿̿ ̿ ̿̿
Block or report user

Report or block alexdoub

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View getAllChildren
@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
@alexdoub
alexdoub / gist:a9320c42008016b4947a7de342b1c67e
Last active May 21, 2019
Parallel coroutine extensions
View gist:a9320c42008016b4947a7de342b1c67e
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) }
You can’t perform that action at this time.