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

QrFragment

class QrFragment : Fragment (source)

A Fragment that displays a QR scanner.

This class is based on Camera2BasicFragment from:

https://github.com/googlesamples/android-Camera2Basic https://github.com/kismkof/camera2basic

Types

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

Constructors

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

Functions

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): QrFragment

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.