Merge "Remove red underline from Device name"

This commit is contained in:
TreeHugger Robot
2018-08-24 16:02:14 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 1 deletions

View File

@@ -93,7 +93,8 @@ public class ValidatedEditTextPreference extends CustomEditTextPreferenceCompat
textView.setInputType(
InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
} else {
textView.setInputType(InputType.TYPE_CLASS_TEXT);
textView.setInputType(
InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
}
}

View File

@@ -131,4 +131,16 @@ public class ValidatedEditTextPreferenceTest {
& (InputType.TYPE_TEXT_VARIATION_PASSWORD | InputType.TYPE_CLASS_TEXT))
.isNotEqualTo(0);
}
@Test
public void bindViewHolder_isNotPassword_shouldNotAutoCorrectText() {
final TextView textView = spy(new TextView(RuntimeEnvironment.application));
when(mViewHolder.findViewById(android.R.id.summary)).thenReturn(textView);
mPreference.setIsSummaryPassword(false);
mPreference.onBindViewHolder(mViewHolder);
assertThat(textView.getInputType()).isEqualTo(
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_CLASS_TEXT);
}
}