mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 19:34:15 +01:00
Fixed scroll on select
This commit is contained in:
@@ -336,7 +336,24 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||
rvMessage.setHasFixedSize(false);
|
||||
//rvMessage.setItemViewCacheSize(10);
|
||||
//rvMessage.getRecycledViewPool().setMaxRecycledViews(0, 10);
|
||||
final LinearLayoutManager llm = new LinearLayoutManager(getContext());
|
||||
final LinearLayoutManager llm = new LinearLayoutManager(getContext()) {
|
||||
Rect parentRect = new Rect();
|
||||
Rect childRect = new Rect();
|
||||
|
||||
@Override
|
||||
public boolean requestChildRectangleOnScreen(@NonNull RecyclerView parent, @NonNull View child, @NonNull Rect rect, boolean immediate) {
|
||||
return requestChildRectangleOnScreen(parent, child, rect, immediate, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requestChildRectangleOnScreen(@NonNull RecyclerView parent, @NonNull View child, @NonNull Rect rect, boolean immediate, boolean focusedChildVisible) {
|
||||
parent.getHitRect(parentRect);
|
||||
child.getHitRect(childRect);
|
||||
if (Rect.intersects(parentRect, childRect))
|
||||
return false;
|
||||
return super.requestChildRectangleOnScreen(parent, child, rect, immediate, focusedChildVisible);
|
||||
}
|
||||
};
|
||||
rvMessage.setLayoutManager(llm);
|
||||
|
||||
DividerItemDecoration itemDecorator = new DividerItemDecoration(getContext(), llm.getOrientation()) {
|
||||
|
||||
Reference in New Issue
Block a user