Skip to content

Commit

Permalink
[chore] #153 ktlintformat
Browse files Browse the repository at this point in the history
  • Loading branch information
김명석 committed Jan 26, 2025
1 parent 288d85c commit 22ddd20
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class ExhibitionRepositoryImpl @Inject constructor(
}

override suspend fun getExhibitionsFromDate(number: Int, size: Int): Result<Page<Place>> = runCatching {
remotePlaceDataSource.getHasInProgressExhibitionPlaces(number = number, size = size )
remotePlaceDataSource.getHasInProgressExhibitionPlaces(number = number, size = size)
}.mapCatching { it ->
Page(
hasNext = it.hasNext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ interface ExhibitionRepository {
suspend fun getNearPlaceData(number: Int, size: Int, latitude: Double, longitude: Double): Result<Page<Place>>
suspend fun getPlaceById(placeId: Long): Result<Place>
suspend fun getExhibitions(placeId: Long, filter: ExhibitionFilter): Result<List<Exhibition>>
suspend fun getExhibitionsFromDate(number: Int, size:Int) :Result<Page<Place>>
suspend fun getExhibitionsFromDate(number: Int, size: Int): Result<Page<Place>>
}
9 changes: 4 additions & 5 deletions feature/home/src/main/java/com/record/home/HomeScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,9 @@ fun HomeScreen(
.padding(end = 20.dp)
.padding(top = 66.dp, bottom = 32.dp)
.clickable {
if(!state.locationSelected){
launcher.launch(Manifest.permission.ACCESS_FINE_LOCATION,)
}
else{
if (!state.locationSelected) {
launcher.launch(Manifest.permission.ACCESS_FINE_LOCATION)
} else {
updateLocationSelected()
}
},
Expand Down Expand Up @@ -329,7 +328,7 @@ fun PreviewHome() {
onVideoClick = { i, j, k -> },
onBookmarkClick = {},
updatePermissionGranted = {},
updateLocationSelected ={},
updateLocationSelected = {},
)
}
}
17 changes: 8 additions & 9 deletions feature/home/src/main/java/com/record/home/HomeViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class HomeViewModel @Inject constructor(
}

fun resetPlaces() = viewModelScope.launch {
if(uiState.value.locationSelected){
if (uiState.value.locationSelected) {
exhibitionRepository.getNearPlaceData(0, if (uiState.value.exhibitionList.size < 10) 30 else uiState.value.exhibitionList.size, uiState.value.location.latitude, uiState.value.location.longitude)
.onSuccess {
intent {
Expand All @@ -45,7 +45,7 @@ class HomeViewModel @Inject constructor(
Log.e("asdfasdf", throwable.message.toString())
}
}
}else{
} else {
exhibitionRepository.getExhibitionsFromDate(0, if (uiState.value.exhibitionList.size < 10) 30 else uiState.value.exhibitionList.size)
.onSuccess {
intent {
Expand All @@ -63,12 +63,11 @@ class HomeViewModel @Inject constructor(
}
}
}

}

fun getPlaces() = if(uiState.value.locationSelected) getNearPlace() else getRandomPlace()
fun getPlaces() = if (uiState.value.locationSelected) getNearPlace() else getRandomPlace()

fun getNearPlace(){
fun getNearPlace() {
viewModelScope.launch {
if (uiState.value.isEnd) return@launch
val list = uiState.value.exhibitionList
Expand All @@ -91,7 +90,7 @@ class HomeViewModel @Inject constructor(
}
}

fun getRandomPlace(){
fun getRandomPlace() {
viewModelScope.launch {
if (uiState.value.isEnd) return@launch
val list = uiState.value.exhibitionList
Expand All @@ -111,7 +110,7 @@ class HomeViewModel @Inject constructor(
Log.e("asdfasdf", throwable.message.toString())
}
}
}
}
}

fun showLocationPermissionDialog(isShow: Boolean) = intent {
Expand Down Expand Up @@ -178,11 +177,11 @@ class HomeViewModel @Inject constructor(
}
}

fun updateLocationSelected(){
fun updateLocationSelected() {
viewModelScope.launch {
intent {
copy(
locationSelected = !locationSelected
locationSelected = !locationSelected,
)
}
resetPlaces()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import com.record.designsystem.component.bottomsheet.RecordyBottomSheet
import com.record.designsystem.theme.Background
import com.record.designsystem.theme.Gray03
import com.record.designsystem.theme.RecordyTheme
import com.record.designsystem.theme.White
import com.record.ui.extension.customClickable
import com.record.ui.scroll.OnBottomReached
import com.record.upload.model.GalleryImage
Expand Down Expand Up @@ -187,7 +186,7 @@ fun VideoThumbnail(
shape = RectangleShape,
),

) {
) {
AsyncImage(
model = request,
imageLoader = imageLoader,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ fun ProfileEditRoute(
showShouldShowRationaleDialog = viewModel::showShouldShowRationaleDialog,
hideExitUploadDialog = viewModel::hideUploadDialog,
updateUserProfile = viewModel::updateUserProfile,
showSelectImgDialog = viewModel:: showImageDialog,
hideImageDialog = viewModel:: hideImageDialog
showSelectImgDialog = viewModel::showImageDialog,
hideImageDialog = viewModel::hideImageDialog,
)
}

Expand All @@ -126,7 +126,7 @@ fun ProfileScreen(
hideExitUploadDialog: () -> Unit = {},
updateUserProfile: () -> Unit = {},
showSelectImgDialog: () -> Unit = {},
hideImageDialog : () -> Unit = {}
hideImageDialog: () -> Unit = {},
) {
val context = LocalContext.current

Expand Down Expand Up @@ -347,7 +347,7 @@ fun ProfileScreen(
},
)
}
if(state.selectInfo.showDialog){
if (state.selectInfo.showDialog) {
RecordyDialog(
title = state.selectInfo.title,
subTitle = state.selectInfo.subTitle,
Expand Down Expand Up @@ -381,7 +381,6 @@ fun ProfileScreen(
}
},
)

}

SelectedImageBottomSheet(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class ProfileEditViewModel @Inject constructor(
copy(isSelectedImageSheetOpen = false)
}

private fun nickNameRegex(nickname: String): Boolean = NICKNAME_PATTERN.matches(nickname);
private fun nickNameRegex(nickname: String): Boolean = NICKNAME_PATTERN.matches(nickname)

companion object {
val NICKNAME_PATTERN = Regex("^[ㄱ-ㅎ|가-힣ㅏ-ㅣ0-9_]+$")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
Expand Down Expand Up @@ -321,9 +320,9 @@ fun VideoPickerScreen(
.height(24.dp)
.background(
color = Color(0xB3000000),
shape = RoundedCornerShape(40.dp)
shape = RoundedCornerShape(40.dp),
),
contentAlignment = Alignment.Center
contentAlignment = Alignment.Center,
) {
Text(
text = "다른 영상 고르기",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fun ReportBottomSheet(
horizontalAlignment = Alignment.CenterHorizontally,
) {
BottomSheetDefaults.DragHandle(
color = RecordyTheme.colors.gray01
color = RecordyTheme.colors.gray01,
)
}
},
Expand Down

0 comments on commit 22ddd20

Please sign in to comment.