/**
* Animates the tooltip into view with a simple slide and fade animation,
* then schedules the tooltip to automatically dismiss itself.
*
* @param onDismissListener A functor to call if the tooltip is dismissed without user intervention.
*/
private void animateInText(final @NonNull OnDismissListener onDismissListener) {
final int overlap = getResources().getDimensionPixelSize(R.dimen.view_info_tooltip_overlap);
animatorFor(text, animatorContext)
.withInterpolator(new FastOutLinearInInterpolator())
.slideYAndFade(overlap, 0f, 0f, 1f)
.addOnAnimationCompleted(new OnAnimationCompleted() {
@Override
public void onAnimationCompleted(boolean finished) {
postDelayed(new Runnable() {
@Override
public void run() {
if (Anime.isAnimating(text) || !isShown()) {
return;
}
onDismissListener.onInfoTooltipDismissed();
dismiss(false);
}
}, VISIBLE_DURATION);
}
})
.start();
}
InfoTooltipView.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:anime-android-go-99
作者:
评论列表
文章目录