本文整理汇总了Java中com.github.johnpersano.supertoasts.library.Style.ANIMATIONS_POP属性的典型用法代码示例。如果您正苦于以下问题:Java Style.ANIMATIONS_POP属性的具体用法?Java Style.ANIMATIONS_POP怎么用?Java Style.ANIMATIONS_POP使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.github.johnpersano.supertoasts.library.Style
的用法示例。
在下文中一共展示了Style.ANIMATIONS_POP属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSystemAnimationsResource
/**
* Returns the corresponding system animation reference for a
* particular {@link Style.Animations} reference.
* This is used by the {@link com.github.johnpersano.supertoasts.library.SuperToast}
* {@link android.view.WindowManager}.
*
* @param animations The desired {@link Style.Animations} constant
* @return The corresponding system animation reference
*/
public static int getSystemAnimationsResource(@Style.Animations int animations) {
switch (animations) {
case Style.ANIMATIONS_FADE: return android.R.style.Animation_Toast;
case Style.ANIMATIONS_FLY: return android.R.style.Animation_Translucent;
case Style.ANIMATIONS_SCALE: return android.R.style.Animation_Dialog;
case Style.ANIMATIONS_POP: return android.R.style.Animation_InputMethod;
default: return android.R.style.Animation_Toast;
}
}
示例2: getHideAnimation
/**
* Returns the corresponding {@link Animator} for a particular
* {@link Style.Animations} reference.
* This is used when hiding a {@link SuperActivityToast}.
*
* @param superActivityToast {@link SuperActivityToast}
* @return The corresponding Animator
*/
public static Animator getHideAnimation(SuperActivityToast superActivityToast) {
final PropertyValuesHolder propertyValuesHolderAlpha = PropertyValuesHolder.ofFloat(ALPHA, 1f, 0f);
switch (superActivityToast.getAnimations()) {
case Style.ANIMATIONS_FADE:
return ObjectAnimator.ofPropertyValuesHolder(superActivityToast.getView(), propertyValuesHolderAlpha)
.setDuration(SHOW_DURATION);
case Style.ANIMATIONS_FLY:
final PropertyValuesHolder propertyValuesHolderX = PropertyValuesHolder.ofFloat(TRANSLATION_X, 0f, 500f);
return ObjectAnimator.ofPropertyValuesHolder(superActivityToast.getView(), propertyValuesHolderX,
propertyValuesHolderAlpha).setDuration(SHOW_DURATION);
case Style.ANIMATIONS_SCALE:
final PropertyValuesHolder propertyValuesHolderScaleX = PropertyValuesHolder.ofFloat(SCALE_X, 1f, 0f);
final PropertyValuesHolder propertyValuesHolderScaleY = PropertyValuesHolder.ofFloat(SCALE_Y, 1f, 0f);
return ObjectAnimator.ofPropertyValuesHolder(superActivityToast.getView(), propertyValuesHolderScaleX,
propertyValuesHolderScaleY, propertyValuesHolderAlpha).setDuration(SHOW_DURATION);
case Style.ANIMATIONS_POP:
final PropertyValuesHolder propertyValuesHolderY = PropertyValuesHolder.ofFloat(TRANSLATION_Y, 0f, 250f);
return ObjectAnimator.ofPropertyValuesHolder(superActivityToast.getView(), propertyValuesHolderY,
propertyValuesHolderAlpha).setDuration(SHOW_DURATION);
default:
return ObjectAnimator.ofPropertyValuesHolder(superActivityToast.getView(), propertyValuesHolderAlpha)
.setDuration(SHOW_DURATION);
}
}
示例3: getXPAnimations
public static int getXPAnimations(XSharedPreferences xpref) {
switch (xpref.getInt(Common.KEY_TOAST_ANIMATIONS,0)) {
case 0: return Style.ANIMATIONS_FLY;
case 1: return Style.ANIMATIONS_FADE;
case 2: return Style.ANIMATIONS_SCALE;
case 3: return Style.ANIMATIONS_POP;
default: return Style.ANIMATIONS_FLY;
}
}
示例4: getAnimations
public static int getAnimations(Context context) {
switch (PreferenceManager.getDefaultSharedPreferences(context).getInt(context
.getResources().getString(R.string.animation_title), 0)) {
case 0: return Style.ANIMATIONS_FADE;
case 1: return Style.ANIMATIONS_FLY;
case 2: return Style.ANIMATIONS_SCALE;
case 3: return Style.ANIMATIONS_POP;
default: return Style.ANIMATIONS_FADE;
}
}
示例5: getShowAnimation
/**
* Returns the corresponding {@link Animator} for a particular
* {@link Style.Animations} reference.
* This is used by the {@link com.github.johnpersano.supertoasts.library.Toaster}
* when showing a {@link SuperActivityToast} and has no purpose being called directly.
*
* @param superActivityToast The SuperActivityToast being animated
* @return The corresponding Animator
*/
public static Animator getShowAnimation(SuperActivityToast superActivityToast) {
final PropertyValuesHolder propertyValuesHolderAlpha = PropertyValuesHolder
.ofFloat(ALPHA, 0f, 1f);
switch (superActivityToast.getAnimations()) {
case Style.ANIMATIONS_FADE:
return ObjectAnimator.ofPropertyValuesHolder(superActivityToast.getView(),
propertyValuesHolderAlpha)
.setDuration(SHOW_DURATION);
case Style.ANIMATIONS_FLY:
final PropertyValuesHolder propertyValuesHolderX = PropertyValuesHolder.
ofFloat(TRANSLATION_X, -500f, 0f);
return ObjectAnimator.ofPropertyValuesHolder(superActivityToast.getView(),
propertyValuesHolderX,
propertyValuesHolderAlpha).setDuration(SHOW_DURATION);
case Style.ANIMATIONS_SCALE:
final PropertyValuesHolder propertyValuesHolderScaleX = PropertyValuesHolder
.ofFloat(SCALE_X, 0f, 1f);
final PropertyValuesHolder propertyValuesHolderScaleY = PropertyValuesHolder
.ofFloat(SCALE_Y, 0f, 1f);
return ObjectAnimator.ofPropertyValuesHolder(superActivityToast.getView(),
propertyValuesHolderScaleX,
propertyValuesHolderScaleY, propertyValuesHolderAlpha)
.setDuration(SHOW_DURATION);
case Style.ANIMATIONS_POP:
final PropertyValuesHolder propertyValuesHolderY = PropertyValuesHolder
.ofFloat(TRANSLATION_Y, 250f, 0f);
return ObjectAnimator.ofPropertyValuesHolder(superActivityToast.getView(),
propertyValuesHolderY,
propertyValuesHolderAlpha).setDuration(SHOW_DURATION);
default:
return ObjectAnimator.ofPropertyValuesHolder(superActivityToast.getView(),
propertyValuesHolderAlpha)
.setDuration(SHOW_DURATION);
}
}