You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background Parallax Solution:
Define a ScrollView in the background layer, the viewpager is defined in another layer which is inflated by Layoutinflater. (Not accurate) / Alternative method: make a ImageView set its scale type then make the imageview translationY direction.
Fragment Pager Parallax Solution:
mViewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@OverRide
public void onPageScrolled(int position, float percent, int offset) {
int totalPages = 4;
float Percentage = ((position+percent)_100 / totalPages);
mImageDrawable.setLevel((int)(400_Percentage));
}
}
The key point is that: set a clipdrawable then set its level based on the percentage of page scrolling.
The text was updated successfully, but these errors were encountered: