mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-07 08:01:10 +00:00
Various fixes
This commit is contained in:
parent
50a789e9ed
commit
ab9d4748ec
@ -8677,7 +8677,7 @@ Sorry for the inconvenience.";
|
||||
"RequestPeer.Requirement.Channel.Rights.Send" = "post messages";
|
||||
"RequestPeer.Requirement.Channel.Rights.Delete" = "delete messages";
|
||||
"RequestPeer.Requirement.Channel.Rights.Edit" = "edit messages";
|
||||
"RequestPeer.Requirement.Channel.Rights.Invite" = "add subscribers";
|
||||
"RequestPeer.Requirement.Channel.Rights.Invite" = "invite users via link";
|
||||
"RequestPeer.Requirement.Channel.Rights.Pin" = "pin messages";
|
||||
"RequestPeer.Requirement.Channel.Rights.Topics" = "manage topics";
|
||||
"RequestPeer.Requirement.Channel.Rights.VideoChats" = "manage live streams";
|
||||
|
@ -67,6 +67,7 @@ public final class PagerComponentChildEnvironment: Equatable {
|
||||
}
|
||||
|
||||
public final class PagerComponentPanelEnvironment<TopPanelEnvironment>: Equatable {
|
||||
public let isContentInFocus: Bool
|
||||
public let contentOffset: CGFloat
|
||||
public let contentTopPanels: [AnyComponentWithIdentity<TopPanelEnvironment>]
|
||||
public let contentIcons: [PagerComponentContentIcon]
|
||||
@ -78,6 +79,7 @@ public final class PagerComponentPanelEnvironment<TopPanelEnvironment>: Equatabl
|
||||
public let isExpandedUpdated: (Bool, Transition) -> Void
|
||||
|
||||
init(
|
||||
isContentInFocus: Bool,
|
||||
contentOffset: CGFloat,
|
||||
contentTopPanels: [AnyComponentWithIdentity<TopPanelEnvironment>],
|
||||
contentIcons: [PagerComponentContentIcon],
|
||||
@ -88,6 +90,7 @@ public final class PagerComponentPanelEnvironment<TopPanelEnvironment>: Equatabl
|
||||
visibilityFractionUpdated: ActionSlot<(CGFloat, Transition)>,
|
||||
isExpandedUpdated: @escaping (Bool, Transition) -> Void
|
||||
) {
|
||||
self.isContentInFocus = isContentInFocus
|
||||
self.contentOffset = contentOffset
|
||||
self.contentTopPanels = contentTopPanels
|
||||
self.contentIcons = contentIcons
|
||||
@ -100,6 +103,9 @@ public final class PagerComponentPanelEnvironment<TopPanelEnvironment>: Equatabl
|
||||
}
|
||||
|
||||
public static func ==(lhs: PagerComponentPanelEnvironment, rhs: PagerComponentPanelEnvironment) -> Bool {
|
||||
if lhs.isContentInFocus != rhs.isContentInFocus {
|
||||
return false
|
||||
}
|
||||
if lhs.contentOffset != rhs.contentOffset {
|
||||
return false
|
||||
}
|
||||
@ -171,6 +177,7 @@ public final class PagerComponentContentIcon: Equatable {
|
||||
public final class PagerComponent<ChildEnvironmentType: Equatable, TopPanelEnvironment: Equatable>: Component {
|
||||
public typealias EnvironmentType = ChildEnvironmentType
|
||||
|
||||
public let isContentInFocus: Bool
|
||||
public let contentInsets: UIEdgeInsets
|
||||
public let contents: [AnyComponentWithIdentity<(ChildEnvironmentType, PagerComponentChildEnvironment)>]
|
||||
public let contentTopPanels: [AnyComponentWithIdentity<TopPanelEnvironment>]
|
||||
@ -191,6 +198,7 @@ public final class PagerComponent<ChildEnvironmentType: Equatable, TopPanelEnvir
|
||||
public let clipContentToTopPanel: Bool
|
||||
|
||||
public init(
|
||||
isContentInFocus: Bool,
|
||||
contentInsets: UIEdgeInsets,
|
||||
contents: [AnyComponentWithIdentity<(ChildEnvironmentType, PagerComponentChildEnvironment)>],
|
||||
contentTopPanels: [AnyComponentWithIdentity<TopPanelEnvironment>],
|
||||
@ -210,6 +218,7 @@ public final class PagerComponent<ChildEnvironmentType: Equatable, TopPanelEnvir
|
||||
panelHideBehavior: PagerComponentPanelHideBehavior,
|
||||
clipContentToTopPanel: Bool
|
||||
) {
|
||||
self.isContentInFocus = isContentInFocus
|
||||
self.contentInsets = contentInsets
|
||||
self.contents = contents
|
||||
self.contentTopPanels = contentTopPanels
|
||||
@ -231,6 +240,9 @@ public final class PagerComponent<ChildEnvironmentType: Equatable, TopPanelEnvir
|
||||
}
|
||||
|
||||
public static func ==(lhs: PagerComponent, rhs: PagerComponent) -> Bool {
|
||||
if lhs.isContentInFocus != rhs.isContentInFocus {
|
||||
return false
|
||||
}
|
||||
if lhs.contentInsets != rhs.contentInsets {
|
||||
return false
|
||||
}
|
||||
@ -504,6 +516,7 @@ public final class PagerComponent<ChildEnvironmentType: Equatable, TopPanelEnvir
|
||||
component: topPanel,
|
||||
environment: {
|
||||
PagerComponentPanelEnvironment(
|
||||
isContentInFocus: component.isContentInFocus,
|
||||
contentOffset: 0.0,
|
||||
contentTopPanels: component.contentTopPanels,
|
||||
contentIcons: [],
|
||||
@ -596,6 +609,7 @@ public final class PagerComponent<ChildEnvironmentType: Equatable, TopPanelEnvir
|
||||
component: bottomPanel,
|
||||
environment: {
|
||||
PagerComponentPanelEnvironment<TopPanelEnvironment>(
|
||||
isContentInFocus: component.isContentInFocus,
|
||||
contentOffset: 0.0,
|
||||
contentTopPanels: [],
|
||||
contentIcons: component.contentIcons,
|
||||
|
@ -190,7 +190,7 @@ public final class TextAlertContentNode: AlertContentNode {
|
||||
titleNode.attributedText = title
|
||||
titleNode.displaysAsynchronously = false
|
||||
titleNode.isUserInteractionEnabled = false
|
||||
titleNode.maximumNumberOfLines = 2
|
||||
titleNode.maximumNumberOfLines = 4
|
||||
titleNode.truncationType = .end
|
||||
titleNode.isAccessibilityElement = true
|
||||
self.titleNode = titleNode
|
||||
|
@ -706,6 +706,7 @@ public final class EntityKeyboardComponent: Component {
|
||||
let pagerSize = self.pagerView.update(
|
||||
transition: transition,
|
||||
component: AnyComponent(PagerComponent(
|
||||
isContentInFocus: component.isContentInFocus,
|
||||
contentInsets: component.containerInsets,
|
||||
contents: contents,
|
||||
contentTopPanels: contentTopPanels,
|
||||
|
@ -8,18 +8,24 @@ import TelegramCore
|
||||
import Postbox
|
||||
|
||||
public final class EntityKeyboardTopContainerPanelEnvironment: Equatable {
|
||||
let isContentInFocus: Bool
|
||||
let visibilityFractionUpdated: ActionSlot<(CGFloat, Transition)>
|
||||
let isExpandedUpdated: (Bool, Transition) -> Void
|
||||
|
||||
init(
|
||||
isContentInFocus: Bool,
|
||||
visibilityFractionUpdated: ActionSlot<(CGFloat, Transition)>,
|
||||
isExpandedUpdated: @escaping (Bool, Transition) -> Void
|
||||
) {
|
||||
self.isContentInFocus = isContentInFocus
|
||||
self.visibilityFractionUpdated = visibilityFractionUpdated
|
||||
self.isExpandedUpdated = isExpandedUpdated
|
||||
}
|
||||
|
||||
public static func ==(lhs: EntityKeyboardTopContainerPanelEnvironment, rhs: EntityKeyboardTopContainerPanelEnvironment) -> Bool {
|
||||
if lhs.isContentInFocus != rhs.isContentInFocus {
|
||||
return false
|
||||
}
|
||||
if lhs.visibilityFractionUpdated !== rhs.visibilityFractionUpdated {
|
||||
return false
|
||||
}
|
||||
@ -146,6 +152,7 @@ final class EntityKeyboardTopContainerPanelComponent: Component {
|
||||
component: panel.component,
|
||||
environment: {
|
||||
EntityKeyboardTopContainerPanelEnvironment(
|
||||
isContentInFocus: panelEnvironment.isContentInFocus,
|
||||
visibilityFractionUpdated: panelView.visibilityFractionUpdated,
|
||||
isExpandedUpdated: { [weak self] isExpanded, transition in
|
||||
guard let strongSelf = self else {
|
||||
|
@ -167,7 +167,7 @@ final class EntityKeyboardAnimationTopPanelComponent: Component {
|
||||
itemLayer.layerTintColor = component.theme.list.itemAccentColor.cgColor
|
||||
}
|
||||
|
||||
itemLayer.isVisibleForAnimations = true
|
||||
itemLayer.isVisibleForAnimations = itemEnvironment.isContentInFocus
|
||||
}
|
||||
|
||||
if itemEnvironment.isExpanded {
|
||||
@ -924,11 +924,13 @@ final class EntityKeyboardStaticStickersPanelComponent: Component {
|
||||
|
||||
public final class EntityKeyboardTopPanelItemEnvironment: Equatable {
|
||||
public let isExpanded: Bool
|
||||
public let isContentInFocus: Bool
|
||||
public let isHighlighted: Bool
|
||||
public let highlightedSubgroupId: AnyHashable?
|
||||
|
||||
public init(isExpanded: Bool, isHighlighted: Bool, highlightedSubgroupId: AnyHashable?) {
|
||||
public init(isExpanded: Bool, isContentInFocus: Bool, isHighlighted: Bool, highlightedSubgroupId: AnyHashable?) {
|
||||
self.isExpanded = isExpanded
|
||||
self.isContentInFocus = isContentInFocus
|
||||
self.isHighlighted = isHighlighted
|
||||
self.highlightedSubgroupId = highlightedSubgroupId
|
||||
}
|
||||
@ -937,6 +939,9 @@ public final class EntityKeyboardTopPanelItemEnvironment: Equatable {
|
||||
if lhs.isExpanded != rhs.isExpanded {
|
||||
return false
|
||||
}
|
||||
if lhs.isContentInFocus != rhs.isContentInFocus {
|
||||
return false
|
||||
}
|
||||
if lhs.isHighlighted != rhs.isHighlighted {
|
||||
return false
|
||||
}
|
||||
@ -1798,7 +1803,11 @@ public final class EntityKeyboardTopPanelComponent: Component {
|
||||
transition: itemTransition,
|
||||
component: item.content,
|
||||
environment: {
|
||||
EntityKeyboardTopPanelItemEnvironment(isExpanded: itemLayout.isExpanded, isHighlighted: self.activeContentItemId == item.id, highlightedSubgroupId: self.activeContentItemId == item.id ? self.activeSubcontentItemId : nil)
|
||||
EntityKeyboardTopPanelItemEnvironment(
|
||||
isExpanded: itemLayout.isExpanded,
|
||||
isContentInFocus: self.environment?.isContentInFocus ?? false,
|
||||
isHighlighted: self.activeContentItemId == item.id,
|
||||
highlightedSubgroupId: self.activeContentItemId == item.id ? self.activeSubcontentItemId : nil)
|
||||
},
|
||||
containerSize: itemOuterFrame.size
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user