OSDN Git Service

setTransformationMethod should reset mTextDir
authorSiyamed Sinir <siyamed@google.com>
Fri, 20 May 2016 01:26:09 +0000 (18:26 -0700)
committerSiyamed Sinir <siyamed@google.com>
Fri, 20 May 2016 01:30:38 +0000 (18:30 -0700)
When transformation method is set via API, text direction heuristics has
to be reset since for PasswordTransformationMethod it is set to LTR. Not
resetting it causes inconsistencies with the remaining of the TextView.

Bug: 28562779
Change-Id: I225e35e39bde60d4296852ff17b107d5b7b99f8a

core/java/android/widget/TextView.java

index 3909307..f62e6ff 100644 (file)
@@ -1939,6 +1939,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
             notifyViewAccessibilityStateChangedIfNeeded(
                     AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED);
         }
+
+        // PasswordTransformationMethod always have LTR text direction heuristics returned by
+        // getTextDirectionHeuristic, needs reset
+        mTextDir = getTextDirectionHeuristic();
     }
 
     /**