mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
adding missing instance of the qr scanner args being passed
This commit is contained in:
parent
95b3afd148
commit
6998e846f9
@ -152,7 +152,8 @@ class CreateDirectRoomActivity : SimpleFragmentActivity() {
|
||||
|
||||
private val permissionCameraLauncher = registerForPermissionsResult { allGranted, deniedPermanently ->
|
||||
if (allGranted) {
|
||||
addFragment(views.container, QrCodeScannerFragment::class.java)
|
||||
val args = QrScannerArgs(showExtraButtons = false, R.string.add_by_qr_code)
|
||||
addFragment(views.container, QrCodeScannerFragment::class.java, args)
|
||||
} else if (deniedPermanently) {
|
||||
onPermissionDeniedSnackbar(R.string.permissions_denied_qr_code)
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ data class QrScannerArgs(
|
||||
open class QrCodeScannerFragment @Inject constructor() : VectorBaseFragment<FragmentQrCodeScannerBinding>(), ZXingScannerView.ResultHandler {
|
||||
|
||||
private val qrViewModel: QrCodeScannerViewModel by activityViewModel()
|
||||
private val scannerArgs: QrScannerArgs? by args()
|
||||
private val scannerArgs: QrScannerArgs by args()
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentQrCodeScannerBinding {
|
||||
return FragmentQrCodeScannerBinding.inflate(inflater, container, false)
|
||||
@ -93,13 +93,13 @@ open class QrCodeScannerFragment @Inject constructor() : VectorBaseFragment<Frag
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
val title = scannerArgs?.titleRes?.let { getString(it) }
|
||||
val title = scannerArgs.titleRes.let { getString(it) }
|
||||
|
||||
setupToolbar(views.qrScannerToolbar)
|
||||
.setTitle(title)
|
||||
.allowBack(useCross = true)
|
||||
|
||||
scannerArgs?.showExtraButtons?.let { showButtons ->
|
||||
scannerArgs.showExtraButtons.let { showButtons ->
|
||||
views.userCodeMyCodeButton.isVisible = showButtons
|
||||
views.userCodeOpenGalleryButton.isVisible = showButtons
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user