Je travaille sur un petit projet, une application pour une carte d'image, et j'essaie de l'implémenter dans un design 100% matériel.Accrocher des animations à la transition de vue
https://www.youtube.com/watch?v=Tr6U3hclx8I
Je voulais ajouter une petite animation fading pour les superpositions que chaque élément a. Comme vous pouvez le voir lorsque je tape sur un élément, les deux superpositions supérieure et inférieure exécutent une animation de fondu. La chose est que quand il revient l'animation semble un peu maladroite. Je voudrais que l'image du détail rétrécisse, puis revienne à sa position d'origine, puis les superpositions supérieures et inférieures reviennent avec une animation en fondu.
Problème ici est que je ne peux pas trouver un crochet approprié pour ce faire. Je veux dire, comment puis-je savoir quand l'animation de transition est terminée et ensuite effectuer l'animation de fondu?
est ici un peu du code:
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();
}
Les VoxItemViews sont les vues sur la grille de RecyclerView.
Si quelqu'un peut me diriger dans la bonne direction, je l'apprécierais.