-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
15 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,5 @@ kotlin { | |
tvosSimulatorArm64() | ||
watchosArm32() | ||
watchosArm64() | ||
watchosDeviceArm64() | ||
watchosX64() | ||
} |
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
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 |
---|---|---|
@@ -1,22 +1,26 @@ | ||
package com.github.ajalt.mordant.main | ||
|
||
import com.github.ajalt.mordant.animation.coroutines.animateInCoroutine | ||
import com.github.ajalt.mordant.animation.progress.animateOnThread | ||
import com.github.ajalt.mordant.animation.progress.execute | ||
import com.github.ajalt.mordant.markdown.Markdown | ||
import com.github.ajalt.mordant.rendering.AnsiLevel | ||
import com.github.ajalt.mordant.terminal.Terminal | ||
import com.github.ajalt.mordant.widgets.progress.progressBar | ||
import com.github.ajalt.mordant.widgets.progress.progressBarLayout | ||
import kotlinx.coroutines.coroutineScope | ||
import kotlinx.coroutines.delay | ||
import kotlinx.coroutines.launch | ||
|
||
fun main(args: Array<String>) { | ||
suspend fun main(args: Array<String>) = coroutineScope{ | ||
// make sure that the terminal detection doesn't crash. | ||
Terminal() | ||
|
||
// make sure animations and markdown don't crash. | ||
val t = Terminal(interactive = true, ansiLevel = AnsiLevel.TRUECOLOR) | ||
val animation = progressBarLayout { progressBar() }.animateOnThread(t, total = 1) | ||
animation.execute() | ||
val animation = progressBarLayout { progressBar() }.animateInCoroutine(t, total = 1) | ||
launch { animation.execute() } | ||
t.print(Markdown("- Your args: **${args.asList()}**")) | ||
Thread.sleep(100) | ||
delay(100) | ||
animation.update { completed = 1 } | ||
} |