fix size of table view of chat room creations

This commit is contained in:
Benjamin Reis 2018-02-13 15:49:29 +01:00
parent 3293aaaa41
commit 745ce34ded
4 changed files with 19 additions and 15 deletions

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -170,6 +170,7 @@
<connections>
<outlet property="searchBar" destination="Rd9-hK-nqR" id="rLn-7q-CwC"/>
<outlet property="view" destination="6" id="13"/>
<outlet property="waitView" destination="Ztm-hK-aBp" id="uSB-4b-n7e"/>
</connections>
<point key="canvasLocation" x="463" y="90"/>
</tableViewController>

View file

@ -15,6 +15,7 @@
@property(nonatomic, strong) NSMutableArray *contactsGroup;
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
@property (weak, nonatomic) IBOutlet UIIconButton *controllerNextButton;
@property (weak, nonatomic) IBOutlet UIView *waitView;
@property(nonatomic) Boolean isForEditing;
- (void) loadData;

View file

@ -33,6 +33,20 @@
return [[first.firstName lowercaseString] compare:[second.firstName lowercaseString]];
}];
int y = _contactsGroup.count > 0
? _collectionView.frame.origin.y + _collectionView.frame.size.height
: _searchBar.frame.origin.y + _searchBar.frame.size.height;
[UIView animateWithDuration:0
delay:0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
[self.tableView setFrame:CGRectMake(self.tableView.frame.origin.x,
y,
self.tableView.frame.size.width,
_waitView.frame.size.height - _waitView.frame.origin.y - y)];
}
completion:nil];
_contacts = [[NSMutableDictionary alloc] initWithCapacity:_sortedAddresses.count];
if(_notFirstTime) {
for(NSString *addr in _contactsGroup) {
@ -47,19 +61,6 @@
[_searchBar setText:@""];
[self searchBar:_searchBar textDidChange:_searchBar.text];
self.tableView.accessibilityIdentifier = @"Suggested addresses";
if (_contactsGroup.count > 0) {
[UIView animateWithDuration:0
delay:0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
[self.tableView setFrame:CGRectMake(self.tableView.frame.origin.x,
_collectionView.frame.origin.y + _collectionView.frame.size.height,
self.tableView.frame.size.width,
self.tableView.frame.size.height - _collectionView.frame.size.height)];
}
completion:nil];
}
}
- (void) viewWillDisappear:(BOOL)animated {

View file

@ -84,6 +84,7 @@ static UICompositeViewDescription *compositeDescription = nil;
ChatConversationCreateView *view = VIEW(ChatConversationCreateView);
view.isForEditing = false;
view.tableController.notFirstTime = FALSE;
[view.tableController.contactsGroup removeAllObjects];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
}