mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 00:52:43 +02:00
Merge pull request #5690 from vector-im/andy/5603_room_indicators
Room activity indicators
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user