-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from everymeals/feature/more_list
[feature/more_list] 맛집 카테고리 별 상세 화면에 들어갈 바텀다이얼로그 구현
- Loading branch information
Showing
15 changed files
with
586 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
presentation/src/main/java/com/everymeal/presentation/ui/detail/DetailListContract.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.everymeal.presentation.ui.detail | ||
|
||
import com.everymeal.presentation.base.LoadState | ||
import com.everymeal.presentation.base.ViewEvent | ||
import com.everymeal.presentation.base.ViewSideEffect | ||
import com.everymeal.presentation.base.ViewState | ||
|
||
class DetailContract { | ||
data class DetailState( | ||
val uiState: LoadState = LoadState.SUCCESS, | ||
val detailSortCategoryType: DetailSortCategoryType = DetailSortCategoryType.POPULARITY, | ||
val sortBottomSheetState: Boolean = false, | ||
val mealRatingBottomSheetState: Boolean = false, | ||
) : ViewState | ||
|
||
sealed class DetailEvent : ViewEvent { | ||
data class OnClickDetailListCategoryType(val detailSortCategoryType: DetailSortCategoryType) : DetailEvent() | ||
data class SortBottomSheetStateChange(val sortBottomSheetState: Boolean) : DetailEvent() | ||
data class MealRatingBottomSheetStateChange(val mealRatingBottomSheetState: Boolean) : DetailEvent() | ||
} | ||
|
||
sealed class HomeEffect : ViewSideEffect { | ||
|
||
} | ||
} | ||
|
||
enum class DetailSortCategoryType { | ||
POPULARITY, | ||
DISTANCE, | ||
RECENT | ||
} | ||
|
||
fun String.DetailSortCategoryType(): DetailSortCategoryType { | ||
return when (this) { | ||
"인기순" -> DetailSortCategoryType.POPULARITY | ||
"거리순" -> DetailSortCategoryType.DISTANCE | ||
"최신순" -> DetailSortCategoryType.RECENT | ||
else -> DetailSortCategoryType.POPULARITY | ||
} | ||
} | ||
|
||
fun DetailSortCategoryType.title(): String { | ||
return when (this) { | ||
DetailSortCategoryType.POPULARITY -> "인기순" | ||
DetailSortCategoryType.DISTANCE -> "거리순" | ||
DetailSortCategoryType.RECENT -> "최신순" | ||
} | ||
} |
Oops, something went wrong.