From d615304e83d349b3da741d8262e4c998ea74ae52 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 25 Jul 2018 02:37:36 +0200 Subject: qrcode: minor adjustments Signed-off-by: Jason A. Donenfeld --- .../wireguard/android/fragment/ConfigNamingDialogFragment.java | 2 +- .../java/com/wireguard/android/fragment/TunnelListFragment.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'app/src/main/java/com/wireguard/android') diff --git a/app/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.java b/app/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.java index 1a3ec0d2..d89938e1 100644 --- a/app/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.java +++ b/app/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.java @@ -70,7 +70,7 @@ public class ConfigNamingDialogFragment extends DialogFragment { imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(activity); - alertDialogBuilder.setTitle(R.string.create_tunnel); + alertDialogBuilder.setTitle(R.string.import_from_qrcode); binding = ConfigNamingDialogFragmentBinding.inflate(getActivity().getLayoutInflater(), null, false); binding.executePendingBindings(); diff --git a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java index 23e449b6..e2291f9c 100644 --- a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java +++ b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java @@ -83,10 +83,8 @@ public class TunnelListFragment extends BaseFragment { // Config text is valid, now create the tunnel… final FragmentManager fragmentManager = getFragmentManager(); - if (fragmentManager != null) { - final ConfigNamingDialogFragment fragment = ConfigNamingDialogFragment.newInstance(configText); - fragment.show(fragmentManager, null); - } + if (fragmentManager != null) + ConfigNamingDialogFragment.newInstance(configText).show(fragmentManager, null); } catch (final IllegalArgumentException|IOException exception) { onTunnelImportFinished(Collections.emptyList(), Collections.singletonList(exception)); } @@ -246,6 +244,8 @@ public class TunnelListFragment extends BaseFragment { public void onRequestScanQRCode(@SuppressWarnings("unused") final View view) { final IntentIntegrator intentIntegrator = IntentIntegrator.forSupportFragment(this); intentIntegrator.setOrientationLocked(false); + intentIntegrator.setBeepEnabled(false); + intentIntegrator.setPrompt(getString(R.string.qrcode_hint)); intentIntegrator.initiateScan(Collections.singletonList(IntentIntegrator.QR_CODE)); if (binding != null) -- cgit v1.2.3