Bug Fix - Chat screen: The collapse point for scrolling down the keyboard should include the activities view

#280
This commit is contained in:
giomfo
2016-09-05 10:40:46 +02:00
parent 042d4f3166
commit e3e3edf160
2 changed files with 17 additions and 7 deletions
+17 -2
View File
@@ -960,6 +960,11 @@
// We reset here the property 'showExpandedHeader'. Then the header is not expanded automatically on viewWillAppear.
self.showExpandedHeader = NO;
}
else if (view == self.activitiesView)
{
// Dismiss the keyboard when user swipes down on activities view.
[self.inputToolbarView dismissKeyboard];
}
}
#pragma mark - Hide/Show expanded header
@@ -2628,6 +2633,12 @@
if ([self.activitiesView isKindOfClass:RoomActivitiesView.class])
{
RoomActivitiesView *roomActivitiesView = (RoomActivitiesView*)self.activitiesView;
// Reset gesture recognizers
while (roomActivitiesView.gestureRecognizers.count)
{
[roomActivitiesView removeGestureRecognizer:roomActivitiesView.gestureRecognizers[0]];
}
if ([AppDelegate theDelegate].isOffline)
{
@@ -2654,8 +2665,6 @@
[tapGesture setNumberOfTapsRequired:1];
[tapGesture setDelegate:self];
[roomActivitiesView addGestureRecognizer:tapGesture];
roomActivitiesView.userInteractionEnabled = YES;
}
}
else if ([self checkUnsentMessages] == NO)
@@ -2684,6 +2693,12 @@
[self refreshTypingNotification];
}
}
// Recognize swipe downward to dismiss keyboard if any
UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(onSwipeGesture:)];
[swipe setNumberOfTouchesRequired:1];
[swipe setDirection:UISwipeGestureRecognizerDirectionDown];
[roomActivitiesView addGestureRecognizer:swipe];
}
}