From 017a2413b6e099e79eb699257895d2296c3ff532 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 20 Jan 2024 23:51:34 +0900 Subject: [PATCH] =?UTF-8?q?=E6=8C=BF=E5=85=A5=E6=99=82=E3=81=AB=E3=82=A2?= =?UTF-8?q?=E3=83=8B=E3=83=A1=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=8C?= =?UTF-8?q?=E7=99=BA=E7=94=9F=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/one/nem/lacerta/feature/home/HomeTopFragment.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java b/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java index f8cc7ba2..1510b2ac 100644 --- a/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java +++ b/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java @@ -15,7 +15,6 @@ import androidx.appcompat.widget.Toolbar; import androidx.core.content.ContextCompat; import androidx.drawerlayout.widget.DrawerLayout; import androidx.fragment.app.Fragment; -import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -77,7 +76,7 @@ public class HomeTopFragment extends Fragment { super.onViewCreated(view, savedInstanceState); RecyclerView recyclerView = view.findViewById(R.id.home_item_recycler_view); - recyclerView.setItemAnimator(new DefaultItemAnimator()); + ListItemAdapter listItemAdapter = new ListItemAdapter(); recyclerView.setAdapter(listItemAdapter); @@ -85,7 +84,9 @@ public class HomeTopFragment extends Fragment { lacertaLibrary.getRecentDocument(10).thenAccept(listItems -> { listItemAdapter.setListItems(listItems); - getActivity().runOnUiThread(listItemAdapter::notifyDataSetChanged); + getActivity().runOnUiThread(() -> { + listItemAdapter.notifyItemRangeInserted(0, listItems.size()); + }); }); CollapsingToolbarLayout collapsingToolbarLayout = view.findViewById(R.id.collapsing_toolbar);