From bccb1229c8dde15402643bc88313bacd176582e2 Mon Sep 17 00:00:00 2001 From: MCAxiaz Date: Sun, 31 May 2020 15:29:20 -0700 Subject: [PATCH] use material password toggle (#3261) use material for track search --- .../preference/LoginDialogPreference.kt | 11 ----------- .../main/res/layout/pref_account_login.xml | 14 ++++---------- .../main/res/layout/track_search_dialog.xml | 19 ++++++++++++++----- 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/LoginDialogPreference.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/LoginDialogPreference.kt index 3b9c65355a..3065b1a306 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/LoginDialogPreference.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/LoginDialogPreference.kt @@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.widget.preference import android.app.Dialog import android.os.Bundle -import android.text.method.PasswordTransformationMethod import android.view.View import androidx.annotation.StringRes import com.afollestad.materialdialogs.MaterialDialog @@ -14,8 +13,6 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.ui.base.controller.DialogController import kotlinx.android.synthetic.main.pref_account_login.view.login -import kotlinx.android.synthetic.main.pref_account_login.view.password -import kotlinx.android.synthetic.main.pref_account_login.view.show_password import kotlinx.android.synthetic.main.pref_account_login.view.username_label import rx.Subscription import uy.kohesive.injekt.injectLazy @@ -50,14 +47,6 @@ abstract class LoginDialogPreference( fun onViewCreated(view: View) { v = view.apply { - show_password.setOnCheckedChangeListener { _, isChecked -> - if (isChecked) { - password.transformationMethod = null - } else { - password.transformationMethod = PasswordTransformationMethod() - } - } - if (usernameLabelRes != null) { username_label.hint = context.getString(usernameLabelRes) } diff --git a/app/src/main/res/layout/pref_account_login.xml b/app/src/main/res/layout/pref_account_login.xml index 5776637dca..35254a738c 100644 --- a/app/src/main/res/layout/pref_account_login.xml +++ b/app/src/main/res/layout/pref_account_login.xml @@ -16,31 +16,25 @@ + android:layout_height="wrap_content" + android:inputType="text" /> + android:hint="@string/password" + app:endIconMode="password_toggle"> - - - + app:boxBackgroundMode="filled" + app:endIconMode="clear_text" + app:hintEnabled="false"> + + + +