Weekly Questions Thread - December 03, 2018

In the view pager I set my second fragment with setTranslationX(-70), but when I scroll to the end of the view pager - it still contains empty space. For fixed this, I can just put this line. view.animate().translationX(0).start();

But I want to smooth transition effect. I tried to override method transformPage in the ViewPager.PageTransformer like this

@Override

public void transformPage(@NonNull View page, float position) {

if ((int) page.getTag() == 1 && position < .30f) {
    page.animate().translationX(0).start();
}

}

It works when we cross the 0.30 value or another one, but not smoothing. Which way should I move to remove the empty space at the end?

/r/androiddev Thread