From 9092c513b14fc9445ea7e1f17aa8f1f594cfef7b Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Mon, 25 Apr 2022 16:05:05 +0530 Subject: [PATCH] Update login page design --- .../ui/setup/EeloAuthenticatorFragment.kt | 33 ++-- app/src/main/res/color/edittext.xml | 13 ++ app/src/main/res/drawable/ic_expand_less.xml | 2 +- app/src/main/res/drawable/ic_expand_more.xml | 2 +- app/src/main/res/drawable/ic_murena_logo.xml | 156 ++++++++++++++++++ .../layout/fragment_eelo_authenticator.xml | 103 +++++------- app/src/main/res/values-night/colors.xml | 6 + app/src/main/res/values/colors.xml | 3 + app/src/main/res/values/strings.xml | 3 +- app/src/main/res/values/styles.xml | 2 +- 10 files changed, 241 insertions(+), 82 deletions(-) create mode 100644 app/src/main/res/color/edittext.xml create mode 100644 app/src/main/res/drawable/ic_murena_logo.xml create mode 100644 app/src/main/res/values-night/colors.xml diff --git a/app/src/main/java/foundation/e/accountmanager/ui/setup/EeloAuthenticatorFragment.kt b/app/src/main/java/foundation/e/accountmanager/ui/setup/EeloAuthenticatorFragment.kt index 3f488bf7e..4217d5281 100644 --- a/app/src/main/java/foundation/e/accountmanager/ui/setup/EeloAuthenticatorFragment.kt +++ b/app/src/main/java/foundation/e/accountmanager/ui/setup/EeloAuthenticatorFragment.kt @@ -46,7 +46,7 @@ class EeloAuthenticatorFragment : Fragment() { v.lifecycleOwner = this v.model = model - v.root.urlpwd_other_account_title_panel.setOnClickListener() { expandCollapse() } + v.root.server_toggle_button.setOnClickListener() { expandCollapse() } v.root.urlpwd_user_name.setOnFocusChangeListener() { v, hasFocus -> if (!hasFocus) { @@ -60,7 +60,7 @@ class EeloAuthenticatorFragment : Fragment() { } } - v.login.setOnClickListener { login() } + v.root.sign_in.setOnClickListener { login() } // code below is to draw toggle button in its correct state and show or hide server url input field //add by Vincent, 18/02/2019 @@ -69,15 +69,15 @@ class EeloAuthenticatorFragment : Fragment() { } //This allow the button to be redraw in the correct state if user turn screen - if (toggleButtonState == true) { - v.root.expand_collapse_button.setChecked(toggleButtonState) + if (toggleButtonState) { + v.root.server_toggle_button.setCompoundDrawablesWithIntrinsicBounds(null, null , resources.getDrawable(R.drawable.ic_expand_less), null) v.root.urlpwd_server_uri_layout.setVisibility(View.VISIBLE) v.root.urlpwd_server_uri.setEnabled(true) } else { + v.root.server_toggle_button.setCompoundDrawablesWithIntrinsicBounds(null, null , resources.getDrawable(R.drawable.ic_expand_more), null) v.root.urlpwd_server_uri_layout.setVisibility(View.GONE) v.root.urlpwd_server_uri.setEnabled(false) } - return v.root } @@ -154,18 +154,17 @@ class EeloAuthenticatorFragment : Fragment() { * Show/Hide panel containing server's uri input field. */ private fun expandCollapse() { - //inverse state of Toggle button - expand_collapse_button.setChecked(!expand_collapse_button.isChecked()) - - if (expand_collapse_button.isChecked) { - urlpwd_server_uri_layout.setVisibility(View.VISIBLE) - urlpwd_server_uri.setEnabled(true) - toggleButtonState = true; - } else { - urlpwd_server_uri_layout.setVisibility(View.GONE) - urlpwd_server_uri.setEnabled(false) - toggleButtonState = false; - } + if (!toggleButtonState) { + server_toggle_button.setCompoundDrawablesWithIntrinsicBounds(null, null , resources.getDrawable(R.drawable.ic_expand_less), null) + urlpwd_server_uri_layout.setVisibility(View.VISIBLE) + urlpwd_server_uri.setEnabled(true) + toggleButtonState = true + } else { + server_toggle_button.setCompoundDrawablesWithIntrinsicBounds(null, null , resources.getDrawable(R.drawable.ic_expand_more), null) + urlpwd_server_uri_layout.setVisibility(View.GONE) + urlpwd_server_uri.setEnabled(false) + toggleButtonState = false + } } } diff --git a/app/src/main/res/color/edittext.xml b/app/src/main/res/color/edittext.xml new file mode 100644 index 000000000..3bccb0b2e --- /dev/null +++ b/app/src/main/res/color/edittext.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_expand_less.xml b/app/src/main/res/drawable/ic_expand_less.xml index e8ab253fa..da367740d 100644 --- a/app/src/main/res/drawable/ic_expand_less.xml +++ b/app/src/main/res/drawable/ic_expand_less.xml @@ -4,7 +4,7 @@ android:viewportWidth="24" android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/ic_expand_more.xml b/app/src/main/res/drawable/ic_expand_more.xml index 8c09c2dba..22a48ffa4 100644 --- a/app/src/main/res/drawable/ic_expand_more.xml +++ b/app/src/main/res/drawable/ic_expand_more.xml @@ -4,7 +4,7 @@ android:viewportWidth="24" android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/ic_murena_logo.xml b/app/src/main/res/drawable/ic_murena_logo.xml new file mode 100644 index 000000000..6eff4e833 --- /dev/null +++ b/app/src/main/res/drawable/ic_murena_logo.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_eelo_authenticator.xml b/app/src/main/res/layout/fragment_eelo_authenticator.xml index 1e416b8a5..2b62454b2 100644 --- a/app/src/main/res/layout/fragment_eelo_authenticator.xml +++ b/app/src/main/res/layout/fragment_eelo_authenticator.xml @@ -50,22 +50,32 @@ android:paddingTop="8dp" android:paddingBottom="16dp"> + + + android:textSize="17sp" /> @@ -96,54 +109,41 @@ android:textColor="@color/primaryTextColor" /> - - - - - - - + android:layout_marginStart="16dp" + android:layout_marginTop="24dp" + android:layout_marginEnd="16dp" + android:text="@string/sign_in" + android:textColor="@android:color/white" + app:backgroundTint="@*android:color/accent_material_light" /> + +