Make pending friend request status more obvious

pull/15/head
Niels Andriesse 6 years ago
parent 1fc9ac34a2
commit 3c579548cc

@ -36,6 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) id<ConversationTextViewToolbarDelegate> textViewToolbarDelegate;
- (NSString *)trimmedText;
- (void)setPlaceholderText:(NSString *)placeholderText;
@end

@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN
self.text = nil;
self.placeholderView = [UILabel new];
self.placeholderView.text = NSLocalizedString(@"new_message", @"");
self.placeholderView.text = NSLocalizedString(@"New Message", @"");
self.placeholderView.textColor = Theme.placeholderColor;
self.placeholderView.userInteractionEnabled = NO;
[self addSubview:self.placeholderView];
@ -176,6 +176,11 @@ NS_ASSUME_NONNULL_BEGIN
return [self.text ows_stripped];
}
- (void)setPlaceholderText:(NSString *)placeholderText
{
[self.placeholderView setText:placeholderText];
}
#pragma mark - UITextViewDelegate
- (void)textViewDidChange:(UITextView *)textView

@ -51,6 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
- (NSString *)messageText;
- (void)setMessageText:(NSString *_Nullable)value animated:(BOOL)isAnimated;
- (void)setPlaceholderText:(NSString *)placeholderText;
- (void)clearTextMessageAnimated:(BOOL)isAnimated;
- (void)toggleDefaultKeyboard;

@ -313,6 +313,11 @@ const CGFloat kMaxTextViewHeight = 98;
[self ensureShouldShowVoiceMemoButtonAnimated:isAnimated doLayout:YES];
}
- (void)setPlaceholderText:(NSString *)placeholderText
{
[self.inputTextView setPlaceholderText:placeholderText];
}
- (void)ensureTextViewHeight
{
[self updateHeightWithTextView:self.inputTextView];

@ -627,6 +627,7 @@ typedef enum : NSUInteger {
self.inputToolbar.inputToolbarDelegate = self;
self.inputToolbar.inputTextViewDelegate = self;
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _inputToolbar);
[self updateInputToolbar];
self.loadMoreHeader = [UILabel new];
self.loadMoreHeader.text = NSLocalizedString(@"CONVERSATION_VIEW_LOADING_MORE_MESSAGES",
@ -1584,11 +1585,13 @@ typedef enum : NSUInteger {
#pragma mark - Updating
- (void)updateIsInputToolbarInteractionEnabled {
- (void)updateInputToolbar {
TSThreadFriendRequestStatus friendRequestStatus = [self.thread getFriendRequestStatus];
BOOL isFriendRequest = friendRequestStatus == TSThreadFriendRequestStatusPendingSend || friendRequestStatus == TSThreadFriendRequestStatusRequestSent
|| friendRequestStatus == TSThreadFriendRequestStatusRequestReceived;
[self.inputToolbar setUserInteractionEnabled:!isFriendRequest];
NSString *placeholderText = isFriendRequest ? NSLocalizedString(@"Pending Friend Request...", "") : NSLocalizedString(@"New Message", "");
[self.inputToolbar setPlaceholderText:placeholderText];
}
#pragma mark - Identity
@ -4891,7 +4894,7 @@ typedef enum : NSUInteger {
[self updateBackButtonUnreadCount];
[self updateNavigationBarSubtitleLabel];
[self dismissMenuActionsIfNecessary];
[self updateIsInputToolbarInteractionEnabled];
[self updateInputToolbar];
if (self.isGroupConversation) {
[self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {

@ -2574,3 +2574,5 @@
"%@ sent you a friend request" = "%@ sent you a friend request";
"Accept" = "Accept";
"Decline" = "Decline";
"Pending Friend Request..." = "Pending Friend Request...";
"New Message" = "New Message";

Loading…
Cancel
Save