Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
Signed-off-by: parneet-guraya <[email protected]>
  • Loading branch information
parneet-guraya committed Dec 4, 2023
1 parent 37223e6 commit 2f38c65
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1004,8 +1004,8 @@ private boolean isSearchOpen() {
* BackPressed priority/hierarchy:
* 1. close search view if opened
* 2. close drawer if opened
* 3. close FAB if open (only if drawer isn't open)
* 4. navigate up (only if drawer and FAB aren't open)
* 3. if it is OCFileListFragment and it's in Root -> (finish Activity) or it's not Root -> (browse up)
* 4. otherwise pop up the fragment and sortGroup view visibility and call super.onBackPressed()
*/
@SuppressFBWarnings("ITC_INHERITANCE_TYPE_CHECKING")
@Override
Expand Down Expand Up @@ -1034,6 +1034,11 @@ public void onBackPressed() {
}
}

/**
* Use this method when want to pop the fragment on back press. It resets Scrolling (See
* {@link #resetScrolling(boolean) with true} and pop the visibility for sortListGroup (See
* {@link #setSortListGroup(boolean, boolean)}. At last call to super.onBackPressed()
*/
private void popBack() {
// pop back fragment
resetScrolling(true);
Expand All @@ -1050,6 +1055,9 @@ private void browseUp(OCFileListFragment listOfFiles) {
setDrawerAllFiles();
}

/**
* It resets the Search Action (call when search is open)
*/
private void resetSearchAction() {
Fragment leftFragment = getLeftFragment();
if (isSearchOpen() && searchView != null) {
Expand Down Expand Up @@ -2613,11 +2621,20 @@ public void showFile(String message) {
}
}

/**
* Use this method to set the visibility of SortListGroup while going to another fragment/view (which needs
* different visibility) It internally sets the visibility as well as save the previous one in the stack so that on
* going back it pops out the correct visibility. Also see {@link #popSortListGroupVisibility()}
*/
private void setSortListGroup(boolean currentListGroupVisibility, boolean show) {
previousSortGroupState.push(currentListGroupVisibility);
showSortListGroup(show);
}

/**
* Use this method to set the visibility of SortListGroup when coming back from a view/fragment (which changed the
* visibility earlier using {@link #setSortListGroup(boolean, boolean)}
*/
private void popSortListGroupVisibility() {
boolean popped = previousSortGroupState.pop();
showSortListGroup(popped);
Expand Down

0 comments on commit 2f38c65

Please sign in to comment.