Skip to content

Commit

Permalink
Fix crash and improve readability for "past_exams"
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-tennert committed Sep 26, 2023
1 parent fbe3dbf commit 20d0346
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fun ExamCreateScreen(
val date = Instant.fromEpochMilliseconds(it).toLocalDateTime(
TimeZone.currentSystemDefault()
)
"${date.dayOfMonth}.${date.monthNumber}.${date.year}"
"${if(date.dayOfMonth < 10) "0" + date.dayOfMonth else date.dayOfMonth}.${date.monthNumber}.${date.year}"
}
}
var type by remember {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Shadow
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.NavController
Expand Down Expand Up @@ -170,7 +173,11 @@ fun ExamScreen(
checked = showPastExams,
onCheckedChange = { examVm.showPastExams.value = !showPastExams })
Spacer(modifier = Modifier.size(12.dp))
Text(stringResource(R.string.past_exams), modifier = Modifier.weight(1f))
Text(
stringResource(R.string.past_exams),
modifier = Modifier.weight(1f),
style = TextStyle(shadow = Shadow(MaterialTheme.colorScheme.inverseOnSurface, Offset(5.0f, 5.0f), 1f))
)
ExtendedFloatingActionButton(
onClick = { navController.navigate(NavigationTarget.Exams.Create.destinationFormat) },
text = { Text(stringResource(R.string.create)) },
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ kotlin.experimental.tryK2=true
android.lint.useK2Uast=true

# App settings
app.versionName=0.1.1
app.versionCode=7
app.versionName=0.1.2
app.versionCode=8

0 comments on commit 20d0346

Please sign in to comment.