bdlukaa / native_admob_flutter

Easy-to-make native ads in flutter using AdMOB SDK.
https://pub.dev/packages/native_admob_flutter
BSD 3-Clause "New" or "Revised" License
80 stars 56 forks source link

Add textSizeUnit property in NativeAd #89

Closed jja08111 closed 3 years ago

jja08111 commented 3 years ago

This makes the plugin can use the textSizeUnit property.

bdlukaa commented 3 years ago

hmm.. why?

jja08111 commented 3 years ago

For example, you can use the dip attribute to fix text size regardless of the device's font size settings. Similar to textScaleFactor in flutter.

android.util.TypedValue.java

/** Complex data: bit location of unit information. */
...

 /** {@link #TYPE_DIMENSION} complex unit: Value is raw pixels. */
    public static final int COMPLEX_UNIT_PX = 0;
    /** {@link #TYPE_DIMENSION} complex unit: Value is Device Independent
     *  Pixels. */
    public static final int COMPLEX_UNIT_DIP = 1;
    /** {@link #TYPE_DIMENSION} complex unit: Value is a scaled pixel. */
    public static final int COMPLEX_UNIT_SP = 2;
    /** {@link #TYPE_DIMENSION} complex unit: Value is in points. */
    public static final int COMPLEX_UNIT_PT = 3;
    /** {@link #TYPE_DIMENSION} complex unit: Value is in inches. */
    public static final int COMPLEX_UNIT_IN = 4;
    /** {@link #TYPE_DIMENSION} complex unit: Value is in millimeters. */
    public static final int COMPLEX_UNIT_MM = 5;