Reorganized author info and readjusted paddings to match other components

This commit is contained in:
Abdelilah El Aissaoui 2021-09-25 02:21:15 +02:00
parent c6d1271743
commit 9c99bd1b10

View file

@ -44,7 +44,6 @@ fun CommitChanges(commitDiff: Pair<RevCommit, List<DiffEntry>>, onDiffSelected:
) {
Column(
modifier = Modifier
.padding(all = 8.dp)
.fillMaxWidth(),
) {
val scroll = rememberScrollState(0)
@ -92,18 +91,26 @@ fun CommitChanges(commitDiff: Pair<RevCommit, List<DiffEntry>>, onDiffSelected:
color = MaterialTheme.colors.primaryTextColor,
maxLines = 1,
)
Spacer(modifier = Modifier.weight(1f, fill = true))
val date = remember(commit) {
val systemLocale = System.getProperty("user.language")
val locale = Locale(systemLocale)
val sdf = DateFormat.getDateInstance(DateFormat.MEDIUM, locale)
sdf.format(commit.authorIdent.`when`)
}
Text(
text = commit.authorIdent.emailAddress,
text = date,
color = MaterialTheme.colors.secondaryTextColor,
modifier = Modifier.padding(horizontal = 4.dp),
maxLines = 1,
modifier = Modifier.padding(horizontal = 16.dp),
)
}
val systemLocale = System.getProperty("user.language")
val locale = Locale(systemLocale)
val sdf = DateFormat.getDateInstance(DateFormat.MEDIUM, locale)
Text(
text = sdf.format(commit.authorIdent.`when`),
text = commit.authorIdent.emailAddress,
color = MaterialTheme.colors.secondaryTextColor,
maxLines = 1,
)