Various improvements

This commit is contained in:
Ilya Laktyushin
2023-10-20 21:56:12 +04:00
parent 56db74612e
commit 2107f94bc3
31 changed files with 2512 additions and 202 deletions

View File

@@ -124,6 +124,7 @@ public final class EntityKeyboardComponent: Component {
public let clipContentToTopPanel: Bool
public let useExternalSearchContainer: Bool
public let hidePanels: Bool
public let customTintColor: UIColor?
public init(
theme: PresentationTheme,
@@ -157,7 +158,8 @@ public final class EntityKeyboardComponent: Component {
isExpanded: Bool,
clipContentToTopPanel: Bool,
useExternalSearchContainer: Bool,
hidePanels: Bool = false
hidePanels: Bool = false,
customTintColor: UIColor? = nil
) {
self.theme = theme
self.strings = strings
@@ -191,6 +193,7 @@ public final class EntityKeyboardComponent: Component {
self.clipContentToTopPanel = clipContentToTopPanel
self.useExternalSearchContainer = useExternalSearchContainer
self.hidePanels = hidePanels
self.customTintColor = customTintColor
}
public static func ==(lhs: EntityKeyboardComponent, rhs: EntityKeyboardComponent) -> Bool {
@@ -257,7 +260,9 @@ public final class EntityKeyboardComponent: Component {
if lhs.useExternalSearchContainer != rhs.useExternalSearchContainer {
return false
}
if lhs.customTintColor != rhs.customTintColor {
return false
}
return true
}
@@ -341,6 +346,7 @@ public final class EntityKeyboardComponent: Component {
icon: icon,
theme: component.theme,
useAccentColor: false,
customTintColor: component.customTintColor,
title: title,
pressed: { [weak self] in
self?.scrollToItemGroup(contentId: "masks", groupId: itemGroup.supergroupId, subgroupId: nil)
@@ -376,6 +382,7 @@ public final class EntityKeyboardComponent: Component {
contentTopPanels.append(AnyComponentWithIdentity(id: "masks", component: AnyComponent(EntityKeyboardTopPanelComponent(
id: "masks",
theme: component.theme,
customTintColor: component.customTintColor,
items: topMaskItems,
containerSideInset: component.containerInsets.left + component.topPanelInsets.left,
defaultActiveItemId: maskContent.panelItemGroups.first?.groupId,
@@ -430,6 +437,7 @@ public final class EntityKeyboardComponent: Component {
icon: .featured,
theme: component.theme,
useAccentColor: false,
customTintColor: component.customTintColor,
title: component.strings.Stickers_Trending,
pressed: { [weak self] in
self?.component?.stickerContent?.inputInteractionHolder.inputInteraction?.openFeatured?()
@@ -475,6 +483,7 @@ public final class EntityKeyboardComponent: Component {
icon: icon,
theme: component.theme,
useAccentColor: false,
customTintColor: component.customTintColor,
title: title,
pressed: { [weak self] in
self?.scrollToItemGroup(contentId: "stickers", groupId: itemGroup.supergroupId, subgroupId: nil)
@@ -511,6 +520,7 @@ public final class EntityKeyboardComponent: Component {
contentTopPanels.append(AnyComponentWithIdentity(id: "stickers", component: AnyComponent(EntityKeyboardTopPanelComponent(
id: "stickers",
theme: component.theme,
customTintColor: component.customTintColor,
items: topStickerItems,
containerSideInset: component.containerInsets.left + component.topPanelInsets.left,
defaultActiveItemId: stickerContent.panelItemGroups.first?.groupId,
@@ -573,6 +583,7 @@ public final class EntityKeyboardComponent: Component {
icon: icon,
theme: component.theme,
useAccentColor: false,
customTintColor: component.customTintColor,
title: title,
pressed: { [weak self] in
self?.scrollToItemGroup(contentId: "emoji", groupId: itemGroup.supergroupId, subgroupId: nil)
@@ -623,6 +634,7 @@ public final class EntityKeyboardComponent: Component {
contentTopPanels.append(AnyComponentWithIdentity(id: "emoji", component: AnyComponent(EntityKeyboardTopPanelComponent(
id: "emoji",
theme: component.theme,
customTintColor: component.customTintColor,
items: topEmojiItems,
containerSideInset: component.containerInsets.left + component.topPanelInsets.left,
activeContentItemIdUpdated: emojiContentItemIdUpdated,