android-components / mozilla.components.feature.qr / QrFragment


class QrFragment : Fragment (source)

A Fragment that displays a QR scanner.

This class is based on Camera2BasicFragment from:


Name Summary
OnScanCompleteListener interface OnScanCompleteListener : Serializable
Listener invoked when the QR scan completed successfully.


Name Summary
<init> QrFragment()
A Fragment that displays a QR scanner.


Name Summary
onCreateView fun onCreateView(inflater: <ERROR CLASS>, container: <ERROR CLASS>?, savedInstanceState: <ERROR CLASS>?): <ERROR CLASS>?
onPause fun onPause(): Unit
onResume fun onResume(): Unit
onViewCreated fun onViewCreated(view: <ERROR CLASS>, savedInstanceState: <ERROR CLASS>?): Unit

Companion Object Functions

Name Summary
newInstance fun newInstance(listener: OnScanCompleteListener, scanMessage: Int? = null): QrFragment
Returns a new instance of QR Fragment

Extension Functions

Name Summary
consumeFrom fun <S : State, A : Action> Fragment.consumeFrom(store: Store<S, A>, block: (S) -> Unit): Unit
Helper extension method for consuming State from a Store sequentially in order inside a Fragment. The block function will get invoked for every State update.
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.