Commit bfdcd415 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer 🎼 Committed by Nihar Thakkar

update user interface custom url

parent bc3dcd9e
Pipeline #4020 passed with stage
in 5 minutes and 9 seconds
......@@ -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;
......
......@@ -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">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
android:layout_marginTop="32dp"
android:layout_marginBottom="32dp"
android:gravity="center"
android:text="@string/login_eelo_title"
android:textColor="#000000"
......@@ -49,8 +49,8 @@
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="16dp"
android:paddingStart="16dp">
android:paddingStart="16dp"
android:paddingEnd="16dp">
<android.support.design.widget.TextInputEditText
android:id="@+id/urlpwd_user_name"
......@@ -63,8 +63,8 @@
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText
......@@ -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">
<TextView
......@@ -105,7 +106,8 @@
android:button="@drawable/custom_url_button_value"
android:text=""
android:textOff=""
android:textOn="" />
android:textOn=""
android:clickable="false"/>
</LinearLayout>
<!--android:checked="false"-->
<android.support.design.widget.TextInputLayout
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment