From 4b88332caedfd67b26c5ed35466e2dc38f57d9cd Mon Sep 17 00:00:00 2001 From: Michael Johnston Date: Thu, 15 Feb 2024 21:01:04 +1100 Subject: [PATCH] removed old function --- .../LibraryActivity/LibraryActivity.kt | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/app/src/main/java/com/mickstarify/zooforzotero/LibraryActivity/LibraryActivity.kt b/app/src/main/java/com/mickstarify/zooforzotero/LibraryActivity/LibraryActivity.kt index 2361ada..4aa4038 100644 --- a/app/src/main/java/com/mickstarify/zooforzotero/LibraryActivity/LibraryActivity.kt +++ b/app/src/main/java/com/mickstarify/zooforzotero/LibraryActivity/LibraryActivity.kt @@ -114,18 +114,6 @@ class LibraryActivity : AppCompatActivity(), } } - private val getBarcode = - registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result -> - if (result.resultCode == RESULT_OK) { - val data: Intent? = result.data - val contents = data?.getStringExtra("SCAN_RESULT") - Log.i("zotero", "got barcode scan result $contents") - if (contents != null) { - libraryListViewModel.scannedBarcodeNumber(contents) - } - } - } - private val barcodeLauncher = registerForActivityResult( ScanContract() ) { @@ -147,34 +135,6 @@ class LibraryActivity : AppCompatActivity(), }) } - private fun handleBarcodeScanRequestExternal() { - val intent = Intent("com.google.zxing.client.android.SCAN") - intent.setPackage("com.google.zxing.client.android") - intent.putExtra("SCAN_MODE", "PRODUCT_MODE") - intent.putExtra("SCAN_FORMATS", "EAN_13") - - try { - getBarcode.launch(intent) - } catch (e: ActivityNotFoundException) { - Log.e("zotero", "error launching barcode scanner. ${e.message}") - - val alertDialog = AlertDialog.Builder(this) - .setTitle("Barcode Scanner Not Found") - .setMessage("You need to install the ZXing barcode scanner to use this feature.") - .setPositiveButton("Install", { _, _ -> - val intent2 = Intent( - Intent.ACTION_VIEW, - Uri.parse("market://details?id=com.google.zxing.client.android") - ) - startActivity(intent2) - }) - .setIcon(android.R.drawable.ic_dialog_alert) - .setNegativeButton("Cancel", { _, _ -> }) - alertDialog.show() - } - } - - private fun libraryLoadingScreenShown() { supportActionBar?.title = "Loading" mDrawerToggle.isDrawerIndicatorEnabled = true