mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-04 20:00:53 +00:00
Various fixes
This commit is contained in:
parent
3103f3ef5d
commit
ff158e66fd
@ -35,6 +35,7 @@ final class PeerInfoScreenInfoItem: PeerInfoScreenItem {
|
||||
|
||||
private final class PeerInfoScreenInfoItemNode: PeerInfoScreenItemNode {
|
||||
private let bottomSeparatorNode: ASDisplayNode
|
||||
private let maskNode: ASImageNode
|
||||
|
||||
private var item: PeerInfoScreenInfoItem?
|
||||
private var itemNode: InfoItemNode?
|
||||
@ -43,6 +44,9 @@ private final class PeerInfoScreenInfoItemNode: PeerInfoScreenItemNode {
|
||||
self.bottomSeparatorNode = ASDisplayNode()
|
||||
self.bottomSeparatorNode.isLayerBacked = true
|
||||
|
||||
self.maskNode = ASImageNode()
|
||||
self.maskNode.isUserInteractionEnabled = false
|
||||
|
||||
super.init()
|
||||
|
||||
self.addSubnode(self.bottomSeparatorNode)
|
||||
@ -99,6 +103,18 @@ private final class PeerInfoScreenInfoItemNode: PeerInfoScreenItemNode {
|
||||
separatorInset += 49.0
|
||||
}
|
||||
|
||||
let hasCorners = safeInsets.left > 0.0 && (topItem == nil || bottomItem == nil)
|
||||
let hasTopCorners = hasCorners && topItem == nil
|
||||
let hasBottomCorners = hasCorners && bottomItem == nil
|
||||
|
||||
self.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil
|
||||
self.maskNode.frame = CGRect(origin: CGPoint(x: safeInsets.left, y: 0.0), size: CGSize(width: width - safeInsets.left - safeInsets.right, height: height))
|
||||
self.bottomSeparatorNode.isHidden = hasBottomCorners
|
||||
|
||||
if self.maskNode.supernode == nil {
|
||||
self.addSubnode(self.maskNode)
|
||||
}
|
||||
|
||||
transition.updateFrame(node: self.bottomSeparatorNode, frame: CGRect(origin: CGPoint(x: separatorInset, y: height - UIScreenPixel), size: CGSize(width: width - sideInset, height: UIScreenPixel)))
|
||||
transition.updateAlpha(node: self.bottomSeparatorNode, alpha: bottomItem == nil ? 0.0 : 1.0)
|
||||
|
||||
|
@ -2266,7 +2266,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
||||
panelSubtitleAlpha = 0.0
|
||||
|
||||
var headerBackgroundAlpha: CGFloat = 0.0
|
||||
if titleCollapseFraction >= 0.8 {
|
||||
if !state.isEditing && titleCollapseFraction >= 0.8 {
|
||||
headerBackgroundAlpha = (titleCollapseFraction - 0.8) / 0.2
|
||||
}
|
||||
self.updateHeaderAlpha?(headerBackgroundAlpha, transition)
|
||||
|
@ -111,8 +111,6 @@ private final class PeerInfoScreenItemSectionContainerNode: ASDisplayNode {
|
||||
}
|
||||
|
||||
func update(width: CGFloat, safeInsets: UIEdgeInsets, presentationData: PresentationData, items: [PeerInfoScreenItem], transition: ContainedViewLayoutTransition) -> CGFloat {
|
||||
let previousItems = self.currentItems
|
||||
|
||||
self.backgroundNode.backgroundColor = presentationData.theme.list.itemBlocksBackgroundColor
|
||||
self.topSeparatorNode.backgroundColor = presentationData.theme.list.itemBlocksSeparatorColor
|
||||
self.bottomSeparatorNode.backgroundColor = presentationData.theme.list.itemBlocksSeparatorColor
|
||||
@ -217,12 +215,6 @@ private final class PeerInfoScreenItemSectionContainerNode: ASDisplayNode {
|
||||
transition.updateAlpha(node: self.bottomSeparatorNode, alpha: 1.0)
|
||||
}
|
||||
|
||||
if previousItems.isEmpty && items.count == 1 && transition.isAnimated {
|
||||
self.alpha = 0.0
|
||||
let alphaTransition: ContainedViewLayoutTransition = .animated(duration: 0.35, curve: .linear)
|
||||
alphaTransition.updateAlpha(node: self, alpha: 1.0)
|
||||
}
|
||||
|
||||
return contentHeight
|
||||
}
|
||||
}
|
||||
@ -6395,6 +6387,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
||||
for (sectionId, sectionItems) in items {
|
||||
validRegularSections.append(sectionId)
|
||||
|
||||
var wasAdded = false
|
||||
let sectionNode: PeerInfoScreenItemSectionContainerNode
|
||||
if let current = self.regularSections[sectionId] {
|
||||
sectionNode = current
|
||||
@ -6402,6 +6395,12 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
||||
sectionNode = PeerInfoScreenItemSectionContainerNode()
|
||||
self.regularSections[sectionId] = sectionNode
|
||||
self.scrollNode.addSubnode(sectionNode)
|
||||
wasAdded = true
|
||||
}
|
||||
|
||||
if wasAdded && transition.isAnimated && self.isSettings && !self.state.isEditing {
|
||||
sectionNode.alpha = 0.0
|
||||
transition.updateAlpha(node: sectionNode, alpha: 1.0)
|
||||
}
|
||||
|
||||
let sectionHeight = sectionNode.update(width: layout.size.width, safeInsets: insets, presentationData: self.presentationData, items: sectionItems, transition: transition)
|
||||
|
Loading…
x
Reference in New Issue
Block a user