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

This commit is contained in:
David A. Velasco 2013-11-06 11:30:15 +01:00
parent fec03ffe2e
commit 850a3dd09a
4 changed files with 17 additions and 13 deletions

View file

@ -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>

View file

@ -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>

View 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>

View file

@ -193,11 +193,16 @@ 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