mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-30 21:26:57 +02:00
Chat: Expanded header
Hide the header only on scroll down.
This commit is contained in:
@@ -63,6 +63,9 @@
|
||||
// The expanded header
|
||||
ExpandedRoomTitleView *expandedHeader;
|
||||
|
||||
// The content offset at the beginning of scrolling
|
||||
CGFloat storedContentOffset;
|
||||
|
||||
// The customized room data source for Vector
|
||||
RoomDataSource *customizedRoomDataSource;
|
||||
|
||||
@@ -365,12 +368,6 @@
|
||||
[super destroy];
|
||||
}
|
||||
|
||||
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
|
||||
{
|
||||
// Hide the expanded header in case of scrolling
|
||||
[self hideExpandedHeader:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Hide/Show expanded header
|
||||
|
||||
- (void)hideExpandedHeader:(BOOL)isHidden
|
||||
@@ -1035,6 +1032,23 @@
|
||||
[super tableView:tableView didSelectRowAtIndexPath:indexPath];
|
||||
}
|
||||
|
||||
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
|
||||
{
|
||||
// Store the current offset to detect scroll down
|
||||
storedContentOffset = scrollView.contentOffset.y;
|
||||
}
|
||||
|
||||
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
|
||||
{
|
||||
[super scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:targetContentOffset];
|
||||
|
||||
// Hide expanded header on scroll down
|
||||
if (storedContentOffset < scrollView.contentOffset.y)
|
||||
{
|
||||
[self hideExpandedHeader:YES];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - MXKRoomTitleViewDelegate
|
||||
|
||||
- (BOOL)roomTitleViewShouldBeginEditing:(MXKRoomTitleView*)titleView
|
||||
|
||||
Reference in New Issue
Block a user