Methods Summary |
---|
protected boolean | checkLayoutParams(ViewGroup.LayoutParams p)
return p instanceof LayoutParams;
|
protected ViewGroup.LayoutParams | generateLayoutParams(ViewGroup.LayoutParams p)
return p instanceof LayoutParams ? new LayoutParams((LayoutParams) p) : new LayoutParams(p);
|
public com.android.keyguard.KeyguardSecurityViewFlipper$LayoutParams | generateLayoutParams(android.util.AttributeSet attrs)
return new LayoutParams(getContext(), attrs);
|
public KeyguardSecurityCallback | getCallback()
KeyguardSecurityView ksv = getSecurityView();
return (ksv != null) ? ksv.getCallback() : null;
|
KeyguardSecurityView | getSecurityView()
View child = getChildAt(getDisplayedChild());
if (child instanceof KeyguardSecurityView) {
return (KeyguardSecurityView) child;
}
return null;
|
public void | hideBouncer(int duration)
KeyguardSecurityView active = getSecurityView();
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child instanceof KeyguardSecurityView) {
KeyguardSecurityView ksv = (KeyguardSecurityView) child;
ksv.hideBouncer(ksv == active ? duration : 0);
}
}
|
private int | makeChildMeasureSpec(int maxSize, int childDimen)
final int mode;
final int size;
switch (childDimen) {
case LayoutParams.WRAP_CONTENT:
mode = MeasureSpec.AT_MOST;
size = maxSize;
break;
case LayoutParams.MATCH_PARENT:
mode = MeasureSpec.EXACTLY;
size = maxSize;
break;
default:
mode = MeasureSpec.EXACTLY;
size = Math.min(maxSize, childDimen);
break;
}
return MeasureSpec.makeMeasureSpec(size, mode);
|
public boolean | needsInput()
KeyguardSecurityView ksv = getSecurityView();
return (ksv != null) ? ksv.needsInput() : false;
|
protected void | onMeasure(int widthSpec, int heightSpec)
final int widthMode = MeasureSpec.getMode(widthSpec);
final int heightMode = MeasureSpec.getMode(heightSpec);
if (DEBUG && widthMode != MeasureSpec.AT_MOST) {
Log.w(TAG, "onMeasure: widthSpec " + MeasureSpec.toString(widthSpec) +
" should be AT_MOST");
}
if (DEBUG && heightMode != MeasureSpec.AT_MOST) {
Log.w(TAG, "onMeasure: heightSpec " + MeasureSpec.toString(heightSpec) +
" should be AT_MOST");
}
final int widthSize = MeasureSpec.getSize(widthSpec);
final int heightSize = MeasureSpec.getSize(heightSpec);
int maxWidth = widthSize;
int maxHeight = heightSize;
final int count = getChildCount();
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
if (lp.maxWidth > 0 && lp.maxWidth < maxWidth) {
maxWidth = lp.maxWidth;
}
if (lp.maxHeight > 0 && lp.maxHeight < maxHeight) {
maxHeight = lp.maxHeight;
}
}
final int wPadding = getPaddingLeft() + getPaddingRight();
final int hPadding = getPaddingTop() + getPaddingBottom();
maxWidth -= wPadding;
maxHeight -= hPadding;
int width = widthMode == MeasureSpec.EXACTLY ? widthSize : 0;
int height = heightMode == MeasureSpec.EXACTLY ? heightSize : 0;
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
final int childWidthSpec = makeChildMeasureSpec(maxWidth, lp.width);
final int childHeightSpec = makeChildMeasureSpec(maxHeight, lp.height);
child.measure(childWidthSpec, childHeightSpec);
width = Math.max(width, Math.min(child.getMeasuredWidth(), widthSize - wPadding));
height = Math.max(height, Math.min(child.getMeasuredHeight(), heightSize - hPadding));
}
setMeasuredDimension(width + wPadding, height + hPadding);
|
public void | onPause()
KeyguardSecurityView ksv = getSecurityView();
if (ksv != null) {
ksv.onPause();
}
|
public void | onResume(int reason)
KeyguardSecurityView ksv = getSecurityView();
if (ksv != null) {
ksv.onResume(reason);
}
|
public boolean | onTouchEvent(android.view.MotionEvent ev)
boolean result = super.onTouchEvent(ev);
mTempRect.set(0, 0, 0, 0);
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child.getVisibility() == View.VISIBLE) {
offsetRectIntoDescendantCoords(child, mTempRect);
ev.offsetLocation(mTempRect.left, mTempRect.top);
result = child.dispatchTouchEvent(ev) || result;
ev.offsetLocation(-mTempRect.left, -mTempRect.top);
}
}
return result;
|
public void | reset()
KeyguardSecurityView ksv = getSecurityView();
if (ksv != null) {
ksv.reset();
}
|
public void | setKeyguardCallback(KeyguardSecurityCallback callback)
KeyguardSecurityView ksv = getSecurityView();
if (ksv != null) {
ksv.setKeyguardCallback(callback);
}
|
public void | setLockPatternUtils(com.android.internal.widget.LockPatternUtils utils)
KeyguardSecurityView ksv = getSecurityView();
if (ksv != null) {
ksv.setLockPatternUtils(utils);
}
|
public void | showBouncer(int duration)
KeyguardSecurityView active = getSecurityView();
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child instanceof KeyguardSecurityView) {
KeyguardSecurityView ksv = (KeyguardSecurityView) child;
ksv.showBouncer(ksv == active ? duration : 0);
}
}
|
public void | showUsabilityHint()
KeyguardSecurityView ksv = getSecurityView();
if (ksv != null) {
ksv.showUsabilityHint();
}
|
public void | startAppearAnimation()
KeyguardSecurityView ksv = getSecurityView();
if (ksv != null) {
ksv.startAppearAnimation();
}
|
public boolean | startDisappearAnimation(java.lang.Runnable finishRunnable)
KeyguardSecurityView ksv = getSecurityView();
if (ksv != null) {
return ksv.startDisappearAnimation(finishRunnable);
} else {
return false;
}
|