Skip to content

Commit

Permalink
Merge branch 'feature/calendar_scroll' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
JaewonKim04 committed Apr 1, 2022
2 parents b63d40a + 71fecad commit b72e34f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
applicationId "com.halill.halill2"
minSdk 26
targetSdk 31
versionCode 8
versionCode 9
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Binary file modified app/release/app-release.aab
Binary file not shown.
45 changes: 30 additions & 15 deletions app/src/main/java/com/halill/halill2/features/list/ListPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ import com.halill.domain.features.todo.entity.TodoEntity
import com.halill.halill2.R
import com.halill.halill2.base.EventFlow
import com.halill.halill2.base.observeWithLifecycle
import com.halill.halill2.ui.theme.Purple400
import com.halill.halill2.ui.theme.Purple500
import com.halill.halill2.ui.theme.Teal500
import com.halill.halill2.ui.theme.Teal700
import com.halill.halill2.util.toShowDeadlineText
import java.time.LocalDateTime
Expand All @@ -46,18 +43,13 @@ fun ListPage(navController: NavController, viewModel: ListViewModel = hiltViewMo
viewModel.loadTodoList()
}

Column(horizontalAlignment = Alignment.End) {
SwitchContentDoneOrTodoText(mainState = state) {
viewModel.switchTodoOrDone()
}

MainPager(
state = state,
onItemClick = { id -> viewModel.startDetailTodo(id) },
onDoneClick = { id -> viewModel.doneTodo(id) },
onDeleteClick = { id -> viewModel.deleteTodo(id) }
)
}
ListPageContent(
state = state,
onSwitchContentClick = { viewModel.switchTodoOrDone() },
onItemClick = { id -> viewModel.startDetailTodo(id) },
onDoneClick = { id -> viewModel.doneTodo(id) },
onDeleteClick = { id -> viewModel.deleteTodo(id) }
)

handleViewEffect(navController = navController, uiEvent = viewModel.listViewEffect)
}
Expand All @@ -83,6 +75,29 @@ private fun handleViewEffect(
}
}

@OptIn(ExperimentalPagerApi::class)
@Composable
fun ListPageContent(
state: ListState,
onSwitchContentClick: () -> Unit,
onItemClick: (Long) -> Unit,
onDoneClick: (Long) -> Unit,
onDeleteClick: (Long) -> Unit
) {
Column(horizontalAlignment = Alignment.End) {
SwitchContentDoneOrTodoText(mainState = state) {
onSwitchContentClick()
}

MainPager(
state = state,
onItemClick = onItemClick,
onDoneClick = onDoneClick,
onDeleteClick = onDeleteClick
)
}
}

@Composable
fun SwitchContentDoneOrTodoText(mainState: ListState, doOnClick: () -> Unit) {
val text = if (mainState.showDoneList) "완료한 할일" else "할일"
Expand Down

0 comments on commit b72e34f

Please sign in to comment.