Merge commit '00b69bbe7ed3911da901dcddabd83d1ff4316b03' into experimental-3

# Conflicts:
#	submodules/TelegramCore/Sources/TelegramEngine/Messages/Translate.swift
#	submodules/TelegramUI/Components/AvatarEditorScreen/Sources/AvatarEditorScreen.swift
This commit is contained in:
Ali
2023-01-19 17:51:45 +04:00
72 changed files with 2150 additions and 595 deletions

View File

@@ -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,

View File

@@ -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 {

View File

@@ -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
)