diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java index 3af6eb035c0a..fe5fd8e2704d 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -1504,13 +1504,23 @@ protected void setTitle() { setTitle(R.string.drawer_item_shared); break; default: - setTitle(themeUtils.getDefaultDisplayNameForRootFolder(getContext()), false); + setTitle(themeUtils.getDefaultDisplayNameForRootFolder(getContext()), isRoot()); break; } } } + //NMC Customization + //for NMC we are using defaultToolbar instead searchToolbar for which we needed customization + private boolean isRoot() { + Activity activity; + if ((activity = getActivity()) != null && activity instanceof FileDisplayActivity) { + return ((FileDisplayActivity) activity).isRoot(((FileDisplayActivity) activity).getFile()); + } + return false; + } + protected void prepareActionBarItems(SearchEvent event) { if (event != null) { switch (event.getSearchType()) { @@ -1571,7 +1581,7 @@ public void onMessageEvent(ChangeMenuEvent changeMenuEvent) { ((FileDisplayActivity) activity).initSyncBroadcastReceiver(); } - setTitle(themeUtils.getDefaultDisplayNameForRootFolder(getContext()), false); + setTitle(themeUtils.getDefaultDisplayNameForRootFolder(getContext()), isRoot()); activity.getIntent().removeExtra(OCFileListFragment.SEARCH_EVENT); }