Skip to content

Instantly share code, notes, and snippets.

@saiday
Last active March 24, 2018 20:16
Show Gist options
  • Save saiday/2ae656aef8a2779f593867464ffa0a87 to your computer and use it in GitHub Desktop.
Save saiday/2ae656aef8a2779f593867464ffa0a87 to your computer and use it in GitHub Desktop.
...
@Override
public void setPrimaryItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
super.setPrimaryItem(container, position, object);
NestedScrollView current = ((NestedScrollView)object);
current.setNestedScrollingEnabled(true);
for (int i = 0; i < getCount(); i++) {
if (i != position) {
NestedScrollView otherScrollView = container.findViewWithTag(i);
otherScrollView.setNestedScrollingEnabled(false);
}
}
container.requestLayout();
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment