add spring animation to list view
This commit is contained in:
@@ -188,9 +188,7 @@ struct HomeView: View {
|
|||||||
VStack {
|
VStack {
|
||||||
if ShowBasedOnVoteLogics.isMissingCurrentVote(onboardingData: onboardingData.savedOnboardingData) {
|
if ShowBasedOnVoteLogics.isMissingCurrentVote(onboardingData: onboardingData.savedOnboardingData) {
|
||||||
AddMoodHeaderView(addItemHeaderClosure: { (mood, date) in
|
AddMoodHeaderView(addItemHeaderClosure: { (mood, date) in
|
||||||
withAnimation {
|
viewModel.add(mood: mood, forDate: date, entryType: .header)
|
||||||
viewModel.add(mood: mood, forDate: date, entryType: .header)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.frame(height: headerHeight)
|
.frame(height: headerHeight)
|
||||||
.frame(minWidth: 0, maxWidth: .infinity)
|
.frame(minWidth: 0, maxWidth: .infinity)
|
||||||
@@ -251,7 +249,9 @@ struct HomeView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.background(
|
}
|
||||||
|
.animation(Animation.spring(response: 0.3, dampingFraction: 0.5, blendDuration: 1))
|
||||||
|
.background(
|
||||||
GeometryReader { proxy in
|
GeometryReader { proxy in
|
||||||
let offset = proxy.frame(in: .named("scroll")).minY
|
let offset = proxy.frame(in: .named("scroll")).minY
|
||||||
Color.clear.preference(key: ViewOffsetKey.self, value: offset)
|
Color.clear.preference(key: ViewOffsetKey.self, value: offset)
|
||||||
|
|||||||
Reference in New Issue
Block a user