sharedModule/src/main/java/ru/nekit/android/qls/widget/AutofitHelper.java
/**
     * Creates a new instance of {@code AutofitHelper} that wraps a {@link TextView} and enables
     * automatically sizing the text to fit.
     */
Creates a new instance of  AutofitHelper that wraps a  TextView and enables
automatically sizing the text to fit.
Creates a new instance of AutofitHelper that wraps a TextView and enables automatically sizing the text to fit .
public static AutofitHelper create(TextView view, AttributeSet attrs, int defStyle) {
        AutofitHelper helper = new AutofitHelper(view);
        boolean sizeToFit = true;
        if (attrs != null) {
            Context context = view.getContext();
            int minTextSize = (int) helper.getMinTextSize();
            float precision = helper.getPrecision();
            TypedArray ta = context.obtainStyledAttributes(
                    attrs,
                    R.styleable.AutofitTextView,
                    defStyle,
                    0);
            sizeToFit = ta.getBoolean(R.styleable.AutofitTextView_sizeToFit, sizeToFit);
            minTextSize = ta.getDimensionPixelSize(R.styleable.AutofitTextView_minTextSize,
                    minTextSize);
            precision = ta.getFloat(R.styleable.AutofitTextView_precision, precision);
            ta.recycle();
            helper.setMinTextSize(TypedValue.COMPLEX_UNIT_PX, minTextSize)
                    .setPrecision(precision);
        }
        helper.setEnabled(sizeToFit);
        return helper;
    }
public static AutofitHelper create ( TextView view , AttributeSet attrs , int defStyle ) { AutofitHelper helper = new AutofitHelper ( view ) ; boolean sizeToFit = true ; if ( attrs != null ) { Context context = view . getContext ( ) ; int minTextSize = ( int ) helper . getMinTextSize ( ) ; float precision = helper . getPrecision ( ) ; TypedArray ta = context . obtainStyledAttributes ( attrs , R . styleable . AutofitTextView , defStyle , 0 ) ; sizeToFit = ta . getBoolean ( R . styleable . AutofitTextView_sizeToFit , sizeToFit ) ; minTextSize = ta . getDimensionPixelSize ( R . styleable . AutofitTextView_minTextSize , minTextSize ) ; precision = ta . getFloat ( R . styleable . AutofitTextView_precision , precision ) ; ta . recycle ( ) ; helper . setMinTextSize ( TypedValue . COMPLEX_UNIT_PX , minTextSize ) . setPrecision ( precision ) ; } helper . setEnabled ( sizeToFit ) ; return helper ; }
Creates a new instance of {@code AutofitHelper} that wraps a {@link TextView} and enables
 automatically sizing the text to fit.
Creates a new instance of { @code AutofitHelper } that wraps a { @link TextView } and enables automatically sizing the text to fit .