I am creating a list based navigation for a file system. The database contains FOLDERS and FILES. Each FOLDER can have FOLDERS or FILES. After clicking a FILE user can see its content.
The drill down navigation logic that I have written is that I load all the parent FOLDERS in recycler view. I am using a java.util.STACK to hold the FOLDER that user clicks. As we drill down, I add the FOLDERS into the stack, and as we press back, I pop the stack to reload the Sub-Folder listing, till user reaches the parent FOLDER listing.
I am having multiple issues with this navigation and now I have reached a point I am patching the stuff, creating worst logic, that breaks in one use case or another.
I am wondering if there is some data structure or library that can assist in this sort of drill down and handle stuff or a suggestion of better implementation.
I am using Fragments one for the listing and one fragment for showing the file once user has selected.