Browse Source

Merge branch 'develop' into login_toggle_password_icon

David A. Velasco 12 years ago
parent
commit
7160a49e20

+ 1 - 1
THIRD_PARTY.txt

@@ -44,7 +44,7 @@ The third party software included and used by this project is:
    Original license document included at libs/LICENSE.txt
    See http://jackrabbit.apache.org/
  
- * Transifex client.JavaMail API, version 1.4.3
+ * Transifex client.
    Copyright (C) Transifex.
    Licensed under GNU General Public License.
    Placed at third_party/transifex-client.

+ 2 - 2
res/layout-land/account_setup.xml

@@ -50,10 +50,10 @@
 			    android:id="@+id/LinearLayout1"
 			    android:layout_width="match_parent"
 			    android:layout_height="wrap_content"
-			    android:layout_margin="8dp"
 			    android:focusable="true"
 			    android:gravity="center"
-			    android:orientation="vertical" >
+			    android:orientation="vertical"
+			    android:padding="8dp" >
 		
 				<EditText
 					android:id="@+id/hostUrlInput"

+ 5 - 9
res/layout/account_setup.xml

@@ -17,24 +17,20 @@
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
-
 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_gravity="center"
-	android:padding="8dip"
     android:fillViewport="true"
-    android:orientation="vertical"
-    >
+    android:orientation="vertical" >
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-		android:layout_margin="8dip"
-        android:gravity="center"
-        android:orientation="vertical" 
         android:focusable="true"
-        >
+        android:gravity="center"
+        android:orientation="vertical"
+        android:padding="8dp" >
 
         <ImageView
             android:id="@+id/imageView1"
@@ -133,7 +129,7 @@
             android:enabled="false"
             android:onClick="onOkClick"
             android:text="@string/setup_btn_connect"
-            android:textColor="@android:color/black" />
+            />
 
         <Button
             android:id="@+id/account_register"

+ 21 - 1
src/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -48,7 +48,9 @@ import android.net.Uri;
 import android.os.Bundle;
 import android.os.Handler;
 import android.preference.PreferenceManager;
+import android.text.Editable;
 import android.text.InputType;
+import android.text.TextWatcher;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.View;
@@ -266,6 +268,22 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
                 return true;
             }
         });
+        mHostUrlInput.addTextChangedListener(new TextWatcher() {
+
+            @Override
+            public void afterTextChanged(Editable s) {
+                if (!mHostBaseUrl.equals(normalizeUrl(mHostUrlInput.getText().toString()))) {
+                    mOkButton.setEnabled(false);
+                }
+            }
+
+            @Override
+            public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
+
+            @Override
+            public void onTextChanged(CharSequence s, int start, int before, int count) {}
+            
+        });
         mPasswordInput.setOnFocusChangeListener(this);
         mPasswordInput.setImeOptions(EditorInfo.IME_ACTION_DONE);
         mPasswordInput.setOnEditorActionListener(this);
@@ -409,6 +427,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
     private void onUrlInputFocusLost(TextView hostInput) {
         if (!mHostBaseUrl.equals(normalizeUrl(mHostUrlInput.getText().toString()))) {
             checkOcServer();
+        } else {
+            mOkButton.setEnabled(mServerIsValid);
         }
     }
 
@@ -660,7 +680,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
                 url = url.substring(0, url.length() - 1);
             }
         }
-        return url;
+        return (url != null ? url : "");
     }
 
     /**