diff --git a/android/fakewallet/build.gradle b/android/fakewallet/build.gradle index 2e3a13b62..64d0da09b 100644 --- a/android/fakewallet/build.gradle +++ b/android/fakewallet/build.gradle @@ -120,6 +120,7 @@ dependencies { implementation libs.bcprov.jdk18on implementation libs.kotlinx.coroutines.android implementation libs.multimult + implementation libs.zxing.android.embedded implementation project(path: ':walletlib') kapt libs.androidx.room.compiler } diff --git a/android/fakewallet/src/main/AndroidManifest.xml b/android/fakewallet/src/main/AndroidManifest.xml index 01e6ec5a6..fe6f4967d 100644 --- a/android/fakewallet/src/main/AndroidManifest.xml +++ b/android/fakewallet/src/main/AndroidManifest.xml @@ -6,6 +6,10 @@ + + + + + println("Barcode Result = ${barcodeResult.text}") + runCatching { + val remoteAssociationUri = RemoteAssociationUri(Uri.parse(barcodeResult.text)) + barcodeView.pause() + + startActivity( + Intent(applicationContext, MobileWalletAdapterActivity::class.java) + .setData(remoteAssociationUri.uri)) + }.getOrElse { + Snackbar.make(viewBinding.root, R.string.str_invalid_barcode, Snackbar.LENGTH_LONG).apply { + setAction(R.string.label_try_again) { dismiss() } + addCallback(object : Snackbar.Callback() { + override fun onDismissed(transientBottomBar: Snackbar?, event: Int) { + super.onDismissed(transientBottomBar, event) + decodeQRSingle() + } + }) + show() + } + } + } + } +} \ No newline at end of file diff --git a/android/fakewallet/src/main/res/drawable/drawable_view_finder_cutout.xml b/android/fakewallet/src/main/res/drawable/drawable_view_finder_cutout.xml new file mode 100644 index 000000000..cd2183300 --- /dev/null +++ b/android/fakewallet/src/main/res/drawable/drawable_view_finder_cutout.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/fakewallet/src/main/res/layout/activity_main.xml b/android/fakewallet/src/main/res/layout/activity_main.xml index 2d0f40a9a..d9d7256c9 100644 --- a/android/fakewallet/src/main/res/layout/activity_main.xml +++ b/android/fakewallet/src/main/res/layout/activity_main.xml @@ -11,6 +11,7 @@ tools:context=".MainActivity"> +