X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/011700631331a63d2c9d756dc60649fd6b2492f4..1ef9c86b59575ece900b9770c39184e5e2011918:/src/com/owncloud/android/ui/activity/FileDisplayActivity.java diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index 8a64bcec..b1c0ffbe 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -1139,7 +1139,6 @@ public class FileDisplayActivity extends HookActivity cleanSecondFragment(); // Sync Folder startSyncFolderOperation(directory, false); - } /** @@ -1157,47 +1156,16 @@ public class FileDisplayActivity extends HookActivity setFile(file); } - - /** - * TODO - */ - private void updateActionBarTitleAndHomeButton(OCFile chosenFile) { - ActionBar actionBar = getSupportActionBar(); - - // For adding content description tag to a title field in the action bar - int actionBarTitleId = getResources().getIdentifier("action_bar_title", "id", "android"); - - if (chosenFile == null || mDualPane) { - // only list of files - set for browsing through folders - OCFile currentDir = getCurrentDir(); - boolean noRoot = (currentDir != null && currentDir.getParentId() != 0); - //actionBar.setDisplayHomeAsUpEnabled(noRoot); - //actionBar.setDisplayShowTitleEnabled(!noRoot); - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowTitleEnabled(true); - mDrawerToggle.setDrawerIndicatorEnabled(!noRoot); - if (!noRoot) { - actionBar.setTitle(getString(R.string.default_display_name_for_root_folder)); - View actionBarTitleView = getWindow().getDecorView().findViewById(actionBarTitleId); - if (actionBarTitleView != null) { // it's null in Android 2.x - actionBarTitleView.setContentDescription( - getString(R.string.default_display_name_for_root_folder)); - } - } - actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); + @Override + 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(getCurrentDir()); } else { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowTitleEnabled(true); - mDrawerToggle.setDrawerIndicatorEnabled(false); - actionBar.setTitle(chosenFile.getFileName()); - actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); - View actionBarTitleView = getWindow().getDecorView().findViewById(actionBarTitleId); - if (actionBarTitleView != null) { // it's null in Android 2.x - getWindow().getDecorView().findViewById(actionBarTitleId). - setContentDescription(chosenFile.getFileName()); - } + super.updateActionBarTitleAndHomeButton(chosenFile); } + }