Use getBindingAdapterPosition() to get item position

Better solution for #201
This commit is contained in:
FooIbar authored and tarsin committed 2022-12-24 16:52:37 +08:00
1 parent 0d24bc6602
commit 3c37f22027
5 files changed
+13 -47

No files matched your search

@@ -295,6 +295,7 @@ public class ContentLayout extends FrameLayout {
mRecyclerView = contentLayout.mRecyclerView;
Drawable drawable = ContextCompat.getDrawable(getContext(), R.drawable.big_sad_pandroid);
assert drawable != null;
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
mTipView.setCompoundDrawables(null, drawable, null, null);
@@ -321,8 +322,6 @@ public class ContentLayout extends FrameLayout {
protected abstract void notifyDataSetChanged();
protected abstract void notifyItemRangeChanged(int positionStart, int itemCount);
protected abstract void notifyItemRangeInserted(int positionStart, int itemCount);
protected void onScrollToPosition(int position) {
@@ -478,7 +477,6 @@ public class ContentLayout extends FrameLayout {
mData.addAll(0, data);
onAddData(data);
notifyItemRangeInserted(0, data.size());
notifyItemRangeChanged(data.size(), mData.size() - data.size());
// Ui change, show content
mRefreshLayout.setRefreshing(false);