qrcode: minor adjustments
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
8e0835e570
commit
d615304e83
@ -70,7 +70,7 @@ public class ConfigNamingDialogFragment extends DialogFragment {
|
|||||||
imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
|
||||||
final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(activity);
|
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 = ConfigNamingDialogFragmentBinding.inflate(getActivity().getLayoutInflater(), null, false);
|
||||||
binding.executePendingBindings();
|
binding.executePendingBindings();
|
||||||
|
@ -83,10 +83,8 @@ public class TunnelListFragment extends BaseFragment {
|
|||||||
|
|
||||||
// Config text is valid, now create the tunnel…
|
// Config text is valid, now create the tunnel…
|
||||||
final FragmentManager fragmentManager = getFragmentManager();
|
final FragmentManager fragmentManager = getFragmentManager();
|
||||||
if (fragmentManager != null) {
|
if (fragmentManager != null)
|
||||||
final ConfigNamingDialogFragment fragment = ConfigNamingDialogFragment.newInstance(configText);
|
ConfigNamingDialogFragment.newInstance(configText).show(fragmentManager, null);
|
||||||
fragment.show(fragmentManager, null);
|
|
||||||
}
|
|
||||||
} catch (final IllegalArgumentException|IOException exception) {
|
} catch (final IllegalArgumentException|IOException exception) {
|
||||||
onTunnelImportFinished(Collections.emptyList(), Collections.singletonList(exception));
|
onTunnelImportFinished(Collections.emptyList(), Collections.singletonList(exception));
|
||||||
}
|
}
|
||||||
@ -246,6 +244,8 @@ public class TunnelListFragment extends BaseFragment {
|
|||||||
public void onRequestScanQRCode(@SuppressWarnings("unused") final View view) {
|
public void onRequestScanQRCode(@SuppressWarnings("unused") final View view) {
|
||||||
final IntentIntegrator intentIntegrator = IntentIntegrator.forSupportFragment(this);
|
final IntentIntegrator intentIntegrator = IntentIntegrator.forSupportFragment(this);
|
||||||
intentIntegrator.setOrientationLocked(false);
|
intentIntegrator.setOrientationLocked(false);
|
||||||
|
intentIntegrator.setBeepEnabled(false);
|
||||||
|
intentIntegrator.setPrompt(getString(R.string.qrcode_hint));
|
||||||
intentIntegrator.initiateScan(Collections.singletonList(IntentIntegrator.QR_CODE));
|
intentIntegrator.initiateScan(Collections.singletonList(IntentIntegrator.QR_CODE));
|
||||||
|
|
||||||
if (binding != null)
|
if (binding != null)
|
||||||
|
@ -72,15 +72,6 @@
|
|||||||
app:fab_labelsPosition="@integer/label_position"
|
app:fab_labelsPosition="@integer/label_position"
|
||||||
app:layout_behavior="com.wireguard.android.widget.fab.FloatingActionButtonBehavior" >
|
app:layout_behavior="com.wireguard.android.widget.fab.FloatingActionButtonBehavior" >
|
||||||
|
|
||||||
<com.wireguard.android.widget.fab.LabeledFloatingActionButton
|
|
||||||
android:id="@+id/create_empty"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:onClick="@{fragment::onRequestCreateConfig}"
|
|
||||||
app:fabSize="mini"
|
|
||||||
app:srcCompat="@drawable/ic_action_edit_white"
|
|
||||||
app:fab_title="@string/create_empty" />
|
|
||||||
|
|
||||||
<com.wireguard.android.widget.fab.LabeledFloatingActionButton
|
<com.wireguard.android.widget.fab.LabeledFloatingActionButton
|
||||||
android:id="@+id/create_from_file"
|
android:id="@+id/create_from_file"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -97,7 +88,16 @@
|
|||||||
android:onClick="@{fragment::onRequestScanQRCode}"
|
android:onClick="@{fragment::onRequestScanQRCode}"
|
||||||
app:srcCompat="@drawable/ic_action_scan_qr_code_white"
|
app:srcCompat="@drawable/ic_action_scan_qr_code_white"
|
||||||
app:fabSize="mini"
|
app:fabSize="mini"
|
||||||
app:fab_title="@string/scan_qr_code" />
|
app:fab_title="@string/create_from_qrcode" />
|
||||||
|
|
||||||
|
<com.wireguard.android.widget.fab.LabeledFloatingActionButton
|
||||||
|
android:id="@+id/create_empty"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:onClick="@{fragment::onRequestCreateConfig}"
|
||||||
|
app:fabSize="mini"
|
||||||
|
app:srcCompat="@drawable/ic_action_edit_white"
|
||||||
|
app:fab_title="@string/create_empty" />
|
||||||
</com.wireguard.android.widget.fab.FloatingActionsMenu>
|
</com.wireguard.android.widget.fab.FloatingActionsMenu>
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
<string name="create_activity_title">Create WireGuard Tunnel</string>
|
<string name="create_activity_title">Create WireGuard Tunnel</string>
|
||||||
<string name="create_empty">Create from scratch</string>
|
<string name="create_empty">Create from scratch</string>
|
||||||
<string name="create_from_file">Create from file or archive</string>
|
<string name="create_from_file">Create from file or archive</string>
|
||||||
|
<string name="create_from_qrcode">Create from QR code</string>
|
||||||
<string name="create_tunnel">Create Tunnel</string>
|
<string name="create_tunnel">Create Tunnel</string>
|
||||||
<string name="dark_theme_title">Use dark theme</string>
|
<string name="dark_theme_title">Use dark theme</string>
|
||||||
<string name="dark_theme_summary_on">Currently using dark night theme</string>
|
<string name="dark_theme_summary_on">Currently using dark night theme</string>
|
||||||
@ -51,6 +52,7 @@
|
|||||||
<string name="hint_generated">(generated)</string>
|
<string name="hint_generated">(generated)</string>
|
||||||
<string name="hint_optional">(optional)</string>
|
<string name="hint_optional">(optional)</string>
|
||||||
<string name="hint_random">(random)</string>
|
<string name="hint_random">(random)</string>
|
||||||
|
<string name="import_from_qrcode">Import Tunnel from QR Code</string>
|
||||||
<string name="import_error">Unable to import tunnel: %s</string>
|
<string name="import_error">Unable to import tunnel: %s</string>
|
||||||
<string name="import_success">Imported “%s”</string>
|
<string name="import_success">Imported “%s”</string>
|
||||||
<string name="interface_title">Interface</string>
|
<string name="interface_title">Interface</string>
|
||||||
@ -69,10 +71,10 @@
|
|||||||
<string name="private_key">Private key</string>
|
<string name="private_key">Private key</string>
|
||||||
<string name="public_key">Public key</string>
|
<string name="public_key">Public key</string>
|
||||||
<string name="public_key_description">Public key</string>
|
<string name="public_key_description">Public key</string>
|
||||||
|
<string name="qrcode_hint">Tip: generate with `qrencode -t ansiutf8 < tunnel.conf`.</string>
|
||||||
<string name="restore_on_boot_summary">Bring up previously-enabled tunnels on boot</string>
|
<string name="restore_on_boot_summary">Bring up previously-enabled tunnels on boot</string>
|
||||||
<string name="restore_on_boot_title">Restore on boot</string>
|
<string name="restore_on_boot_title">Restore on boot</string>
|
||||||
<string name="save">Save</string>
|
<string name="save">Save</string>
|
||||||
<string name="scan_qr_code">Scan QR Code</string>
|
|
||||||
<plurals name="set_excluded_applications">
|
<plurals name="set_excluded_applications">
|
||||||
<item quantity="one">%d Excluded Application</item>
|
<item quantity="one">%d Excluded Application</item>
|
||||||
<item quantity="other">%d Excluded Applications</item>
|
<item quantity="other">%d Excluded Applications</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user