mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 22:37:03 +05:30
Alternate between WireGuardItem and TodoRowItem
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
b6e01e71fa
commit
afe93e989f
1 changed files with 7 additions and 1 deletions
|
@ -21,6 +21,7 @@ import androidx.ui.tooling.preview.Preview
|
|||
import dev.msfjarvis.todo.data.TodoItem
|
||||
import dev.msfjarvis.todo.ui.TodoRowItem
|
||||
import dev.msfjarvis.todo.ui.TodoTheme
|
||||
import dev.msfjarvis.todo.ui.WireGuardItem
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
@ -52,7 +53,12 @@ fun TodoApp() {
|
|||
},
|
||||
bodyContent = {
|
||||
LazyColumnFor(items = items, modifier = Modifier.padding(horizontal = 16.dp)) { todoItem ->
|
||||
TodoRowItem(item = todoItem)
|
||||
val isOdd = items.indexOf(todoItem) % 2 == 1
|
||||
if (isOdd) {
|
||||
WireGuardItem(item = todoItem)
|
||||
} else {
|
||||
TodoRowItem(item = todoItem)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue