Merge pull request #7375 from nextcloud/fileDetailLeftFragment
FileDetailFragment also uses left fragment
This commit is contained in:
commit
879157e468
|
@ -844,6 +844,7 @@ public abstract class FileActivity extends DrawerActivity
|
|||
* @return A {@link FileDetailSharingFragment} instance, or null
|
||||
*/
|
||||
private @Nullable
|
||||
@Deprecated
|
||||
FileDetailSharingFragment getShareFileFragment() {
|
||||
Fragment fragment = getSupportFragmentManager().findFragmentByTag(ShareActivity.TAG_SHARE_FRAGMENT);
|
||||
|
||||
|
|
|
@ -812,6 +812,8 @@ public class FileDisplayActivity extends FileActivity
|
|||
second != null && second.getFile() != null ||
|
||||
isSearchOpen()) {
|
||||
onBackPressed();
|
||||
} else if (getLeftFragment() instanceof FileDetailFragment) {
|
||||
onBackPressed();
|
||||
} else {
|
||||
openDrawer();
|
||||
}
|
||||
|
@ -1571,18 +1573,10 @@ public class FileDisplayActivity extends FileActivity
|
|||
public void showDetails(OCFile file, int activeTab) {
|
||||
User currentUser = getUser().orElseThrow(RuntimeException::new);
|
||||
Fragment detailFragment = FileDetailFragment.newInstance(file, currentUser, activeTab);
|
||||
setSecondFragment(detailFragment);
|
||||
setLeftFragment(detailFragment);
|
||||
|
||||
OCFileListFragment listOfFiles = getListOfFilesFragment();
|
||||
if (listOfFiles != null) {
|
||||
resetHeaderScrollingState();
|
||||
showSortListGroup(false);
|
||||
listOfFiles.setFabVisible(false);
|
||||
}
|
||||
|
||||
updateFragmentsVisibility(true);
|
||||
updateActionBarTitleAndHomeButton(file);
|
||||
setFile(file);
|
||||
mDrawerToggle.setDrawerIndicatorEnabled(false);
|
||||
}
|
||||
|
||||
private void resetHeaderScrollingState() {
|
||||
|
@ -1818,21 +1812,6 @@ public class FileDisplayActivity extends FileActivity
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
|
Loading…
Reference in New Issue