Created
August 15, 2014 07:13
-
-
Save ksc91u/df81b97110cb0eef7758 to your computer and use it in GitHub Desktop.
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
protected void onLayout(boolean changed, int l, int t, int r, int b) { | |
super.onLayout(changed, l, t, r, b); | |
int itemsPerView = getLastVisiblePosition() - getFirstVisiblePosition() + 1; | |
if ((getAdapter().getCount() / itemsPerView) > 3) { | |
setFastScrollEnabled(true); | |
setScrollBarStyle(View.SCROLLBARS_OUTSIDE_INSET); | |
}else{ | |
setFastScrollEnabled(false); | |
setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment