Skip to content

Commit

Permalink
Adds .editorconfig file for Kotlinter (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamMc331 authored Feb 4, 2023
1 parent 4761304 commit 7524ab8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*.{kt,kts}]
max_line_length = 140
indent_size = 4
insert_final_newline = true
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
ktlint_disabled_rules = filename
2 changes: 1 addition & 1 deletion app/src/main/java/template/theme/Shape.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ import androidx.compose.ui.unit.dp
val Shapes = Shapes(
small = RoundedCornerShape(4.dp),
medium = RoundedCornerShape(4.dp),
large = RoundedCornerShape(0.dp)
large = RoundedCornerShape(0.dp),
)
8 changes: 4 additions & 4 deletions app/src/main/java/template/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ import androidx.compose.ui.platform.LocalContext

private val darkColorScheme = darkColorScheme(
primary = Purple200,
secondary = Teal200
secondary = Teal200,
)

private val lightColorScheme = lightColorScheme(
primary = Purple500,
secondary = Teal200
secondary = Teal200,
)

@Composable
@TargetApi(Build.VERSION_CODES.S)
fun TemplateTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
dynamicTheme: Boolean = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S,
content: @Composable () -> Unit
content: @Composable () -> Unit,
) {
val colorScheme = when {
dynamicTheme && darkTheme -> dynamicDarkColorScheme(LocalContext.current)
Expand All @@ -39,6 +39,6 @@ fun TemplateTheme(
colorScheme = colorScheme,
typography = Typography,
shapes = Shapes,
content = content
content = content,
)
}
4 changes: 2 additions & 2 deletions app/src/main/java/template/theme/Type.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ val Typography = Typography(
bodyMedium = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp
)
fontSize = 16.sp,
),
)

0 comments on commit 7524ab8

Please sign in to comment.