I got the FragmentBasics example from here. Is there a way make the ViewPager animation simply fade in and out when I swipe instead of sliding left and right? I\'ve been try
Fade according to Google: https://developer.android.com/training/animation/reveal-or-hide-view
viewPager.setPageTransformer(false, new ViewPager.PageTransformer() {
@Override
public void transformPage(@NonNull View page, float position) {
page.setAlpha(0f);
page.setVisibility(View.VISIBLE);
// Start Animation for a short period of time
page.animate()
.alpha(1f)
.setDuration(page.getResources().getInteger(android.R.integer.config_shortAnimTime));
}
});