From 71f9be77cd7809716f80ead95d3886e874dcc52a Mon Sep 17 00:00:00 2001 From: Fuchimoto1234 Date: Wed, 17 Jan 2024 12:58:25 +0900 Subject: [PATCH] fix --- .../lacerta/feature/home/HomeTopFragment.java | 16 ++++++++-------- .../one/nem/lacerta/feature/home/MyAdapter.java | 14 ++++++++------ 2 files changed, 16 insertions(+), 14 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 ca5c671d..7dede1f2 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 @@ -17,6 +17,8 @@ import javax.inject.Inject; import dagger.hilt.android.AndroidEntryPoint; import one.nem.lacerta.data.Document; +import one.nem.lacerta.data.LacertaLibrary; +import one.nem.lacerta.model.ListItem; import one.nem.lacerta.model.document.DocumentMeta; @@ -30,11 +32,7 @@ import one.nem.lacerta.model.document.DocumentMeta; public class HomeTopFragment extends Fragment { @Inject - Document document; - - - - + LacertaLibrary lacertaLibrary; // TODO: Rename parameter arguments, choose names that match @@ -86,15 +84,17 @@ public class HomeTopFragment extends Fragment { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_home_top, container, false); - List metas = document.getAllDocumentMetas(100); +// List metas = document.getAllDocumentMetas(100); - Log.d("docs", Integer.toString(metas.size())); + List listItem = lacertaLibrary.getRecentDocument(100).getListItems(); + + Log.d("docs", Integer.toString(listItem.size())); RecyclerView recyclerView = view.findViewById(R.id.item_recycler_view); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - MyAdapter myAdapter = new MyAdapter(metas); + MyAdapter myAdapter = new MyAdapter(listItems); recyclerView.setAdapter(myAdapter); diff --git a/feature/home/src/main/java/one/nem/lacerta/feature/home/MyAdapter.java b/feature/home/src/main/java/one/nem/lacerta/feature/home/MyAdapter.java index e6e251dd..98ff0fb7 100644 --- a/feature/home/src/main/java/one/nem/lacerta/feature/home/MyAdapter.java +++ b/feature/home/src/main/java/one/nem/lacerta/feature/home/MyAdapter.java @@ -5,19 +5,21 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import one.nem.lacerta.model.ListItem; import one.nem.lacerta.model.document.DocumentMeta; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; +import java.util.ArrayList; import java.util.List; public class MyAdapter extends RecyclerView.Adapter { - List documentMetas; + ArrayList listItems; - public MyAdapter(List documentMeta) { - this.documentMetas = documentMeta; + public MyAdapter(ArrayList ListItem) { +// this.listItem = listItem; } @NonNull @@ -31,8 +33,8 @@ public class MyAdapter extends RecyclerView.Adapter