-
Notifications
You must be signed in to change notification settings - Fork 0
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
8 changed files
with
72 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,21 +1,23 @@ | ||
package com.example.common | ||
|
||
import androidx.compose.material.Text | ||
import androidx.compose.material.Button | ||
import androidx.compose.foundation.lazy.LazyColumn | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
import com.example.common.model.AttendanceTei | ||
import org.hisp.dhis.mobile.ui.designsystem.theme.DHIS2Theme | ||
|
||
@Composable | ||
fun App() { | ||
var text by remember { mutableStateOf("Hello, World!") } | ||
val platformName = getPlatformName() | ||
|
||
Button(onClick = { | ||
text = "Hello, ${platformName}" | ||
}) { | ||
Text(text) | ||
DHIS2Theme { | ||
LazyColumn { | ||
items(8) { | ||
AttendanceItem( | ||
AttendanceTei( | ||
firstName = "Manu", | ||
lastName = "Muñoz", | ||
attend = false, | ||
), | ||
) | ||
} | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
common/src/commonMain/kotlin/com/example/common/AttendanceItem.kt
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.example.common | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.shape.CircleShape | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import com.example.common.model.AttendanceTei | ||
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing | ||
import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor | ||
import org.hisp.dhis.mobile.ui.designsystem.theme.TextColor | ||
|
||
@Composable | ||
fun AttendanceItem(attendanceItem: AttendanceTei) { | ||
Row { | ||
Text( | ||
attendanceItem.firstName.first().toString(), | ||
style = MaterialTheme.typography.labelLarge, | ||
color = TextColor.OnPrimary, | ||
modifier = Modifier | ||
.background(SurfaceColor.Primary, CircleShape) | ||
.padding(Spacing.Spacing10), | ||
) | ||
Text( | ||
attendanceItem.firstName + attendanceItem.lastName, | ||
style = MaterialTheme.typography.titleLarge, | ||
color = TextColor.OnSurface, | ||
modifier = Modifier.padding(Spacing.Spacing10), | ||
) | ||
} | ||
} | ||
|
7 changes: 7 additions & 0 deletions
7
common/src/commonMain/kotlin/com/example/common/model/AttendanceTei.kt
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.example.common.model | ||
|
||
data class AttendanceTei( | ||
val firstName: String, | ||
val lastName: String, | ||
val attend: Boolean | ||
) |
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