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
class MainActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
enableEdgeToEdge() | |
setContent { | |
BorderPathTheme { | |
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -> | |
Box( | |
modifier = Modifier | |
.fillMaxSize() |
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
@Composable | |
fun HomeList(taskViewModel: ListViewModel = viewModel()) { | |
val coroutineScope = rememberCoroutineScope() | |
val scaffoldState = rememberScaffoldState() | |
val onShowSnackbar: (Task) -> Unit = { task -> | |
coroutineScope.launch { | |
val snackbarResult = scaffoldState.snackbarHostState.showSnackbar( | |
message = "${task.title} completed", | |
actionLabel = "Undo" |
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
package net.ayataka.bas.utils | |
import kotlinx.coroutines.experimental.* | |
import net.ayataka.bas.LOGGER | |
import kotlin.system.measureTimeMillis | |
fun CoroutineScope.timer(interval: Long, fixedRate: Boolean = true, action: suspend TimerScope.() -> Unit): Job { | |
return launch { | |
val scope = TimerScope() |