diff options
| author | Raph Levien <raph@google.com> | 2013-09-30 14:12:47 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-30 14:12:47 -0700 |
| commit | 8ba675293542050e74375981a009b72513ceec88 (patch) | |
| tree | efaf985832675df5f71a0712e638ff4ac41e01b9 /core/java/android/widget/TextView.java | |
| parent | b12db27b3205a72ae11546c8f78b0ea8728dc23b (diff) | |
| parent | adf149029f701464c66cc5cacbbbc649c1319bcd (diff) | |
am adf14902: Merge "Fix for Text fading on RTL app names is done at the beginning..." into klp-dev
* commit 'adf149029f701464c66cc5cacbbbc649c1319bcd':
Fix for Text fading on RTL app names is done at the beginning...
Diffstat (limited to 'core/java/android/widget/TextView.java')
| -rw-r--r-- | core/java/android/widget/TextView.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 8fca0df23f94..ba1effbbdf9f 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -7842,7 +7842,15 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener getCompoundPaddingLeft() - getCompoundPaddingRight() - mLayout.getLineLeft(0)) / getHorizontalFadingEdgeLength(); case Gravity.CENTER_HORIZONTAL: - return 0.0f; + case Gravity.FILL_HORIZONTAL: + final int textDirection = mLayout.getParagraphDirection(0); + if (textDirection == Layout.DIR_LEFT_TO_RIGHT) { + return 0.0f; + } else { + return (mLayout.getLineRight(0) - (mRight - mLeft) - + getCompoundPaddingLeft() - getCompoundPaddingRight() - + mLayout.getLineLeft(0)) / getHorizontalFadingEdgeLength(); + } } } } @@ -7871,9 +7879,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return 0.0f; case Gravity.CENTER_HORIZONTAL: case Gravity.FILL_HORIZONTAL: - return (mLayout.getLineWidth(0) - ((mRight - mLeft) - + final int textDirection = mLayout.getParagraphDirection(0); + if (textDirection == Layout.DIR_RIGHT_TO_LEFT) { + return 0.0f; + } else { + return (mLayout.getLineWidth(0) - ((mRight - mLeft) - getCompoundPaddingLeft() - getCompoundPaddingRight())) / getHorizontalFadingEdgeLength(); + } } } } |
