July 2018
Intermediate to advanced
242 pages
8h 6m
English
private suspend fun `show progress animation`() { val progressBarLength = 30 var currentPosition = 0 while (true) { print("\r") val progressbar = (0 until progressBarLength) .map { if (it == currentPosition) " " else "░" } .joinToString("") print(progressbar) delay(50) if (currentPosition == progressBarLength) { currentPosition = 0 } currentPosition++ }}
runBlocking { val job = launch { `show progress animation`() }}
runBlocking { val job = launch { `show progress animation`() } delay(5000)}
Read now
Unlock full access