Skip to content

Commit

Permalink
feat: ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
jinukeu committed Jan 16, 2024
1 parent 2a4da61 commit 71b5bd2
Show file tree
Hide file tree
Showing 19 changed files with 9 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.susu.core.designsystem.component.bottomsheet.datepicker

import android.util.Log
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ fun SusuTextFieldWrapContentButton(
modifier = modifier
.clip(shape)
.background(backgroundColor)
.susuClickable (onClick = onClickButton)
.susuClickable(onClick = onClickButton)
.padding(paddingValues),
horizontalArrangement = Arrangement.spacedBy(iconSpacing),
verticalAlignment = Alignment.CenterVertically,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package com.susu.core.ui.extension

import android.util.Log
import androidx.compose.foundation.lazy.grid.LazyGridState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.snapshotFlow
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.distinctUntilChanged

// https://manavtamboli.medium.com/infinite-list-paged-list-in-jetpack-compose-b10fc7e74768
@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ class LedgerRepositoryImpl @Inject constructor(
sort = sort,
).getOrThrow().toModel()


override suspend fun editLedger(ledger: Ledger): Ledger = ledgerService.editLedger(
id = ledger.id,
ledgerRequest = ledger.toData(),
).getOrThrow().toModel()

override suspend fun deleteLedger(id: Int) = ledgerService.deleteLedgerList(
listOf(id)
listOf(id),
).getOrThrow()
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.susu.data.remote.api

import com.susu.data.remote.model.response.CategoryConfigResponse
import com.susu.data.remote.model.response.CategoryInfo
import com.susu.data.remote.retrofit.ApiResult
import retrofit2.http.GET

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.susu.data.remote.api

import com.susu.data.remote.model.request.LedgerRequest
import com.susu.data.remote.model.response.LedgerInfo
import com.susu.data.remote.model.response.LedgerListResponse
import com.susu.data.remote.model.response.LedgerResponse
import com.susu.data.remote.retrofit.ApiResult
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.susu.data.remote.model.response

import com.susu.core.model.Category
import com.susu.core.model.Ledger
import kotlinx.datetime.LocalDateTime
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand All @@ -17,7 +14,6 @@ data class LedgerListResponse(
val sort: SortInfo,
)


@Serializable
data class SortInfo(
val empty: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ internal fun LedgerResponse.toModel() = Ledger(
totalCounts = totalCounts,
)


internal fun CategoryInfo.toModel() = Category(
id = id,
seq = seq,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ interface LedgerRepository {
): Ledger

suspend fun deleteLedger(
id: Int
id: Int,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package com.susu.domain.usecase.categoryconfig

import com.susu.core.common.runCatchingIgnoreCancelled
import com.susu.domain.repository.CategoryConfigRepository
import com.susu.domain.repository.LedgerRepository
import java.time.LocalDateTime
import javax.inject.Inject

class GetCategoryConfigUseCase @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.susu.domain.usecase.ledger

import com.susu.core.common.runCatchingIgnoreCancelled
import com.susu.core.model.Ledger
import com.susu.domain.repository.LedgerRepository
import java.time.LocalDateTime
import javax.inject.Inject

class DeleteLedgerUseCase @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.susu.domain.usecase.ledger
import com.susu.core.common.runCatchingIgnoreCancelled
import com.susu.core.model.Ledger
import com.susu.domain.repository.LedgerRepository
import java.time.LocalDateTime
import javax.inject.Inject

class EditLedgerUseCase @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.graphics.Color
import androidx.navigation.NavDestination
import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.NavHostController
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal fun MainScreen(
message = "네트워크 오류가 발생했어요",
onClickActionButton = sideEffect.retry,
actionIcon = R.drawable.ic_refresh,
actionIconContentDescription = "새로고침 아이콘"
actionIconContentDescription = "새로고침 아이콘",
),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ class MainViewModel @Inject constructor(
intent { copy(dialogVisible = false) }
}

fun handleException(throwable: Throwable, retry: () -> Unit) = when(throwable) {
fun handleException(throwable: Throwable, retry: () -> Unit) = when (throwable) {
is NetworkException -> postSideEffect(MainSideEffect.ShowNetworkErrorSnackbar(retry))
is UnknownHostException -> postSideEffect(MainSideEffect.ShowNetworkErrorSnackbar(retry))
else -> throwUnknownException(throwable)
}

fun initCategoryConfig() = viewModelScope.launch {
getCategoryConfigUseCase()
.onFailure { }
.onFailure { }
intent { copy(isInitializing = false) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.launch
import kotlinx.datetime.toJavaLocalDateTime
import kotlinx.serialization.json.Json
import timber.log.Timber
import javax.inject.Inject

@HiltViewModel
Expand Down Expand Up @@ -75,7 +74,7 @@ class LedgerDetailViewModel @Inject constructor(
)
}
.onFailure { throwable ->
when(throwable) {
when (throwable) {
is NotFoundLedgerException -> postSideEffect(LedgerDetailSideEffect.ShowSnackbar(throwable.message))
else -> postSideEffect(LedgerDetailSideEffect.HandleException(throwable, ::deleteLedger))
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.susu.feature.received.ledgeredit

import com.susu.core.model.Category
import com.susu.core.model.Ledger
import com.susu.core.ui.base.SideEffect
import com.susu.core.ui.base.UiState
import kotlinx.collections.immutable.PersistentList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.susu.core.designsystem.component.appbar.SusuDefaultAppBar
import com.susu.core.designsystem.component.appbar.icon.BackIcon
import com.susu.core.designsystem.component.bottomsheet.datepicker.SusuDatePickerBottomSheet
import com.susu.core.designsystem.component.bottomsheet.datepicker.SusuLimitDatePickerBottomSheet
import com.susu.core.designsystem.component.button.AddConditionButton
import com.susu.core.designsystem.component.button.FilledButtonColor
Expand All @@ -41,7 +40,6 @@ import com.susu.core.designsystem.component.textfieldbutton.TextFieldButtonColor
import com.susu.core.designsystem.component.textfieldbutton.style.SmallTextFieldButtonStyle
import com.susu.core.designsystem.theme.Gray80
import com.susu.core.designsystem.theme.SusuTheme
import com.susu.core.model.Ledger
import com.susu.core.ui.extension.collectWithLifecycle
import com.susu.core.ui.extension.susuClickable
import com.susu.core.ui.util.AnnotatedText
Expand Down Expand Up @@ -76,7 +74,6 @@ fun LedgerEditRoute(
viewModel.initData()
}


LedgerEditScreen(
uiState = uiState,
onClickBack = viewModel::popBackStack,
Expand Down Expand Up @@ -260,7 +257,7 @@ fun LedgerEditScreen(
afterDate = false,
maximumContainerHeight = 346.dp,
onDismissRequest = { _, _, _ -> onDismissStartDateBottomSheet() },
onItemSelected = onStartDateItemSelected
onItemSelected = onStartDateItemSelected,
)
}

Expand All @@ -275,7 +272,7 @@ fun LedgerEditScreen(
afterDate = true,
maximumContainerHeight = 346.dp,
onDismissRequest = { _, _, _ -> onDismissEndDateBottomSheet() },
onItemSelected = onEndDateItemSelected
onItemSelected = onEndDateItemSelected,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import kotlinx.coroutines.launch
import kotlinx.datetime.toJavaLocalDateTime
import kotlinx.datetime.toKotlinLocalDateTime
import kotlinx.serialization.json.Json
import timber.log.Timber
import java.time.LocalDateTime
import javax.inject.Inject

Expand Down Expand Up @@ -50,7 +49,6 @@ class LedgerEditViewModel @Inject constructor(
postSideEffect(LedgerEditSideEffect.PopBackStackWithLedger(Json.encodeToUri(ledger)))
}
.onFailure {

}
}

Expand Down

0 comments on commit 71b5bd2

Please sign in to comment.