|
|
|
|
@ -41,7 +41,8 @@ internal class PenguinView(
|
|
|
|
|
id: Int,
|
|
|
|
|
val creationParams: Map<String, Any>,
|
|
|
|
|
messenger: BinaryMessenger,
|
|
|
|
|
activity: MainActivity
|
|
|
|
|
activity: MainActivity,
|
|
|
|
|
val channel: MethodChannel
|
|
|
|
|
) : PlatformView, MethodChannel.MethodCallHandler, PenNavUIDelegate {
|
|
|
|
|
// The layout for displaying the Penguin UI
|
|
|
|
|
private val mapLayout: RelativeLayout = RelativeLayout(context)
|
|
|
|
|
@ -200,7 +201,7 @@ internal class PenguinView(
|
|
|
|
|
.setLanguageID(language)
|
|
|
|
|
.setSimulationModeEnabled(creationParams["isSimulationModeEnabled"] as Boolean)
|
|
|
|
|
.setEnableBackButton(true)
|
|
|
|
|
.setDeepLinkData("deeplink")
|
|
|
|
|
// .setDeepLinkData("deeplink")
|
|
|
|
|
.setCustomizeColor("#2CA0AF")
|
|
|
|
|
.setDeepLinkSchema("")
|
|
|
|
|
.build()
|
|
|
|
|
@ -238,7 +239,7 @@ internal class PenguinView(
|
|
|
|
|
// referenceId = refID
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
navigator.navigateTo(mContext, "",object : RefIdDelegate {
|
|
|
|
|
navigator.navigateTo(mContext, refID,object : RefIdDelegate {
|
|
|
|
|
override fun onRefByIDSuccess(PoiId: String?) {
|
|
|
|
|
Log.e("navigateTo", "PoiId is penguin view+++++++ $PoiId")
|
|
|
|
|
|
|
|
|
|
@ -273,19 +274,11 @@ internal class PenguinView(
|
|
|
|
|
* @param warningCode Optional warning code received from the SDK.
|
|
|
|
|
*/
|
|
|
|
|
override fun onPenNavSuccess(warningCode: String?) {
|
|
|
|
|
val clinicId = creationParams["clinic_id"] as String
|
|
|
|
|
|
|
|
|
|
navigateTo("123")
|
|
|
|
|
// if (_context is Activity) {
|
|
|
|
|
// _context.runOnUiThread {
|
|
|
|
|
// Toast.makeText(_context, "Success Info: $warningCode", Toast.LENGTH_SHORT).show()
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// println("the warming is presented $$warningCode")
|
|
|
|
|
//// val handler = Handler(Looper.getMainLooper())
|
|
|
|
|
//// handler.post {
|
|
|
|
|
//// Toast.makeText(_context, "Success Info: $warningCode", Toast.LENGTH_SHORT).show()
|
|
|
|
|
//// }
|
|
|
|
|
// }
|
|
|
|
|
if(clinicId.isEmpty()) return
|
|
|
|
|
|
|
|
|
|
navigateTo(clinicId)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -298,6 +291,12 @@ internal class PenguinView(
|
|
|
|
|
description: String?,
|
|
|
|
|
errorType: InitializationErrorType?
|
|
|
|
|
) {
|
|
|
|
|
val arguments: Map<String, Any?> = mapOf(
|
|
|
|
|
"description" to description,
|
|
|
|
|
"type" to errorType?.name
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
channel.invokeMethod(PenguinMethod.onPenNavInitializationError.name, arguments)
|
|
|
|
|
Toast.makeText(mContext, "Navigation Error: $description", Toast.LENGTH_SHORT).show()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|