mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 21:41:45 +00:00
Improvements for feedback compose view on iPad
When the actionsheet is visible, disable the add image button and remove the first responder from the textview
This commit is contained in:
parent
429af075bc
commit
0f142f0ec5
@ -68,7 +68,9 @@
|
||||
|
||||
|
||||
@implementation BITFeedbackComposeViewController {
|
||||
BOOL _blockUserDataScreen;
|
||||
BOOL _blockUserDataScreen;
|
||||
|
||||
BOOL _actionSheetVisible;
|
||||
}
|
||||
|
||||
|
||||
@ -79,6 +81,7 @@
|
||||
if (self) {
|
||||
self.title = BITHockeyLocalizedString(@"HockeyFeedbackComposeTitle");
|
||||
_blockUserDataScreen = NO;
|
||||
_actionSheetVisible = NO;
|
||||
_delegate = nil;
|
||||
_manager = [BITHockeyManager sharedHockeyManager].feedbackManager;
|
||||
_attachments = [NSMutableArray new];
|
||||
@ -411,6 +414,8 @@
|
||||
}
|
||||
|
||||
-(void)addPhotoAction:(id)sender {
|
||||
if (_actionSheetVisible) return;
|
||||
|
||||
// add photo.
|
||||
UIImagePickerController *pickerController = [[UIImagePickerController alloc] init];
|
||||
pickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
|
||||
@ -464,6 +469,11 @@
|
||||
otherButtonTitles: BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentEdit"), nil];
|
||||
|
||||
[actionSheet showFromRect: sender.frame inView: self.attachmentScrollView animated: YES];
|
||||
|
||||
_actionSheetVisible = YES;
|
||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
||||
[self.textView resignFirstResponder];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -526,6 +536,10 @@
|
||||
[self presentViewController:navController animated:YES completion:nil];
|
||||
}
|
||||
}
|
||||
_actionSheetVisible = NO;
|
||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
||||
[self.textView becomeFirstResponder];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user