From c6cf442d7ad970eb13361411faab78fd22c62763 Mon Sep 17 00:00:00 2001 From: Catfriend1 Date: Sun, 24 Feb 2019 19:16:20 +0100 Subject: [PATCH] Add Binary Eye barcode scanner support (fixes #325) (#339) * Add Binary Eye barcode scanner support (fixes #325) * Remove "Barcode Scanner" app as preferred choice (fixes #325) * Add app recommendation: "Binary Eye" * Imported de translation * Updated whatsnew --- .../syncthingandroid/activities/DeviceActivity.java | 12 ++++++++++++ app/src/main/play/en-GB/whatsnew | 1 + app/src/main/res/values-de/strings.xml | 3 +++ app/src/main/res/values/strings.xml | 3 +++ 4 files changed, 19 insertions(+) diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/DeviceActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/DeviceActivity.java index fd1d65db9..b4d3a1129 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/activities/DeviceActivity.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/DeviceActivity.java @@ -604,7 +604,15 @@ private void onCopyDeviceIdClick() { } private void onQrButtonClick() { + final List targetApplications = list( + "de.markusfisch.android.binaryeye", // Binary Eye + "com.srowen.bs.android", // Barcode Scanner+ + "com.srowen.bs.android.simple" // Barcode Scanner+ Simple + // "com.google.zxing.client.android" // Barcode Scanner (2019-02-24: no longer on GPlay) + ); IntentIntegrator integrator = new IntentIntegrator(DeviceActivity.this); + integrator.setTargetApplications(targetApplications); + integrator.setMessage(getString(R.string.install_barcode_scanner_app_message)); integrator.initiateScan(); } @@ -721,4 +729,8 @@ private void onDeviceIdViewClick(View view) { mDiscoveredDevicesTitle.setVisibility(View.GONE); mDiscoveredDevicesContainer.setVisibility(View.GONE); } + + private static List list(String... values) { + return Collections.unmodifiableList(Arrays.asList(values)); + } } diff --git a/app/src/main/play/en-GB/whatsnew b/app/src/main/play/en-GB/whatsnew index f62269e39..0db01417e 100644 --- a/app/src/main/play/en-GB/whatsnew +++ b/app/src/main/play/en-GB/whatsnew @@ -1,4 +1,5 @@ Enhancements +* Add Binary Eye barcode scanner support (#325) * Download Support Bundle (#332) * Add label to explain why Syncthing Options are greyed out (#337) Notes diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 34ecaa042..06b514489 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -320,6 +320,9 @@ Bitte melden Sie auftretende Probleme via GitHub. QR Code scannen + + Dies erfordert eine Barcode Scanner App. Möchtest Du die App \'Binary Eye\' von F-Droid installieren? + Konnte keine Root-Rechte erhalten. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f472da905..68056c3ed 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -323,6 +323,9 @@ Please report any problems you encounter via Github. Scan QR Code + + This requires a barcode scanner app. Would you like to install the app \'Binary Eye\' from F-Droid? + Did not get root permissions