Restart timer animation when returning from background

// FREEBIE
This commit is contained in:
Michael Kirk 2016-10-12 15:18:27 -04:00
parent 04f5c3ce22
commit da82c01f6e
1 changed files with 11 additions and 2 deletions

View File

@ -305,6 +305,10 @@ typedef enum : NSUInteger {
selector:@selector(startReadTimer)
name:UIApplicationWillEnterForegroundNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(startExpirationTimerAnimations)
name:UIApplicationWillEnterForegroundNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(cancelReadTimer)
name:UIApplicationDidEnterBackgroundNotification
@ -349,8 +353,7 @@ typedef enum : NSUInteger {
[self.thread touch];
// restart any animations that were stopped e.g. while inspecting the contact info screens.
[[NSNotificationCenter defaultCenter] postNotificationName:OWSMessagesViewControllerDidAppearNotification
object:nil];
[self startExpirationTimerAnimations];
OWSDisappearingMessagesConfiguration *configuration =
[OWSDisappearingMessagesConfiguration fetchObjectWithUniqueID:self.thread.uniqueId];
@ -437,6 +440,12 @@ typedef enum : NSUInteger {
[self saveDraft];
}
- (void)startExpirationTimerAnimations
{
[[NSNotificationCenter defaultCenter] postNotificationName:OWSMessagesViewControllerDidAppearNotification
object:nil];
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
self.inputToolbar.contentView.textView.editable = NO;