diff --git a/Artemis.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Artemis.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 16f6ba03..b5075ef9 100644 --- a/Artemis.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Artemis.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "5cadd12433353b4144bcc99fd464b53c0aa36084b12784b90706859f84dad8c5", + "originHash" : "5c8626acffff005e2642c0e07e1f755598c39323b3bb020fb01711f64303781e", "pins" : [ { "identity" : "apollon-ios-module", @@ -15,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ls1intum/artemis-ios-core-modules", "state" : { - "revision" : "ffa278884a4c61262a0cdc227084e838a8649c89", - "version" : "15.1.0" + "revision" : "83a8eafae4d7b098e303aa0c06b392c505852b7f", + "version" : "15.1.2" } }, { diff --git a/Artemis/Supporting/Info.plist b/Artemis/Supporting/Info.plist index 901218a5..69490c06 100644 --- a/Artemis/Supporting/Info.plist +++ b/Artemis/Supporting/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.5.0 + 1.5.1 CFBundleVersion 1 ITSAppUsesNonExemptEncryption diff --git a/ArtemisKit/Package.swift b/ArtemisKit/Package.swift index 0b2557ac..80a0c678 100644 --- a/ArtemisKit/Package.swift +++ b/ArtemisKit/Package.swift @@ -20,7 +20,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/Kelvas09/EmojiPicker.git", from: "1.0.0"), .package(url: "https://github.com/ls1intum/apollon-ios-module", .upToNextMajor(from: "1.0.2")), - .package(url: "https://github.com/ls1intum/artemis-ios-core-modules", .upToNextMajor(from: "15.1.0")), + .package(url: "https://github.com/ls1intum/artemis-ios-core-modules", .upToNextMajor(from: "15.1.2")), .package(url: "https://github.com/mac-cain13/R.swift.git", from: "7.7.0") ], targets: [ diff --git a/ArtemisKit/Sources/Messages/ViewModels/SendMessageViewModels/SendMessageViewModel.swift b/ArtemisKit/Sources/Messages/ViewModels/SendMessageViewModels/SendMessageViewModel.swift index a3d8679a..f9361022 100644 --- a/ArtemisKit/Sources/Messages/ViewModels/SendMessageViewModels/SendMessageViewModel.swift +++ b/ArtemisKit/Sources/Messages/ViewModels/SendMessageViewModels/SendMessageViewModel.swift @@ -144,6 +144,7 @@ extension SendMessageViewModel { } func performOnDisappear() { + keyboardVisible = false do { if let host = userSession.institution?.baseURL?.host() { switch configuration { diff --git a/ArtemisKit/Sources/Messages/Views/SendMessageViews/SendMessageImagePickerView.swift b/ArtemisKit/Sources/Messages/Views/SendMessageViews/SendMessageImagePickerView.swift index 34563f53..e6124dad 100644 --- a/ArtemisKit/Sources/Messages/Views/SendMessageViews/SendMessageImagePickerView.swift +++ b/ArtemisKit/Sources/Messages/Views/SendMessageViews/SendMessageImagePickerView.swift @@ -65,18 +65,6 @@ private struct UploadImageView: View { .animation(.smooth(duration: 0.2), value: viewModel.uploadState) } .interactiveDismissDisabled() - .onChange(of: viewModel.uploadState) { - if viewModel.uploadState == .done { - DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { - dismiss() - } - } - if viewModel.error != nil { - DispatchQueue.main.asyncAfter(deadline: .now() + 3) { - dismiss() - } - } - } } @ViewBuilder var statusIcon: some View { @@ -89,10 +77,20 @@ private struct UploadImageView: View { if viewModel.uploadState == .done { Image(systemName: "checkmark.circle.fill") .foregroundStyle(.green) + .onAppear { + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + dismiss() + } + } } if viewModel.error != nil { Image(systemName: "xmark.circle.fill") .foregroundStyle(.red) + .onAppear { + DispatchQueue.main.asyncAfter(deadline: .now() + 3) { + dismiss() + } + } } } .font(.largeTitle) diff --git a/ArtemisKit/Sources/Messages/Views/SendMessageViews/SendMessageView.swift b/ArtemisKit/Sources/Messages/Views/SendMessageViews/SendMessageView.swift index b5e56e63..83ae4e96 100644 --- a/ArtemisKit/Sources/Messages/Views/SendMessageViews/SendMessageView.swift +++ b/ArtemisKit/Sources/Messages/Views/SendMessageViews/SendMessageView.swift @@ -33,7 +33,7 @@ struct SendMessageView: View { } textField .padding(isFocused ? [.horizontal, .bottom] : .all, .l) - if isFocused { + if isFocused || viewModel.keyboardVisible { keyboardToolbarContent .padding(.horizontal, .l) .padding(.vertical, .m) @@ -41,7 +41,11 @@ struct SendMessageView: View { } } .onChange(of: isFocused, initial: true) { - viewModel.keyboardVisible = isFocused + // Don't set keyboardVisible to false automatically on iPad + // Focus with hardware keyboard is messed up, this is a workaround + if UIDevice.current.userInterfaceIdiom != .pad || isFocused { + viewModel.keyboardVisible = isFocused + } } .onAppear { viewModel.performOnAppear() @@ -58,6 +62,7 @@ struct SendMessageView: View { if value.translation.height > 0 { // down isFocused = false + viewModel.keyboardVisible = false let impactMed = UIImpactFeedbackGenerator(style: .medium) impactMed.impactOccurred() } diff --git a/ArtemisKit/Sources/Navigation/Resources/en.lproj/Localizable.strings b/ArtemisKit/Sources/Navigation/Resources/en.lproj/Localizable.strings index 31b41646..ccb064a6 100644 --- a/ArtemisKit/Sources/Navigation/Resources/en.lproj/Localizable.strings +++ b/ArtemisKit/Sources/Navigation/Resources/en.lproj/Localizable.strings @@ -1,3 +1,4 @@ "selectConversation" = "Please Select a Conversation."; "selectLecture" = "Please Select a Lecture."; "selectExercise" = "Please Select an Exercise."; +"selectFaq" = "Please Select an FAQ."; diff --git a/ArtemisKit/Sources/Navigation/SplitViewSupporting/SelectDetailView.swift b/ArtemisKit/Sources/Navigation/SplitViewSupporting/SelectDetailView.swift index 80a380fe..8d2fbf38 100644 --- a/ArtemisKit/Sources/Navigation/SplitViewSupporting/SelectDetailView.swift +++ b/ArtemisKit/Sources/Navigation/SplitViewSupporting/SelectDetailView.swift @@ -48,7 +48,7 @@ public struct SelectDetailView: View { case .communication: R.string.localizable.selectConversation() case .faq: - "Select faq" // TODO + R.string.localizable.selectFaq() } } } diff --git a/ArtemisKit/Sources/Notifications/Views/View+NotificationToolbar.swift b/ArtemisKit/Sources/Notifications/Views/View+NotificationToolbar.swift index 5d8e71e1..51eafaf8 100644 --- a/ArtemisKit/Sources/Notifications/Views/View+NotificationToolbar.swift +++ b/ArtemisKit/Sources/Notifications/Views/View+NotificationToolbar.swift @@ -22,8 +22,6 @@ private struct NotificationBell: ViewModifier { func body(content: Content) -> some View { content - // Prevent user from accidentally tapping buttons outside the popover while open - .disabled(isNotificationSheetPresented) .toolbar { ToolbarItem(placement: .navigationBarLeading) { Button {