PortalFragment

An Android Fragment class containing an instance of a Portal to load in a web view supported by Capacitor.

Example usage (kotlin):

val fragment: PortalFragment = PortalFragment(myPortal)

Example usage (java):

PortalFragment fragment = new PortalFragment(myPortal);

Constructors

Link copied to clipboard
Link copied to clipboard
fun PortalFragment(portal: Portal?)
Link copied to clipboard
fun PortalFragment(portal: Portal?, onBridgeAvailable: (bridge: Bridge) -> Unit?)

Functions

Link copied to clipboard
fun addPlugin(plugin: Class<out Plugin?>?)

Add a Capacitor Plugin to be loaded with the Portal.

Link copied to clipboard
fun addPluginInstance(plugin: Plugin)

Add a Capacitor Plugin instance to be loaded with the Portal.

Link copied to clipboard
fun addWebViewListener(webViewListener: WebViewListener)

Adds a Capacitor WebViewListener to the Portal to trigger a callback on web view events.

Link copied to clipboard
Link copied to clipboard
operator override fun equals(@Nullable other: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getBridge(): Bridge?

Get the Capacitor Bridge instance used in the Portal.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getId(): Int
Link copied to clipboard

Get the Initial Context that will be loaded in lieu of one set on the Portal object, if set.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getView(): View?
Link copied to clipboard
override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun linkMessageReceivers(messageReceiverParent: Any, pubSub: PortalsPubSub = PortalsPubSub.shared)

Link a class with methods decorated with the PortalMethod annotation to use as Portals message receivers.

Link copied to clipboard
Link copied to clipboard
open fun onActivityResult(p0: Int, p1: Int, @Nullable p2: Intent?)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun onConfigurationChanged(@NonNull newConfig: Configuration)

Extends the Android Fragment 'onConfigurationChanged' event.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View?

Extends the Android Fragment onCreateView lifecycle event.

Link copied to clipboard
open override fun onDestroy()

Extends the Android Fragment 'onDestroy' lifecycle event. At this point in the lifecycle the fragment will attempt to clean up the Bridge and unsubscribe any attached Portals message subscriptions.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun onLowMemory()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun onPause()

Extends the Android Fragment 'onPause' lifecycle event.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun onResume()

Extends the Android Fragment 'onResume' lifecycle event.

Link copied to clipboard
open override fun onSaveInstanceState(outState: Bundle)

Extends the Android Fragment 'onSaveInstanceState' event.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun onViewCreated(view: View, savedInstanceState: Bundle?)

Extends the Android Fragment onViewCreated lifecycle event. At this point in the lifecycle the fragment will attempt to load the Portal content. This is when the fragment will load any provided config or plugins.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun reload()

Reloads the Portal. If Live Updates is used and the web content was updated, the new content will be loaded.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setArguments(@Nullable p0: Bundle?)
Link copied to clipboard
fun setConfig(config: CapConfig?)

Set a Capacitor CapConfig to be used to configure the instance of Capacitor used in the Portal.

Link copied to clipboard
Link copied to clipboard
open fun setExitTransition(@Nullable p0: Any?)
Link copied to clipboard
Link copied to clipboard
fun setInitialContext(initialContext: Any)

Set an Initial Context that will be loaded in lieu of one set on the Portal object.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setTargetFragment(@Nullable p0: Fragment?, p1: Int)
Link copied to clipboard
Link copied to clipboard
open fun startActivity(@NonNull p0: Intent)
open fun startActivity(@NonNull p0: Intent, @Nullable p1: Bundle?)
Link copied to clipboard
Link copied to clipboard
open fun startIntentSenderForResult(@NonNull p0: IntentSender, p1: Int, @Nullable p2: Intent?, p3: Int, p4: Int, p5: Int, @Nullable p6: Bundle?)
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Properties

Link copied to clipboard
@get:NonNull
open override val lifecycle: Lifecycle
Link copied to clipboard
var liveUpdateFiles: File? = null
Link copied to clipboard
Link copied to clipboard
var onBridgeAvailable: (bridge: Bridge) -> Unit? = null
Link copied to clipboard
var portal: Portal? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@get:NonNull
open override val viewModelStore: ViewModelStore