Fixed keyboard obscuring the calls UI in one case, fixed QA ids

pull/960/head
Morgan Pretty 1 year ago
parent 93f136c0c1
commit fee7f09c38

@ -132,6 +132,7 @@ extension ConversationVC:
let callVC = CallVC(for: call) let callVC = CallVC(for: call)
callVC.conversationVC = self callVC.conversationVC = self
hideInputAccessoryView() hideInputAccessoryView()
resignFirstResponder()
present(callVC, animated: true, completion: nil) present(callVC, animated: true, completion: nil)
} }

@ -57,6 +57,7 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
/// from trying to animate (as the animations can cause buggy transitions) /// from trying to animate (as the animations can cause buggy transitions)
var viewIsDisappearing = false var viewIsDisappearing = false
var viewIsAppearing = false var viewIsAppearing = false
var lastPresentedViewController: UIViewController?
// Reaction // Reaction
var currentReactionListSheet: ReactionListSheet? var currentReactionListSheet: ReactionListSheet?
@ -294,6 +295,8 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
self?.scrollToBottom(isAnimated: true) self?.scrollToBottom(isAnimated: true)
} }
result.alpha = 0 result.alpha = 0
result.accessibilityIdentifier = "Scroll button"
result.isAccessibilityElement = true
return result return result
}() }()
@ -472,9 +475,11 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
)?.becomeFirstResponder() )?.becomeFirstResponder()
} }
} }
else if !self.isFirstResponder && hasLoadedInitialThreadData { else if !self.isFirstResponder && hasLoadedInitialThreadData && lastPresentedViewController == nil {
// After we have loaded the initial data if the user starts and cancels the interactive pop // After we have loaded the initial data if the user starts and cancels the interactive pop
// gesture the input view will disappear // gesture the input view will disappear (but if we are returning from a presented view controller
// the keyboard will automatically reappear and calling this will break the first responder state
// so don't do it in that case)
self.becomeFirstResponder() self.becomeFirstResponder()
} }
@ -483,6 +488,7 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
// of different behaviours) // of different behaviours)
self?.didFinishInitialLayout = true self?.didFinishInitialLayout = true
self?.viewIsAppearing = false self?.viewIsAppearing = false
self?.lastPresentedViewController = nil
} }
} }
@ -500,6 +506,7 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
} }
viewIsDisappearing = true viewIsDisappearing = true
lastPresentedViewController = self.presentedViewController
// Don't set the draft or resign the first responder if we are replacing the thread (want the keyboard // Don't set the draft or resign the first responder if we are replacing the thread (want the keyboard
// to appear to remain focussed) // to appear to remain focussed)

@ -122,8 +122,8 @@ final class InputView: UIView, InputViewButtonDelegate, InputTextViewDelegate, M
let adjustment = (InputViewButton.expandedSize - InputViewButton.size) / 2 let adjustment = (InputViewButton.expandedSize - InputViewButton.size) / 2
let maxWidth = UIScreen.main.bounds.width - 2 * InputViewButton.expandedSize - 2 * Values.smallSpacing - 2 * (Values.mediumSpacing - adjustment) let maxWidth = UIScreen.main.bounds.width - 2 * InputViewButton.expandedSize - 2 * Values.smallSpacing - 2 * (Values.mediumSpacing - adjustment)
let result = InputTextView(delegate: self, maxWidth: maxWidth) let result = InputTextView(delegate: self, maxWidth: maxWidth)
result.accessibilityLabel = "Message input box" result.accessibilityLabel = "Text input box"
result.accessibilityIdentifier = "Message input box" result.accessibilityIdentifier = "Text input box"
result.isAccessibilityElement = true result.isAccessibilityElement = true
return result return result

@ -37,6 +37,8 @@ class MessageRequestFooterView: UIView {
result.themeTextColor = .textSecondary result.themeTextColor = .textSecondary
result.textAlignment = .center result.textAlignment = .center
result.numberOfLines = 0 result.numberOfLines = 0
result.accessibilityIdentifier = "Control message"
result.isAccessibilityElement = true
return result return result
}() }()

Loading…
Cancel
Save