Let setting up the visibility of the link for new users in the login view
[pub/Android/ownCloud.git] / src / com / owncloud / android / authentication / AuthenticatorActivity.java
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
         /// 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
+\r
         /// initialization\r
         mAccountMgr = AccountManager.get(this);\r
         mNewCapturedUriFromOAuth2Redirection = null;\r
         /// initialization\r
         mAccountMgr = AccountManager.get(this);\r
         mNewCapturedUriFromOAuth2Redirection = null;\r