refactor(common): resolve Detekt-reported issues

This commit is contained in:
Harsh Shandilya 2022-10-05 11:50:22 +05:30
parent 54c4b01411
commit 8851071d58
No known key found for this signature in database
3 changed files with 11 additions and 7 deletions

View file

@ -129,6 +129,8 @@ fun PostLink(
}
}
private val CommentEntryPadding = 16f.dp
@OptIn(ExperimentalAnimationApi::class)
@Composable
fun CommentEntry(
@ -144,7 +146,12 @@ fun CommentEntry(
.fillMaxWidth()
.clickable { expanded = !expanded }
.background(MaterialTheme.colorScheme.background)
.padding(start = (comment.indentLevel * 16).dp, end = 16.dp, top = 16.dp, bottom = 16.dp),
.padding(
start = CommentEntryPadding * comment.indentLevel,
end = CommentEntryPadding,
top = CommentEntryPadding,
bottom = CommentEntryPadding,
),
) {
Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
Submitter(

View file

@ -71,6 +71,7 @@ internal val DarkThemeColors =
inverseSurface = md_theme_dark_inverseSurface,
)
@Suppress("SpreadOperator")
@Composable
fun LobstersTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
@ -80,7 +81,7 @@ fun LobstersTheme(
) {
val colorScheme =
when {
dynamicColor && Build.VERSION.SDK_INT >= 31 -> {
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
val context = LocalContext.current
if (darkTheme) {
dynamicDarkColorScheme(context)

View file

@ -1,9 +1,5 @@
<?xml version="1.0" ?>
<SmellBaseline>
<ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues>
<ID>MagicNumber:CommentEntry.kt$16</ID>
<ID>MagicNumber:Theme.kt$31</ID>
<ID>SpreadOperator:Theme.kt$(*providedValues)</ID>
</CurrentIssues>
<CurrentIssues></CurrentIssues>
</SmellBaseline>