Commit f5389c9e authored by siashah's avatar siashah Committed by Commit Bot

Hide the char counter when nickname not focused

Video: https://drive.google.com/file/d/138nyvCrRQd80CHFlAWQlE13Lkp-dFyms/view?usp=sharing

Bug: 1082013
Change-Id: Icef37cfd081eb92be14fed1abe9faf90b2080508
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2225283Reviewed-by: default avatarJared Saul <jsaul@google.com>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Siddharth Shah <siashah@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774910}
parent ebf599de
...@@ -113,7 +113,6 @@ ...@@ -113,7 +113,6 @@
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/credit_card_nickname_label" android:id="@+id/credit_card_nickname_label"
android:labelFor="@+id/credit_card_nickname_edit" android:labelFor="@+id/credit_card_nickname_edit"
app:counterEnabled="true"
app:counterMaxLength="25" app:counterMaxLength="25"
app:errorEnabled="true" app:errorEnabled="true"
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -78,6 +78,8 @@ public class AutofillLocalCardEditor extends AutofillCreditCardEditor { ...@@ -78,6 +78,8 @@ public class AutofillLocalCardEditor extends AutofillCreditCardEditor {
// Set the visibility of the nickname field based on the experiment flag. // Set the visibility of the nickname field based on the experiment flag.
mNicknameLabel.setVisibility(isNicknameManagementEnabled() ? View.VISIBLE : View.GONE); mNicknameLabel.setVisibility(isNicknameManagementEnabled() ? View.VISIBLE : View.GONE);
mNicknameText.addTextChangedListener(nicknameTextWatcher()); mNicknameText.addTextChangedListener(nicknameTextWatcher());
mNicknameText.setOnFocusChangeListener(
(view, hasFocus) -> mNicknameLabel.setCounterEnabled(hasFocus));
// Set text watcher to format credit card number // Set text watcher to format credit card number
mNumberText.addTextChangedListener(new CreditCardNumberFormattingTextWatcher()); mNumberText.addTextChangedListener(new CreditCardNumberFormattingTextWatcher());
......
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