Skip to content

Instantly share code, notes, and snippets.

@mumayank
Created August 7, 2016 07:52
Show Gist options
  • Save mumayank/510bd317f46a23d2c7308fd5cad987e3 to your computer and use it in GitHub Desktop.
Save mumayank/510bd317f46a23d2c7308fd5cad987e3 to your computer and use it in GitHub Desktop.
try {
Field f;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
f = AbsListView.class.getDeclaredField("mFastScroll");
} else {
f = AbsListView.class.getDeclaredField("mFastScroller");
}
Object o = f.get(getListView());
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
f = f.getType().getDeclaredField("mThumbImage");
thumbView = (View) f.get(o);
} else {
f = f.getType().getDeclaredField("mThumbDrawable");
thumbView = (View) f.get(o);
}
} catch (Exception ignored) {
String ig = ignored.getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment