Android BidirectionalViewPager 一個可以橫向滑動、豎向滑動的雙向滑動ViewPager
BidirectionalViewPager
BidirectionalViewPager is a viewpager that can slide in both directions.
XML Usage
<engineer.jsp.bidirectional.viewpager.BidirectionalViewPager
android:id="@+id/bidirectional_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:orientation="horizontal" >
</engineer.jsp.bidirectional.viewpager.BidirectionalViewPager>
Java Code Usage
BidirectionalViewPager mBidirectionalViewPager = new BidirectionalViewPager(this);
The Listener Usage
mBidirectionalViewPager.setOnPageChangeListener(new OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
Android Eclipse Project URL:
https://github.com/Mr-Jiang/BidirectionalViewPager/tree/master/Eclipse/BidirectionalViewPager
Android Studio Project URL:
https://github.com/Mr-Jiang/BidirectionalViewPager/tree/master/Studio/BidirectionalViewPager
Horizontal slide effect
Vertical slide effect
If you think this project is helpful to you, please give me GitHub Start or Fork to support me to continue to provide better projects!
GitHub URL:https://github.com/Mr-Jiang/BidirectionalViewPager