mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 11:20:18 +00:00
Implemented UIAccessibilityIdentification for ASDisplayNode
This commit is contained in:
parent
1a7723d0c6
commit
a299a5b550
@ -533,6 +533,9 @@ typedef CALayer *(^ASDisplayNodeLayerBlock)();
|
|||||||
@property (atomic, assign) BOOL accessibilityViewIsModal;
|
@property (atomic, assign) BOOL accessibilityViewIsModal;
|
||||||
@property (atomic, assign) BOOL shouldGroupAccessibilityChildren;
|
@property (atomic, assign) BOOL shouldGroupAccessibilityChildren;
|
||||||
|
|
||||||
|
// Accessibility identification support
|
||||||
|
@property (nonatomic, copy) NSString *accessibilityIdentifier;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -75,6 +75,9 @@
|
|||||||
@property (atomic, assign) BOOL shouldGroupAccessibilityChildren;
|
@property (atomic, assign) BOOL shouldGroupAccessibilityChildren;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Accessibility identification support
|
||||||
|
@property (nonatomic, copy) NSString *accessibilityIdentifier;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface CALayer (ASDisplayNodeLayer)
|
@interface CALayer (ASDisplayNodeLayer)
|
||||||
|
|||||||
@ -642,6 +642,18 @@
|
|||||||
_setToViewOnly(shouldGroupAccessibilityChildren, shouldGroupAccessibilityChildren);
|
_setToViewOnly(shouldGroupAccessibilityChildren, shouldGroupAccessibilityChildren);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *)accessibilityIdentifier
|
||||||
|
{
|
||||||
|
_bridge_prologue;
|
||||||
|
return _getFromViewOnly(accessibilityIdentifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setAccessibilityIdentifier:(NSString *)accessibilityIdentifier
|
||||||
|
{
|
||||||
|
_bridge_prologue;
|
||||||
|
_setToViewOnly(accessibilityIdentifier, accessibilityIdentifier);
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,7 @@
|
|||||||
BOOL accessibilityElementsHidden;
|
BOOL accessibilityElementsHidden;
|
||||||
BOOL accessibilityViewIsModal;
|
BOOL accessibilityViewIsModal;
|
||||||
BOOL shouldGroupAccessibilityChildren;
|
BOOL shouldGroupAccessibilityChildren;
|
||||||
|
NSString *accessibilityIdentifier;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
// Properties
|
// Properties
|
||||||
@ -97,6 +98,7 @@
|
|||||||
int setAccessibilityElementsHidden:1;
|
int setAccessibilityElementsHidden:1;
|
||||||
int setAccessibilityViewIsModal:1;
|
int setAccessibilityViewIsModal:1;
|
||||||
int setShouldGroupAccessibilityChildren:1;
|
int setShouldGroupAccessibilityChildren:1;
|
||||||
|
int setAccessibilityIdentifier:1;
|
||||||
} _flags;
|
} _flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,6 +189,7 @@
|
|||||||
accessibilityElementsHidden = NO;
|
accessibilityElementsHidden = NO;
|
||||||
accessibilityViewIsModal = NO;
|
accessibilityViewIsModal = NO;
|
||||||
shouldGroupAccessibilityChildren = NO;
|
shouldGroupAccessibilityChildren = NO;
|
||||||
|
accessibilityIdentifier = nil;
|
||||||
edgeAntialiasingMask = (kCALayerLeftEdge | kCALayerRightEdge | kCALayerTopEdge | kCALayerBottomEdge);
|
edgeAntialiasingMask = (kCALayerLeftEdge | kCALayerRightEdge | kCALayerTopEdge | kCALayerBottomEdge);
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
@ -542,6 +545,19 @@
|
|||||||
_flags.setShouldGroupAccessibilityChildren = YES;
|
_flags.setShouldGroupAccessibilityChildren = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *)accessibilityIdentifier
|
||||||
|
{
|
||||||
|
return accessibilityIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setAccessibilityIdentifier:(NSString *)newAccessibilityIdentifier
|
||||||
|
{
|
||||||
|
_flags.setAccessibilityIdentifier = YES;
|
||||||
|
if (accessibilityIdentifier != newAccessibilityIdentifier) {
|
||||||
|
accessibilityIdentifier = [newAccessibilityIdentifier copy];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void)applyToLayer:(CALayer *)layer
|
- (void)applyToLayer:(CALayer *)layer
|
||||||
{
|
{
|
||||||
if (_flags.setAnchorPoint)
|
if (_flags.setAnchorPoint)
|
||||||
@ -775,6 +791,9 @@
|
|||||||
|
|
||||||
if (_flags.setShouldGroupAccessibilityChildren)
|
if (_flags.setShouldGroupAccessibilityChildren)
|
||||||
view.shouldGroupAccessibilityChildren = shouldGroupAccessibilityChildren;
|
view.shouldGroupAccessibilityChildren = shouldGroupAccessibilityChildren;
|
||||||
|
|
||||||
|
if (_flags.setAccessibilityIdentifier)
|
||||||
|
view.accessibilityIdentifier = accessibilityIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user