Let setting up the visibility of the link for new users in the login view
authorDavid A. Velasco <dvelasco@solidgear.es>
Wed, 6 Nov 2013 10:30:15 +0000 (11:30 +0100)
committerDavid A. Velasco <dvelasco@solidgear.es>
Wed, 6 Nov 2013 10:30:15 +0000 (11:30 +0100)
res/layout-land/account_setup.xml
res/layout/account_setup.xml
res/values/setup.xml
src/com/owncloud/android/authentication/AuthenticatorActivity.java

index 322ac9a..c672362 100644 (file)
            android:id="@id/buttonOK"\r
            android:layout_width="match_parent"\r
            android:layout_height="wrap_content"\r
-           android:layout_above="@id/account_register"\r
+           android:layout_above="@+id/welcome_link"\r
            android:layout_centerHorizontal="true"\r
            android:enabled="false"\r
            android:onClick="onOkClick"\r
            android:text="@string/setup_btn_connect" />\r
 \r
        <Button\r
-           android:id="@+id/account_register"\r
+           android:id="@id/welcome_link"\r
            android:layout_width="wrap_content"\r
            android:layout_height="wrap_content"\r
            android:layout_alignParentBottom="true"\r
            android:paddingBottom="5dp"\r
            android:paddingTop="5dp"\r
            android:text="@string/auth_register"\r
-           android:textColor="#0000FF"\r
-           android:visibility="invisible" />\r
+           android:textColor="#0000FF"/>\r
        \r
 </RelativeLayout>\r
index de77dd2..52afe54 100644 (file)
             android:text="@string/setup_btn_connect" />\r
 \r
         <Button\r
-            android:id="@+id/account_register"\r
+            android:id="@+id/welcome_link"\r
             android:layout_width="wrap_content"\r
             android:layout_height="wrap_content"\r
             android:background="@android:color/transparent"\r
             android:paddingBottom="5dp"\r
             android:paddingTop="5dp"\r
             android:text="@string/auth_register"\r
-            android:textColor="#0000FF"\r
-            android:visibility="gone" />\r
+            android:textColor="#0000FF"/>\r
 \r
     </LinearLayout>\r
 \r
index dc32b09..2092c3f 100644 (file)
@@ -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>
index f6e6780..f6c21e2 100644 (file)
@@ -193,13 +193,18 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
         /// set Host Url Input Enabled\r
         mHostUrlInputEnabled = getResources().getBoolean(R.bool.show_server_url_input);\r
         \r
-\r
-        /// complete label for 'register account' button\r
-        Button b = (Button) findViewById(R.id.account_register);\r
-        if (b != null) {\r
-            b.setText(String.format(getString(R.string.auth_register), getString(R.string.app_name)));            \r
+        /// set visibility of link for new users\r
+        boolean accountRegisterVisibility = getResources().getBoolean(R.bool.show_welcome_link);\r
+        Button welcomeLink = (Button) findViewById(R.id.welcome_link);\r
+        if (welcomeLink != null) {\r
+            if (accountRegisterVisibility) {\r
+                welcomeLink.setVisibility(View.VISIBLE);\r
+                welcomeLink.setText(String.format(getString(R.string.auth_register), getString(R.string.app_name)));            \r
+            } else {\r
+                findViewById(R.id.welcome_link).setVisibility(View.GONE);\r
+            }\r
         }\r
-        \r
+\r
         /// initialization\r
         mAccountMgr = AccountManager.get(this);\r
         mNewCapturedUriFromOAuth2Redirection = null;\r