Synchronise composer and toolbar resizing animation duration

This commit is contained in:
aringenbach
2022-11-02 15:17:54 +01:00
committed by aringenbach
parent bf767b1362
commit 32f9d15635
5 changed files with 12 additions and 3 deletions
@@ -54,7 +54,11 @@ enum MockComposerScreenState: MockScreenState, CaseIterable {
[viewModel, wysiwygviewModel],
AnyView(VStack {
Spacer()
Composer(viewModel: viewModel.context, wysiwygViewModel: wysiwygviewModel, sendMessageAction: { _ in }, showSendMediaActions: { })
Composer(viewModel: viewModel.context,
wysiwygViewModel: wysiwygviewModel,
resizeAnimationDuration: 0.1,
sendMessageAction: { _ in },
showSendMediaActions: { })
}.frame(
minWidth: 0,
maxWidth: .infinity,
@@ -77,6 +77,7 @@ struct Composer: View {
@ObservedObject var viewModel: ComposerViewModelType.Context
@ObservedObject var wysiwygViewModel: WysiwygComposerViewModel
let resizeAnimationDuration: Double
let sendMessageAction: (WysiwygComposerContent) -> Void
let showSendMediaActions: () -> Void
@@ -138,7 +139,7 @@ struct Composer: View {
}
.clipShape(rect)
.overlay(rect.stroke(borderColor, lineWidth: 1))
.animation(.easeInOut(duration: 0.1), value: wysiwygViewModel.idealHeight)
.animation(.easeInOut(duration: resizeAnimationDuration), value: wysiwygViewModel.idealHeight)
.padding(.horizontal, horizontalPadding)
.padding(.top, 8)
.onTapGesture {