mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
Fix
This commit is contained in:
parent
bc304f8535
commit
fe4999384a
|
@ -115,7 +115,8 @@ 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, new PublicPath().parse(publicPath).resolve(folderName).getStringPath()));
|
logger.debug("LibraryTopFragment", "publicPath: " + publicPath);
|
||||||
|
fragmentNavigation.navigateToFragment(LibraryPageFragment.newInstance(folderId, folderName, publicPath == null ? new PublicPath().parse("/").resolve(folderName).getStringPath() : new PublicPath().parse(publicPath).resolve(folderName).getStringPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -39,14 +39,19 @@ public class PublicPath {
|
||||||
}
|
}
|
||||||
|
|
||||||
public PublicPath parse(String path) {
|
public PublicPath parse(String path) {
|
||||||
if (path.startsWith("/")) {
|
if (path == null) {
|
||||||
this.path.clear();
|
this.path.clear();
|
||||||
path = path.substring(1);
|
this.path.add("/");
|
||||||
}
|
} else {
|
||||||
String[] pathArray = path.split("/");
|
if (path.startsWith("/")) {
|
||||||
for (String p : pathArray) {
|
this.path.clear();
|
||||||
Log.d("PublicPath", "parse: " + p);
|
path = path.substring(1);
|
||||||
resolveInternal(p);
|
}
|
||||||
|
String[] pathArray = path.split("/");
|
||||||
|
for (String p : pathArray) {
|
||||||
|
Log.d("PublicPath", "parse: " + p);
|
||||||
|
resolveInternal(p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user