penguin updates

dev_v3.13.6_penguin_confirmation
sultan khan 1 year ago
parent 3e956e3920
commit 321e4a095b

@ -1,6 +1,6 @@
import Foundation
import FLAnimatedImage
import PenNavUI
var flutterMethodChannelPenguinIn:FlutterMethodChannel? = nil
fileprivate var mainViewController:MainFlutterVC!
@ -72,6 +72,7 @@ class HMGPenguinInPlatformBridge{
gifImageView.center = loadingOverlay.center
gifImageView.contentMode = .scaleAspectFit
loadingOverlay.addSubview(gifImageView)
PenNavUIManager.shared.setBackButtonVisibility(true)
if let window = UIApplication.shared.windows.first {
@ -88,6 +89,31 @@ class HMGPenguinInPlatformBridge{
}
}
penguinView.onBackPress = {
let areYouSure : String
let exit : String
let yes : String
let no : String
areYouSure = NSLocalizedString("are_you_sure", comment: "")
exit = NSLocalizedString("exit", comment: "")
yes = NSLocalizedString("yes", comment: "")
no = NSLocalizedString("no", comment: "")
// Implement custom behavior, such as displaying a confirmation dialog.
let alert = UIAlertController(
title: String(localized:"exit"),
message: String(localized:"are_you_sure"),
preferredStyle: .alert
)
alert.addAction(UIAlertAction(title: String(localized: "yes"), style: .default) { _ in
PenNavUIManager.shared.dismiss()
penguinUIView.removeFromSuperview()
})
alert.addAction(UIAlertAction(title: String(localized: "no"), style: .cancel, handler: nil))
mainViewController.present(alert, animated: true, completion: nil)
}
result(nil)
}

@ -43,6 +43,8 @@ class PenguinView: NSObject, FlutterPlatformView, PIEventsDelegate, PenNavInitia
private var methodChannel: FlutterMethodChannel
var onSuccess: (() -> Void)?
var onBackPress : (()->Void)?
@ -210,7 +212,9 @@ class PenguinView: NSObject, FlutterPlatformView, PIEventsDelegate, PenNavInitia
// MARK: - PIEventsDelegate Methods
func onBackButtonPressed() {
onBackPress?()
}

@ -0,0 +1,11 @@
/*
Localizable.strings
Runner
Created by User on 02/02/2025.
*/
"are_you_sure" = "Are you sure you want to close";
"exit" = "Exit";
"yes" = "Yes";
"no" = "No";
Loading…
Cancel
Save