GIFs in media editor

Image search in media editor
This commit is contained in:
Ilya Laktyushin
2023-08-07 08:38:02 +02:00
parent 9ddb8fa2d6
commit b71304a3d2
24 changed files with 1231 additions and 686 deletions

View File

@@ -18,7 +18,6 @@ import PagerComponent
import SoftwareVideo
import AVFoundation
import PhotoResources
//import ContextUI
import ShimmerEffect
private class GifVideoLayer: AVSampleBufferDisplayLayer {
@@ -269,6 +268,7 @@ public final class GifPagerContentComponent: Component {
return true
}
public final class View: ContextControllerSourceView, PagerContentViewWithBackground, UIScrollViewDelegate {
private struct ItemGroupDescription: Equatable {
let hasTitle: Bool
@@ -994,7 +994,13 @@ public final class GifPagerContentComponent: Component {
vibrancyEffectView.contentView.addSubview(self.mirrorSearchHeaderContainer)
}
}
self.backgroundView.updateColor(color: theme.chat.inputMediaPanel.backgroundColor, enableBlur: true, forceKeepBlur: false, transition: transition.containedViewLayoutTransition)
let hideBackground = self.component?.hideBackground ?? false
var backgroundColor = theme.chat.inputMediaPanel.backgroundColor
if hideBackground {
backgroundColor = backgroundColor.withAlphaComponent(0.01)
}
self.backgroundView.updateColor(color: backgroundColor, enableBlur: true, forceKeepBlur: false, transition: transition.containedViewLayoutTransition)
transition.setFrame(view: self.backgroundView, frame: backgroundFrame)
self.backgroundView.update(size: backgroundFrame.size, transition: transition.containedViewLayoutTransition)
@@ -1115,8 +1121,6 @@ public final class GifPagerContentComponent: Component {
transition.setPosition(view: self.scrollClippingView, position: clippingFrame.center)
transition.setBounds(view: self.scrollClippingView, bounds: clippingFrame)
self.backgroundView.isHidden = component.hideBackground
return availableSize
}
}