am 8de2cf4c: merge from open-source master

Merge commit '8de2cf4cce9ae2e121fccb4732fd23c64aace102' into kraken

* commit '8de2cf4cce9ae2e121fccb4732fd23c64aace102':
  Fix last character of password field being visible after rotation
  gl_code : add end of line.
This commit is contained in:
The Android Open Source Project
2010-03-31 14:17:32 -07:00
committed by Android Git Automerger
2 changed files with 13 additions and 9 deletions

View File

@@ -51,6 +51,8 @@ implements TransformationMethod, TextWatcher
sp.removeSpan(vr[i]);
}
removeVisibleSpans(sp);
sp.setSpan(new ViewReference(view), 0, 0,
Spannable.SPAN_POINT_POINT);
}
@@ -100,10 +102,7 @@ implements TransformationMethod, TextWatcher
int pref = TextKeyListener.getInstance().getPrefs(v.getContext());
if ((pref & TextKeyListener.SHOW_PASSWORD) != 0) {
if (count > 0) {
Visible[] old = sp.getSpans(0, sp.length(), Visible.class);
for (int i = 0; i < old.length; i++) {
sp.removeSpan(old[i]);
}
removeVisibleSpans(sp);
if (count == 1) {
sp.setSpan(new Visible(sp, this), start, start + count,
@@ -125,14 +124,18 @@ implements TransformationMethod, TextWatcher
if (sourceText instanceof Spannable) {
Spannable sp = (Spannable) sourceText;
Visible[] old = sp.getSpans(0, sp.length(), Visible.class);
for (int i = 0; i < old.length; i++) {
sp.removeSpan(old[i]);
}
removeVisibleSpans(sp);
}
}
}
private static void removeVisibleSpans(Spannable sp) {
Visible[] old = sp.getSpans(0, sp.length(), Visible.class);
for (int i = 0; i < old.length; i++) {
sp.removeSpan(old[i]);
}
}
private static class PasswordCharSequence
implements CharSequence, GetChars
{

View File

@@ -180,4 +180,5 @@ JNIEXPORT void JNICALL Java_com_android_gljni_GLJNILib_step(JNIEnv * env, jobjec
JNIEXPORT void JNICALL Java_com_android_gljni_GLJNILib_changeBackground(JNIEnv * env, jobject obj)
{
background = 1.0f - background;
}
}