Skip to content

Commit

Permalink
⚡️:: animation
Browse files Browse the repository at this point in the history
  • Loading branch information
JaewonKim04 committed Apr 2, 2022
1 parent b72e34f commit de7b911
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.halill.halill2.features.calendar

import androidx.compose.animation.*
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
Expand Down Expand Up @@ -57,6 +58,7 @@ fun Calendar(navController: NavController, viewModel: CalendarViewModel = hiltVi
)
}

@OptIn(ExperimentalAnimationApi::class)
@Composable
fun CalendarContent(
state: CalendarState,
Expand All @@ -75,7 +77,24 @@ fun CalendarContent(
)
WeekTextLinearLayout()
Divider(color = MaterialTheme.colors.onSurface)
CalendarView(state, doOnDateSelect)

AnimatedContent(
targetState = state.showingMonthDate,
transitionSpec = {
if (targetState.isBefore(initialState)) {
slideInHorizontally { horizontal -> -horizontal } + fadeIn() with
slideOutHorizontally { horizontal -> horizontal } + fadeOut()
} else {
slideInHorizontally { horizontal -> horizontal } + fadeIn() with
slideOutHorizontally { horizontal -> -horizontal } + fadeOut()
}.using(
SizeTransform(clip = false)
)
}
) {
CalendarView(state, doOnDateSelect)
}

Divider(color = MaterialTheme.colors.onSurface)
TodoList(
todoList = state.selectedDateTodoList,
Expand Down

0 comments on commit de7b911

Please sign in to comment.