mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
update sample app
This commit is contained in:
@@ -130,13 +130,11 @@ static const CGFloat kInnerPadding = 10.0f;
|
||||
|
||||
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
|
||||
{
|
||||
ASTraitCollection *traitCollection = [self asyncTraitCollection];
|
||||
|
||||
ASStackLayoutSpec *stackSpec = [[ASStackLayoutSpec alloc] init];
|
||||
stackSpec.spacing = kInnerPadding;
|
||||
[stackSpec setChildren:@[_imageNode, _textNode] withTraitCollection:traitCollection];
|
||||
[stackSpec setChildren:@[_imageNode, _textNode]];
|
||||
|
||||
if (traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular) {
|
||||
if (self.asyncTraitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular) {
|
||||
_imageNode.alignSelf = ASStackLayoutAlignSelfStart;
|
||||
stackSpec.direction = ASStackLayoutDirectionHorizontal;
|
||||
} else {
|
||||
@@ -144,7 +142,7 @@ static const CGFloat kInnerPadding = 10.0f;
|
||||
stackSpec.direction = ASStackLayoutDirectionVertical;
|
||||
}
|
||||
|
||||
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(kOuterPadding, kOuterPadding, kOuterPadding, kOuterPadding) child:stackSpec traitCollection:traitCollection];
|
||||
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(kOuterPadding, kOuterPadding, kOuterPadding, kOuterPadding) child:stackSpec];
|
||||
}
|
||||
|
||||
+ (void)defaultImageTappedAction:(ASViewController *)sourceViewController
|
||||
|
||||
@@ -63,9 +63,9 @@ static NSString *kLinkAttributeName = @"PlaceKittenNodeLinkAttributeName";
|
||||
_textNode.attributedString = string;
|
||||
|
||||
ASStackLayoutSpec *stackSpec = [ASStackLayoutSpec verticalStackLayoutSpec];
|
||||
[stackSpec setChildren:@[_textNode, _buttonNode] withTraitCollection:traitCollection];
|
||||
[stackSpec setChildren:@[_textNode, _buttonNode]];
|
||||
stackSpec.spacing = 10;
|
||||
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(40, 20, 20, 20) child:stackSpec traitCollection:traitCollection];
|
||||
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(40, 20, 20, 20) child:stackSpec];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user