diff options
| author | Siyamed Sinir <siyamed@google.com> | 2017-08-24 19:59:22 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-08-24 19:59:22 +0000 |
| commit | faba49c4d3f2bada7a25e6d84be0518bb06eb00e (patch) | |
| tree | 40a56975ce3f93c66639b0c137199a17cf969278 /core/java/android/text/StaticLayout.java | |
| parent | 7ee92d52918363c70b889e57c471d1e7475cb4a2 (diff) | |
| parent | 261118009def6217cdd70e3b3e76ef4648a223f5 (diff) | |
Merge changes from topic "siyamed_maxlines" into oc-mr1-dev
* changes:
StaticLayout capped height should be 0 when maxLines=0
Reset StaticLayout.mEllipsized during generate()
Diffstat (limited to 'core/java/android/text/StaticLayout.java')
| -rw-r--r-- | core/java/android/text/StaticLayout.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java index a8c6aa6cbbbb..a03a4fbd5243 100644 --- a/core/java/android/text/StaticLayout.java +++ b/core/java/android/text/StaticLayout.java @@ -608,6 +608,8 @@ public class StaticLayout extends Layout { b.setLocales(paint.getTextLocales()); mLineCount = 0; + mEllipsized = false; + mMaxLineHeight = mMaximumVisibleLineCount < 1 ? 0 : DEFAULT_MAX_LINE_HEIGHT; int v = 0; boolean needMultiply = (spacingmult != 1 || spacingadd != 0); @@ -1366,7 +1368,7 @@ public class StaticLayout extends Layout { * The value is the same as getLineTop(maxLines) for ellipsized version where structurally no * more than maxLines is contained. */ - private int mMaxLineHeight = -1; + private int mMaxLineHeight = DEFAULT_MAX_LINE_HEIGHT; private static final int COLUMNS_NORMAL = 4; private static final int COLUMNS_ELLIPSIZE = 6; @@ -1394,6 +1396,8 @@ public class StaticLayout extends Layout { private static final double EXTRA_ROUNDING = 0.5; + private static final int DEFAULT_MAX_LINE_HEIGHT = -1; + // This is used to return three arrays from a single JNI call when // performing line breaking /*package*/ static class LineBreaks { |
