/** Called when a drawer has settled in a completely closed state. */
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
- updateActionBarTitleAndHomeButton(mFile);
+ updateActionBarTitleAndHomeButton(null);
invalidateOptionsMenu();
}
/// choose the appropiate title
if (chosenFile == null) {
- // mFile determines the title
- OCFile currentDir = null;
- if (mFile != null && mFile.isFolder()) {
- currentDir = mFile;
- } else {
- currentDir = getStorageManager().getFileById(mFile.getParentId());
- }
- inRoot = (mFile == null || currentDir.getParentId() == 0);
- if (!inRoot) {
- title = mFile.getFileName();
-
- }
-
- } else {
- // chosenFile determines the title, instead of mFile
+ chosenFile = mFile; // if no file is passed, current file decides
+ }
+ inRoot = (
+ chosenFile == null ||
+ (chosenFile.isFolder() && chosenFile.getParentId() == FileDataStorageManager.ROOT_PARENT_ID)
+ );
+ if (!inRoot) {
title = chosenFile.getFileName();
- inRoot = false;
}
/// set the chosen title