Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timob-7260: reset typeface when password input is set. #5656

Merged
merged 1 commit into from May 7, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -19,6 +19,7 @@

import android.content.Context;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.os.Build;
import android.text.Editable;
import android.text.InputType;
Expand Down Expand Up @@ -513,9 +514,13 @@ protected char[] getAcceptedChars() {

if (passwordMask) {
textTypeAndClass |= InputType.TYPE_TEXT_VARIATION_PASSWORD;
Typeface origTF = tv.getTypeface();
// Sometimes password transformation does not work properly when the input type is set after the transformation method.
// This issue has been filed at http://code.google.com/p/android/issues/detail?id=7092
tv.setInputType(textTypeAndClass);
// Workaround for https://code.google.com/p/android/issues/detail?id=55418 since setInputType
// with InputType.TYPE_TEXT_VARIATION_PASSWORD sets the typeface to monospace.
tv.setTypeface(origTF);
tv.setTransformationMethod(PasswordTransformationMethod.getInstance());

//turn off text UI in landscape mode b/c Android numeric passwords are not masked correctly in landscape mode.
Expand Down