Skip to content

Commit

Permalink
[CHORE] #86 ktlint 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
l5x5l committed Dec 14, 2024
1 parent d6fd05e commit ea15c74
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 38 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/pokitmons/pokit/navigation/RootNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ fun RootNavHost(
composable(
route = Uncategorized.route
) {
val viewModel : UncategorizedViewModelImpl = hiltViewModel()
val viewModel: UncategorizedViewModelImpl = hiltViewModel()
UncategorizedScreen(
viewModel = viewModel,
onBackPressed = {
Expand All @@ -249,7 +249,7 @@ fun RootNavHost(
?.savedStateHandle
?.set("refresh", needRefresh)
navHostController.popBackStack()
},
}
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ fun<T> LinkCard(
}

if (hasMember) {
Box (
Box(
modifier = Modifier.size(20.dp)
) {
Icon(
Expand Down
4 changes: 2 additions & 2 deletions data/src/main/java/pokitmons/pokit/data/api/LinkApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ interface LinkApi {

@PUT("content/uncategorized")
suspend fun deleteUncategorizedLinks(
@Body deleteUncategorizedLinksRequest: DeleteUncategorizedLinksRequest
@Body deleteUncategorizedLinksRequest: DeleteUncategorizedLinksRequest,
): Response<Unit>

@PATCH("content")
suspend fun modifyPokitOfLinks(
@Body modifyPokitOfLinksRequest: ModifyPokitOfLinksRequest
@Body modifyPokitOfLinksRequest: ModifyPokitOfLinksRequest,
): Response<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import kotlinx.serialization.Serializable

@Serializable
data class DeleteUncategorizedLinksRequest(
val contentId: List<Int>
val contentId: List<Int>,
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import kotlinx.serialization.Serializable
@Serializable
data class ModifyPokitOfLinksRequest(
val contentIds: List<Int>,
val categoryId: Int
val categoryId: Int,
)
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ interface LinkRepository {

suspend fun modifyPokitOfLinks(
linkIds: List<Int>,
categoryId: Int
categoryId: Int,
): PokitResult<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fun PokitScreen(
onNavigateToPokitModify: (String) -> Unit,
onNavigateToAddLink: () -> Unit,
onNavigateToAddPokit: () -> Unit,
onNavigateToUncategorizedLinkList: () -> Unit,
onNavigateToUncategorizedLinkList: () -> Unit,
) {
val pokits = viewModel.pokits.collectAsState()
val pokitsState by viewModel.pokitsState.collectAsState()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package pokitmons.pokit.uncategorized

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.assertEquals

/**
* Instrumented test, which will execute on an Android device.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,30 @@ internal fun Preview() {

private val dummyViewModel = object : UncategorizedViewModel {
override fun toggleLinkSelected(linkId: String) {

}

override fun toggleAllLinksSelected() {

}

override fun removeSelectedLinks() {

}

override fun showPokitSelectBottomSheet() {

}

override fun hidePokitSelectBottomSheet() {

}

override fun moveSelectedLinks(pokitId: String) {

}

override fun loadNextLinks() {

}

override fun refreshPokits() {

}

override fun loadNextPokits() {

}

override val state: StateFlow<UncategorizedScreenState>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import pokitmons.pokit.core.ui.components.template.pookiempty.EmptyPooki
import pokitmons.pokit.core.ui.components.template.pookierror.ErrorPooki
import pokitmons.pokit.core.ui.theme.PokitTheme
import pokitmons.pokit.uncategorized.components.FloatingBottomNavigation
import pokitmons.pokit.uncategorized.R.string as uncategorizedString
import pokitmons.pokit.core.ui.R.drawable as coreDrawable
import pokitmons.pokit.uncategorized.R.string as uncategorizedString

@Composable
fun UncategorizedScreen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ interface UncategorizedViewModel {
fun refreshPokits()
fun loadNextPokits()

val state : StateFlow<UncategorizedScreenState>
val linkList : StateFlow<List<UncategorizedLink>>
val linkListState : StateFlow<PagingState>
val pokitList : StateFlow<List<Pokit>>
val state: StateFlow<UncategorizedScreenState>
val linkList: StateFlow<List<UncategorizedLink>>
val linkListState: StateFlow<PagingState>
val pokitList: StateFlow<List<Pokit>>
val pokitListState: StateFlow<PagingState>
val linkChanged: Boolean
}
Expand Down Expand Up @@ -67,8 +67,8 @@ class UncategorizedViewModelImpl @Inject constructor(
coroutineScope = viewModelScope
)

override val linkList : StateFlow<List<UncategorizedLink>> = linkPaging.pagingData
override val linkListState : StateFlow<PagingState> = linkPaging.pagingState
override val linkList: StateFlow<List<UncategorizedLink>> = linkPaging.pagingData
override val linkListState: StateFlow<PagingState> = linkPaging.pagingState

// pokits paging
private val pokitPagingSource = object : PagingSource<Pokit> {
Expand All @@ -92,7 +92,7 @@ class UncategorizedViewModelImpl @Inject constructor(

// state
private val _state = MutableStateFlow(UncategorizedScreenState(selectAll = false, updateLoading = false))
override val state : StateFlow<UncategorizedScreenState> = _state.asStateFlow()
override val state: StateFlow<UncategorizedScreenState> = _state.asStateFlow()

private var _linkChanged = false
override val linkChanged: Boolean
Expand Down Expand Up @@ -123,7 +123,7 @@ class UncategorizedViewModelImpl @Inject constructor(
}

override fun removeSelectedLinks() {
val selectedLinkIds = linkPaging.pagingData.value.filter{ it.isChecked }.map { it.link.id }
val selectedLinkIds = linkPaging.pagingData.value.filter { it.isChecked }.map { it.link.id }
if (selectedLinkIds.isEmpty()) return

viewModelScope.launch {
Expand All @@ -138,7 +138,7 @@ class UncategorizedViewModelImpl @Inject constructor(
}

override fun showPokitSelectBottomSheet() {
val selectedLinkIds = linkPaging.pagingData.value.filter{ it.isChecked }.map { it.link.id }
val selectedLinkIds = linkPaging.pagingData.value.filter { it.isChecked }.map { it.link.id }
if (selectedLinkIds.isEmpty()) return

_state.update { it.copy(showPokitSelectBottomSheet = true) }
Expand All @@ -149,7 +149,7 @@ class UncategorizedViewModelImpl @Inject constructor(
}

override fun moveSelectedLinks(pokitId: String) {
val selectedLinkIds = linkPaging.pagingData.value.filter{ it.isChecked }.map { it.link.id }
val selectedLinkIds = linkPaging.pagingData.value.filter { it.isChecked }.map { it.link.id }
if (selectedLinkIds.isEmpty()) return

viewModelScope.launch {
Expand Down Expand Up @@ -180,5 +180,4 @@ class UncategorizedViewModelImpl @Inject constructor(
pokitPaging.load()
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import pokitmons.pokit.core.ui.theme.PokitTheme
import pokitmons.pokit.uncategorized.R.string as uncategorizedString
import pokitmons.pokit.core.ui.R.drawable as coreDrawable
import pokitmons.pokit.uncategorized.R.string as uncategorizedString

@Composable
fun FloatingBottomNavigation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fun FloatingBottomNavigationButton(
modifier = Modifier.size(24.dp),
painter = painterResource(id = iconResourceId),
contentDescription = null,
tint = PokitTheme.colors.inverseWh,
tint = PokitTheme.colors.inverseWh
)

Spacer(modifier = Modifier.height(4.dp))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package pokitmons.pokit.uncategorized

import org.junit.Test

import org.junit.Assert.assertEquals
import org.junit.Test

/**
* Example local unit test, which will execute on the development machine (host).
Expand Down

0 comments on commit ea15c74

Please sign in to comment.