Story collage improvements

This commit is contained in:
Ilya Laktyushin
2024-11-30 04:06:13 +04:00
parent 685ed2cc9e
commit 7dd7a6ba69
4 changed files with 31 additions and 11 deletions

View File

@@ -504,6 +504,10 @@ final class CameraCollageView: UIView, UIGestureRecognizerDelegate {
self.contextAction?(item.uniqueId, self.extractedContainerView, nil)
}
func stopPlayback() {
self.videoPlayer?.pause()
}
func resetPlayback() {
self.videoPlayer?.seek(to: .zero)
self.videoPlayer?.play()
@@ -991,6 +995,12 @@ final class CameraCollageView: UIView, UIGestureRecognizerDelegate {
}
}
func stopPlayback() {
for (_, itemView) in self.itemViews {
itemView.stopPlayback()
}
}
func resetPlayback() {
for (_, itemView) in self.itemViews {
itemView.resetPlayback()
@@ -1054,7 +1064,7 @@ final class CameraCollageView: UIView, UIGestureRecognizerDelegate {
var itemList: [ContextMenuItem] = []
if self.collage.cameraIndex == nil {
itemList.append(.action(ContextMenuActionItem(text: "Retake", icon: { theme in
itemList.append(.action(ContextMenuActionItem(text: presentationData.strings.Camera_CollageRetake, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Camera"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] _, f in
f(.default)
@@ -1066,7 +1076,7 @@ final class CameraCollageView: UIView, UIGestureRecognizerDelegate {
if self.itemViews.count > 2 {
itemList.append(.separator)
itemList.append(.action(ContextMenuActionItem(text: "Delete", textColor: .destructive, icon: { theme in
itemList.append(.action(ContextMenuActionItem(text: presentationData.strings.Camera_CollageDelete, textColor: .destructive, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Delete"), color: theme.contextMenu.destructiveColor)
}, action: { [weak self] _, f in
f(.dismissWithoutContent)