Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(BottomBar): Ignore keyboard safe area #798

Merged
merged 2 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Infomaniak/ios-core",
"state" : {
"revision" : "cf001ba55dbf5f152353d66b55cd46350bd4b895"
"revision" : "e5fe8e03aa06375f20c8e40f4fae3a6af6e4d75e"
}
},
{
Expand Down
13 changes: 7 additions & 6 deletions Mail/Components/BottomBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ struct BottomBar<Items: View>: ViewModifier {
@ViewBuilder var items: () -> Items

func body(content: Content) -> some View {
content
.safeAreaInset(edge: .bottom) {
if isVisible {
BottomBarView(items: items)
.transition(.opacity)
}
VStack(spacing: 0) {
content
Spacer(minLength: 0)
if isVisible {
BottomBarView(items: items)
}
}
.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