use of android.view.ViewTreeObserver.OnScrollChangedListener in project Osmand by osmandapp.
the class MenuBottomSheetDialogFragment method setupScrollShadow.
private void setupScrollShadow(View view) {
final View scrollView;
if (useScrollableItemsContainer()) {
scrollView = view.findViewById(R.id.scroll_view);
} else {
scrollView = itemsContainer;
}
scrollView.getViewTreeObserver().addOnScrollChangedListener(new OnScrollChangedListener() {
@Override
public void onScrollChanged() {
boolean scrollToBottomAvailable = scrollView.canScrollVertically(1);
if (scrollToBottomAvailable) {
showShadowButton();
} else {
hideShadowButton();
}
}
});
}
use of android.view.ViewTreeObserver.OnScrollChangedListener in project OsmAnd by osmandapp.
the class MenuBottomSheetDialogFragment method setupScrollShadow.
private void setupScrollShadow(View view) {
final View scrollView;
if (useScrollableItemsContainer()) {
scrollView = view.findViewById(R.id.scroll_view);
} else {
scrollView = itemsContainer;
}
scrollView.getViewTreeObserver().addOnScrollChangedListener(new OnScrollChangedListener() {
@Override
public void onScrollChanged() {
boolean scrollToBottomAvailable = scrollView.canScrollVertically(1);
if (scrollToBottomAvailable) {
showShadowButton();
} else {
hideShadowButton();
}
}
});
}
Aggregations