mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Various fixes
This commit is contained in:
parent
7845bf7b10
commit
3103f3ef5d
@ -675,7 +675,7 @@ public class ItemListInviteRequestItemNode: ListViewItemNode, ItemListItemNode {
|
||||
strongSelf.avatarNode.frame = avatarFrame
|
||||
|
||||
if let importer = item.importer, let peer = importer.peer.peer.flatMap({ EnginePeer($0) }) {
|
||||
strongSelf.avatarNode.setPeer(context: item.context, theme: item.presentationData.theme, peer: peer, overrideImage: nil, emptyColor: item.presentationData.theme.list.mediaPlaceholderColor, synchronousLoad: false)
|
||||
strongSelf.avatarNode.setPeer(context: item.context, theme: item.presentationData.theme, peer: peer, overrideImage: nil, emptyColor: item.presentationData.theme.list.mediaPlaceholderColor, synchronousLoad: false, storeUnrounded: true)
|
||||
}
|
||||
|
||||
transition.updateFrame(node: strongSelf.titleNode, frame: CGRect(origin: CGPoint(x: leftInset, y: verticalInset), size: titleLayout.size))
|
||||
|
@ -699,7 +699,11 @@ open class ItemListControllerNode: ASDisplayNode {
|
||||
if let validLayout = self.validLayout {
|
||||
updatedNode.updateLayout(layout: validLayout.0, navigationBarHeight: validLayout.1, transition: .immediate)
|
||||
}
|
||||
self.insertSubnode(updatedNode, aboveSubnode: self.listNode)
|
||||
if self.rightOverlayNode.supernode != nil {
|
||||
self.insertSubnode(updatedNode, aboveSubnode: self.rightOverlayNode)
|
||||
} else {
|
||||
self.insertSubnode(updatedNode, aboveSubnode: self.listNode)
|
||||
}
|
||||
updatedNode.activate()
|
||||
}
|
||||
} else {
|
||||
|
@ -32,7 +32,7 @@ final class ChannelMembersSearchItem: ItemListControllerSearch {
|
||||
self.pushController = pushController
|
||||
self.dismissInput = dismissInput
|
||||
self.searchMode = searchMode
|
||||
activityDisposable.set((activity.get() |> mapToSignal { value -> Signal<Bool, NoError> in
|
||||
self.activityDisposable.set((activity.get() |> mapToSignal { value -> Signal<Bool, NoError> in
|
||||
if value {
|
||||
return .single(value) |> delay(0.2, queue: Queue.mainQueue())
|
||||
} else {
|
||||
|
@ -1717,6 +1717,8 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
||||
|
||||
var navigationTransition: PeerInfoHeaderNavigationTransition?
|
||||
|
||||
var updateHeaderAlpha: ((CGFloat, ContainedViewLayoutTransition) -> Void)?
|
||||
|
||||
init(context: AccountContext, avatarInitiallyExpanded: Bool, isOpenedFromChat: Bool, isSettings: Bool) {
|
||||
self.context = context
|
||||
self.isAvatarExpanded = avatarInitiallyExpanded
|
||||
@ -2086,7 +2088,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
if self.isSettings {
|
||||
titleString = NSAttributedString(string: title, font: Font.regular(30.0), textColor: presentationData.theme.list.itemPrimaryTextColor)
|
||||
titleString = NSAttributedString(string: title, font: Font.semibold(26.0), textColor: presentationData.theme.list.itemPrimaryTextColor)
|
||||
smallTitleString = NSAttributedString(string: title, font: Font.semibold(28.0), textColor: .white)
|
||||
} else {
|
||||
titleString = NSAttributedString(string: title, font: Font.semibold(24.0), textColor: presentationData.theme.list.itemPrimaryTextColor)
|
||||
@ -2262,6 +2264,12 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
||||
if self.isSettings {
|
||||
subtitleAlpha = 1.0 - titleCollapseFraction
|
||||
panelSubtitleAlpha = 0.0
|
||||
|
||||
var headerBackgroundAlpha: CGFloat = 0.0
|
||||
if titleCollapseFraction >= 0.8 {
|
||||
headerBackgroundAlpha = (titleCollapseFraction - 0.8) / 0.2
|
||||
}
|
||||
self.updateHeaderAlpha?(headerBackgroundAlpha, transition)
|
||||
} else {
|
||||
if (panelSubtitleString ?? subtitleString).string != subtitleString.string {
|
||||
subtitleAlpha = 1.0 - effectiveAreaExpansionFraction
|
||||
|
@ -111,6 +111,8 @@ 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
|
||||
@ -172,7 +174,8 @@ private final class PeerInfoScreenItemSectionContainerNode: ASDisplayNode {
|
||||
itemTransition.updateFrame(node: itemNode, frame: itemFrame)
|
||||
if wasAdded {
|
||||
itemNode.alpha = 0.0
|
||||
transition.updateAlpha(node: itemNode, alpha: 1.0)
|
||||
let alphaTransition: ContainedViewLayoutTransition = transition.isAnimated ? .animated(duration: 0.35, curve: .linear) : .immediate
|
||||
alphaTransition.updateAlpha(node: itemNode, alpha: 1.0)
|
||||
}
|
||||
|
||||
if item is PeerInfoScreenCommentItem {
|
||||
@ -214,6 +217,12 @@ 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
|
||||
}
|
||||
}
|
||||
@ -1639,6 +1648,10 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
||||
|
||||
self.paneContainerNode.parentController = controller
|
||||
|
||||
self.headerNode.updateHeaderAlpha = { [weak self] alpha, transition in
|
||||
self?.updateHeaderBackgroundAlpha(alpha, transition: transition)
|
||||
}
|
||||
|
||||
self._interaction = PeerInfoInteraction(
|
||||
openUsername: { [weak self] value in
|
||||
self?.openUsername(value: value)
|
||||
@ -2989,7 +3002,6 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
||||
|
||||
transition.updateAlpha(node: self.headerNode.backgroundNode, alpha: alpha, delay: 0.15)
|
||||
transition.updateAlpha(node: self.headerNode.expandedBackgroundNode, alpha: alpha, delay: 0.15)
|
||||
transition.updateAlpha(node: self.headerNode.navigationBackgroundNode, alpha: alpha, delay: 0.15)
|
||||
transition.updateAlpha(node: self.headerNode.separatorNode, alpha: alpha, delay: 0.15)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user