mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-24 02:22:44 +02:00
Fix composer resizing animations
This commit is contained in:
@@ -3360,33 +3360,34 @@
|
||||
- (void)roomInputToolbarView:(MXKRoomInputToolbarView*)toolbarView heightDidChanged:(CGFloat)height completion:(void (^)(BOOL finished))completion
|
||||
{
|
||||
NSLog(@"%@", [NSThread currentThread]);
|
||||
_roomInputToolbarContainerHeightConstraint.constant = height;
|
||||
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// Update layout with animation
|
||||
[UIView animateWithDuration:self.resizeComposerAnimationDuration delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseIn
|
||||
animations:^{
|
||||
// We will scroll to bottom if the bottom of the table is currently visible
|
||||
BOOL shouldScrollToBottom = [self isBubblesTableScrollViewAtTheBottom];
|
||||
|
||||
CGFloat bubblesTableViewBottomConst = self->_roomInputToolbarContainerBottomConstraint.constant + self->_roomInputToolbarContainerHeightConstraint.constant + self->_roomActivitiesContainerHeightConstraint.constant;
|
||||
|
||||
self->_bubblesTableViewBottomConstraint.constant = bubblesTableViewBottomConst;
|
||||
|
||||
// Force to render the view
|
||||
[self.view layoutIfNeeded];
|
||||
|
||||
if (shouldScrollToBottom)
|
||||
{
|
||||
[self scrollBubblesTableViewToBottomAnimated:NO];
|
||||
}
|
||||
}
|
||||
completion:^(BOOL finished){
|
||||
if (completion)
|
||||
{
|
||||
completion(finished);
|
||||
}
|
||||
}];
|
||||
// Update layout with animation
|
||||
[UIView animateWithDuration:self.resizeComposerAnimationDuration delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseIn
|
||||
animations:^{
|
||||
// We will scroll to bottom if the bottom of the table is currently visible
|
||||
BOOL shouldScrollToBottom = [self isBubblesTableScrollViewAtTheBottom];
|
||||
|
||||
self->_roomInputToolbarContainerHeightConstraint.constant = height;
|
||||
CGFloat bubblesTableViewBottomConst = self->_roomInputToolbarContainerBottomConstraint.constant + self->_roomInputToolbarContainerHeightConstraint.constant + self->_roomActivitiesContainerHeightConstraint.constant;
|
||||
|
||||
self->_bubblesTableViewBottomConstraint.constant = bubblesTableViewBottomConst;
|
||||
|
||||
// Force to render the view
|
||||
[self.view layoutIfNeeded];
|
||||
|
||||
if (shouldScrollToBottom)
|
||||
{
|
||||
[self scrollBubblesTableViewToBottomAnimated:NO];
|
||||
}
|
||||
}
|
||||
completion:^(BOOL finished){
|
||||
if (completion)
|
||||
{
|
||||
completion(finished);
|
||||
}
|
||||
}];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user