FileDocCategorySizeDatePackage
FaceUnlockView.javaAPI DocAndroid 5.1 API2349Thu Mar 12 22:22:10 GMT 2015com.android.internal.widget

FaceUnlockView

public class FaceUnlockView extends android.widget.RelativeLayout

Fields Summary
private static final String
TAG
Constructors Summary
public FaceUnlockView(android.content.Context context)


       
        this(context, null);
    
public FaceUnlockView(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
    
Methods Summary
protected voidonMeasure(int widthMeasureSpec, int heightMeasureSpec)

        final int minimumWidth = getSuggestedMinimumWidth();
        final int minimumHeight = getSuggestedMinimumHeight();
        int viewWidth = resolveMeasured(widthMeasureSpec, minimumWidth);
        int viewHeight = resolveMeasured(heightMeasureSpec, minimumHeight);

        final int chosenSize = Math.min(viewWidth, viewHeight);
        final int newWidthMeasureSpec =
                MeasureSpec.makeMeasureSpec(chosenSize, MeasureSpec.AT_MOST);
        final int newHeightMeasureSpec =
                MeasureSpec.makeMeasureSpec(chosenSize, MeasureSpec.AT_MOST);

        super.onMeasure(newWidthMeasureSpec, newHeightMeasureSpec);
    
private intresolveMeasured(int measureSpec, int desired)

        int result = 0;
        int specSize = MeasureSpec.getSize(measureSpec);
        switch (MeasureSpec.getMode(measureSpec)) {
            case MeasureSpec.UNSPECIFIED:
                result = desired;
                break;
            case MeasureSpec.AT_MOST:
                result = Math.max(specSize, desired);
                break;
            case MeasureSpec.EXACTLY:
            default:
                result = specSize;
        }
        return result;