Browse Source

Let setting up the visibility of the link for new users in the login view

David A. Velasco 11 years ago
parent
commit
850a3dd09a

+ 3 - 4
res/layout-land/account_setup.xml

@@ -189,14 +189,14 @@
 	    android:id="@id/buttonOK"
 	    android:layout_width="match_parent"
 	    android:layout_height="wrap_content"
-	    android:layout_above="@id/account_register"
+	    android:layout_above="@+id/welcome_link"
 	    android:layout_centerHorizontal="true"
 	    android:enabled="false"
 	    android:onClick="onOkClick"
 	    android:text="@string/setup_btn_connect" />
 
 	<Button
-	    android:id="@+id/account_register"
+	    android:id="@id/welcome_link"
 	    android:layout_width="wrap_content"
 	    android:layout_height="wrap_content"
 	    android:layout_alignParentBottom="true"
@@ -206,7 +206,6 @@
 	    android:paddingBottom="5dp"
 	    android:paddingTop="5dp"
 	    android:text="@string/auth_register"
-	    android:textColor="#0000FF"
-	    android:visibility="invisible" />
+	    android:textColor="#0000FF"/>
 	
 </RelativeLayout>

+ 2 - 3
res/layout/account_setup.xml

@@ -176,7 +176,7 @@
             android:text="@string/setup_btn_connect" />
 
         <Button
-            android:id="@+id/account_register"
+            android:id="@+id/welcome_link"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:background="@android:color/transparent"
@@ -184,8 +184,7 @@
             android:paddingBottom="5dp"
             android:paddingTop="5dp"
             android:text="@string/auth_register"
-            android:textColor="#0000FF"
-            android:visibility="gone" />
+            android:textColor="#0000FF"/>
 
     </LinearLayout>
 

+ 1 - 0
res/values/setup.xml

@@ -12,6 +12,7 @@
     <!-- Server URL -->
     <string name="server_url"></string>
     <bool name="show_server_url_input">true</bool>
+    <bool name="show_welcome_link">true</bool>
     
     <!-- Flags to setup the authentication methods available in the app -->
     <string name="auth_method_oauth2">off</string>

+ 11 - 6
src/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -193,13 +193,18 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
         /// set Host Url Input Enabled
         mHostUrlInputEnabled = getResources().getBoolean(R.bool.show_server_url_input);
         
-
-        /// complete label for 'register account' button
-        Button b = (Button) findViewById(R.id.account_register);
-        if (b != null) {
-            b.setText(String.format(getString(R.string.auth_register), getString(R.string.app_name)));            
+        /// set visibility of link for new users
+        boolean accountRegisterVisibility = getResources().getBoolean(R.bool.show_welcome_link);
+        Button welcomeLink = (Button) findViewById(R.id.welcome_link);
+        if (welcomeLink != null) {
+            if (accountRegisterVisibility) {
+                welcomeLink.setVisibility(View.VISIBLE);
+                welcomeLink.setText(String.format(getString(R.string.auth_register), getString(R.string.app_name)));            
+            } else {
+                findViewById(R.id.welcome_link).setVisibility(View.GONE);
+            }
         }
-        
+
         /// initialization
         mAccountMgr = AccountManager.get(this);
         mNewCapturedUriFromOAuth2Redirection = null;