OSDN Git Service

Update BoringLayout.isBoring Javadoc
authorSeigo Nonaka <nona@google.com>
Sat, 12 Jan 2019 01:13:16 +0000 (17:13 -0800)
committerSeigo Nonaka <nona@google.com>
Tue, 29 Jan 2019 23:14:19 +0000 (15:14 -0800)
Bug: N/A
Test: TreeHugger

Change-Id: I92fe34eb34facc6011843d679feb78ff0ea44087

core/java/android/text/BoringLayout.java

index 2b33fae..cf6987c 100644 (file)
@@ -272,16 +272,27 @@ public class BoringLayout extends Layout implements TextUtils.EllipsizeCallback
     }
 
     /**
-     * Returns null if not boring; the width, ascent, and descent if boring.
+     * Determine and compute metrics if given text can be handled by BoringLayout.
+     *
+     * @param text a text
+     * @param paint a paint
+     * @return layout metric for the given text. null if given text is unable to be handled by
+     *         BoringLayout.
      */
     public static Metrics isBoring(CharSequence text, TextPaint paint) {
         return isBoring(text, paint, TextDirectionHeuristics.FIRSTSTRONG_LTR, null);
     }
 
     /**
-     * Returns null if not boring; the width, ascent, and descent in the
-     * provided Metrics object (or a new one if the provided one was null)
-     * if boring.
+     * Determine and compute metrics if given text can be handled by BoringLayout.
+     *
+     * @param text a text
+     * @param paint a paint
+     * @param metrics a metrics object to be recycled. If null is passed, this function creat new
+     *                object.
+     * @return layout metric for the given text. If metrics is not null, this method fills values
+     *         to given metrics object instead of allocating new metrics object. null if given text
+     *         is unable to be handled by BoringLayout.
      */
     public static Metrics isBoring(CharSequence text, TextPaint paint, Metrics metrics) {
         return isBoring(text, paint, TextDirectionHeuristics.FIRSTSTRONG_LTR, metrics);