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 b3a000f96546b71fa88e51c9947b869f338b6c1b..a071c64ca8b6b0409a0f11640437339153bae7fd 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,8 +18,6 @@ import android.view.ViewGroup import foundation.e.accountmanager.R import android.net.ConnectivityManager import android.net.Uri -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.* @@ -48,7 +46,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 +56,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 +157,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 1a448b4fc52f81ab763a262afed2c453c567d20b..6dfeae1925608654f88895af17825d54251d9160 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"> + android:textOn="" + android:clickable="false"/>