Commit ac16c3d0 authored by Ricki Hirner's avatar Ricki Hirner

Use TextInputLayout for password field

parent bc0b1d78
Pipeline #24671660 passed with stage
in 4 minutes and 23 seconds
......@@ -55,9 +55,9 @@ class CredentialsFragment: Fragment(), CompoundButton.OnCheckedChangeListener, T
updateViews()
}
var password: String?
get() = StringUtils.trimToNull(view?.password?.text.toString())
get() = StringUtils.trimToNull(view?.password?.editText?.text.toString())
set(value) {
view?.password?.setText(value)
view?.password?.editText?.setText(value)
updateViews()
}
......@@ -67,12 +67,12 @@ class CredentialsFragment: Fragment(), CompoundButton.OnCheckedChangeListener, T
arguments?.let { args ->
v.requires_authentication.isChecked = args.getBoolean(ARG_AUTH_REQUIRED)
v.user_name.setText(args.getString(ARG_USERNAME))
v.password.setText(args.getString(ARG_PASSWORD))
v.password.editText?.setText(args.getString(ARG_PASSWORD))
}
v.requires_authentication.setOnCheckedChangeListener(this)
v.user_name.addTextChangedListener(this)
v.password.addTextChangedListener(this)
v.password.editText?.addTextChangedListener(this)
return v
}
......
......@@ -12,12 +12,14 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Switch
android:layout_marginTop="32dp"
android:layout_marginBottom="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/add_calendar_requires_authentication"
......@@ -46,12 +48,16 @@
android:visibility="gone"
android:id="@+id/password_label"/>
<EditText
<android.support.design.widget.TextInputLayout
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:visibility="gone"
android:id="@+id/password"
android:singleLine="true"/>
app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:maxLines="1" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
\ No newline at end of file
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