mirror of
https://github.com/nextcloud/android.git
synced 2024-11-29 10:49:04 +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:id="@id/buttonOK"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_above="@id/account_register"
|
android:layout_above="@+id/welcome_link"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:onClick="onOkClick"
|
android:onClick="onOkClick"
|
||||||
android:text="@string/setup_btn_connect" />
|
android:text="@string/setup_btn_connect" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/account_register"
|
android:id="@id/welcome_link"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
|
@ -206,7 +206,6 @@
|
||||||
android:paddingBottom="5dp"
|
android:paddingBottom="5dp"
|
||||||
android:paddingTop="5dp"
|
android:paddingTop="5dp"
|
||||||
android:text="@string/auth_register"
|
android:text="@string/auth_register"
|
||||||
android:textColor="#0000FF"
|
android:textColor="#0000FF"/>
|
||||||
android:visibility="invisible" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
|
@ -176,7 +176,7 @@
|
||||||
android:text="@string/setup_btn_connect" />
|
android:text="@string/setup_btn_connect" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/account_register"
|
android:id="@+id/welcome_link"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
|
@ -184,8 +184,7 @@
|
||||||
android:paddingBottom="5dp"
|
android:paddingBottom="5dp"
|
||||||
android:paddingTop="5dp"
|
android:paddingTop="5dp"
|
||||||
android:text="@string/auth_register"
|
android:text="@string/auth_register"
|
||||||
android:textColor="#0000FF"
|
android:textColor="#0000FF"/>
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<!-- Server URL -->
|
<!-- Server URL -->
|
||||||
<string name="server_url"></string>
|
<string name="server_url"></string>
|
||||||
<bool name="show_server_url_input">true</bool>
|
<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 -->
|
<!-- Flags to setup the authentication methods available in the app -->
|
||||||
<string name="auth_method_oauth2">off</string>
|
<string name="auth_method_oauth2">off</string>
|
||||||
|
|
|
@ -193,13 +193,18 @@ implements OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
|
||||||
/// set Host Url Input Enabled
|
/// set Host Url Input Enabled
|
||||||
mHostUrlInputEnabled = getResources().getBoolean(R.bool.show_server_url_input);
|
mHostUrlInputEnabled = getResources().getBoolean(R.bool.show_server_url_input);
|
||||||
|
|
||||||
|
/// set visibility of link for new users
|
||||||
/// complete label for 'register account' button
|
boolean accountRegisterVisibility = getResources().getBoolean(R.bool.show_welcome_link);
|
||||||
Button b = (Button) findViewById(R.id.account_register);
|
Button welcomeLink = (Button) findViewById(R.id.welcome_link);
|
||||||
if (b != null) {
|
if (welcomeLink != null) {
|
||||||
b.setText(String.format(getString(R.string.auth_register), getString(R.string.app_name)));
|
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
|
/// initialization
|
||||||
mAccountMgr = AccountManager.get(this);
|
mAccountMgr = AccountManager.get(this);
|
||||||
mNewCapturedUriFromOAuth2Redirection = null;
|
mNewCapturedUriFromOAuth2Redirection = null;
|
||||||
|
|
Loading…
Reference in a new issue