KeyguardSecurityViewHelperpublic class KeyguardSecurityViewHelper extends Object Some common functions that are useful for KeyguardSecurityViews. |
Methods Summary |
---|
public static void | hideBouncer(SecurityMessageDisplay securityMessageDisplay, android.view.View ecaView, android.graphics.drawable.Drawable bouncerFrame, int duration)
if (securityMessageDisplay != null) {
securityMessageDisplay.hideBouncer(duration);
}
if (ecaView != null) {
ecaView.setVisibility(View.VISIBLE);
if (duration > 0) {
Animator anim = ObjectAnimator.ofFloat(ecaView, "alpha", 1f);
anim.setDuration(duration);
anim.start();
} else {
ecaView.setAlpha(1f);
}
}
if (bouncerFrame != null) {
if (duration > 0) {
Animator anim = ObjectAnimator.ofInt(bouncerFrame, "alpha", 255, 0);
anim.setDuration(duration);
anim.start();
} else {
bouncerFrame.setAlpha(0);
}
}
| public static void | showBouncer(SecurityMessageDisplay securityMessageDisplay, android.view.View ecaView, android.graphics.drawable.Drawable bouncerFrame, int duration)
if (securityMessageDisplay != null) {
securityMessageDisplay.showBouncer(duration);
}
if (ecaView != null) {
if (duration > 0) {
Animator anim = ObjectAnimator.ofFloat(ecaView, "alpha", 0f);
anim.setDuration(duration);
anim.addListener(new AnimatorListenerAdapter() {
private boolean mCanceled;
@Override
public void onAnimationCancel(Animator animation) {
// Fail safe and show the emergency button in onAnimationEnd()
mCanceled = true;
ecaView.setAlpha(1f);
}
@Override
public void onAnimationEnd(Animator animation) {
ecaView.setVisibility(mCanceled ? View.VISIBLE : View.INVISIBLE);
}
});
anim.start();
} else {
ecaView.setAlpha(0f);
ecaView.setVisibility(View.INVISIBLE);
}
}
if (bouncerFrame != null) {
if (duration > 0) {
Animator anim = ObjectAnimator.ofInt(bouncerFrame, "alpha", 0, 255);
anim.setDuration(duration);
anim.start();
} else {
bouncerFrame.setAlpha(255);
}
}
|
|