Open shenliangshanghai opened 1 year ago
I have the same issue.
public static boolean isFirstViewCovered(FlexboxLayoutManager flexboxLayoutManager) {
try {
if (flexboxLayoutManager.findFirstVisibleItemPosition() == 0) {
View firstView = flexboxLayoutManager.findViewByPosition(0);
if (firstView != null) {
return isViewCoveredByParent(firstView);
}
}
} catch (Throwable e) {
Log.e("isFirstViewCovered", "error: " + e.getMessage());
}
return false;
}
I made a compromise with this method
Issues and steps to reproduce
*Why is flexboxmanager. Computescrolloffset() equal to 0 when only half of the first line is visible;I can't judge whether recyclerView.canScrollVertically() can continue to slide
Expected behavior
Version of the flexbox library
*1.1.1 - 3.0.0
Link to code
//bottomSheetBehavior.java if (!target.canScrollVertically(-1)) { if (newTop <= collapsedOffset || hideable) { if (!isDraggable) { // Prevent dragging return } consumed[1] = dyUnconsumed ViewCompat.offsetTopAndBottom(child, -dyUnconsumed) setStateInternal(STATE_DRAGGING) } else { consumed[1] = currentTop - collapsedOffset ViewCompat.offsetTopAndBottom(child, -consumed[1]) setStateInternal(STATE_COLLAPSED) } }