xmuSistone / ViewpagerTransition

viewpager with parallax pages, together with vertical sliding (or click) and activity transition
3.04k stars 508 forks source link

viewPager & pictures #10

Closed HamidReza-katani closed 5 years ago

HamidReza-katani commented 5 years ago

Hi and thank you for your beautiful design 1- if I want to have viewPager not in the center of screen (on the bottom as an example), which method or class of DragActivity shall I customize? 2- if I want to add a new picture (on the left) by clicking on a button, do I have to write just this one on its onClick ? "fragments.add(new CommonFragment());" 3- and I also want to know which part sets the number of pictures according to the number of IndicatorTv? what should I do (which method or class need to be customized) for having pictures, with the same number of existed pictures? sorry if I asked too many questions and thank you so much! wish you to be successful in all the steps of your life!

xmuSistone commented 5 years ago

@hamidrezakatani the answers may not that easy by several sentences:

Globally, the ViewPager is "match_parent", that means you can not make the ViewPager on the bottom. However, you can make ViewPager's item view looks like on the bottom.

1. u want to have viewPager in the bottom: --> pay more attention to DragLayout. DragLayout extends FrameLayout, it contains two itemView, please try to adjust the ViewDragHelper. onViewPositionChanged(), maybe you would have to modify other functions as well. 2. add a new picture --> please be more familiar with viewPager, try FragmentStateAdapter, this is ViewPager's thing. 3. number of IndicatorTv --> please be more professional with ViewPager.