Attachment Menu Improvements

This commit is contained in:
Ilya Laktyushin
2022-02-15 21:48:46 +03:00
parent 95b6b44d0a
commit 2efbb9170f
40 changed files with 875 additions and 886 deletions

View File

@@ -33,7 +33,7 @@
@property (nonatomic) bool hasSilentPosting;
@property (nonatomic) bool hasSchedule;
@property (nonatomic) bool reminder;
@property (nonatomic, copy) void (^presentScheduleController)(void (^)(int32_t));
@property (nonatomic, copy) void (^presentScheduleController)(bool, void (^)(int32_t));
@property (nonatomic, copy) void (^presentTimerController)(void (^)(int32_t));
@property (nonatomic, strong) NSArray *underlyingViews;

View File

@@ -58,7 +58,7 @@ typedef enum {
@property (nonatomic, copy) void(^finishedTransitionOut)(void);
@property (nonatomic, copy) void(^customPresentOverlayController)(TGOverlayController *(^)(id<LegacyComponentsContext>));
@property (nonatomic, copy) void (^presentScheduleController)(void (^)(int32_t));
@property (nonatomic, copy) void (^presentScheduleController)(bool, void (^)(int32_t));
@property (nonatomic, copy) void (^presentTimerController)(void (^)(int32_t));
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context saveEditedPhotos:(bool)saveEditedPhotos saveCapturedMedia:(bool)saveCapturedMedia;

View File

@@ -64,7 +64,7 @@ typedef enum
@property (nonatomic, assign) bool hasSilentPosting;
@property (nonatomic, assign) bool hasSchedule;
@property (nonatomic, assign) bool reminder;
@property (nonatomic, copy) void (^presentScheduleController)(void (^)(int32_t));
@property (nonatomic, copy) void (^presentScheduleController)(bool, void (^)(int32_t));
@property (nonatomic, copy) void (^presentTimerController)(void (^)(int32_t));
@property (nonatomic, assign) bool liveVideoUploadEnabled;
@@ -92,7 +92,7 @@ typedef enum
- (UIBarButtonItem *)rightBarButtonItem;
- (void)send:(bool)silently;
- (void)schedule;
- (void)schedule:(bool)schedule;
- (NSArray *)resultSignalsWithCurrentItem:(TGMediaAsset *)currentItem descriptionGenerator:(id (^)(id, NSAttributedString *, NSString *, NSString *))descriptionGenerator;

View File

@@ -30,7 +30,7 @@
@property (nonatomic, assign) bool hasSilentPosting;
@property (nonatomic, assign) bool hasSchedule;
@property (nonatomic, assign) bool reminder;
@property (nonatomic, copy) void (^presentScheduleController)(void (^)(int32_t));
@property (nonatomic, copy) void (^presentScheduleController)(bool, void (^)(int32_t));
@property (nonatomic, copy) void (^presentTimerController)(void (^)(int32_t));
@property (nonatomic, assign) CGFloat topInset;

View File

@@ -28,7 +28,7 @@
@property (nonatomic, copy) void (^editorOpened)(void);
@property (nonatomic, copy) void (^editorClosed)(void);
@property (nonatomic, copy) void (^presentScheduleController)(void (^)(int32_t));
@property (nonatomic, copy) void (^presentScheduleController)(bool, void (^)(int32_t));
@property (nonatomic, copy) void (^presentTimerController)(void (^)(int32_t));
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context item:(id)item fetchResult:(TGMediaAssetFetchResult *)fetchResult parentController:(TGViewController *)parentController thumbnailImage:(UIImage *)thumbnailImage selectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext hasCaptions:(bool)hasCaptions allowCaptionEntities:(bool)allowCaptionEntities hasTimer:(bool)hasTimer onlyCrop:(bool)onlyCrop inhibitDocumentCaptions:(bool)inhibitDocumentCaptions inhibitMute:(bool)inhibitMute asFile:(bool)asFile itemsLimit:(NSUInteger)itemsLimit recipientName:(NSString *)recipientName hasSilentPosting:(bool)hasSilentPosting hasSchedule:(bool)hasSchedule reminder:(bool)reminder stickersContext:(id<TGPhotoPaintStickersContext>)stickersContext;

View File

@@ -1618,7 +1618,7 @@ static CGPoint TGCameraControllerClampPointToScreenSize(__unused id self, __unus
if (strongSelf == nil)
return;
strongSelf.presentScheduleController(^(int32_t time) {
strongSelf.presentScheduleController(true, ^(int32_t time) {
__strong TGCameraController *strongSelf = weakSelf;
__strong TGMediaPickerGalleryModel *strongModel = weakModel;

View File

@@ -363,7 +363,7 @@
self.pickerController.reminder = reminder;
}
- (void)setPresentScheduleController:(void (^)(void (^)(int32_t)))presentScheduleController {
- (void)setPresentScheduleController:(void (^)(bool, void (^)(int32_t)))presentScheduleController {
_presentScheduleController = [presentScheduleController copy];
self.pickerController.presentScheduleController = presentScheduleController;
}
@@ -1432,9 +1432,9 @@
[self completeWithCurrentItem:nil silentPosting:silently scheduleTime:0];
}
- (void)schedule {
- (void)schedule:(bool)media {
__weak TGMediaAssetsController *weakSelf = self;
self.presentScheduleController(^(int32_t scheduleTime) {
self.presentScheduleController(media, ^(int32_t scheduleTime) {
[weakSelf completeWithCurrentItem:nil silentPosting:false scheduleTime:scheduleTime];
});
}

View File

@@ -191,7 +191,7 @@
if (strongSelf == nil)
return;
strongSelf.presentScheduleController(^(int32_t time) {
strongSelf.presentScheduleController(true, ^(int32_t time) {
__strong TGMediaPickerModernGalleryMixin *strongSelf = weakSelf;
if (strongSelf == nil)
return;