Skip to content

Commit

Permalink
fix: Remove multiple selection animations
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinperignon committed Jun 13, 2023
1 parent 7d5e3cc commit a7e6382
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
1 change: 0 additions & 1 deletion Mail/Components/BottomBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ struct BottomBar<Items: View>: ViewModifier {
BottomBarView(items: items)
}
}
// .animation(.nil, value: isVisible)
.ignoresSafeArea(.keyboard, edges: .bottom)
}
}
Expand Down
16 changes: 7 additions & 9 deletions Mail/Views/Thread List/ThreadListCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,13 @@ struct ThreadListCell: View {
}

private func didLongPressCell() {
withAnimation {
multipleSelectionViewModel.feedbackGenerator.prepare()
multipleSelectionViewModel.isEnabled.toggle()
if multipleSelectionViewModel.isEnabled {
@InjectService var matomo: MatomoUtils
matomo.track(eventWithCategory: .multiSelection, action: .longPress, name: "enable")
multipleSelectionViewModel.feedbackGenerator.impactOccurred()
multipleSelectionViewModel.toggleSelection(of: thread)
}
multipleSelectionViewModel.feedbackGenerator.prepare()
multipleSelectionViewModel.isEnabled.toggle()
if multipleSelectionViewModel.isEnabled {
@InjectService var matomo: MatomoUtils
matomo.track(eventWithCategory: .multiSelection, action: .longPress, name: "enable")
multipleSelectionViewModel.feedbackGenerator.impactOccurred()
multipleSelectionViewModel.toggleSelection(of: thread)
}
}
}
Expand Down
8 changes: 2 additions & 6 deletions Mail/Views/Thread List/ThreadListModifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ struct ThreadListToolbar: ViewModifier {
if multipleSelectionViewModel.isEnabled {
Button(MailResourcesStrings.Localizable.buttonCancel) {
matomo.track(eventWithCategory: .multiSelection, name: "cancel")
withAnimation {
multipleSelectionViewModel.isEnabled = false
}
multipleSelectionViewModel.isEnabled = false
}
} else {
if isCompactWindow {
Expand Down Expand Up @@ -160,9 +158,7 @@ struct ThreadListToolbar: ViewModifier {
.disabled(multipleSelectionViewModel.selectedItems.isEmpty)
}
.actionsPanel(actionsTarget: $multipleSelectionActionsTarget) {
withAnimation {
multipleSelectionViewModel.isEnabled = false
}
multipleSelectionViewModel.isEnabled = false
}
.navigationTitle(
multipleSelectionViewModel.isEnabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ import SwiftUI
default:
break
}
withAnimation {
isEnabled = false
}
isEnabled = false
}

private func setActions() {
Expand Down

0 comments on commit a7e6382

Please sign in to comment.