diff options
author | Parménides GV <parmegv@sdf.org> | 2015-03-27 13:41:23 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2015-03-27 13:41:23 +0100 |
commit | 88fd90e85c8aa584520ad67978e1ed4c419e2fd9 (patch) | |
tree | 4f559d0e698d3365cfcaafdb488101dee3ffcd8d /app/src/release/java/se/leap/bitmaskclient/NewProviderDialog.java | |
parent | ea748b512ecb4eaff6ad7e212d9356a1caf7ed98 (diff) | |
parent | 8cd10bcac50a7e76085d5d7384dc8910a80e44c6 (diff) |
Merge branch 'develop' into release-0.9.3
Diffstat (limited to 'app/src/release/java/se/leap/bitmaskclient/NewProviderDialog.java')
-rw-r--r-- | app/src/release/java/se/leap/bitmaskclient/NewProviderDialog.java | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/app/src/release/java/se/leap/bitmaskclient/NewProviderDialog.java b/app/src/release/java/se/leap/bitmaskclient/NewProviderDialog.java index f6709c22..1823d3e3 100644 --- a/app/src/release/java/se/leap/bitmaskclient/NewProviderDialog.java +++ b/app/src/release/java/se/leap/bitmaskclient/NewProviderDialog.java @@ -16,26 +16,19 @@ */ package se.leap.bitmaskclient; -import butterknife.ButterKnife; -import butterknife.InjectView; +import butterknife.*; import se.leap.bitmaskclient.ProviderListContent.ProviderItem; -import android.app.Activity; -import android.app.AlertDialog; -import android.app.Dialog; -import android.app.DialogFragment; -import android.content.DialogInterface; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.CheckBox; -import android.widget.EditText; -import android.widget.Toast; + +import android.app.*; +import android.content.*; +import android.os.*; +import android.view.*; +import android.widget.*; /** * Implements the new custom provider dialog. * * @author parmegv - * */ public class NewProviderDialog extends DialogFragment { @@ -68,7 +61,7 @@ public class NewProviderDialog extends DialogFragment { View view = inflater.inflate(R.layout.new_provider_dialog, null); ButterKnife.inject(this, view); Bundle arguments = getArguments(); - if(arguments != null) { + if (arguments != null) { url_input_field.setText(arguments.getString(Provider.MAIN_URL, "")); } @@ -90,24 +83,26 @@ public class NewProviderDialog extends DialogFragment { private void saveProvider() { String entered_url = url_input_field.getText().toString().trim(); - if(!entered_url.startsWith("https://")) { - if (entered_url.startsWith("http://")){ + if (!entered_url.startsWith("https://")) { + if (entered_url.startsWith("http://")) { entered_url = entered_url.substring("http://".length()); } entered_url = "https://".concat(entered_url); } - if(validURL(entered_url)) { + if (validURL(entered_url)) { interface_with_ConfigurationWizard.showAndSelectProvider(entered_url); Toast.makeText(getActivity().getApplicationContext(), R.string.valid_url_entered, Toast.LENGTH_LONG).show(); } else { url_input_field.setText(""); - Toast.makeText(getActivity().getApplicationContext(), R.string.not_valid_url_entered, Toast.LENGTH_LONG).show();; + Toast.makeText(getActivity().getApplicationContext(), R.string.not_valid_url_entered, Toast.LENGTH_LONG).show(); + ; } } /** * Checks if the entered url is valid or not. + * * @param entered_url * @return true if it's not empty nor contains only the protocol. */ |