Various improvements

This commit is contained in:
Ilya Laktyushin
2023-06-30 03:28:34 +02:00
parent 882680ed4d
commit b6e9138ea7
11 changed files with 515 additions and 36 deletions

View File

@@ -371,6 +371,8 @@ private final class CameraScreenComponent: CombinedComponent {
self.camera.setDualCamEnabled(isEnabled)
self.cameraState = self.cameraState.updatedIsDualCamEnabled(isEnabled)
self.updated(transition: .easeInOut(duration: 0.1))
self.hapticFeedback.impact(.light)
}
func updateSwipeHint(_ hint: CaptureControlsComponent.SwipeHint) {
@@ -1607,13 +1609,11 @@ public class CameraScreen: ViewController {
}
func presentDraftTooltip() {
guard let sourceView = self.componentHost.findTaggedView(tag: galleryButtonTag) else {
guard let sourceView = self.componentHost.findTaggedView(tag: galleryButtonTag), let absoluteLocation = sourceView.superview?.convert(sourceView.center, to: self.view) else {
return
}
let parentFrame = self.view.convert(self.bounds, to: nil)
let absoluteFrame = sourceView.convert(sourceView.bounds, to: nil).offsetBy(dx: -parentFrame.minX, dy: 0.0)
let location = CGRect(origin: CGPoint(x: absoluteFrame.midX, y: absoluteFrame.minY - 4.0), size: CGSize())
let location = CGRect(origin: CGPoint(x: absoluteLocation.x, y: absoluteLocation.y - 29.0), size: CGSize())
let controller = TooltipScreen(account: self.context.account, sharedContext: self.context.sharedContext, text: .plain(text: "Draft Saved"), location: .point(location, .bottom), displayDuration: .default, inset: 16.0, shouldDismissOnTouch: { _ in
return .ignore