mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
Prepare UX rework:
- Fix sections handling in unified search screen. - Prepare sticky headers in RecentsViewController.
This commit is contained in:
@@ -67,6 +67,22 @@
|
||||
|
||||
@implementation RecentsViewController
|
||||
|
||||
#pragma mark - Class methods
|
||||
|
||||
+ (UINib *)nib
|
||||
{
|
||||
return [UINib nibWithNibName:NSStringFromClass([RecentsViewController class])
|
||||
bundle:[NSBundle bundleForClass:[RecentsViewController class]]];
|
||||
}
|
||||
|
||||
+ (instancetype)recentListViewController
|
||||
{
|
||||
return [[[self class] alloc] initWithNibName:NSStringFromClass([RecentsViewController class])
|
||||
bundle:[NSBundle bundleForClass:[RecentsViewController class]]];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
[super awakeFromNib];
|
||||
@@ -89,6 +105,8 @@
|
||||
// Set default screen name
|
||||
_screenName = @"RecentsScreen";
|
||||
|
||||
_enableStickyHeaders = NO;
|
||||
|
||||
// Set itself as delegate by default.
|
||||
self.delegate = self;
|
||||
}
|
||||
@@ -98,6 +116,17 @@
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
|
||||
// Adjust Bottom constraint to take into account tabBar.
|
||||
[NSLayoutConstraint deactivateConstraints:@[_stickyHeadersBottomContainerBottomConstraint]];
|
||||
_stickyHeadersBottomContainerBottomConstraint = [NSLayoutConstraint constraintWithItem:self.bottomLayoutGuide
|
||||
attribute:NSLayoutAttributeTop
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:self.stickyHeadersBottomContainer
|
||||
attribute:NSLayoutAttributeBottom
|
||||
multiplier:1.0f
|
||||
constant:0.0f];
|
||||
[NSLayoutConstraint activateConstraints:@[_stickyHeadersBottomContainerBottomConstraint]];
|
||||
|
||||
self.recentsTableView.accessibilityIdentifier = @"RecentsVCTableView";
|
||||
|
||||
// Register here the customized cell view class used to render recents
|
||||
@@ -243,6 +272,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Override MXKRecentListViewController
|
||||
|
||||
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
|
||||
{
|
||||
// Deduce the bottom constraint for the table view (Don't forget the potential tabBar)
|
||||
CGFloat tableViewBottomConst = keyboardHeight - self.bottomLayoutGuide.length;
|
||||
// Check whether the keyboard is over the tabBar
|
||||
if (tableViewBottomConst < 0)
|
||||
{
|
||||
tableViewBottomConst = 0;
|
||||
}
|
||||
|
||||
// Update constraints
|
||||
_stickyHeadersBottomContainerBottomConstraint.constant = tableViewBottomConst;
|
||||
|
||||
// Force layout immediately to take into account new constraint
|
||||
[self.view layoutIfNeeded];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)refreshCurrentSelectedCell:(BOOL)forceVisible
|
||||
|
||||
Reference in New Issue
Block a user