Merge branch 'charlesmchen/conversationViewIsDisappearing'

pull/2/head
Michael Kirk 7 years ago
commit 753a60fe66

@ -213,6 +213,7 @@ typedef enum : NSUInteger {
@property (nonatomic) BOOL isShowingSearchUI; @property (nonatomic) BOOL isShowingSearchUI;
@property (nonatomic, nullable) MenuActionsViewController *menuActionsViewController; @property (nonatomic, nullable) MenuActionsViewController *menuActionsViewController;
@property (nonatomic) CGFloat extraContentInsetPadding; @property (nonatomic) CGFloat extraContentInsetPadding;
@property (nonatomic) CGFloat contentInsetBottom;
@end @end
@ -1262,7 +1263,7 @@ typedef enum : NSUInteger {
// until `viewDidDisappear`. // until `viewDidDisappear`.
- (void)viewWillDisappear:(BOOL)animated - (void)viewWillDisappear:(BOOL)animated
{ {
OWSLogDebug(@"viewWillDisappear"); OWSLogDebug(@"");
[super viewWillDisappear:animated]; [super viewWillDisappear:animated];
@ -1273,6 +1274,8 @@ typedef enum : NSUInteger {
- (void)viewDidDisappear:(BOOL)animated - (void)viewDidDisappear:(BOOL)animated
{ {
OWSLogDebug(@"");
[super viewDidDisappear:animated]; [super viewDidDisappear:animated];
self.userHasScrolled = NO; self.userHasScrolled = NO;
self.isViewVisible = NO; self.isViewVisible = NO;
@ -3847,18 +3850,26 @@ typedef enum : NSUInteger {
UIEdgeInsets oldInsets = self.collectionView.contentInset; UIEdgeInsets oldInsets = self.collectionView.contentInset;
UIEdgeInsets newInsets = oldInsets; UIEdgeInsets newInsets = oldInsets;
// Use a content inset that so that the conversation content // Measures how far the keyboard "intrudes" into the collection view's content region.
// is not hidden behind the keyboard + input accessory. // Indicates how large the bottom content inset should be in order to avoid the keyboard
// from hiding the conversation content.
// //
// Make sure to leave space for the bottom layout guide (the notch). // NOTE: we can ignore the "bottomLayoutGuide" (i.e. the notch); this will be accounted
// for by the "adjustedContentInset".
CGFloat keyboardContentOverlap
= MAX(0, self.view.height - self.bottomLayoutGuide.length - keyboardEndFrameConverted.origin.y);
// For the sake of continuity, we want to maintain the same contentInsetBottom when the
// the keyboard/input accessory are hidden, e.g. during dismissal animations, when
// presenting popups like the attachment picker, etc.
// //
// Always reserve room for the input accessory, which we display even // Therefore, we only zero out the contentInsetBottom if the inputAccessoryView is nil.
// if the keyboard is not active. if (self.inputAccessoryView == nil || keyboardContentOverlap > 0) {
newInsets.top = 0; self.contentInsetBottom = keyboardContentOverlap;
newInsets.bottom = MAX(0, self.view.height - self.bottomLayoutGuide.length - keyboardEndFrameConverted.origin.y); }
newInsets.top += self.extraContentInsetPadding; newInsets.top = 0 + self.extraContentInsetPadding;
newInsets.bottom += self.extraContentInsetPadding; newInsets.bottom = self.contentInsetBottom + self.extraContentInsetPadding;
BOOL wasScrolledToBottom = [self isScrolledToBottom]; BOOL wasScrolledToBottom = [self isScrolledToBottom];

@ -115,7 +115,8 @@ public class ProfileFetcherJob: NSObject {
}.catch(on: DispatchQueue.global()) { error in }.catch(on: DispatchQueue.global()) { error in
switch error { switch error {
case ProfileFetcherJobError.throttled(let lastTimeInterval): case ProfileFetcherJobError.throttled(let lastTimeInterval):
Logger.info("skipping updateProfile: \(recipientId), lastTimeInterval: \(lastTimeInterval)") // skipping
break
case let error as SignalServiceProfile.ValidationError: case let error as SignalServiceProfile.ValidationError:
Logger.warn("skipping updateProfile retry. Invalid profile for: \(recipientId) error: \(error)") Logger.warn("skipping updateProfile retry. Invalid profile for: \(recipientId) error: \(error)")
default: default:

Loading…
Cancel
Save