mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
WIP
This commit is contained in:
parent
305cbcd679
commit
e77fafc108
|
@ -115,7 +115,7 @@ public class LibraryPageFragment extends Fragment {
|
||||||
Toast.makeText(getContext(), "Folder selected! folderId: " + folderId + ", folderName: " + folderName, Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "Folder selected! folderId: " + folderId + ", folderName: " + folderName, Toast.LENGTH_SHORT).show();
|
||||||
FragmentNavigation fragmentNavigation = (FragmentNavigation) getActivity();
|
FragmentNavigation fragmentNavigation = (FragmentNavigation) getActivity();
|
||||||
assert fragmentNavigation != null;
|
assert fragmentNavigation != null;
|
||||||
fragmentNavigation.navigateToFragment(LibraryPageFragment.newInstance(folderId, folderName, currentPublicPath.resolve(folderName).getStringPath()));
|
fragmentNavigation.navigateToFragment(LibraryPageFragment.newInstance(folderId, folderName, new PublicPath().parse(publicPath).resolve(folderName).getStringPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -140,8 +140,6 @@ public class LibraryPageFragment extends Fragment {
|
||||||
if (this.folderId == null) { // Root
|
if (this.folderId == null) { // Root
|
||||||
toolbarSetup(view.findViewById(R.id.library_toolbar), false, "ライブラリ", "Placeholder");
|
toolbarSetup(view.findViewById(R.id.library_toolbar), false, "ライブラリ", "Placeholder");
|
||||||
lacertaLibrary.getLibraryPage(10).thenAccept(libraryItemPage -> {
|
lacertaLibrary.getLibraryPage(10).thenAccept(libraryItemPage -> {
|
||||||
this.currentPublicPath = new PublicPath().resolve("/");
|
|
||||||
logger.debug("LibraryInit(ROOT)",currentPublicPath.getStringPath());
|
|
||||||
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(() -> {
|
||||||
|
@ -152,8 +150,6 @@ public class LibraryPageFragment extends Fragment {
|
||||||
} else { // Root以外
|
} else { // Root以外
|
||||||
toolbarSetup(view.findViewById(R.id.library_toolbar), true, this.title, "Placeholder");
|
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 -> {
|
||||||
this.currentPublicPath = new PublicPath().parse(this.publicPath);
|
|
||||||
logger.debug("LibraryInit(NON_ROOT)",currentPublicPath.getStringPath());
|
|
||||||
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(() -> {
|
||||||
|
@ -189,6 +185,7 @@ public class LibraryPageFragment extends Fragment {
|
||||||
if (showBackButton) {
|
if (showBackButton) {
|
||||||
toolbar.setNavigationIcon(one.nem.lacerta.shared.ui.R.drawable.arrow_back_24px);
|
toolbar.setNavigationIcon(one.nem.lacerta.shared.ui.R.drawable.arrow_back_24px);
|
||||||
toolbar.setNavigationOnClickListener(v -> {
|
toolbar.setNavigationOnClickListener(v -> {
|
||||||
|
this.publicPath = new PublicPath().parse(this.publicPath).resolve("..").getStringPath();
|
||||||
getParentFragmentManager().popBackStack();
|
getParentFragmentManager().popBackStack();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -216,7 +213,7 @@ public class LibraryPageFragment extends Fragment {
|
||||||
input.setText("フォルダ名");
|
input.setText("フォルダ名");
|
||||||
builder.setView(input);
|
builder.setView(input);
|
||||||
builder.setPositiveButton("作成", (dialog, which) -> {
|
builder.setPositiveButton("作成", (dialog, which) -> {
|
||||||
lacertaLibrary.createFolder(null, input.getText().toString()).thenAccept(folderId -> {
|
lacertaLibrary.createFolder(this.currentPublicPath.getStringPath(), input.getText().toString()).thenAccept(folderId -> {
|
||||||
logger.debug("LibraryTopFragment", "folderId: " + folderId);
|
logger.debug("LibraryTopFragment", "folderId: " + folderId);
|
||||||
});
|
});
|
||||||
// Refresh
|
// Refresh
|
||||||
|
|
Loading…
Reference in New Issue
Block a user