mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-08 08:31:13 +00:00
Story collage improvements
This commit is contained in:
parent
685ed2cc9e
commit
7dd7a6ba69
@ -13304,6 +13304,8 @@ Sorry for the inconvenience.";
|
|||||||
|
|
||||||
"Chat.VideoProcessingInfo" = "The video will be published once converted and optimized.";
|
"Chat.VideoProcessingInfo" = "The video will be published once converted and optimized.";
|
||||||
|
|
||||||
|
"Camera.CollageRetake" = "Retake";
|
||||||
|
"Camera.CollageDelete" = "Delete";
|
||||||
"Camera.CollageManagementTooltip" = "Tap a tile to delete or reorder it.";
|
"Camera.CollageManagementTooltip" = "Tap a tile to delete or reorder it.";
|
||||||
"Camera.CollageReorderingInfo" = "Hold and drag tiles to reorder them.";
|
"Camera.CollageReorderingInfo" = "Hold and drag tiles to reorder them.";
|
||||||
|
|
||||||
|
@ -504,6 +504,10 @@ final class CameraCollageView: UIView, UIGestureRecognizerDelegate {
|
|||||||
self.contextAction?(item.uniqueId, self.extractedContainerView, nil)
|
self.contextAction?(item.uniqueId, self.extractedContainerView, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func stopPlayback() {
|
||||||
|
self.videoPlayer?.pause()
|
||||||
|
}
|
||||||
|
|
||||||
func resetPlayback() {
|
func resetPlayback() {
|
||||||
self.videoPlayer?.seek(to: .zero)
|
self.videoPlayer?.seek(to: .zero)
|
||||||
self.videoPlayer?.play()
|
self.videoPlayer?.play()
|
||||||
@ -991,6 +995,12 @@ final class CameraCollageView: UIView, UIGestureRecognizerDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func stopPlayback() {
|
||||||
|
for (_, itemView) in self.itemViews {
|
||||||
|
itemView.stopPlayback()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func resetPlayback() {
|
func resetPlayback() {
|
||||||
for (_, itemView) in self.itemViews {
|
for (_, itemView) in self.itemViews {
|
||||||
itemView.resetPlayback()
|
itemView.resetPlayback()
|
||||||
@ -1054,7 +1064,7 @@ final class CameraCollageView: UIView, UIGestureRecognizerDelegate {
|
|||||||
|
|
||||||
var itemList: [ContextMenuItem] = []
|
var itemList: [ContextMenuItem] = []
|
||||||
if self.collage.cameraIndex == nil {
|
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)
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Camera"), color: theme.contextMenu.primaryColor)
|
||||||
}, action: { [weak self] _, f in
|
}, action: { [weak self] _, f in
|
||||||
f(.default)
|
f(.default)
|
||||||
@ -1066,7 +1076,7 @@ final class CameraCollageView: UIView, UIGestureRecognizerDelegate {
|
|||||||
if self.itemViews.count > 2 {
|
if self.itemViews.count > 2 {
|
||||||
itemList.append(.separator)
|
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)
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Delete"), color: theme.contextMenu.destructiveColor)
|
||||||
}, action: { [weak self] _, f in
|
}, action: { [weak self] _, f in
|
||||||
f(.dismissWithoutContent)
|
f(.dismissWithoutContent)
|
||||||
|
@ -2615,13 +2615,9 @@ public class CameraScreenImpl: ViewController, CameraScreen {
|
|||||||
view.animateOutToEditor(transition: transition)
|
view.animateOutToEditor(transition: transition)
|
||||||
}
|
}
|
||||||
|
|
||||||
Queue.mainQueue().after(2.0, {
|
Queue.mainQueue().after(1.5, {
|
||||||
if self.cameraState.isCollageEnabled {
|
if let collageView = self.collageView {
|
||||||
self.collage = nil
|
collageView.stopPlayback()
|
||||||
if let collageView = self.collageView {
|
|
||||||
collageView.removeFromSuperview()
|
|
||||||
self.collageView = nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -2679,6 +2675,10 @@ public class CameraScreenImpl: ViewController, CameraScreen {
|
|||||||
if !toGallery {
|
if !toGallery {
|
||||||
self.resumeCameraCapture(fromGallery: false)
|
self.resumeCameraCapture(fromGallery: false)
|
||||||
|
|
||||||
|
if let collageView = self.collageView {
|
||||||
|
collageView.resetPlayback()
|
||||||
|
}
|
||||||
|
|
||||||
self.cameraIsActive = true
|
self.cameraIsActive = true
|
||||||
self.requestUpdateLayout(transition: .immediate)
|
self.requestUpdateLayout(transition: .immediate)
|
||||||
|
|
||||||
|
@ -999,14 +999,22 @@ final class CaptureControlsComponent: Component {
|
|||||||
func animateInFromEditor(transition: ComponentTransition) {
|
func animateInFromEditor(transition: ComponentTransition) {
|
||||||
self.animatedOut = false
|
self.animatedOut = false
|
||||||
|
|
||||||
|
guard let component = self.component else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if let view = self.galleryButtonView.view {
|
if let view = self.galleryButtonView.view {
|
||||||
transition.setScale(view: view, scale: 1.0)
|
transition.setScale(view: view, scale: 1.0)
|
||||||
transition.setAlpha(view: view, alpha: 1.0)
|
if !component.hideControls {
|
||||||
|
transition.setAlpha(view: view, alpha: 1.0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let view = self.flipButtonView.view {
|
if let view = self.flipButtonView.view {
|
||||||
transition.setScale(view: view, scale: 1.0)
|
transition.setScale(view: view, scale: 1.0)
|
||||||
transition.setAlpha(view: view, alpha: 1.0)
|
if !component.hideControls {
|
||||||
|
transition.setAlpha(view: view, alpha: 1.0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let view = self.shutterButtonView.view {
|
if let view = self.shutterButtonView.view {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user