/** 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);
+ inRoot = (mFile == null || mFile.getParentId() == 0);
if (!inRoot) {
- title = mFile.getFileName();
-
+ title = mFile.getFileName();
}
- } else {
+ } else if (chosenFile.getParentId() != 0){
// chosenFile determines the title, instead of mFile
title = chosenFile.getFileName();
inRoot = false;
+
+ } else{
+ inRoot = true;
}
/// set the chosen title
protected void updateActionBarTitleAndHomeButton(OCFile chosenFile) {
if (mDualPane) {
// in dual pane mode, keep the focus of title an action bar in the current folder
- super.updateActionBarTitleAndHomeButton(null);
+ super.updateActionBarTitleAndHomeButton(getCurrentDir());
} else {
super.updateActionBarTitleAndHomeButton(chosenFile);