RoomioScanView
class RoomioScanView@JvmOverloadsconstructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : FrameLayout
The scanning screen for a RoomioScanSession.
Shows the camera and the scan as it builds, with the buttons to finish and to exit it: "Complete scan", which calls RoomioScanSession.stop, and a close button that asks the user to confirm, then calls RoomioScanSession.cancel. While there is a scan to lose, back does the same as the close button; otherwise back goes to your app. Watch RoomioScanSession.state for RoomioScanState.Finished and RoomioScanState.Cancelled.
The view includes its own scanning guidance, which cannot be turned off: "Slow down" and "Tracking Lost" in the centre, and full storage, low memory, low battery, a hot phone, Battery Saver and tips such as moving slowly or finding more light in a bar at the top. All of it is also reported through RoomioScanEvent.GuidanceChanged. Before the scan it shows the onboarding unless RoomioScanConfig.showsOnboarding is off; hide your own controls while RoomioScanSession.isShowingOnboarding is true. On low storage or battery, it asks before the scan whether to continue; with camera access refused, Battery Saver on, full storage or a nearly flat battery, it says the scan can't start. Every sheet's way out cancels the session. When a scan under way fails, it says so in a dialog over the scan; RoomioScanSession.state is already RoomioScanState.Failed. It also tells the user when saving or packaging the scan fails, when the device can't run AR, and when AR services need installing. Hide your own controls while RoomioScanSession.isShowingDialog is true.
Set style to use your own colours.
A plain FrameLayout, so it can be used from XML layouts or from Compose with AndroidView.
Constructors
| RoomioScanView | @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) |
Properties
| Name | Summary |
|---|---|
| style | var style: RoomioScanStyle The colours of the view's buttons, exit confirmation and onboarding. Set it before bind. |
Functions
| Name | Summary |
|---|---|
| bind | fun bind(session: RoomioScanSession) Show a session in this view. Use one view per session. |
| unbind | fun unbind(session: RoomioScanSession) Stop showing a session and release the camera surface. |
RoomioScanView
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0)
bind
fun bind(session: RoomioScanSession)
Show a session in this view. Use one view per session.
style
var style: RoomioScanStyle
The colours of the view's buttons, exit confirmation and onboarding. Set it before bind.
unbind
fun unbind(session: RoomioScanSession)
Stop showing a session and release the camera surface.