Emoji fixes

This commit is contained in:
Ali 2022-07-24 18:18:59 +02:00
parent ea6929fef6
commit df6e87cc3d
15 changed files with 44 additions and 55 deletions

View File

@ -456,6 +456,10 @@ private final class AnimationCacheItemWriterImpl: AnimationCacheItemWriter {
}
func add(with drawingBlock: (AnimationCacheItemDrawingSurface) -> Double?, proposedWidth: Int, proposedHeight: Int) {
if proposedWidth == 0 || proposedHeight == 0 {
self.isFailed = true
return
}
if self.isFailed || self.isFinished {
return
}

View File

@ -207,60 +207,60 @@ private final class AccessoryItemIconButtonNode: HighlightTrackingButtonNode {
case .keyboard:
if let previousInputMode = previousInputMode {
if case .stickers = previousInputMode {
animationName = "anim_stickerToKey"
animationName = "input_anim_stickerToKey"
animationMode = .animating(loop: false)
} else if case .emoji = previousInputMode {
animationName = "anim_smileToKey"
animationName = "input_anim_smileToKey"
animationMode = .animating(loop: false)
} else if case .bot = previousInputMode {
animationName = "anim_botToKey"
animationName = "input_anim_botToKey"
animationMode = .animating(loop: false)
} else {
animationName = "anim_stickerToKey"
animationName = "input_anim_stickerToKey"
}
} else {
animationName = "anim_stickerToKey"
animationName = "input_anim_stickerToKey"
}
case .stickers:
if let previousInputMode = previousInputMode {
if case .keyboard = previousInputMode {
animationName = "anim_keyToSticker"
animationName = "input_anim_keyToSticker"
animationMode = .animating(loop: false)
} else if case .emoji = previousInputMode {
animationName = "anim_smileToSticker"
animationName = "input_anim_smileToSticker"
animationMode = .animating(loop: false)
colorKeys = emojiColorKeys
} else {
animationName = "anim_keyToSticker"
animationName = "input_anim_keyToSticker"
}
} else {
animationName = "anim_keyToSticker"
animationName = "input_anim_keyToSticker"
}
case .emoji:
if let previousInputMode = previousInputMode {
if case .keyboard = previousInputMode {
animationName = "anim_keyToSmile"
animationName = "input_anim_keyToSmile"
animationMode = .animating(loop: false)
} else if case .stickers = previousInputMode {
animationName = "anim_stickerToSmile"
animationName = "input_anim_stickerToSmile"
animationMode = .animating(loop: false)
colorKeys = emojiColorKeys
} else {
animationName = "anim_keyToSmile"
animationName = "input_anim_keyToSmile"
}
} else {
animationName = "anim_keyToSmile"
animationName = "input_anim_keyToSmile"
}
case .bot:
if let previousInputMode = previousInputMode {
if case .keyboard = previousInputMode {
animationName = "anim_keyToBot"
animationName = "input_anim_keyToBot"
animationMode = .animating(loop: false)
} else {
animationName = "anim_keyToBot"
animationName = "input_anim_keyToBot"
}
} else {
animationName = "anim_keyToBot"
animationName = "input_anim_keyToBot"
}
}
} else {

View File

@ -169,28 +169,8 @@ void applySmoothRoundedCornersImpl(CALayer * _Nonnull layer) {
}
}
/*@interface _UIPortalView : UIView
@property(nonatomic, getter=_isGeometryFrozen, setter=_setGeometryFrozen:) _Bool _geometryFrozen; // @synthesize _geometryFrozen=__geometryFrozen;
@property(nonatomic) _Bool forwardsClientHitTestingToSourceView; // @synthesize forwardsClientHitTestingToSourceView=_forwardsClientHitTestingToSourceView;
@property(copy, nonatomic) NSString * _Nullable name; // @synthesize name=_name;
@property(nonatomic) __weak UIView * _Nullable sourceView; // @synthesize sourceView=_sourceView;
- (void)setCenter:(struct CGPoint)arg1;
- (void)setBounds:(struct CGRect)arg1;
- (void)setFrame:(struct CGRect)arg1;
- (void)setHidden:(_Bool)arg1;
@property(nonatomic) _Bool allowsHitTesting; // @dynamic allowsHitTesting;
@property(nonatomic) _Bool allowsBackdropGroups; // @dynamic allowsBackdropGroups;
@property(nonatomic) _Bool matchesPosition; // @dynamic matchesPosition;
@property(nonatomic) _Bool matchesTransform; // @dynamic matchesTransform;
@property(nonatomic) _Bool matchesAlpha; // @dynamic matchesAlpha;
@property(nonatomic) _Bool hidesSourceView; // @dynamic hidesSourceView;
- (instancetype _Nonnull)initWithFrame:(struct CGRect)arg1;
- (instancetype _Nonnull)initWithSourceView:(UIView * _Nullable)arg1;
@end*/
UIView<UIKitPortalViewProtocol> * _Nullable makePortalView() {
if (@available(iOS 12.0, *)) {
static Class portalViewClass = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
@ -204,11 +184,16 @@ UIView<UIKitPortalViewProtocol> * _Nullable makePortalView() {
return nil;
}
if (@available(iOS 13.0, *)) {
view.forwardsClientHitTestingToSourceView = false;
}
view.matchesPosition = true;
view.matchesTransform = true;
view.matchesAlpha = false;
view.allowsHitTesting = false;
return view;
} else {
return nil;
}
}