Last active
August 29, 2015 13:57
-
-
Save philipesteiff/9641729 to your computer and use it in GitHub Desktop.
Custom ViewPager para Viewpagers aninhados
This file contains hidden or 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
public class FocusLooserViewPager extends ViewPager { | |
public FocusLooserViewPager(Context context) { | |
super(context); | |
} | |
public FocusLooserViewPager(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
/** | |
* Previne que os filhos percam seu precioso swipe | |
*/ | |
@Override | |
protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) { | |
if (v != this && v instanceof ViewPager) { | |
return true; | |
} | |
return super.canScroll(v, checkV, dx, x, y); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment