Joined commit message card with the author card
This commit is contained in:
parent
3ba7aed256
commit
c6d1271743
@ -52,70 +52,64 @@ fun CommitChanges(commitDiff: Pair<RevCommit, List<DiffEntry>>, onDiffSelected:
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(8.dp)
|
.padding(8.dp)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.height(120.dp)
|
|
||||||
) {
|
) {
|
||||||
Box {
|
Column {
|
||||||
Text(
|
Text(
|
||||||
text = commit.fullMessage,
|
text = commit.fullMessage,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxWidth()
|
||||||
|
.height(120.dp)
|
||||||
.padding(8.dp)
|
.padding(8.dp)
|
||||||
.verticalScroll(scroll),
|
.verticalScroll(scroll),
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Card(
|
|
||||||
modifier = Modifier
|
|
||||||
.padding(horizontal = 8.dp, vertical = 8.dp)
|
|
||||||
.fillMaxWidth()
|
|
||||||
.height(72.dp)
|
|
||||||
) {
|
|
||||||
Row(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth(),
|
|
||||||
verticalAlignment = Alignment.CenterVertically
|
|
||||||
) {
|
|
||||||
val url = "https://www.gravatar.com/avatar/${commit.authorIdent.emailAddress.md5}"
|
|
||||||
Image(
|
|
||||||
bitmap = rememberNetworkImage(url),
|
|
||||||
modifier = Modifier
|
|
||||||
.padding(horizontal = 16.dp)
|
|
||||||
.height(40.dp)
|
|
||||||
.clip(CircleShape),
|
|
||||||
contentDescription = null,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
Column(
|
Divider(modifier = Modifier.fillMaxWidth())
|
||||||
|
|
||||||
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize(),
|
.fillMaxWidth()
|
||||||
verticalArrangement = Arrangement.Center
|
.height(72.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
Row {
|
val url = "https://www.gravatar.com/avatar/${commit.authorIdent.emailAddress.md5}"
|
||||||
|
Image(
|
||||||
|
bitmap = rememberNetworkImage(url),
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(horizontal = 16.dp)
|
||||||
|
.height(40.dp)
|
||||||
|
.clip(CircleShape),
|
||||||
|
contentDescription = null,
|
||||||
|
)
|
||||||
|
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize(),
|
||||||
|
verticalArrangement = Arrangement.Center
|
||||||
|
) {
|
||||||
|
Row {
|
||||||
|
Text(
|
||||||
|
text = commit.authorIdent.name,
|
||||||
|
color = MaterialTheme.colors.primaryTextColor,
|
||||||
|
maxLines = 1,
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
text = commit.authorIdent.emailAddress,
|
||||||
|
color = MaterialTheme.colors.secondaryTextColor,
|
||||||
|
modifier = Modifier.padding(horizontal = 4.dp),
|
||||||
|
maxLines = 1,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
val systemLocale = System.getProperty("user.language")
|
||||||
|
val locale = Locale(systemLocale)
|
||||||
|
val sdf = DateFormat.getDateInstance(DateFormat.MEDIUM, locale)
|
||||||
Text(
|
Text(
|
||||||
text = commit.authorIdent.name,
|
text = sdf.format(commit.authorIdent.`when`),
|
||||||
color = MaterialTheme.colors.primaryTextColor,
|
|
||||||
maxLines = 1,
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
text = commit.authorIdent.emailAddress,
|
|
||||||
color = MaterialTheme.colors.secondaryTextColor,
|
color = MaterialTheme.colors.secondaryTextColor,
|
||||||
modifier = Modifier.padding(horizontal = 4.dp),
|
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val systemLocale = System.getProperty("user.language")
|
|
||||||
val locale = Locale(systemLocale)
|
|
||||||
val sdf = DateFormat.getDateInstance(DateFormat.MEDIUM, locale)
|
|
||||||
Text(
|
|
||||||
text = sdf.format(commit.authorIdent.`when`),
|
|
||||||
color = MaterialTheme.colors.secondaryTextColor,
|
|
||||||
maxLines = 1,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user