mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Prepare UX rework:
- Fix flickering observed on sticky headers when the full table content is displayed
This commit is contained in:
parent
44166dc616
commit
de61103452
1 changed files with 10 additions and 1 deletions
|
@ -509,13 +509,22 @@
|
||||||
|
|
||||||
- (void)refreshStickyHeadersContainersHeight
|
- (void)refreshStickyHeadersContainersHeight
|
||||||
{
|
{
|
||||||
|
// Check whether the full table content is visible.
|
||||||
|
if (self.recentsTableView.contentSize.height + self.recentsTableView.contentInset.top + self.recentsTableView.contentInset.bottom <= self.recentsTableView.frame.size.height )
|
||||||
|
{
|
||||||
|
// No sticky header is required. Hide them to prevent from flickering in case of vertical bounces.
|
||||||
|
self.stickyHeadersTopContainerHeightConstraint.constant = 0;
|
||||||
|
self.stickyHeadersBottomContainerHeightConstraint.constant = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_enableStickyHeaders)
|
if (_enableStickyHeaders)
|
||||||
{
|
{
|
||||||
// Retrieve the first and the last headers actually visible in the recents table view.
|
// Retrieve the first and the last headers actually visible in the recents table view.
|
||||||
// Caution: In some cases like the screen rotation, some displayed section headers are temporarily not visible.
|
// Caution: In some cases like the screen rotation, some displayed section headers are temporarily not visible.
|
||||||
UIView *firstDisplayedSectionHeader, *lastDisplayedSectionHeader;
|
UIView *firstDisplayedSectionHeader, *lastDisplayedSectionHeader;
|
||||||
CGFloat containerHeight;
|
CGFloat containerHeight;
|
||||||
CGFloat maxVisiblePosY = self.recentsTableView.contentOffset.y + (self.recentsTableView.frame.size.height - self.recentsTableView.contentInset.bottom);
|
CGFloat maxVisiblePosY = self.recentsTableView.contentOffset.y + self.recentsTableView.frame.size.height - self.recentsTableView.contentInset.bottom;
|
||||||
|
|
||||||
for (UIView *header in displayedSectionHeaders)
|
for (UIView *header in displayedSectionHeaders)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue