com.bear.common.sdk.ui.activities.main / ArActivity

ArActivity

abstract class ArActivity : AppCompatActivity, IArActivity

This activity provides augmented reality view. Implements IArActivity.

Constructors

<init>

ArActivity()

This activity provides augmented reality view. Implements IArActivity.

Properties

bearHandler

val bearHandler: IBearHandler

The IBearHandler.

scanLineColor

open val scanLineColor: Int

The scan line color. White if not set.

scanTimeout

open val scanTimeout: Int

The scan timeout duration in seconds. Disabled if not set or set to 0.

Functions

onCreate

open fun onCreate(savedInstanceState: Bundle?): Unit

Called when the activity is starting. Initialize augmented reality view.

onDestroy

open fun onDestroy(): Unit

Perform any final cleanup before activity is destroyed.

onPause

open fun onPause(): Unit

This callback will stop scan if running.

onRequestPermissionsResult

open fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray): Unit

onStart

open fun onStart(): Unit

This callback will trigger ArActivity.resumeArView.

onStop

open fun onStop(): Unit

This callback will trigger ArActivity.pauseArView.

onWindowFocusChanged

open fun onWindowFocusChanged(hasFocus: Boolean): Unit

openPlayer

fun openPlayer(assetId: Int, timeStamp: Long): Unit

Called when video or audio asset is clicked. Opens video or audio player depending on asset type.

pauseArView

fun pauseArView(): Unit

Pause augmented reality view. This method can be called from a fragment. Warning: screen will become black because it will deinit camera.

resumeArView

fun resumeArView(): Unit

Resume augmented reality view. This method can be called from a fragment.

showArSceneWithoutTracking

fun showArSceneWithoutTracking(markerId: Int): Unit

Display marker without tracking. This method can be called from a fragment.

Inherited Functions

inflateContentView

abstract fun inflateContentView(): Unit

This method will be called on BearCallback.onArViewInitialized. Make sure to inflate your view and add it by calling androidx.appcompat.app.AppCompatActivity.addContentView.

openWebView

abstract fun openWebView(url: String): Unit

Called when webview asset is clicked.

showAlert

abstract fun showAlert(message: String): Unit
abstract fun showAlert(messageId: Int): Unit

Method for showing alert messages from SDK.