[Temp] custom emoji layouts

This commit is contained in:
Ali
2022-07-08 15:09:55 +02:00
parent 2377d3e08c
commit 1ac654e8b2
26 changed files with 1155 additions and 283 deletions

View File

@@ -117,6 +117,12 @@ private class GifVideoLayer: AVSampleBufferDisplayLayer {
public final class GifPagerContentComponent: Component {
public typealias EnvironmentType = (EntityKeyboardChildEnvironment, PagerComponentChildEnvironment)
public enum Subject: Equatable {
case recent
case trending
case emojiSearch(String)
}
public final class InputInteraction {
public let performItemAction: (Item, UIView, CGRect) -> Void
@@ -148,15 +154,18 @@ public final class GifPagerContentComponent: Component {
public let context: AccountContext
public let inputInteraction: InputInteraction
public let subject: Subject
public let items: [Item]
public init(
context: AccountContext,
inputInteraction: InputInteraction,
subject: Subject,
items: [Item]
) {
self.context = context
self.inputInteraction = inputInteraction
self.subject = subject
self.items = items
}
@@ -167,6 +176,9 @@ public final class GifPagerContentComponent: Component {
if lhs.inputInteraction !== rhs.inputInteraction {
return false
}
if lhs.subject != rhs.subject {
return false
}
if lhs.items != rhs.items {
return false
}
@@ -363,7 +375,10 @@ public final class GifPagerContentComponent: Component {
}
}
private let scrollView: UIScrollView
private final class ContentScrollView: UIScrollView, PagerExpandableScrollView {
}
private let scrollView: ContentScrollView
private var visibleItemLayers: [MediaId: ItemLayer] = [:]
private var ignoreScrolling: Bool = false
@@ -374,7 +389,7 @@ public final class GifPagerContentComponent: Component {
private var itemLayout: ItemLayout?
override init(frame: CGRect) {
self.scrollView = UIScrollView()
self.scrollView = ContentScrollView()
super.init(frame: frame)