Yorkie

ExamplesTodoMVC Android

TodoMVC Android

This is an example of real-time collaborative TodoMVC using Yorkie Android SDK.

    MainActivity.kt
    1package com.example.todomvc
    2
    3import android.os.Bundle
    4import androidx.activity.ComponentActivity
    5import androidx.activity.compose.setContent
    6import androidx.activity.enableEdgeToEdge
    7import androidx.compose.foundation.layout.fillMaxSize
    8import androidx.compose.foundation.layout.navigationBarsPadding
    9import androidx.compose.foundation.layout.statusBarsPadding
    10import androidx.compose.material.MaterialTheme
    11import androidx.compose.material.Surface
    12import androidx.compose.ui.Modifier
    13import androidx.navigation.compose.rememberNavController
    14import com.example.todomvc.ui.TodoAppHost
    15import com.example.todomvc.ui.theme.TodoMVCTheme
    16
    17class MainActivity : ComponentActivity() {
    18 override fun onCreate(savedInstanceState: Bundle?) {
    19 super.onCreate(savedInstanceState)
    20 enableEdgeToEdge()
    21 setContent {
    22 TodoMVCTheme {
    23 Surface(
    24 modifier = Modifier
    25 .fillMaxSize()
    26 .statusBarsPadding()
    27 .navigationBarsPadding(),
    28 color = MaterialTheme.colors.background,
    29 ) {
    30 TodoAppHost(navController = rememberNavController())
    31 }
    32 }
    33 }
    34 }
    35}
    GitHub
    Your browser does not support the video tag.