Skip to content

Commit

Permalink
Merge pull request #7375 from nextcloud/fileDetailLeftFragment
Browse files Browse the repository at this point in the history
FileDetailFragment also uses left fragment
  • Loading branch information
AndyScherzinger authored Nov 23, 2020
2 parents 01bfc27 + 4640ff0 commit 879157e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ private void onCreateShareViaLinkOperationFinish(CreateShareViaLinkOperation ope
* @return A {@link FileDetailSharingFragment} instance, or null
*/
private @Nullable
@Deprecated
FileDetailSharingFragment getShareFileFragment() {
Fragment fragment = getSupportFragmentManager().findFragmentByTag(ShareActivity.TAG_SHARE_FRAGMENT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,8 @@ public boolean onOptionsItemSelected(MenuItem item) {
second != null && second.getFile() != null ||
isSearchOpen()) {
onBackPressed();
} else if (getLeftFragment() instanceof FileDetailFragment) {
onBackPressed();
} else {
openDrawer();
}
Expand Down Expand Up @@ -1571,18 +1573,10 @@ public void showDetails(OCFile file) {
public void showDetails(OCFile file, int activeTab) {
User currentUser = getUser().orElseThrow(RuntimeException::new);
Fragment detailFragment = FileDetailFragment.newInstance(file, currentUser, activeTab);
setSecondFragment(detailFragment);

OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
resetHeaderScrollingState();
showSortListGroup(false);
listOfFiles.setFabVisible(false);
}
setLeftFragment(detailFragment);

updateFragmentsVisibility(true);
updateActionBarTitleAndHomeButton(file);
setFile(file);
mDrawerToggle.setDrawerIndicatorEnabled(false);
}

private void resetHeaderScrollingState() {
Expand Down Expand Up @@ -1818,21 +1812,6 @@ private void onMoveFileOperationFinish(MoveFileOperation operation,
}
}

/**
* Shortcut to get access to the {@link FileDetailFragment} instance, if any
*
* @return A {@link FileDetailFragment} instance, or null
*/
private FileDetailFragment getShareFileFragment() {
Fragment fragment = getSupportFragmentManager().findFragmentByTag(TAG_SECOND_FRAGMENT);

if (fragment instanceof FileDetailFragment) {
return (FileDetailFragment) fragment;
} else {
return null;
}
}

/**
* Updates the view associated to the activity after the finish of an operation trying to copy a
* file.
Expand Down

0 comments on commit 879157e

Please sign in to comment.