worked on tracking screen
This commit is contained in:
parent
f76ec41891
commit
70acdc756a
5 changed files with 130 additions and 3 deletions
1
DBTApp/.idea/misc.xml
generated
1
DBTApp/.idea/misc.xml
generated
|
|
@ -1,4 +1,3 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,16 @@ import androidx.compose.material.icons.filled.Add
|
||||||
import androidx.compose.material.icons.filled.CalendarMonth
|
import androidx.compose.material.icons.filled.CalendarMonth
|
||||||
import androidx.compose.material.icons.filled.ChevronLeft
|
import androidx.compose.material.icons.filled.ChevronLeft
|
||||||
import androidx.compose.material.icons.filled.ChevronRight
|
import androidx.compose.material.icons.filled.ChevronRight
|
||||||
|
import androidx.compose.material.icons.filled.DataExploration
|
||||||
|
import androidx.compose.material.icons.filled.RemoveRedEye
|
||||||
import androidx.compose.material3.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material3.Card
|
import androidx.compose.material3.Card
|
||||||
|
import androidx.compose.material3.Checkbox
|
||||||
import androidx.compose.material3.HorizontalDivider
|
import androidx.compose.material3.HorizontalDivider
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.material3.VerticalDivider
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.MutableState
|
import androidx.compose.runtime.MutableState
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
|
@ -44,6 +48,7 @@ import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.em
|
import androidx.compose.ui.unit.em
|
||||||
import de.cdaut.dbtapp.R
|
import de.cdaut.dbtapp.R
|
||||||
|
import de.cdaut.dbtapp.model.TherapyAssignment.Companion.mockTherapyAssignments
|
||||||
import de.cdaut.dbtapp.util.weekdayListByLocale
|
import de.cdaut.dbtapp.util.weekdayListByLocale
|
||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
@ -66,11 +71,69 @@ fun TrackingScreen() {
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
) {
|
) {
|
||||||
Spacer(modifier = Modifier.height(20.dp))
|
Spacer(modifier = Modifier.height(20.dp))
|
||||||
Card(
|
Card {
|
||||||
) {
|
|
||||||
TopCalendar()
|
TopCalendar()
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(10.dp))
|
Spacer(modifier = Modifier.height(10.dp))
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.background(
|
||||||
|
color = MaterialTheme.colorScheme.primary,
|
||||||
|
shape = CircleShape
|
||||||
|
),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.SpaceBetween
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(10.dp)
|
||||||
|
.padding(horizontal = 10.dp, vertical = 0.dp)
|
||||||
|
.clickable(onClick = {
|
||||||
|
//TODO: Add tracker
|
||||||
|
}),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.Start
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
Icons.Filled.Add,
|
||||||
|
contentDescription = "//TODO: Provide",
|
||||||
|
tint = MaterialTheme.colorScheme.onPrimary
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.add_trackter),
|
||||||
|
style = MaterialTheme.typography.labelLarge,
|
||||||
|
color = MaterialTheme.colorScheme.onPrimary
|
||||||
|
)
|
||||||
|
}
|
||||||
|
VerticalDivider(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxHeight(0.1f)
|
||||||
|
.padding(5.dp)
|
||||||
|
)
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(10.dp)
|
||||||
|
.padding(horizontal = 10.dp, vertical = 0.dp)
|
||||||
|
.clickable(onClick = {
|
||||||
|
//TODO: Add tracker
|
||||||
|
}),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.Start
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
modifier = Modifier.padding(horizontal = 5.dp),
|
||||||
|
text = stringResource(R.string.view_stats),
|
||||||
|
style = MaterialTheme.typography.labelLarge,
|
||||||
|
color = MaterialTheme.colorScheme.onPrimary
|
||||||
|
)
|
||||||
|
Icon(
|
||||||
|
Icons.Filled.RemoveRedEye,
|
||||||
|
contentDescription = "//TODO: Provide",
|
||||||
|
tint = MaterialTheme.colorScheme.onPrimary
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
Button(
|
Button(
|
||||||
onClick = {
|
onClick = {
|
||||||
//TODO: Add diary card here
|
//TODO: Add diary card here
|
||||||
|
|
@ -262,6 +325,32 @@ fun TitledListCard(title: String) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
HorizontalDivider()
|
HorizontalDivider()
|
||||||
|
for (assignment in mockTherapyAssignments()) {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
|
) {
|
||||||
|
Column {
|
||||||
|
Text(
|
||||||
|
modifier = Modifier.padding(horizontal = 10.dp, vertical = 0.dp),
|
||||||
|
text = assignment.title,
|
||||||
|
style = MaterialTheme.typography.bodyMedium
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
modifier = Modifier.padding(horizontal = 10.dp, vertical = 0.dp),
|
||||||
|
text = assignment.description,
|
||||||
|
style = MaterialTheme.typography.bodySmall
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Checkbox(
|
||||||
|
onCheckedChange = {
|
||||||
|
assignment.done = !assignment.done
|
||||||
|
},
|
||||||
|
checked = assignment.done
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package de.cdaut.dbtapp.model
|
||||||
|
|
||||||
|
import androidx.room.ColumnInfo
|
||||||
|
import androidx.room.Entity
|
||||||
|
import androidx.room.PrimaryKey
|
||||||
|
import java.util.UUID
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
class TherapyAssignment(
|
||||||
|
@PrimaryKey val identifier: UUID,
|
||||||
|
@ColumnInfo(name = "title") val title: String,
|
||||||
|
@ColumnInfo(name = "description") val description: String,
|
||||||
|
@ColumnInfo(name = "done") var done: Boolean
|
||||||
|
) {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun mockTherapyAssignments(): List<TherapyAssignment> {
|
||||||
|
return listOf(
|
||||||
|
TherapyAssignment(
|
||||||
|
identifier = UUID.randomUUID(),
|
||||||
|
title = "Selbstfürsorge",
|
||||||
|
description = "Mir selbst eine gute Sache tun",
|
||||||
|
done = false
|
||||||
|
),
|
||||||
|
TherapyAssignment(
|
||||||
|
identifier = UUID.randomUUID(),
|
||||||
|
title = "Bedürfnis durchsetzen",
|
||||||
|
description = "Eine Sache durchsetzen, die mir schwer fällt",
|
||||||
|
done = false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -11,4 +11,6 @@
|
||||||
<string name="desc_btn_expand">Ausklappen</string>
|
<string name="desc_btn_expand">Ausklappen</string>
|
||||||
<string name="btn_add_diarycard">Diary Card Hinzufügen</string>
|
<string name="btn_add_diarycard">Diary Card Hinzufügen</string>
|
||||||
<string name="card_therapy_hw_heading">Therapiehausaufgaben</string>
|
<string name="card_therapy_hw_heading">Therapiehausaufgaben</string>
|
||||||
|
<string name="add_trackter">Tracker hinzufügen</string>
|
||||||
|
<string name="view_stats">Statistiken</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -10,4 +10,6 @@
|
||||||
<string name="desc_btn_expand">Expand</string>
|
<string name="desc_btn_expand">Expand</string>
|
||||||
<string name="btn_add_diarycard">Add Diary Card</string>
|
<string name="btn_add_diarycard">Add Diary Card</string>
|
||||||
<string name="card_therapy_hw_heading">Therapy Assignments</string>
|
<string name="card_therapy_hw_heading">Therapy Assignments</string>
|
||||||
|
<string name="add_trackter">Add Tracker</string>
|
||||||
|
<string name="view_stats">View Statistics</string>
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue