Fix back arrow appearing as hamburger icon

Signed-off-by: ZetaTom <70907959+ZetaTom@users.noreply.github.com>
This commit is contained in:
ZetaTom 2023-06-22 17:11:55 +02:00
parent 7c69cbeee1
commit 391ffa5b1d

View file

@ -1519,7 +1519,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
setTitle(R.string.drawer_item_shared);
break;
default:
setTitle(themeUtils.getDefaultDisplayNameForRootFolder(getContext()));
setTitle(themeUtils.getDefaultDisplayNameForRootFolder(getContext()), false);
break;
}
}
@ -1586,7 +1586,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
((FileDisplayActivity) activity).initSyncBroadcastReceiver();
}
setTitle(themeUtils.getDefaultDisplayNameForRootFolder(getContext()));
setTitle(themeUtils.getDefaultDisplayNameForRootFolder(getContext()), false);
activity.getIntent().removeExtra(OCFileListFragment.SEARCH_EVENT);
}
@ -1832,18 +1832,30 @@ public class OCFileListFragment extends ExtendedListFragment implements
}
}
/**
* Theme default action bar according to provided parameters.
* Replaces back arrow with hamburger menu icon.
*
* @param title string res id of title to be shown in action bar
*/
protected void setTitle(@StringRes final int title) {
setTitle(getContext().getString(title));
setTitle(requireContext().getString(title), true);
}
protected void setTitle(final String title) {
getActivity().runOnUiThread(() -> {
/**
* Theme default action bar according to provided parameters.
*
* @param title title to be shown in action bar
* @param showBackAsMenu iff true replace back arrow with hamburger menu icon
*/
protected void setTitle(final String title, Boolean showBackAsMenu) {
requireActivity().runOnUiThread(() -> {
if (getActivity() != null) {
final ActionBar actionBar = ((FileDisplayActivity) getActivity()).getSupportActionBar();
final Context context = getContext();
if (actionBar != null && context != null) {
viewThemeUtils.files.themeActionBar(context, actionBar, title, true);
viewThemeUtils.files.themeActionBar(context, actionBar, title, showBackAsMenu);
}
}
});