|
|
|
|
@ -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)
|
|
|
|
|
}
|
|
|
|
|
|