Fix issues with conversation list position.

This commit is contained in:
Alex Hart
2020-08-13 20:09:16 -03:00
committed by Greyson Parrelli
parent e4456bb236
commit a73427d68d
4 changed files with 25 additions and 23 deletions

View File

@@ -61,7 +61,12 @@ public final class FixedViewsAdapter extends RecyclerView.Adapter<RecyclerView.V
private void setHidden(boolean hidden) {
if (this.hidden != hidden) {
this.hidden = hidden;
notifyDataSetChanged();
if (hidden) {
notifyItemRangeRemoved(0, viewList.size());
} else {
notifyItemRangeInserted(0, viewList.size());
}
}
}
}

View File

@@ -143,7 +143,7 @@ public class RecyclerViewConcatenateAdapter extends RecyclerView.Adapter<Recycle
}
}
static class ChildAdapterPositionPair {
public static class ChildAdapterPositionPair {
final ChildAdapter childAdapter;
final int localPosition;
@@ -156,6 +156,10 @@ public class RecyclerViewConcatenateAdapter extends RecyclerView.Adapter<Recycle
RecyclerView.Adapter<? extends RecyclerView.ViewHolder> getAdapter() {
return childAdapter.adapter;
}
public int getLocalPosition() {
return localPosition;
}
}
/**
@@ -195,7 +199,7 @@ public class RecyclerViewConcatenateAdapter extends RecyclerView.Adapter<Recycle
* position in that adapter that corresponds to the given global position.
*/
@NonNull
ChildAdapterPositionPair getLocalPosition(final int globalPosition) {
public ChildAdapterPositionPair getLocalPosition(final int globalPosition) {
int count = 0;
for (ChildAdapter childAdapter : adapters) {