mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 22:55:46 +03:00
Let setting up the visibility of the link for new users in the login view
This commit is contained in:
parent
fec03ffe2e
commit
850a3dd09a
4 changed files with 17 additions and 13 deletions
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue