Merge pull request #5690 from vector-im/andy/5603_room_indicators

Room activity indicators
This commit is contained in:
Anderas
2022-03-01 13:08:29 +00:00
committed by GitHub
28 changed files with 458 additions and 329 deletions
@@ -21,6 +21,9 @@ NS_ASSUME_NONNULL_BEGIN
@interface MXKActivityHandlingViewController : UIViewController<MXKViewControllerActivityHandling>
/// A subclass can override this method to block `stopActivityIndicator` if there are still activities in progress
- (BOOL)canStopActivityIndicator;
@end
NS_ASSUME_NONNULL_END
@@ -83,9 +83,15 @@
}
}
- (BOOL)canStopActivityIndicator {
return YES;
}
- (void)stopActivityIndicator
{
[activityIndicator stopAnimating];
if ([self canStopActivityIndicator]) {
[activityIndicator stopAnimating];
}
}
@end
@@ -492,21 +492,16 @@ const CGFloat MXKViewControllerMaxExternalKeyboardHeight = 80;
#pragma mark - Activity indicator
- (void)stopActivityIndicator
{
- (BOOL)canStopActivityIndicator {
// Check whether all conditions are satisfied before stopping loading wheel
BOOL isActivityInProgress = NO;
for (MXSession *mxSession in mxSessionArray)
{
if (mxSession.shouldShowActivityIndicator)
{
isActivityInProgress = YES;
return NO;
}
}
if (!isActivityInProgress)
{
[super stopActivityIndicator];
}
return [super canStopActivityIndicator];
}
#pragma mark - Shake handling