From 09a969a2697899a19c4ea5dbf3c6d41c290df147 Mon Sep 17 00:00:00 2001 From: Ivan Sein Date: Wed, 29 Apr 2020 16:24:05 +0200 Subject: [PATCH] Use material activity indicator in chat messages sending delivery state. Signed-off-by: Ivan Sein --- Podfile | 1 + VideoCalls.xcodeproj/project.pbxproj | 2 ++ VideoCalls/ChatMessageTableViewCell.m | 6 ++++-- VideoCalls/FileMessageTableViewCell.m | 6 ++++-- VideoCalls/GroupedChatMessageTableViewCell.m | 6 ++++-- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Podfile b/Podfile index e9215491..305ad2e3 100644 --- a/Podfile +++ b/Podfile @@ -12,5 +12,6 @@ pod 'UICKeyChainStore' pod 'Realm' pod "AFViewShaker", "~> 0.0.5" pod 'BKPasscodeView', '~> 0.1.2' +pod 'MaterialComponents/ActivityIndicator' end diff --git a/VideoCalls.xcodeproj/project.pbxproj b/VideoCalls.xcodeproj/project.pbxproj index 8d20f9a7..b20be565 100644 --- a/VideoCalls.xcodeproj/project.pbxproj +++ b/VideoCalls.xcodeproj/project.pbxproj @@ -1312,10 +1312,12 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-VideoCalls/Pods-VideoCalls-resources.sh", "${PODS_ROOT}/DateTools/DateTools/DateTools/DateTools.bundle", + "${PODS_ROOT}/MaterialComponents/components/ActivityIndicator/src/MaterialActivityIndicator.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/DateTools.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialActivityIndicator.bundle", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/VideoCalls/ChatMessageTableViewCell.m b/VideoCalls/ChatMessageTableViewCell.m index 4f09e74a..8896fa4c 100644 --- a/VideoCalls/ChatMessageTableViewCell.m +++ b/VideoCalls/ChatMessageTableViewCell.m @@ -9,6 +9,7 @@ #import "ChatMessageTableViewCell.h" #import "SLKUIConstants.h" #import "QuotedMessageView.h" +#import "MaterialActivityIndicator.h" #import "UIImageView+AFNetworking.h" #import "UIImageView+Letters.h" @@ -193,8 +194,9 @@ [self.statusView.subviews makeObjectsPerformSelector: @selector(removeFromSuperview)]; if (state == ChatMessageDeliveryStateSending) { - UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)]; - activityIndicator.color = [UIColor darkGrayColor]; + MDCActivityIndicator *activityIndicator = [[MDCActivityIndicator alloc] initWithFrame:CGRectMake(0, 0, 20, 20)]; + activityIndicator.radius = 7.0f; + activityIndicator.cycleColors = @[UIColor.grayColor]; [activityIndicator startAnimating]; [self.statusView addSubview:activityIndicator]; } else if (state == ChatMessageDeliveryStateFailed) { diff --git a/VideoCalls/FileMessageTableViewCell.m b/VideoCalls/FileMessageTableViewCell.m index 45aa6ff3..33b01b87 100644 --- a/VideoCalls/FileMessageTableViewCell.m +++ b/VideoCalls/FileMessageTableViewCell.m @@ -8,6 +8,7 @@ #import "FileMessageTableViewCell.h" #import "SLKUIConstants.h" +#import "MaterialActivityIndicator.h" #import "NCSettingsController.h" #import "NCUtils.h" #import "OpenInFirefoxControllerObjC.h" @@ -185,8 +186,9 @@ [self.statusView.subviews makeObjectsPerformSelector: @selector(removeFromSuperview)]; if (state == ChatMessageDeliveryStateSending) { - UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)]; - activityIndicator.color = [UIColor darkGrayColor]; + MDCActivityIndicator *activityIndicator = [[MDCActivityIndicator alloc] initWithFrame:CGRectMake(0, 0, 20, 20)]; + activityIndicator.radius = 7.0f; + activityIndicator.cycleColors = @[UIColor.grayColor]; [activityIndicator startAnimating]; [self.statusView addSubview:activityIndicator]; } else if (state == ChatMessageDeliveryStateFailed) { diff --git a/VideoCalls/GroupedChatMessageTableViewCell.m b/VideoCalls/GroupedChatMessageTableViewCell.m index 7df48f82..b1754534 100644 --- a/VideoCalls/GroupedChatMessageTableViewCell.m +++ b/VideoCalls/GroupedChatMessageTableViewCell.m @@ -7,6 +7,7 @@ // #import "GroupedChatMessageTableViewCell.h" +#import "MaterialActivityIndicator.h" #import "SLKUIConstants.h" @implementation GroupedChatMessageTableViewCell @@ -64,8 +65,9 @@ [self.statusView.subviews makeObjectsPerformSelector: @selector(removeFromSuperview)]; if (state == ChatMessageDeliveryStateSending) { - UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)]; - activityIndicator.color = [UIColor darkGrayColor]; + MDCActivityIndicator *activityIndicator = [[MDCActivityIndicator alloc] initWithFrame:CGRectMake(0, 0, 20, 20)]; + activityIndicator.radius = 7.0f; + activityIndicator.cycleColors = @[UIColor.grayColor]; [activityIndicator startAnimating]; [self.statusView addSubview:activityIndicator]; } else if (state == ChatMessageDeliveryStateFailed) {