Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07457d42 authored by Siyamed Sinir's avatar Siyamed Sinir
Browse files

Update baseline api docs

* add an image for better description
* add constraints between TextView height and padding
* fix broken link (getLineSpacing)

Test: make -offline-sdk-docs
Test: Visual inspection on generated doc, screenshot attached to ticket
Bug: 74032223
Change-Id: I34b91454d3a43f8cb5a450c8d34de9f1abde0d52
parent 11701602
Loading
Loading
Loading
Loading
+19 −3
Original line number Diff line number Diff line
@@ -3270,14 +3270,22 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

    /**
     * Updates the top padding of the TextView so that {@code firstBaselineToTopHeight} is
     * equal to the distance between the firt text baseline and the top of this TextView.
     * the distance between the top of the TextView and first line's baseline.
     * <p>
     * <img src="{@docRoot}reference/android/images/text/widget/first_last_baseline.png" />
     * <figcaption>First and last baseline metrics for a TextView.</figcaption>
     *
     * <strong>Note</strong> that if {@code FontMetrics.top} or {@code FontMetrics.ascent} was
     * already greater than {@code firstBaselineToTopHeight}, the top padding is not updated.
     * Moreover since this function sets the top padding, if the height of the TextView is less than
     * the sum of top padding, line height and bottom padding, top of the line will be pushed
     * down and bottom will be clipped.
     *
     * @param firstBaselineToTopHeight distance between first baseline to top of the container
     *      in pixels
     *
     * @see #getFirstBaselineToTopHeight()
     * @see #setLastBaselineToBottomHeight(int)
     * @see #setPadding(int, int, int, int)
     * @see #setPaddingRelative(int, int, int, int)
     *
@@ -3305,14 +3313,22 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

    /**
     * Updates the bottom padding of the TextView so that {@code lastBaselineToBottomHeight} is
     * equal to the distance between the last text baseline and the bottom of this TextView.
     * the distance between the bottom of the TextView and the last line's baseline.
     * <p>
     * <img src="{@docRoot}reference/android/images/text/widget/first_last_baseline.png" />
     * <figcaption>First and last baseline metrics for a TextView.</figcaption>
     *
     * <strong>Note</strong> that if {@code FontMetrics.bottom} or {@code FontMetrics.descent} was
     * already greater than {@code lastBaselineToBottomHeight}, the bottom padding is not updated.
     * Moreover since this function sets the bottom padding, if the height of the TextView is less
     * than the sum of top padding, line height and bottom padding, bottom of the text will be
     * clipped.
     *
     * @param lastBaselineToBottomHeight distance between last baseline to bottom of the container
     *      in pixels
     *
     * @see #getLastBaselineToBottomHeight()
     * @see #setFirstBaselineToTopHeight(int)
     * @see #setPadding(int, int, int, int)
     * @see #setPaddingRelative(int, int, int, int)
     *
@@ -5184,7 +5200,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
     * @param lineHeight the line height in pixels
     *
     * @see #setLineSpacing(float, float)
     * @see #getLineSpacing()
     * @see #getLineSpacingExtra()
     *
     * @attr ref android.R.styleable#TextView_lineHeight
     */
+22 KiB
Loading image diff...