Skip to content

Commit

Permalink
android ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierPineau committed Nov 7, 2023
1 parent 204cded commit 888d373
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 20 deletions.
1 change: 1 addition & 0 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ktlint)
alias(libs.plugins.crashlyticsPlugin)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import androidx.compose.ui.unit.dp

object Const {
val padding = 16.dp
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fun ErrorView(errorViewModel: ErrorViewModel) {
.clip(RoundedCornerShape(percent = 50))
.background(Color.Red)
.padding(vertical = 12.dp),
viewModel = viewModel.retryButton,
viewModel = viewModel.retryButton
) { content ->
Text(
modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ fun Modifier.loading(isLoading: Boolean) = this.then(
)
)

fun VMDColor.toColor() = Color(red, green, blue)
fun VMDColor.toColor() = Color(red, green, blue)
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ fun PreviewProvider(content: @Composable (ViewModelFactoryPreview) -> Unit) {
val viewModelFactoryPreview = ViewModelFactoryPreview(
i18N = PreviewI18N(BuildConfig.KWORD_TRANSLATION_FILE_PATH)
)

content(viewModelFactoryPreview)
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fun ProjectDetailsContentView(content: ProjectDetailsRoot.Content) {
modifier = Modifier
.align(Alignment.BottomStart)
.padding(horizontal = padding)
.padding(bottom = padding),
.padding(bottom = padding)
) {
Text(
modifier = Modifier.loading(content.isLoading),
Expand Down Expand Up @@ -145,4 +145,4 @@ private fun ImagePlaceholder(placeholderImageResource: VMDImageResource, color:
colorFilter = ColorFilter.tint(color)
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fun ProjectDetailsView(projectDetailsViewModel: ProjectDetailsViewModel, systemU
Box(
modifier = Modifier
.fillMaxSize()
.background(viewModel.backgroundColor.toColor()),
.background(viewModel.backgroundColor.toColor())
) {
ContentView(viewModel = viewModel)

Expand All @@ -57,7 +57,7 @@ fun ProjectDetailsView(projectDetailsViewModel: ProjectDetailsViewModel, systemU
@Composable
private fun ContentView(viewModel: ProjectDetailsViewModel) {
viewModel.rootContent?.let { content ->
when(content) {
when (content) {
is ProjectDetailsRoot.Content -> ProjectDetailsContentView(content = content)
is ProjectDetailsRoot.Error -> ErrorView(errorViewModel = content.errorViewModel)
}
Expand Down Expand Up @@ -94,4 +94,4 @@ fun PreviewProjectsDetailsErrorView() {
PreviewProvider {
ProjectDetailsView(projectDetailsViewModel = it.createProjectDetails(previewState = PreviewState.Error))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
Expand All @@ -27,7 +26,7 @@ fun ProjectsView(projectsViewModel: ProjectsViewModel) {
modifier = Modifier
.fillMaxSize()
.navigationBarsPadding()
.background(Color.PrimaryBlack),
.background(Color.PrimaryBlack)
) {
ContentView(viewModel = viewModel)
}
Expand All @@ -37,7 +36,7 @@ fun ProjectsView(projectsViewModel: ProjectsViewModel) {
@Composable
private fun ContentView(viewModel: ProjectsViewModel) {
viewModel.rootContent?.let { content ->
when(content) {
when (content) {
is ProjectsRoot.Content -> ProjectsContentView(listViewModel = content.sections)
is ProjectsRoot.Error -> ErrorView(errorViewModel = content.errorViewModel)
}
Expand Down Expand Up @@ -74,4 +73,4 @@ fun PreviewProjectsErrorView() {
PreviewProvider {
ProjectsView(projectsViewModel = it.createProjects(previewState = PreviewState.Error))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fun RootView(rootViewModel: RootViewModel) {
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.White),
.background(Color.White)
) {
ProjectsView(projectsViewModel = viewModel.projectsViewModel)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import androidx.compose.ui.graphics.Color
val Color.Companion.PrimaryBlack: Color get() = Color(0xFF211E25)
val Color.Companion.AccentOrange: Color get() = Color(0xFFFF3829)
val Color.Companion.ShimmerBackground: Color get() = Color(0xFF4C474f)
val Color.Companion.ShimmerHighlight: Color get() = Color(0xFF938C96)
val Color.Companion.ShimmerHighlight: Color get() = Color(0xFF938C96)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.compose.ui.unit.sp
fun style(size: TextSize, weight: TextWeight) = TextStyle(
fontSize = size.fontSize(),
fontStyle = FontStyle.Normal,
fontWeight = weight.fontName(),
fontWeight = weight.fontName()
)

enum class TextSize {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ package com.mirego.kmp.boilerplate.app.ui.theme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import com.google.accompanist.placeholder.PlaceholderHighlight
import com.google.accompanist.placeholder.placeholder
import com.google.accompanist.placeholder.shimmer

@Composable
fun Theme(
Expand Down

0 comments on commit 888d373

Please sign in to comment.