mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-31 18:29:29 +00:00
keep advancing the group chat UI
This commit is contained in:
parent
e6cf85c050
commit
d9b726edca
8 changed files with 57 additions and 7 deletions
|
|
@ -17,6 +17,7 @@
|
|||
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
|
||||
@property (weak, nonatomic) IBOutlet UIIconButton *controllerNextButton;
|
||||
|
||||
@property(nonatomic) Boolean isForEditing;
|
||||
- (void) loadData;
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -38,6 +38,30 @@
|
|||
[_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];
|
||||
} else {
|
||||
[UIView animateWithDuration:0
|
||||
delay:0
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
[self.tableView setFrame:CGRectMake(self.tableView.frame.origin.x,
|
||||
_searchBar.frame.origin.y + _searchBar.frame.size.height,
|
||||
self.tableView.frame.size.width,
|
||||
self.tableView.frame.size.height + _collectionView.frame.size.height)];
|
||||
}
|
||||
completion:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) viewWillDisappear:(BOOL)animated {
|
||||
|
|
@ -82,6 +106,8 @@
|
|||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
#pragma mark - TableView methods
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -129,7 +155,7 @@
|
|||
[_contactsDict removeObjectForKey:cell.addressLabel.text];
|
||||
}
|
||||
cell.selectedImage.hidden = !cell.selectedImage.hidden;
|
||||
_controllerNextButton.enabled = (_contactsGroup.count > 0);
|
||||
_controllerNextButton.enabled = (_contactsGroup.count > 0) || _isForEditing;
|
||||
if (_contactsGroup.count > 1 || (_contactsGroup.count == 1 && cell.selectedImage.hidden)) {
|
||||
[UIView animateWithDuration:0.2
|
||||
delay:0
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@
|
|||
@property (weak, nonatomic) IBOutlet UIIconButton *linphoneButton;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *selectedButtonImage;
|
||||
|
||||
@property(nonatomic) Boolean isForEditing;
|
||||
|
||||
- (IBAction)onBackClick:(id)sender;
|
||||
- (IBAction)onNextClick:(id)sender;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,12 +53,15 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[_collectionView setCollectionViewLayout:layout];
|
||||
_tableController.collectionView = _collectionView;
|
||||
_tableController.controllerNextButton = _nextButton;
|
||||
_isForEditing = FALSE;
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
if(_tableController.contactsGroup.count == 0) {
|
||||
_nextButton.enabled = FALSE;
|
||||
if (!_isForEditing)
|
||||
_nextButton.enabled = FALSE;
|
||||
|
||||
_tableController.tableView.frame = CGRectMake(_tableController.tableView.frame.origin.x,
|
||||
_tableController.searchBar.frame.origin.y + _tableController.searchBar.frame.size.height,
|
||||
_tableController.tableView.frame.size.width,
|
||||
|
|
@ -67,6 +70,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[_collectionView reloadData];
|
||||
[self changeView:ContactsAll];
|
||||
[_tableController loadData];
|
||||
_tableController.isForEditing = _isForEditing;
|
||||
}
|
||||
|
||||
#pragma mark - searchBar delegate
|
||||
|
|
@ -119,8 +123,15 @@ void create_chat_room_state_changed(LinphoneChatRoom *cr, LinphoneChatRoomState
|
|||
return;
|
||||
}
|
||||
ChatConversationInfoView *view = VIEW(ChatConversationInfoView);
|
||||
view.contacts = _tableController.contactsDict;
|
||||
view.create = TRUE;
|
||||
if (!_isForEditing)
|
||||
view.contacts = _tableController.contactsDict;
|
||||
else {
|
||||
for (NSString *uri in _tableController.contactsDict) {
|
||||
[view.contacts setObject:[_tableController.contactsDict objectForKey:uri] forKey:uri];
|
||||
}
|
||||
}
|
||||
|
||||
view.create = !_isForEditing;
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
view.tableController.contactsDict = _contacts;
|
||||
view.tableController.contactsGroup = [[_contacts allKeys] mutableCopy];
|
||||
view.tableController.notFirstTime = TRUE;
|
||||
view.isForEditing = FALSE;
|
||||
[PhoneMainView.instance popToView:view.compositeViewDescription];
|
||||
} else {
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
|
|
@ -117,6 +118,15 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
- (IBAction)onQuitClick:(id)sender {
|
||||
}
|
||||
|
||||
- (IBAction)onAddClick:(id)sender {
|
||||
ChatConversationCreateView *view = VIEW(ChatConversationCreateView);
|
||||
view.tableController.notFirstTime = TRUE;
|
||||
view.isForEditing = !_create;
|
||||
[view.tableController.contactsDict removeAllObjects];
|
||||
[view.tableController.contactsGroup removeAllObjects];
|
||||
[PhoneMainView.instance popToView:view.compositeViewDescription];
|
||||
}
|
||||
|
||||
#pragma mark - TableView
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@
|
|||
<state key="disabled" image="valid_disabled.png"/>
|
||||
<state key="highlighted" backgroundImage="color_E.png"/>
|
||||
<connections>
|
||||
<action selector="onBackClick:" destination="-1" eventType="touchUpInside" id="EHU-0A-zHi"/>
|
||||
<action selector="onAddClick:" destination="-1" eventType="touchUpInside" id="Dcn-sR-xRc"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
|
|
|
|||
|
|
@ -47,6 +47,6 @@
|
|||
}
|
||||
[_controller.collectionView reloadData];
|
||||
[_controller.tableController.tableView reloadData];
|
||||
_controller.tableController.controllerNextButton.enabled = (_controller.tableController.contactsGroup.count > 0);
|
||||
_controller.nextButton.enabled = (_controller.tableController.contactsGroup.count > 0) || _controller.isForEditing;
|
||||
}
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 94c08dce7f21f9ce03361282cad8ca12b1258d1a
|
||||
Subproject commit 8e05e6a21f0770e4e00fbf316568645bebaf41c0
|
||||
Loading…
Add table
Reference in a new issue