mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Speedup the display of a chatroom.
On a relatively long, the time for loading the chatroom view decreases from 21 seconds to 7 seconds. The main problem is that each the view is entered [tableView reloadData] was called three times.
This commit is contained in:
parent
2487741d7f
commit
52b468ec40
2 changed files with 6 additions and 1 deletions
|
|
@ -36,6 +36,7 @@
|
|||
OrderedDictionary *imageQualities;
|
||||
BOOL scrollOnGrowingEnabled;
|
||||
BOOL composingVisible;
|
||||
BOOL isAppearing;
|
||||
}
|
||||
|
||||
@property(nonatomic) LinphoneChatRoom *chatRoom;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
[NSNumber numberWithFloat:0.5], NSLocalizedString(@"Average", nil),
|
||||
[NSNumber numberWithFloat:0.0], NSLocalizedString(@"Minimum", nil), nil];
|
||||
composingVisible = false;
|
||||
isAppearing = false;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
@ -109,6 +110,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
name:kLinphoneCallUpdate
|
||||
object:nil];
|
||||
[self configureForRoom:false];
|
||||
isAppearing = true;
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
|
|
@ -131,10 +133,12 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
||||
PhoneMainView.instance.currentRoom = NULL;
|
||||
isAppearing = FALSE;
|
||||
}
|
||||
|
||||
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
|
||||
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
||||
if (!isAppearing) return; //no need to do all that stuff if the view isn't yet appeared.
|
||||
// force offset recomputing
|
||||
[_messageField refreshHeight];
|
||||
[self configureForRoom:true];
|
||||
|
|
@ -168,7 +172,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
if (_tableController.isEditing)
|
||||
[_tableController setEditing:editing];
|
||||
|
||||
[[_tableController tableView] reloadData];
|
||||
//[[_tableController tableView] reloadData];
|
||||
|
||||
BOOL fileSharingEnabled = linphone_core_get_file_transfer_server(LC) != NULL;
|
||||
[_pictureButton setEnabled:fileSharingEnabled];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue