|
@@ -43,7 +43,9 @@ import android.support.v4.app.Fragment;
|
|
|
import android.support.v4.app.FragmentManager;
|
|
|
import android.support.v4.app.FragmentTransaction;
|
|
|
import android.text.Editable;
|
|
|
+import android.text.InputFilter;
|
|
|
import android.text.InputType;
|
|
|
+import android.text.Spanned;
|
|
|
import android.text.TextWatcher;
|
|
|
import android.view.KeyEvent;
|
|
|
import android.view.MotionEvent;
|
|
@@ -85,6 +87,7 @@ import com.owncloud.android.operations.GetServerInfoOperation;
|
|
|
import com.owncloud.android.operations.OAuth2GetAccessToken;
|
|
|
import com.owncloud.android.services.OperationsService;
|
|
|
import com.owncloud.android.services.OperationsService.OperationsServiceBinder;
|
|
|
+import com.owncloud.android.ui.components.CustomEditText;
|
|
|
import com.owncloud.android.ui.dialog.CredentialsDialogFragment;
|
|
|
import com.owncloud.android.ui.dialog.IndeterminateProgressDialog;
|
|
|
import com.owncloud.android.ui.dialog.SamlWebViewDialog;
|
|
@@ -97,6 +100,8 @@ import java.util.Map;
|
|
|
|
|
|
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
|
|
|
|
|
+import static android.provider.ContactsContract.CommonDataKinds.StructuredName.PREFIX;
|
|
|
+
|
|
|
/**
|
|
|
* This Activity is used to add an ownCloud account to the App
|
|
|
*/
|
|
@@ -149,6 +154,10 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|
|
private static final String HTTPS_PROTOCOL = "https://";
|
|
|
private static final String HTTP_PROTOCOL = "http://";
|
|
|
|
|
|
+ public static final String REGULAR_SERVER_INPUT_TYPE = "regular";
|
|
|
+ public static final String SUBDOMAIN_SERVER_INPUT_TYPE = "prefix";
|
|
|
+ public static final String DIRECTORY_SERVER_INPUT_TYPE = "suffix";
|
|
|
+
|
|
|
/// parameters from EXTRAs in starter Intent
|
|
|
private byte mAction;
|
|
|
private Account mAccount;
|
|
@@ -164,7 +173,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|
|
|
|
|
|
|
|
/// Server PRE-Fragment elements
|
|
|
- private EditText mHostUrlInput;
|
|
|
+ private CustomEditText mHostUrlInput;
|
|
|
private View mRefreshButton;
|
|
|
private TextView mServerStatusView;
|
|
|
|
|
@@ -438,7 +447,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|
|
}
|
|
|
|
|
|
/// step 2 - set properties of UI elements (text, visibility, enabled...)
|
|
|
- mHostUrlInput = (EditText) findViewById(R.id.hostUrlInput);
|
|
|
+ mHostUrlInput = (CustomEditText) findViewById(R.id.hostUrlInput);
|
|
|
// Convert IDN to Unicode
|
|
|
mHostUrlInput.setText(DisplayUtils.convertIdn(mServerInfo.mBaseUrl, false));
|
|
|
if (mAction != ACTION_CREATE) {
|
|
@@ -446,12 +455,21 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|
|
mHostUrlInput.setEnabled(false);
|
|
|
mHostUrlInput.setFocusable(false);
|
|
|
}
|
|
|
+
|
|
|
+ String serverInputType = getResources().getString(R.string.server_input_type);
|
|
|
+
|
|
|
if (isUrlInputAllowed) {
|
|
|
mRefreshButton = findViewById(R.id.embeddedRefreshButton);
|
|
|
+ if (serverInputType.equals(DIRECTORY_SERVER_INPUT_TYPE) ||
|
|
|
+ serverInputType.equals(SUBDOMAIN_SERVER_INPUT_TYPE)) {
|
|
|
+ mHostUrlInput.setText("");
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
findViewById(R.id.hostUrlFrame).setVisibility(View.GONE);
|
|
|
mRefreshButton = findViewById(R.id.centeredRefreshButton);
|
|
|
}
|
|
|
+
|
|
|
showRefreshButton(mServerIsChecked && !mServerIsValid &&
|
|
|
mWaitingForOpId > Integer.MAX_VALUE);
|
|
|
mServerStatusView = (TextView) findViewById(R.id.server_status_text);
|