From 6998e846f9951a66cbe3d1bcdafdad56c52ae9c8 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Tue, 22 Feb 2022 11:41:47 +0000 Subject: [PATCH] adding missing instance of the qr scanner args being passed --- .../app/features/createdirect/CreateDirectRoomActivity.kt | 3 ++- .../im/vector/app/features/qrcode/QrCodeScannerFragment.kt | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/createdirect/CreateDirectRoomActivity.kt b/vector/src/main/java/im/vector/app/features/createdirect/CreateDirectRoomActivity.kt index a6b34eda25..9df4f52d0f 100644 --- a/vector/src/main/java/im/vector/app/features/createdirect/CreateDirectRoomActivity.kt +++ b/vector/src/main/java/im/vector/app/features/createdirect/CreateDirectRoomActivity.kt @@ -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) } diff --git a/vector/src/main/java/im/vector/app/features/qrcode/QrCodeScannerFragment.kt b/vector/src/main/java/im/vector/app/features/qrcode/QrCodeScannerFragment.kt index c514a1c8aa..0f438a77cd 100644 --- a/vector/src/main/java/im/vector/app/features/qrcode/QrCodeScannerFragment.kt +++ b/vector/src/main/java/im/vector/app/features/qrcode/QrCodeScannerFragment.kt @@ -56,7 +56,7 @@ data class QrScannerArgs( open class QrCodeScannerFragment @Inject constructor() : VectorBaseFragment(), 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 + scannerArgs.showExtraButtons.let { showButtons -> views.userCodeMyCodeButton.isVisible = showButtons views.userCodeOpenGalleryButton.isVisible = showButtons