summaryrefslogtreecommitdiff
path: root/core/java/android/text/Layout.java
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2011-01-14 12:12:04 -0800
committerGilles Debunne <debunne@google.com>2011-01-30 18:23:13 -0800
commit0a4db3c5270440eeb7e4e44a7029926e239ec3bd (patch)
tree93978bf40f919f8c833a7fefac5727109d212efb /core/java/android/text/Layout.java
parentcd73d1ed6d1149a2ae642e87ffe8d89100fbafec (diff)
Pixel were missing on the last line of text when using MaxLines.
Bug 3295544 Only the last line of text includes the bottomPadding (extra line spacing below the characters' descent. When The text is clipped using maxLines, the desired height correctly added this value, but getLineTop and getLineDescent are also used when the layout is drawn. The fix is to make the layout aware of its clipping so that these values are correctly updated. Change-Id: I703656cf45022d34a90f55f0ed8fc5e4b30f80b1
Diffstat (limited to 'core/java/android/text/Layout.java')
-rw-r--r--core/java/android/text/Layout.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java
index 3fe4f4c936a2..8700af802ae6 100644
--- a/core/java/android/text/Layout.java
+++ b/core/java/android/text/Layout.java
@@ -1764,4 +1764,15 @@ public abstract class Layout {
new Directions(new int[] { 0, RUN_LENGTH_MASK });
/* package */ static final Directions DIRS_ALL_RIGHT_TO_LEFT =
new Directions(new int[] { 0, RUN_LENGTH_MASK | RUN_RTL_FLAG });
+
+ /**
+ * Inform this layout that not all of its lines will be displayed, because a maximum number of
+ * lines has been set on the associated TextView.
+ *
+ * A non positive value means that all lines are displayed.
+ *
+ * @param line line number of the last visible line (line numbers start at 1 for the first line)
+ * @hide
+ */
+ public void setMaximumVisibleLineCount(int line) {}
}