mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
コードを微修正
This commit is contained in:
parent
ac2001142f
commit
e70f930929
|
@ -102,7 +102,6 @@ public class LibraryTopFragment extends Fragment {
|
||||||
textView.setText(document);
|
textView.setText(document);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -113,23 +112,18 @@ public class LibraryTopFragment extends Fragment {
|
||||||
// Use view.findViewById instead of findViewById
|
// Use view.findViewById instead of findViewById
|
||||||
RecyclerView documentRecyclerView = view.findViewById(R.id.document_list);
|
RecyclerView documentRecyclerView = view.findViewById(R.id.document_list);
|
||||||
|
|
||||||
|
List<String> documentList = new ArrayList<>();
|
||||||
|
documentList.add("Document A");
|
||||||
|
documentList.add("Document B");
|
||||||
|
documentList.add("Document C");
|
||||||
|
|
||||||
if (documentRecyclerView != null) {
|
// Create and set the adapter
|
||||||
List<String> documentList = new ArrayList<>();
|
DocumentAdapter adapter = new DocumentAdapter(documentList);
|
||||||
documentList.add("Document A");
|
documentRecyclerView.setAdapter(adapter);
|
||||||
documentList.add("Document B");
|
|
||||||
documentList.add("Document C");
|
|
||||||
|
|
||||||
// Create and set the adapter
|
|
||||||
DocumentAdapter adapter = new DocumentAdapter(documentList);
|
|
||||||
documentRecyclerView.setAdapter(adapter);
|
|
||||||
|
|
||||||
// Use a LinearLayoutManager to specify the layout
|
|
||||||
LinearLayoutManager layoutManager = new LinearLayoutManager(requireContext());
|
|
||||||
documentRecyclerView.setLayoutManager(layoutManager);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Use a LinearLayoutManager to specify the layout
|
||||||
|
LinearLayoutManager layoutManager = new LinearLayoutManager(requireContext());
|
||||||
|
documentRecyclerView.setLayoutManager(layoutManager);
|
||||||
return view;
|
return view;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user