Skip to content

Commit

Permalink
Run ktlintFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
StylianosGakis committed Nov 20, 2024
1 parent 2d6ca40 commit d7cc821
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package com.hedvig.android.core.designsystem.material3.motion

import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.dp

object MotionDefaults {
val fadeThroughEnter: EnterTransition = FadeThroughDefaults.fadeThroughEnterTransition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ interface HedvigDatePickerState {
@Stable
interface HedvigSelectableDates {
fun isSelectableDate(utcTimeMillis: Long) = true

fun isSelectableYear(year: Int) = true
}

@Immutable
@JvmInline
value class HedvigDisplayMode internal constructor(internal val value: Int) {

companion object {
/** Date picker mode */
val Picker = HedvigDisplayMode(0)
Expand All @@ -30,12 +30,11 @@ value class HedvigDisplayMode internal constructor(internal val value: Int) {
val Input = HedvigDisplayMode(1)
}

override fun toString() =
when (this) {
Picker -> "Picker"
Input -> "Input"
else -> "Unknown"
}
override fun toString() = when (this) {
Picker -> "Picker"
Input -> "Input"
else -> "Unknown"
}
}

object HedvigDatePickerDefaults {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import com.hedvig.android.design.system.hedvig.tokens.ColorSchemeKeyTokens
import com.hedvig.android.design.system.hedvig.tokens.ColorSchemeKeyTokens.TextNegative
import com.hedvig.android.design.system.hedvig.tokens.ColorSchemeKeyTokens.TextPrimary
import com.hedvig.android.design.system.hedvig.tokens.ColorSchemeKeyTokens.TextTertiary
import com.hedvig.android.design.system.internals.HedvigDatePickerColors
import com.hedvig.android.design.system.internals.HedvigDatePicker
import com.hedvig.android.design.system.internals.HedvigDatePickerColors
import hedvig.resources.R
import java.util.Locale

Expand Down Expand Up @@ -105,24 +105,24 @@ fun HedvigDatePicker(
if (isVisible) {
with(datePickerState) {
HedvigDatePicker(
selectedDateMillis = selectedDateMillis,
displayedMonthMillis = displayedMonthMillis,
yearRange = yearRange,
minDateInMillis = minDateInMillis,
maxDateInMillis = maxDateInMillis,
onDismissRequest = onDismissRequest,
hedvigDatePickerColors = hedvigDatePickerColors,
onSelectedDateChanged = onSelectedDateChanged,
modifier = Modifier.background(
hedvigDatePickerColors.containerColor,
),
confirmButton = {
HedvigTextButton(
text = stringResource(R.string.general_save_button),
onClick = onConfirmRequest,
buttonSize = Medium,
)
},
selectedDateMillis = selectedDateMillis,
displayedMonthMillis = displayedMonthMillis,
yearRange = yearRange,
minDateInMillis = minDateInMillis,
maxDateInMillis = maxDateInMillis,
onDismissRequest = onDismissRequest,
hedvigDatePickerColors = hedvigDatePickerColors,
onSelectedDateChanged = onSelectedDateChanged,
modifier = Modifier.background(
hedvigDatePickerColors.containerColor,
),
confirmButton = {
HedvigTextButton(
text = stringResource(R.string.general_save_button),
onClick = onConfirmRequest,
buttonSize = Medium,
)
},
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ object MotionDefaults {

val fadeThroughExit: ExitTransition = FadeThroughDefaults.fadeThroughExitTransition
}

Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private fun MovingDateButton(
HedvigDatePicker(
datePickerState = datePickerState,
onDismissRequest = { showDatePicker = false },
onConfirmRequest = { showDatePicker = false }
onConfirmRequest = { showDatePicker = false },
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ internal class TravelCertificateDateInputViewModel(
createTravelCertificateUseCase: CreateTravelCertificateUseCase,
languageService: LanguageService,
) : MoleculeViewModel<TravelCertificateDateInputEvent, TravelCertificateDateInputUiState>(
initialState = TravelCertificateDateInputUiState.Loading,
presenter = TravelCertificateDateInputPresenter(
contractId,
getTravelCertificateSpecificationsUseCase,
createTravelCertificateUseCase,
languageService,
),
sharingStarted = SharingStarted.WhileSubscribed(5.seconds),
)
initialState = TravelCertificateDateInputUiState.Loading,
presenter = TravelCertificateDateInputPresenter(
contractId,
getTravelCertificateSpecificationsUseCase,
createTravelCertificateUseCase,
languageService,
),
sharingStarted = SharingStarted.WhileSubscribed(5.seconds),
)

internal class TravelCertificateDateInputPresenter(
private val contractId: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private fun TravelCertificateTravellersInput(
buttonText = stringResource(R.string.travel_certificate_missing_coinsured_button),
onButtonClick = dropUnlessResumed { onNavigateToCoInsuredAddInfo() },
),
modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp)
modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp),
)
}
Spacer(Modifier.height(16.dp))
Expand Down

0 comments on commit d7cc821

Please sign in to comment.