mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 23:47:02 +05:30
Add a simple checkbox style view mirroring the wireguard app
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
d930182e54
commit
405cf34193
1 changed files with 52 additions and 0 deletions
52
app/src/main/java/dev/msfjarvis/todo/ui/WireGuardItem.kt
Normal file
52
app/src/main/java/dev/msfjarvis/todo/ui/WireGuardItem.kt
Normal file
|
@ -0,0 +1,52 @@
|
|||
package dev.msfjarvis.todo.ui
|
||||
|
||||
import androidx.compose.foundation.Text
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyItemScope
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.Card
|
||||
import androidx.compose.material.ListItem
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Switch
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import dev.msfjarvis.todo.data.TodoItem
|
||||
|
||||
@Suppress("Unused")
|
||||
@Composable
|
||||
fun LazyItemScope.WireGuardItem(item: TodoItem) {
|
||||
Row(
|
||||
modifier = Modifier.padding(vertical = 8.dp).fillParentMaxWidth(),
|
||||
) {
|
||||
Card(
|
||||
shape = RoundedCornerShape(8.dp),
|
||||
modifier = Modifier.fillParentMaxWidth(),
|
||||
backgroundColor = MaterialTheme.colors.secondary
|
||||
) {
|
||||
ListItem(
|
||||
text = {
|
||||
Text(
|
||||
text = item.title,
|
||||
style = TextStyle(
|
||||
fontSize = 20.sp,
|
||||
textAlign = TextAlign.Left
|
||||
),
|
||||
modifier = Modifier.padding(horizontal = 8.dp, vertical = 16.dp),
|
||||
color = MaterialTheme.colors.onSecondary
|
||||
)
|
||||
},
|
||||
trailing = {
|
||||
Switch(
|
||||
checked = false,
|
||||
onCheckedChange = { },
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue