From 3bfea3034722a2ff815df4bedcc58ab440bc6576 Mon Sep 17 00:00:00 2001 From: A117870935 Date: Wed, 28 Jun 2023 12:52:45 +0530 Subject: [PATCH] Fix back arrow appearing as hamburger icon. NC PR: https://github.com/nextcloud/android/pull/11769 --- .../android/ui/fragment/OCFileListFragment.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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); }