/** Called when a drawer has settled in a completely closed state. */
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
+ updateActionBarTitle();
getSupportActionBar().setDisplayShowTitleEnabled(true);
- getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
- //initFragmentsWithFile();
+ getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
invalidateOptionsMenu();
}
mDrawerLayout.setDrawerListener(mDrawerToggle);
}
+ protected void updateActionBarTitle(){
+ if (mFile.getParentId() == 0) {
+ getSupportActionBar().setTitle(getString(
+ R.string.default_display_name_for_root_folder));
+ } else {
+ getSupportActionBar().setTitle(mFile.getFileName().toString());
+ }
+ }
/**
* Sets and validates the ownCloud {@link Account} associated to the Activity.
*
if (listOfFiles != null) { // should never be null, indeed
setFile(listOfFiles.getCurrentFile());
}
+ updateActionBarTitle();
cleanSecondFragment();
}
// listOfFiles.listDirectory(root, MainApp.getOnlyOnDevice());
setFile(listOfFiles.getCurrentFile());
startSyncFolderOperation(root, false);
+ updateActionBarTitle();
}
cleanSecondFragment();
+
}
Log_OC.e(TAG, "Unexpected null when accessing list fragment");
}
cleanSecondFragment();
+
}
public void onBrowsedDownTo(OCFile directory) {
pushDirname(directory);
cleanSecondFragment();
-
+ updateActionBarTitle();
// Sync Folder
startSyncFolderOperation(directory, false);
OCFile currentDir = getCurrentDir();
boolean noRoot = (currentDir != null && currentDir.getParentId() != 0);
// actionBar.setDisplayHomeAsUpEnabled(noRoot);
-// actionBar.setDisplayShowTitleEnabled(!noRoot);
+// actionBar.setDisplayShowTitleEnabled(!noRoot);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
if (!noRoot) {
getString(R.string.default_display_name_for_root_folder));
}
}
- actionBar.setNavigationMode(!noRoot ? ActionBar.NAVIGATION_MODE_STANDARD :
- ActionBar.NAVIGATION_MODE_LIST);
+ actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
+// actionBar.setNavigationMode(!noRoot ? ActionBar.NAVIGATION_MODE_STANDARD :
+// ActionBar.NAVIGATION_MODE_LIST);
actionBar.setListNavigationCallbacks(mDirectories, this);
// assuming mDirectories is updated