|
|
|
@ -30,6 +30,8 @@ import com.peng.pennavmap.interfaces.PIEventsDelegate
|
|
|
|
import com.peng.pennavmap.interfaces.PILocationDelegate
|
|
|
|
import com.peng.pennavmap.interfaces.PILocationDelegate
|
|
|
|
import com.peng.pennavmap.interfaces.RefIdDelegate
|
|
|
|
import com.peng.pennavmap.interfaces.RefIdDelegate
|
|
|
|
import com.peng.pennavmap.models.PIReportIssue
|
|
|
|
import com.peng.pennavmap.models.PIReportIssue
|
|
|
|
|
|
|
|
import com.peng.pennavmap.models.LocationMessage
|
|
|
|
|
|
|
|
import penguin.com.pennav.renderer.PIRendererSettings
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Custom PlatformView for displaying Penguin UI components within a Flutter app.
|
|
|
|
* Custom PlatformView for displaying Penguin UI components within a Flutter app.
|
|
|
|
* Implements `PlatformView` for rendering the view, `MethodChannel.MethodCallHandler` for handling method calls,
|
|
|
|
* Implements `PlatformView` for rendering the view, `MethodChannel.MethodCallHandler` for handling method calls,
|
|
|
|
@ -43,7 +45,8 @@ internal class PenguinView(
|
|
|
|
messenger: BinaryMessenger,
|
|
|
|
messenger: BinaryMessenger,
|
|
|
|
activity: MainActivity,
|
|
|
|
activity: MainActivity,
|
|
|
|
val channel: MethodChannel
|
|
|
|
val channel: MethodChannel
|
|
|
|
) : PlatformView, MethodChannel.MethodCallHandler, PenNavUIDelegate {
|
|
|
|
) : PlatformView, MethodChannel.MethodCallHandler, PenNavUIDelegate, PIEventsDelegate,
|
|
|
|
|
|
|
|
PILocationDelegate {
|
|
|
|
// The layout for displaying the Penguin UI
|
|
|
|
// The layout for displaying the Penguin UI
|
|
|
|
private val mapLayout: RelativeLayout = RelativeLayout(context)
|
|
|
|
private val mapLayout: RelativeLayout = RelativeLayout(context)
|
|
|
|
private val _context: Context = context
|
|
|
|
private val _context: Context = context
|
|
|
|
@ -183,6 +186,7 @@ internal class PenguinView(
|
|
|
|
"TAG",
|
|
|
|
"TAG",
|
|
|
|
"initPenguin: ${Languages.getLanguageEnum(creationParams["languageCode"] as String)}"
|
|
|
|
"initPenguin: ${Languages.getLanguageEnum(creationParams["languageCode"] as String)}"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
PIRendererSettings.styleUri = "mapbox://styles/rwaid/cm3h30b36007v01qz7ik8a0sk"
|
|
|
|
PlugAndPlaySDK.configuration = PlugAndPlayConfiguration.Builder()
|
|
|
|
PlugAndPlaySDK.configuration = PlugAndPlayConfiguration.Builder()
|
|
|
|
.setBaseUrl(
|
|
|
|
.setBaseUrl(
|
|
|
|
creationParams["dataURL"] as String,
|
|
|
|
creationParams["dataURL"] as String,
|
|
|
|
@ -203,8 +207,12 @@ internal class PenguinView(
|
|
|
|
.setEnableBackButton(true)
|
|
|
|
.setEnableBackButton(true)
|
|
|
|
// .setDeepLinkData("deeplink")
|
|
|
|
// .setDeepLinkData("deeplink")
|
|
|
|
.setCustomizeColor("#2CA0AF")
|
|
|
|
.setCustomizeColor("#2CA0AF")
|
|
|
|
.setDeepLinkSchema("")
|
|
|
|
// .setDeepLinkSchema("")
|
|
|
|
.setIsEnableReportIssue(true)
|
|
|
|
.setDeepLinkData("")
|
|
|
|
|
|
|
|
.setIsEnableReportIssue(false)
|
|
|
|
|
|
|
|
.setEnableSharedLocationCallBack(false)
|
|
|
|
|
|
|
|
.setShowUILoader(true)
|
|
|
|
|
|
|
|
.setCampusId(creationParams["projectID"] as Int)
|
|
|
|
.build()
|
|
|
|
.build()
|
|
|
|
|
|
|
|
|
|
|
|
// Set location delegate to handle location updates
|
|
|
|
// Set location delegate to handle location updates
|
|
|
|
@ -229,6 +237,8 @@ internal class PenguinView(
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
// Start the Penguin SDK
|
|
|
|
// Start the Penguin SDK
|
|
|
|
|
|
|
|
PlugAndPlaySDK.setPiEventsDelegate(this)
|
|
|
|
|
|
|
|
PlugAndPlaySDK.setPiLocationDelegate(this)
|
|
|
|
PlugAndPlaySDK.start(mContext, this)
|
|
|
|
PlugAndPlaySDK.start(mContext, this)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -317,4 +327,20 @@ internal class PenguinView(
|
|
|
|
Log.e("PenguinView", "Receiver not registered: $e")
|
|
|
|
Log.e("PenguinView", "Receiver not registered: $e")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onReportIssue(issue: PIReportIssue?) {
|
|
|
|
|
|
|
|
TODO("Not yet implemented")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onSharedLocation(link: String?) {
|
|
|
|
|
|
|
|
TODO("Not yet implemented")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onLocationOffCampus(location: ArrayList<Double>?) {
|
|
|
|
|
|
|
|
TODO("Not yet implemented")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onLocationMessage(locationMessage: LocationMessage?) {
|
|
|
|
|
|
|
|
TODO("Not yet implemented")
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|