summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/NewProviderDialog.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2013-06-19 19:05:12 +0200
committerParménides GV <parmegv@sdf.org>2013-06-19 19:05:12 +0200
commitd475ae617d8dc0994a1294be7c8cca338a68fd9e (patch)
treee024cddb5d030ac423f321b8293449afe094e6cb /src/se/leap/leapclient/NewProviderDialog.java
parentbffd21a326bcb86d814dd3fe2caf5295ea705f2d (diff)
First round of comments.
This resolves the first step from issue #2908. Next step: Put user message strings into an appropiate place.
Diffstat (limited to 'src/se/leap/leapclient/NewProviderDialog.java')
-rw-r--r--src/se/leap/leapclient/NewProviderDialog.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/se/leap/leapclient/NewProviderDialog.java b/src/se/leap/leapclient/NewProviderDialog.java
index 60ac8d2a..5b84ec03 100644
--- a/src/se/leap/leapclient/NewProviderDialog.java
+++ b/src/se/leap/leapclient/NewProviderDialog.java
@@ -13,6 +13,12 @@ import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Toast;
+/**
+ * Implements the new custom provider dialog.
+ *
+ * @author parmegv
+ *
+ */
public class NewProviderDialog extends DialogFragment {
public interface NewProviderDialogInterface {
@@ -21,6 +27,9 @@ public class NewProviderDialog extends DialogFragment {
NewProviderDialogInterface interface_with_ConfigurationWizard;
+ /**
+ * @return a new instance of this DialogFragment.
+ */
public static DialogFragment newInstance() {
NewProviderDialog dialog_fragment = new NewProviderDialog();
return dialog_fragment;
@@ -37,6 +46,7 @@ public class NewProviderDialog extends DialogFragment {
}
}
+ @Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater();
@@ -71,6 +81,11 @@ public class NewProviderDialog extends DialogFragment {
return builder.create();
}
+ /**
+ * Checks if the entered url is valid or not.
+ * @param entered_url
+ * @return true if it's not empty nor contains only the protocol.
+ */
boolean validURL(String entered_url) {
return !entered_url.isEmpty() && entered_url.matches("http[s]?://.+") && !entered_url.replaceFirst("http[s]?://", "").isEmpty();
}