动画不适用于标记点击(仅第一次点击)
Animation not working on marker click(Only 1st click)
当我第一次点击标记时,视图突然出现在屏幕上,然后我再次点击标记,视图出现在淡入动画中。
动画不适用于第一次点击标记。
@Override
public boolean onMarkerClick(Marker marker) {
final Animation animationFadeIn = AnimationUtils.loadAnimation(getContext(), R.anim.fadein);
animationFadeIn.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
Log.d(TAG, "animation start");
}
@Override
public void onAnimationEnd(Animation animation) {
Log.d(TAG, "animation end");
profile_details.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
profile_details.startAnimation(animationFadeIn);
return true;
}
只需移动 onAnimationStart() 中的 profile_details.setVisibilty(VISIBLE)。
当我第一次点击标记时,视图突然出现在屏幕上,然后我再次点击标记,视图出现在淡入动画中。 动画不适用于第一次点击标记。
@Override
public boolean onMarkerClick(Marker marker) {
final Animation animationFadeIn = AnimationUtils.loadAnimation(getContext(), R.anim.fadein);
animationFadeIn.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
Log.d(TAG, "animation start");
}
@Override
public void onAnimationEnd(Animation animation) {
Log.d(TAG, "animation end");
profile_details.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
profile_details.startAnimation(animationFadeIn);
return true;
}
只需移动 onAnimationStart() 中的 profile_details.setVisibilty(VISIBLE)。