-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e6ff55
commit aaebda6
Showing
4 changed files
with
51 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
magicindicator/src/main/java/net/lucode/hackware/magicindicator/SimpleViewPagerDelegate.java
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
magicindicator/src/main/java/net/lucode/hackware/magicindicator/ViewPagerHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package net.lucode.hackware.magicindicator; | ||
|
||
import android.support.v4.view.ViewPager; | ||
|
||
/** | ||
* 简化和ViewPager绑定 | ||
* Created by hackware on 2016/8/17. | ||
*/ | ||
|
||
public class ViewPagerHelper { | ||
public static void bind(final MagicIndicator magicIndicator, ViewPager viewPager) { | ||
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { | ||
|
||
@Override | ||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { | ||
magicIndicator.onPageScrolled(position, positionOffset, positionOffsetPixels); | ||
} | ||
|
||
@Override | ||
public void onPageSelected(int position) { | ||
magicIndicator.onPageSelected(position); | ||
} | ||
|
||
@Override | ||
public void onPageScrollStateChanged(int state) { | ||
magicIndicator.onPageScrollStateChanged(state); | ||
} | ||
}); | ||
} | ||
} |