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) @OptIn(ExperimentalAnimationApi::class)
@Composable @Composable
fun CommentEntry( fun CommentEntry(
@ -144,7 +146,12 @@ fun CommentEntry(
.fillMaxWidth() .fillMaxWidth()
.clickable { expanded = !expanded } .clickable { expanded = !expanded }
.background(MaterialTheme.colorScheme.background) .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)) { Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
Submitter( Submitter(

View file

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

View file

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