mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 11:20:18 +00:00
replace missing layoutSpecThatFits method
This commit is contained in:
parent
17bd3acdee
commit
72eb924932
@ -77,6 +77,28 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
|
||||||
|
{
|
||||||
|
|
||||||
|
ASStackLayoutSpec *nameLocationStack = [ASStackLayoutSpec verticalStackLayoutSpec];
|
||||||
|
nameLocationStack.style.flexShrink = 1.0;
|
||||||
|
nameLocationStack.style.flexGrow = 1.0;
|
||||||
|
|
||||||
|
if (_postLocationNode.attributedText) {
|
||||||
|
nameLocationStack.children = @[_usernameNode, _postLocationNode];
|
||||||
|
} else {
|
||||||
|
nameLocationStack.children = @[_usernameNode];
|
||||||
|
}
|
||||||
|
|
||||||
|
ASStackLayoutSpec *headerStackSpec = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal
|
||||||
|
spacing:40
|
||||||
|
justifyContent:ASStackLayoutJustifyContentStart
|
||||||
|
alignItems:ASStackLayoutAlignItemsCenter
|
||||||
|
children:@[nameLocationStack, _postTimeNode]];
|
||||||
|
|
||||||
|
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(0, 10, 0, 10) child:headerStackSpec];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user