FileDocCategorySizeDatePackage
MagnificationSpec.javaAPI DocAndroid 5.1 API3531Thu Mar 12 22:22:10 GMT 2015android.view

MagnificationSpec

public class MagnificationSpec extends Object implements android.os.Parcelable
This class represents spec for performing screen magnification.
hide

Fields Summary
private static final int
MAX_POOL_SIZE
private static final android.util.Pools.SynchronizedPool
sPool
public float
scale
public float
offsetX
public float
offsetY
public static final Creator
CREATOR
Constructors Summary
private MagnificationSpec()


      
        /* do nothing - reducing visibility */
    
Methods Summary
public voidclear()

       scale = 1.0f;
       offsetX = 0.0f;
       offsetY = 0.0f;
    
public intdescribeContents()

        return 0;
    
private voidinitFromParcel(android.os.Parcel parcel)

        scale = parcel.readFloat();
        offsetX = parcel.readFloat();
        offsetY = parcel.readFloat();
    
public voidinitialize(float scale, float offsetX, float offsetY)

        if (scale < 1) {
            throw new IllegalArgumentException("Scale must be greater than or equal to one!");
        }
        this.scale = scale;
        this.offsetX = offsetX;
        this.offsetY = offsetY;
    
public booleanisNop()

        return scale == 1.0f && offsetX == 0 && offsetY == 0;
    
public static android.view.MagnificationSpecobtain(android.view.MagnificationSpec other)

        MagnificationSpec info = obtain();
        info.scale = other.scale;
        info.offsetX = other.offsetX;
        info.offsetY = other.offsetY;
        return info;
    
public static android.view.MagnificationSpecobtain()

        MagnificationSpec spec = sPool.acquire();
        return (spec != null) ? spec : new MagnificationSpec();
    
public voidrecycle()

        clear();
        sPool.release(this);
    
public java.lang.StringtoString()

        StringBuilder builder = new StringBuilder();
        builder.append("<scale:");
        builder.append(scale);
        builder.append(",offsetX:");
        builder.append(offsetX);
        builder.append(",offsetY:");
        builder.append(offsetY);
        builder.append(">");
        return builder.toString();
    
public voidwriteToParcel(android.os.Parcel parcel, int flags)

        parcel.writeFloat(scale);
        parcel.writeFloat(offsetX);
        parcel.writeFloat(offsetY);
        recycle();