私は小さなプロジェクト、イメージボード用のアプリケーションに取り組んでいます。私は100%マテリアルデザインを実装しようとしています。アニメーションをビュー遷移にフックする
https://www.youtube.com/watch?v=Tr6U3hclx8I
私は、各項目が持っているオーバーレイ用の小さなフェージングアニメーションを追加したいです。いくつかの項目をタップするとわかるように、上と下のオーバーレイの両方がフェードアウトのアニメーションを実行しています。物事は、それが戻ってきたときにアニメーションがちょっとぎこちないように見えます。ディテールからのイメージが縮小して元の位置に戻ってきてから、上下のオーバーレイにアニメーションがフェードインして戻ってくるようにしたいと思います。
ここで問題となるのは、これを行うための適切なフックが見つからないということです。つまり、どのようにトランジションアニメーションが終了したのかを知り、その後アニメーションをフェードインすることができますか?
ここでは、コードの少しです:
public void onItemClicked(final Vox vox, final VoxItemView view) {
//I'm using an AnimatorInflator to inflates these animations in the fragment's onCreate method
mFadeOutBottom.setTarget(view.getBottomOverlayView());
mFadeOutTop.setTarget(view.getTopOverlayView());
mFadeInBottom.setTarget(view.getBottomOverlayView());
mFadeInTop.setTarget(view.getTopOverlayView());
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(mFadeOutBottom, mFadeOutTop);
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
//When the animation ends then I jump to the detail screen
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(
getActivity(),
view.getImageView(),
ViewCompat.getTransitionName(view.getImageView()));
startActivity(VoxDetailActivity.getStartIntent(getActivity(), vox), options.toBundle());
//I tried setting the fade in animation here, but it doesnt work
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(mFadeInBottom, mFadeInTop);
animatorSet.start();
}
});
animatorSet.start();
}
VoxItemViewsはRecyclerViewグリッドの図です。
誰かが正しい方向に私を指すことができるなら、私はそれを感謝します。