[go: up one dir, main page]

Skip to content

Commit

Permalink
add new hud
Browse files Browse the repository at this point in the history
Signed-off-by: marinofaggiana <ios@nextcloud.com>
  • Loading branch information
marinofaggiana committed Jan 31, 2022
1 parent 11b4fc2 commit fac3a47
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
19 changes: 11 additions & 8 deletions iOSClient/Main/NCFunctionCenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ import JGProgressHUD
hud.indicatorView = JGProgressHUDRingIndicatorView()
(hud.indicatorView as! JGProgressHUDRingIndicatorView).ringWidth = 2
hud.show(in: (appDelegate.window?.rootViewController?.view)!)

hud.textLabel.text = NSLocalizedString("_saving_", comment: "")

NCLivePhoto.generate(from: fileNameImage, videoURL: fileNameMov, progress: { progress in

hud.progress = Float(progress)
Expand All @@ -375,14 +376,16 @@ import JGProgressHUD

if resources != nil {
NCLivePhoto.saveToLibrary(resources!) { result in
if !result {
hud.indicatorView = JGProgressHUDErrorIndicatorView()
hud.textLabel.text = NSLocalizedString("_livephoto_save_error_", comment: "")
} else {
hud.indicatorView = JGProgressHUDSuccessIndicatorView()
hud.textLabel.text = NSLocalizedString("_success_", comment: "")
DispatchQueue.main.async {
if !result {
hud.indicatorView = JGProgressHUDErrorIndicatorView()
hud.textLabel.text = NSLocalizedString("_livephoto_save_error_", comment: "")
} else {
hud.indicatorView = JGProgressHUDSuccessIndicatorView()
hud.textLabel.text = NSLocalizedString("_success_", comment: "")
}
hud.dismiss(afterDelay: 1)
}
hud.dismiss(afterDelay: 1)
}
} else {
hud.indicatorView = JGProgressHUDErrorIndicatorView()
Expand Down
1 change: 1 addition & 0 deletions iOSClient/Supporting Files/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,7 @@
"_copy_path_" = "Copy path";
"_certificates_" = "Certificates";
"_privacy_screen_" = "Splash screen when app inactive";
"_saving_" = "Saving …";
// Video
"_video_processing_" = "Video processing";
"_video_being_processed_" = "Video being processed …";
Expand Down

0 comments on commit fac3a47

Please sign in to comment.