Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish #465

Merged
merged 10 commits into from
Jan 31, 2025
Prev Previous commit
Next Next commit
Use MaterialTheme.typography instead of adhoc definition
thgoebel committed Jan 31, 2025

Verified

This commit was signed with the committer’s verified signature.
trxcllnt Paul Taylor
commit 72087edd23e15e0e8ca6fe86f78ffc0a1ac8a66c
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ import androidx.compose.material.icons.filled.Stop
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
@@ -43,8 +44,6 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.core.content.ContextCompat
@@ -334,7 +333,7 @@ private fun Reports(reportsViewModel: ReportsViewModel = viewModel()) {
) {
Text(
text = stringResource(R.string.reports),
style = TextStyle(fontSize = 16.sp, fontWeight = FontWeight.SemiBold)
style = MaterialTheme.typography.titleMedium,
)
LazyColumn {
items(
@@ -417,7 +416,7 @@ private fun Report(report: ReportWithStats, geocoder: Geocoder, onDeleteReport:
Text(
modifier = Modifier.wrapContentSize(),
text = dateStr,
style = TextStyle(fontSize = 14.sp),
style = MaterialTheme.typography.bodySmall,
)
Spacer(modifier = Modifier.weight(1.0f))
StationCount(
@@ -444,10 +443,13 @@ private fun Report(report: ReportWithStats, geocoder: Geocoder, onDeleteReport:
onClick = {
context.startActivity(intent)
},
style = TextStyle(fontSize = 14.sp)
style = MaterialTheme.typography.bodySmall,
)
} else {
Text(text = address.value, style = TextStyle(fontSize = 14.sp))
Text(
text = address.value,
style = MaterialTheme.typography.bodySmall,
)
}
}
}
@@ -468,7 +470,7 @@ private fun StationCount(iconRes: Int, iconDescription: String, count: Int) {
.wrapContentWidth()
.fillMaxHeight(),
text = decimalFormat.format(count),
style = TextStyle(fontSize = 14.sp)
style = MaterialTheme.typography.bodySmall,
)
}
}