From 77fa521e49ba8fcc6847833bee0121ba742f98c1 Mon Sep 17 00:00:00 2001 From: jinukeu Date: Wed, 31 Jan 2024 15:32:35 +0900 Subject: [PATCH] chore: ktlint --- .../repository/EnvelopesRepositoryImpl.kt | 2 +- .../data/repository/FriendRepositoryImpl.kt | 2 +- .../ReceivedEnvelopeDetailScreen.kt | 11 ++++++---- .../ReceivedEnvelopeDetailViewModel.kt | 3 +-- .../ReceivedEnvelopeEditScreen.kt | 1 - .../ReceivedEnvelopeEditViewModel.kt | 22 +++++++++---------- .../ledgerdetail/LedgerDetailViewModel.kt | 7 ++++-- .../received/received/ReceivedScreen.kt | 1 - 8 files changed, 25 insertions(+), 24 deletions(-) diff --git a/data/src/main/java/com/susu/data/data/repository/EnvelopesRepositoryImpl.kt b/data/src/main/java/com/susu/data/data/repository/EnvelopesRepositoryImpl.kt index 55f80128..1df24d34 100644 --- a/data/src/main/java/com/susu/data/data/repository/EnvelopesRepositoryImpl.kt +++ b/data/src/main/java/com/susu/data/data/repository/EnvelopesRepositoryImpl.kt @@ -123,6 +123,6 @@ class EnvelopesRepositoryImpl @Inject constructor( } else { null }, - ) + ), ).getOrThrow().toModel() } diff --git a/data/src/main/java/com/susu/data/data/repository/FriendRepositoryImpl.kt b/data/src/main/java/com/susu/data/data/repository/FriendRepositoryImpl.kt index 6126cba7..83c80ac2 100644 --- a/data/src/main/java/com/susu/data/data/repository/FriendRepositoryImpl.kt +++ b/data/src/main/java/com/susu/data/data/repository/FriendRepositoryImpl.kt @@ -41,6 +41,6 @@ class FriendRepositoryImpl @Inject constructor( phoneNumber = phoneNumber, relationshipId = relationshipId, customRelation = customRelation, - ) + ), ).getOrThrow() } diff --git a/feature/received/src/main/java/com/susu/feature/received/envelopedetail/ReceivedEnvelopeDetailScreen.kt b/feature/received/src/main/java/com/susu/feature/received/envelopedetail/ReceivedEnvelopeDetailScreen.kt index 4949e5d5..f1515785 100644 --- a/feature/received/src/main/java/com/susu/feature/received/envelopedetail/ReceivedEnvelopeDetailScreen.kt +++ b/feature/received/src/main/java/com/susu/feature/received/envelopedetail/ReceivedEnvelopeDetailScreen.kt @@ -30,7 +30,6 @@ import com.susu.core.ui.DialogToken import com.susu.core.ui.SnackbarToken import com.susu.core.ui.extension.collectWithLifecycle import com.susu.core.ui.extension.toMoneyFormat -import com.susu.core.ui.util.to_yyyy_dot_MM_dot_dd import com.susu.core.ui.util.to_yyyy_korYear_M_korMonth_d_korDay import com.susu.feature.received.R import com.susu.feature.received.envelopedetail.component.DetailItem @@ -157,9 +156,13 @@ fun ReceivedEnvelopeDetailScreen( ) DetailItem( categoryText = stringResource(com.susu.core.ui.R.string.word_is_visited), - contentText = if (uiState.envelope.hasVisited == true) stringResource(id = com.susu.core.ui.R.string.word_yes) else stringResource( - id = com.susu.core.ui.R.string.word_no, - ), + contentText = if (uiState.envelope.hasVisited == true) { + stringResource(id = com.susu.core.ui.R.string.word_yes) + } else { + stringResource( + id = com.susu.core.ui.R.string.word_no, + ) + }, isEmptyContent = uiState.envelope.hasVisited == null, ) DetailItem( diff --git a/feature/received/src/main/java/com/susu/feature/received/envelopedetail/ReceivedEnvelopeDetailViewModel.kt b/feature/received/src/main/java/com/susu/feature/received/envelopedetail/ReceivedEnvelopeDetailViewModel.kt index d189c751..3c100068 100644 --- a/feature/received/src/main/java/com/susu/feature/received/envelopedetail/ReceivedEnvelopeDetailViewModel.kt +++ b/feature/received/src/main/java/com/susu/feature/received/envelopedetail/ReceivedEnvelopeDetailViewModel.kt @@ -12,7 +12,6 @@ import com.susu.feature.received.navigation.ReceivedRoute import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch import kotlinx.serialization.json.Json -import timber.log.Timber import javax.inject.Inject @HiltViewModel @@ -35,7 +34,7 @@ class ReceivedEnvelopeDetailViewModel @Inject constructor( this@ReceivedEnvelopeDetailViewModel.envelope = envelope intent { copy( - envelope = envelope + envelope = envelope, ) } } diff --git a/feature/received/src/main/java/com/susu/feature/received/envelopeedit/ReceivedEnvelopeEditScreen.kt b/feature/received/src/main/java/com/susu/feature/received/envelopeedit/ReceivedEnvelopeEditScreen.kt index a7c8e38b..d22a0466 100644 --- a/feature/received/src/main/java/com/susu/feature/received/envelopeedit/ReceivedEnvelopeEditScreen.kt +++ b/feature/received/src/main/java/com/susu/feature/received/envelopeedit/ReceivedEnvelopeEditScreen.kt @@ -83,7 +83,6 @@ fun ReceivedEnvelopeEditRoute( viewModel.initData() } - ReceivedEnvelopeEditScreen( uiState = uiState, focusRequester = focusRequester, diff --git a/feature/received/src/main/java/com/susu/feature/received/envelopeedit/ReceivedEnvelopeEditViewModel.kt b/feature/received/src/main/java/com/susu/feature/received/envelopeedit/ReceivedEnvelopeEditViewModel.kt index cbb5189c..d49350ce 100644 --- a/feature/received/src/main/java/com/susu/feature/received/envelopeedit/ReceivedEnvelopeEditViewModel.kt +++ b/feature/received/src/main/java/com/susu/feature/received/envelopeedit/ReceivedEnvelopeEditViewModel.kt @@ -3,15 +3,10 @@ package com.susu.feature.received.envelopeedit import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.viewModelScope import com.susu.core.model.Envelope -import com.susu.core.model.Friend import com.susu.core.model.Relationship import com.susu.core.ui.base.BaseViewModel -import com.susu.core.ui.base.SideEffect import com.susu.core.ui.extension.decodeFromUri -import com.susu.core.ui.extension.encodeToUri -import com.susu.domain.usecase.envelope.DeleteEnvelopeUseCase import com.susu.domain.usecase.envelope.EditReceivedEnvelopeUseCase -import com.susu.domain.usecase.envelope.GetEnvelopeUseCase import com.susu.domain.usecase.envelope.GetRelationShipConfigListUseCase import com.susu.feature.received.navigation.ReceivedRoute import dagger.hilt.android.lifecycle.HiltViewModel @@ -19,7 +14,6 @@ import kotlinx.collections.immutable.toPersistentList import kotlinx.coroutines.launch import kotlinx.datetime.toKotlinLocalDateTime import kotlinx.serialization.json.Json -import timber.log.Timber import java.time.LocalDateTime import javax.inject.Inject @@ -48,8 +42,11 @@ class ReceivedEnvelopeEditViewModel @Inject constructor( copy( envelope = envelope, relationshipConfig = it.map { - if (it.id == envelope.relationship.id) it.copy(customRelation = envelope.relationship.customRelation) - else it + if (it.id == envelope.relationship.id) { + it.copy(customRelation = envelope.relationship.customRelation) + } else { + it + } }.toPersistentList(), showCustomRelationButton = it.last().id == envelope.relationship.id, isRelationSaved = it.last().id == envelope.relationship.id, @@ -60,7 +57,7 @@ class ReceivedEnvelopeEditViewModel @Inject constructor( fun editReceivedEnvelope() = viewModelScope.launch { editReceivedEnvelopeUseCase( - param = with(currentState) { + param = with(currentState) { EditReceivedEnvelopeUseCase.Param( envelopeId = envelope.id, friendId = envelope.friend.id, @@ -75,7 +72,7 @@ class ReceivedEnvelopeEditViewModel @Inject constructor( handedOverAt = envelope.handedOverAt, hasVisited = envelope.hasVisited, ) - } + }, ).onSuccess { popBackStack() }.onFailure { @@ -83,7 +80,6 @@ class ReceivedEnvelopeEditViewModel @Inject constructor( } } - fun popBackStack() = postSideEffect(ReceivedEnvelopeEditSideEffect.PopBackStack) fun updateMoney(money: String) = intent { @@ -110,7 +106,9 @@ class ReceivedEnvelopeEditViewModel @Inject constructor( relationshipConfig = relationshipConfig.map { if (it.id == envelope.relationship.id) { it.copy(customRelation = customRelation) - } else it + } else { + it + } }.toPersistentList(), ) } diff --git a/feature/received/src/main/java/com/susu/feature/received/ledgerdetail/LedgerDetailViewModel.kt b/feature/received/src/main/java/com/susu/feature/received/ledgerdetail/LedgerDetailViewModel.kt index 1457d05b..6b625f1b 100644 --- a/feature/received/src/main/java/com/susu/feature/received/ledgerdetail/LedgerDetailViewModel.kt +++ b/feature/received/src/main/java/com/susu/feature/received/ledgerdetail/LedgerDetailViewModel.kt @@ -69,8 +69,11 @@ class LedgerDetailViewModel @Inject constructor( copy( envelopeList = envelopeList.map { - if (it.envelope.id == searchEnvelope.envelope.id) searchEnvelope - else it + if (it.envelope.id == searchEnvelope.envelope.id) { + searchEnvelope + } else { + it + } }.toPersistentList(), ) } diff --git a/feature/received/src/main/java/com/susu/feature/received/received/ReceivedScreen.kt b/feature/received/src/main/java/com/susu/feature/received/received/ReceivedScreen.kt index 81cc293a..6e4d56f7 100644 --- a/feature/received/src/main/java/com/susu/feature/received/received/ReceivedScreen.kt +++ b/feature/received/src/main/java/com/susu/feature/received/received/ReceivedScreen.kt @@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.grid.GridCells -import androidx.compose.foundation.lazy.grid.GridItemSpan import androidx.compose.foundation.lazy.grid.LazyGridState import androidx.compose.foundation.lazy.grid.LazyVerticalGrid import androidx.compose.foundation.lazy.grid.items