Lennart Rosam 13 жил өмнө
parent
commit
9996436ccc

+ 18 - 0
res/layout/account_setup.xml

@@ -74,6 +74,7 @@
                     android:layout_weight="0.75"
                     android:hint="@string/setup_hint_address"
                     android:inputType="textUri"
+                    android:textColor="@android:color/black"
                     android:singleLine="true" >
 
                     <requestFocus>
@@ -119,6 +120,22 @@
 
                 </EditText>
             </TableRow>
+            <TableRow android:id="@+id/tableRow5"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:gravity="center_horizontal"
+                android:weightSum="1.0">
+                
+                <CheckBox
+					android:id="@+id/show_password"
+					android:layout_width="fill_parent"
+					android:layout_height="wrap_content"
+					android:layout_weight=".75"
+					android:hint="@string/setup_hint_show_password"
+					android:textColor="@android:color/black"
+					android:onClick="onCheckboxClick"/>
+                
+            </TableRow>
         </TableLayout>
 
         <LinearLayout
@@ -135,6 +152,7 @@
                 android:layout_height="wrap_content"
                 android:layout_weight=".50"
                 android:onClick="onOkClick"
+                android:textColor="@android:color/black"
                 android:text="@string/setup_btn_connect" >
             </Button>
         </LinearLayout>

+ 1 - 0
res/values/strings.xml

@@ -30,6 +30,7 @@
     <string name="setup_hint_username">Username</string>
     <string name="setup_hint_password">Password</string>
     <string name="setup_hint_address">Web address</string>
+    <string name="setup_hint_show_password">Show password?</string>
     <string name="setup_title">Connect to your ownCloud</string>
     <string name="setup_btn_connect">Connect</string>
     <string name="uploader_btn_upload_text">Upload</string>

+ 19 - 0
src/eu/alefzero/owncloud/ui/activity/AuthenticatorActivity.java

@@ -32,9 +32,11 @@ import android.content.Intent;
 import android.graphics.Color;
 import android.os.Bundle;
 import android.os.Handler;
+import android.text.InputType;
 import android.util.Log;
 import android.view.View;
 import android.view.Window;
+import android.widget.CheckBox;
 import android.widget.TextView;
 import android.widget.Toast;
 import eu.alefzero.owncloud.R;
@@ -188,4 +190,21 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity {
                 mHandler,
                 AuthenticatorActivity.this);
     }
+    
+    /**
+     * Handles the show password checkbox
+     * @author robstar
+     * @param view
+     */
+    public void onCheckboxClick(View view) {
+    	CheckBox checkbox = (CheckBox) findViewById(R.id.show_password);
+    	TextView password_text = (TextView) findViewById(R.id.account_password);
+    	
+    	if(checkbox.isChecked()) {
+    		password_text.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
+    	} else {
+    		password_text.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
+    	}
+    	
+    }
 }