Various Fixes

This commit is contained in:
Ilya Laktyushin 2022-01-20 00:00:11 +03:00
parent 0cfbafa6c1
commit 241f78ddd9
7 changed files with 27 additions and 11 deletions

View File

@ -207,6 +207,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
self.tabBarItem.image = icon self.tabBarItem.image = icon
self.tabBarItem.selectedImage = icon self.tabBarItem.selectedImage = icon
self.tabBarItem.animationName = "TabChats" self.tabBarItem.animationName = "TabChats"
self.tabBarItem.animationOffset = CGPoint(x: 0.0, y: UIScreenPixel)
let leftBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Edit, style: .plain, target: self, action: #selector(self.editPressed)) let leftBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Edit, style: .plain, target: self, action: #selector(self.editPressed))
leftBarButtonItem.accessibilityLabel = self.presentationData.strings.Common_Edit leftBarButtonItem.accessibilityLabel = self.presentationData.strings.Common_Edit

View File

@ -654,10 +654,11 @@ class TabBarNode: ASDisplayNode {
let scaleFactor: CGFloat = horizontal ? 0.8 : 1.0 let scaleFactor: CGFloat = horizontal ? 0.8 : 1.0
node.animationContainerNode.subnodeTransform = CATransform3DMakeScale(scaleFactor, scaleFactor, 1.0) node.animationContainerNode.subnodeTransform = CATransform3DMakeScale(scaleFactor, scaleFactor, 1.0)
let animationOffset: CGPoint = self.tabBarItems[i].item.animationOffset
if horizontal { if horizontal {
node.animationNode.frame = CGRect(origin: CGPoint(x: -10.0 - UIScreenPixel, y: -4.0 - UIScreenPixel), size: CGSize(width: 51.0, height: 51.0)) node.animationNode.frame = CGRect(origin: CGPoint(x: -10.0 - UIScreenPixel, y: -4.0 - UIScreenPixel), size: CGSize(width: 51.0, height: 51.0))
} else { } else {
node.animationNode.frame = CGRect(origin: CGPoint(x: floorToScreenPixels((nodeSize.width - 51.0) / 2.0), y: -10.0 - UIScreenPixel), size: CGSize(width: 51.0, height: 51.0)) node.animationNode.frame = CGRect(origin: CGPoint(x: floorToScreenPixels((nodeSize.width - 51.0) / 2.0), y: -10.0 - UIScreenPixel).offsetBy(dx: animationOffset.x, dy: animationOffset.y), size: CGSize(width: 51.0, height: 51.0))
} }
if container.badgeValue != container.appliedBadgeValue { if container.badgeValue != container.appliedBadgeValue {

View File

@ -2187,7 +2187,6 @@ func renderVideo(context: AccountContext, backgroundImage: UIImage, media: Teleg
let timeRange = CMTimeRange(start: .zero, duration: duration) let timeRange = CMTimeRange(start: .zero, duration: duration)
try compositionTrack.insertTimeRange(timeRange, of: assetTrack, at: .zero) try compositionTrack.insertTimeRange(timeRange, of: assetTrack, at: .zero)
} catch { } catch {
print(error)
completion(nil) completion(nil)
return return
} }
@ -2228,7 +2227,6 @@ func renderVideo(context: AccountContext, backgroundImage: UIImage, media: Teleg
instruction.layerInstructions = [layerInstruction] instruction.layerInstructions = [layerInstruction]
guard let export = AVAssetExportSession(asset: composition, presetName: AVAssetExportPresetHighestQuality) else { guard let export = AVAssetExportSession(asset: composition, presetName: AVAssetExportPresetHighestQuality) else {
print("Cannot create export session.")
completion(nil) completion(nil)
return return
} }
@ -2240,13 +2238,11 @@ func renderVideo(context: AccountContext, backgroundImage: UIImage, media: Teleg
export.outputURL = exportURL export.outputURL = exportURL
export.exportAsynchronously { export.exportAsynchronously {
DispatchQueue.main.async { Queue.mainQueue().async {
switch export.status { switch export.status {
case .completed: case .completed:
completion(exportURL) completion(exportURL)
default: default:
print("Something went wrong during export.")
print(export.error ?? "unknown error")
completion(nil) completion(nil)
break break
} }

View File

@ -330,7 +330,7 @@ final class ReplyAccessoryPanelNode: AccessoryPanelNode {
} }
if let dustNode = self.dustNode { if let dustNode = self.dustNode {
dustNode.update(size: textFrame.size, color: self.theme.chat.inputPanel.primaryTextColor, textColor: self.theme.chat.inputPanel.primaryTextColor, rects: textLayout.spoilers.map { $0.1.offsetBy(dx: 3.0, dy: 3.0).insetBy(dx: 1.0, dy: 1.0) }, wordRects: textLayout.spoilerWords.map { $0.1.offsetBy(dx: 3.0, dy: 3.0).insetBy(dx: 1.0, dy: 1.0) }) dustNode.update(size: textFrame.size, color: self.theme.chat.inputPanel.secondaryTextColor, textColor: self.theme.chat.inputPanel.primaryTextColor, rects: textLayout.spoilers.map { $0.1.offsetBy(dx: 3.0, dy: 3.0).insetBy(dx: 1.0, dy: 1.0) }, wordRects: textLayout.spoilerWords.map { $0.1.offsetBy(dx: 3.0, dy: 3.0).insetBy(dx: 1.0, dy: 1.0) })
dustNode.frame = textFrame.insetBy(dx: -3.0, dy: -3.0).offsetBy(dx: 0.0, dy: 3.0) dustNode.frame = textFrame.insetBy(dx: -3.0, dy: -3.0).offsetBy(dx: 0.0, dy: 3.0)
} }
} else if let dustNode = self.dustNode { } else if let dustNode = self.dustNode {

View File

@ -49,5 +49,6 @@ NSInteger UITabBarItem_addSetBadgeListener(UITabBarItem * _Nonnull item, UITabBa
- (void)removeSetSelectedImageListener:(NSInteger)key; - (void)removeSetSelectedImageListener:(NSInteger)key;
@property (nonatomic, strong) NSString * _Nullable animationName; @property (nonatomic, strong) NSString * _Nullable animationName;
@property (nonatomic, assign) CGPoint animationOffset;
@end @end

View File

@ -17,6 +17,7 @@ static const void *setBackBarButtonItemListenerBagKey = &setBackBarButtonItemLis
static const void *setBadgeListenerBagKey = &setBadgeListenerBagKey; static const void *setBadgeListenerBagKey = &setBadgeListenerBagKey;
static const void *badgeKey = &badgeKey; static const void *badgeKey = &badgeKey;
static const void *animationNameKey = &animationNameKey; static const void *animationNameKey = &animationNameKey;
static const void *animationOffsetKey = &animationOffsetKey;
@implementation UINavigationItem (Proxy) @implementation UINavigationItem (Proxy)
@ -404,14 +405,18 @@ NSInteger UITabBarItem_addSetBadgeListener(UITabBarItem *item, UITabBarItemSetBa
- (void)setAnimationName:(NSString *)animationName { - (void)setAnimationName:(NSString *)animationName {
[self setAssociatedObject:animationName forKey:animationNameKey]; [self setAssociatedObject:animationName forKey:animationNameKey];
// [(NSBag *)[self associatedObjectForKey:setBadgeListenerBagKey] enumerateItems:^(UITabBarItemSetBadgeListener listener) {
// listener(badge);
// }];
} }
- (NSString *)animationName { - (NSString *)animationName {
return [self associatedObjectForKey:animationNameKey]; return [self associatedObjectForKey:animationNameKey];
} }
- (void)setAnimationOffset:(CGPoint)animationOffset {
[self setAssociatedObject:[NSValue valueWithCGPoint:animationOffset] forKey:animationOffsetKey];
}
- (CGPoint)animationOffset {
return ((NSValue *)[self associatedObjectForKey:animationOffsetKey]).CGPointValue;
}
@end @end

View File

@ -2164,6 +2164,7 @@ webrtc_sources = [
"modules/rtp_rtcp/source/rtp_descriptor_authentication.h", "modules/rtp_rtcp/source/rtp_descriptor_authentication.h",
"modules/rtp_rtcp/source/rtp_format.h", "modules/rtp_rtcp/source/rtp_format.h",
"modules/rtp_rtcp/source/rtp_format_h264.h", "modules/rtp_rtcp/source/rtp_format_h264.h",
"modules/rtp_rtcp/source/rtp_format_h265.h",
"modules/rtp_rtcp/source/rtp_format_video_generic.h", "modules/rtp_rtcp/source/rtp_format_video_generic.h",
"modules/rtp_rtcp/source/rtp_format_vp8.h", "modules/rtp_rtcp/source/rtp_format_vp8.h",
"modules/rtp_rtcp/source/rtp_format_vp9.h", "modules/rtp_rtcp/source/rtp_format_vp9.h",
@ -2859,10 +2860,17 @@ webrtc_sources = [
"api/sequence_checker.h", "api/sequence_checker.h",
"common_audio/third_party/ooura/fft_size_128/ooura_fft_tables_common.h", "common_audio/third_party/ooura/fft_size_128/ooura_fft_tables_common.h",
"common_audio/third_party/ooura/fft_size_128/ooura_fft_tables_neon_sse2.h", "common_audio/third_party/ooura/fft_size_128/ooura_fft_tables_neon_sse2.h",
"modules/rtp_rtcp/source/video_rtp_depacketizer_h265.h",
"modules/rtp_rtcp/source/packet_sequencer.h", "modules/rtp_rtcp/source/packet_sequencer.h",
"modules/rtp_rtcp/source/packet_sequencer.cc", "modules/rtp_rtcp/source/packet_sequencer.cc",
"modules/video_coding/svc/scalability_structure_full_svc.h", "modules/video_coding/svc/scalability_structure_full_svc.h",
"modules/video_coding/svc/scalability_structure_key_svc.h", "modules/video_coding/svc/scalability_structure_key_svc.h",
"modules/video_coding/codecs/h265/include/h265_globals.h",
"common_video/h265/h265_common.h",
"common_video/h265/h265_vps_parser.h",
"common_video/h265/h265_bitstream_parser.h",
"common_video/h265/h265_sps_parser.h",
"common_video/h265/h265_pps_parser.h",
"rtc_base/async_resolver.h", "rtc_base/async_resolver.h",
"rtc_base/async_resolver.cc", "rtc_base/async_resolver.cc",
"rtc_base/experiments/bandwidth_quality_scaler_settings.h", "rtc_base/experiments/bandwidth_quality_scaler_settings.h",
@ -2936,6 +2944,7 @@ webrtc_sources = [
"modules/audio_processing/agc2/adaptive_digital_gain_controller.cc", "modules/audio_processing/agc2/adaptive_digital_gain_controller.cc",
"modules/video_coding/utility/framerate_controller_deprecated.h", "modules/video_coding/utility/framerate_controller_deprecated.h",
"modules/video_coding/utility/framerate_controller_deprecated.cc", "modules/video_coding/utility/framerate_controller_deprecated.cc",
"modules/video_coding/h265_vps_sps_pps_tracker.h",
"video/adaptation/bandwidth_quality_scaler_resource.cc", "video/adaptation/bandwidth_quality_scaler_resource.cc",
"api/wrapping_async_dns_resolver.cc", "api/wrapping_async_dns_resolver.cc",
"modules/video_coding/utility/bandwidth_quality_scaler.cc", "modules/video_coding/utility/bandwidth_quality_scaler.cc",
@ -3046,6 +3055,9 @@ ios_sources = [
"objc/components/video_codec/RTCVideoDecoderH264.mm", "objc/components/video_codec/RTCVideoDecoderH264.mm",
"objc/components/video_codec/RTCVideoEncoderH264.h", "objc/components/video_codec/RTCVideoEncoderH264.h",
"objc/components/video_codec/RTCVideoEncoderH264.mm", "objc/components/video_codec/RTCVideoEncoderH264.mm",
"objc/components/video_codec/RTCH265ProfileLevelId.h",
"objc/components/video_codec/RTCCodecSpecificInfoH265.h",
"objc/components/video_codec/RTCCodecSpecificInfoH265+Private.h",
"objc/api/video_codec/RTCVideoCodecConstants.h", "objc/api/video_codec/RTCVideoCodecConstants.h",
"objc/api/video_codec/RTCVideoCodecConstants.mm", "objc/api/video_codec/RTCVideoCodecConstants.mm",
"objc/components/video_codec/helpers.cc", "objc/components/video_codec/helpers.cc",