引数のフォルダ名を使って取得開始前にToolBarをinitするように

This commit is contained in:
ろむねこ 2024-01-22 18:43:46 +09:00
parent 1648e0b7c1
commit c06d7e6b15
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -127,20 +127,20 @@ public class LibraryPageFragment extends Fragment {
} }
if (this.folderId == null) { // Root if (this.folderId == null) { // Root
toolbarSetup(view.findViewById(R.id.library_toolbar), false, "ライブラリ", "Placeholder");
lacertaLibrary.getLibraryPage(10).thenAccept(libraryItemPage -> { lacertaLibrary.getLibraryPage(10).thenAccept(libraryItemPage -> {
logger.debug("LibraryTopFragment", "Item selected! libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size()); logger.debug("LibraryTopFragment", "Item selected! libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size());
listItemAdapter.setLibraryItemPage(libraryItemPage); listItemAdapter.setLibraryItemPage(libraryItemPage);
getActivity().runOnUiThread(() -> { getActivity().runOnUiThread(() -> {
toolbarSetup(view.findViewById(R.id.library_toolbar), false, "ライブラリ", "Placeholder");
listItemAdapter.notifyItemRangeInserted(0, libraryItemPage.getListItems().size() - 1); listItemAdapter.notifyItemRangeInserted(0, libraryItemPage.getListItems().size() - 1);
}); });
this.currentTotalItemCount = libraryItemPage.getListItems().size(); this.currentTotalItemCount = libraryItemPage.getListItems().size();
}); });
} else { // Root以外 } else { // Root以外
toolbarSetup(view.findViewById(R.id.library_toolbar), true, this.title, "Placeholder");
lacertaLibrary.getLibraryPage(this.folderId, 10).thenAccept(libraryItemPage -> { lacertaLibrary.getLibraryPage(this.folderId, 10).thenAccept(libraryItemPage -> {
logger.debug("LibraryTopFragment", "Item selected! libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size()); logger.debug("LibraryTopFragment", "Item selected! libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size());
listItemAdapter.setLibraryItemPage(libraryItemPage); listItemAdapter.setLibraryItemPage(libraryItemPage);
toolbarSetup(view.findViewById(R.id.library_toolbar), true, libraryItemPage.getPageTitle(), "Placeholder");
getActivity().runOnUiThread(() -> { getActivity().runOnUiThread(() -> {
listItemAdapter.notifyItemRangeInserted(0, libraryItemPage.getListItems().size() - 1); listItemAdapter.notifyItemRangeInserted(0, libraryItemPage.getListItems().size() - 1);
}); });