From d873032927814bee434592b1bee1830ba4e20527 Mon Sep 17 00:00:00 2001 From: vince-bourgmayer Date: Thu, 7 Mar 2019 14:26:34 +0100 Subject: [PATCH 1/3] make title for custom url clickable instead of togglebutton only --- .../ui/setup/EeloAuthenticatorFragment.kt | 10 ++++++++-- .../main/res/layout/fragment_eelo_authenticator.xml | 12 ++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) 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 b3a000f96..b84c3d321 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 @@ -18,6 +18,7 @@ import android.view.ViewGroup import foundation.e.accountmanager.R import android.net.ConnectivityManager import android.net.Uri +import android.util.Log import android.widget.EditText import android.widget.LinearLayout import android.widget.Toast @@ -48,7 +49,7 @@ class EeloAuthenticatorFragment : Fragment() { savedInstanceState: Bundle?): View? { val view = inflater.inflate(R.layout.fragment_eelo_authenticator, container, false) - view.expand_collapse_button.setOnClickListener(){ expandCollapse() } + view.urlpwd_other_account_title_panel.setOnClickListener(){ expandCollapse() } view.login.setOnClickListener { login() } @@ -58,6 +59,7 @@ class EeloAuthenticatorFragment : Fragment() { toggleButtonState = savedInstanceState.getBoolean(TOGGLE_BUTTON_CHECKED_KEY, false) } + //This allow the button to be redraw in the correct state if user turn screen if(toggleButtonState == true) { view.expand_collapse_button.setChecked(toggleButtonState) view.urlpwd_server_uri_layout.setVisibility(View.VISIBLE) @@ -158,7 +160,11 @@ class EeloAuthenticatorFragment : Fragment() { * Show/Hide panel containing server's uri input field. */ private fun expandCollapse(){ - if(expand_collapse_button.isChecked) { + //inverse state of Toggle button + view!!.expand_collapse_button.setChecked(!view!!.expand_collapse_button.isChecked()) + + if(view!!.expand_collapse_button.isChecked) { + urlpwd_server_uri_layout.setVisibility(View.VISIBLE) urlpwd_server_uri.setEnabled(true) toggleButtonState = true; diff --git a/app/src/main/res/layout/fragment_eelo_authenticator.xml b/app/src/main/res/layout/fragment_eelo_authenticator.xml index 1a448b4fc..aa87b2cb5 100644 --- a/app/src/main/res/layout/fragment_eelo_authenticator.xml +++ b/app/src/main/res/layout/fragment_eelo_authenticator.xml @@ -33,14 +33,14 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:paddingBottom="16dp" - android:paddingTop="8dp"> + android:paddingTop="8dp" + android:paddingBottom="16dp"> + android:paddingStart="16dp" + android:paddingEnd="16dp"> Date: Thu, 7 Mar 2019 14:28:44 +0100 Subject: [PATCH 2/3] remove unused import in EeloAuthenticatorFragment.kt --- .../e/accountmanager/ui/setup/EeloAuthenticatorFragment.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 b84c3d321..a071c64ca 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 @@ -7,7 +7,7 @@ */ package foundation.e.accountmanager.ui.setup -import android.app.AlertDialog + import android.content.Context import android.os.* import android.support.v4.app.Fragment @@ -18,9 +18,6 @@ import android.view.ViewGroup import foundation.e.accountmanager.R import android.net.ConnectivityManager import android.net.Uri -import android.util.Log -import android.widget.EditText -import android.widget.LinearLayout import android.widget.Toast import foundation.e.dav4android.Constants import kotlinx.android.synthetic.main.fragment_eelo_authenticator.* -- GitLab From 0387d192adba1b5dbd0e5d74c47208ca4d5cf543 Mon Sep 17 00:00:00 2001 From: vince-bourgmayer Date: Thu, 7 Mar 2019 15:45:35 +0100 Subject: [PATCH 3/3] show custom url field also when taping on button --- app/src/main/res/layout/fragment_eelo_authenticator.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/fragment_eelo_authenticator.xml b/app/src/main/res/layout/fragment_eelo_authenticator.xml index aa87b2cb5..6dfeae192 100644 --- a/app/src/main/res/layout/fragment_eelo_authenticator.xml +++ b/app/src/main/res/layout/fragment_eelo_authenticator.xml @@ -80,6 +80,7 @@ android:id="@+id/urlpwd_other_account_title_panel" android:layout_width="match_parent" android:layout_height="wrap_content" + android:clickable="true" android:orientation="horizontal"> + android:textOn="" + android:clickable="false"/>