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

Commit 04347df8 authored by Tyler Freeman's avatar Tyler Freeman Committed by Android (Google) Code Review
Browse files

Merge "docs(non linear font scaling): deprecate TypedValue.scaledDensity and...

Merge "docs(non linear font scaling): deprecate TypedValue.scaledDensity and add warning on Configuration.fontScale"
parents 5f090c4b c64189b0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -48672,7 +48672,7 @@ package android.util {
    field public float density;
    field public int densityDpi;
    field public int heightPixels;
    field public float scaledDensity;
    field @Deprecated public float scaledDensity;
    field public int widthPixels;
    field public float xdpi;
    field public float ydpi;
+8 −0
Original line number Diff line number Diff line
@@ -98,6 +98,14 @@ public final class Configuration implements Parcelable, Comparable<Configuration
    /**
     * Current user preference for the scaling factor for fonts, relative
     * to the base density scaling.
     *
     * <p>Note: Please do not use this to hardcode font size equations. The equation for font
     * scaling is now non-linear; this coefficient is no longer used as a direct multiplier to
     * determine font size. It exists for informational purposes only.
     *
     * <p>Please use {@link android.util.TypedValue#applyDimension(int, float, DisplayMetrics)} or
     * {@link android.util.TypedValue#deriveDimension(int, float, DisplayMetrics)} to convert
     * between scaled font size dimensions and pixels.
     */
    public float fontScale;

+6 −0
Original line number Diff line number Diff line
@@ -283,7 +283,13 @@ public class DisplayMetrics {
     * A scaling factor for fonts displayed on the display.  This is the same
     * as {@link #density}, except that it may be adjusted in smaller
     * increments at runtime based on a user preference for the font size.
     *
     * @deprecated this scalar factor is no longer accurate due to adaptive non-linear font scaling.
     *  Please use {@link TypedValue#applyDimension(int, float, DisplayMetrics)} or
     *  {@link TypedValue#deriveDimension(int, float, DisplayMetrics)} to convert between SP font
     *  sizes and pixels.
     */
    @Deprecated
    public float scaledDensity;

    /**