Move the selection mode into the bottom bar

Product: 9.2.3

Product Version: Native Android SDK

Please give a brief summary of your issue:
Cannot figure out how to put the view selection mode into the bottom bar

Please describe your issue and provide steps to reproduce it:
Is it possible to move the view selection mode button in the top toolbar (I know not easily visible with theming yet) to the bottom bar?

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

The iOS SDK allows this UI change and curious if the Android SDK allows it as well :slight_smile:

Hi,

For Android you will need manually create your own custom UI. If you wish to retain the same functionality you will need to hook up the toolbar switcher events manually. Here is some documentation on achieving that:

To hook up a button to trigger the switcher please see this method:

To update the toolbar switcher text after switching toolbars you can utilize this listener:

Thanks,
Andrew.

@ama I tried making a custom UI by using the BottomBarBuilder but the BottomBarBuilder won’t let me insert the ToolbarSwitcherButton into it. It will only let me include an icon with a title and an id. Is there a way I can take the ToolbarSwitcherButton and insert it into the bottom bar nav?

This is what I’ve tried. I used the

.addCustomSelectableButton(
                        R.string.billing_invoice,
                        R.drawable.ic_billing_icon,
                        R.id.bottom_bar_view_toggle_btn
                    )

as the trigger for the view toggle. I set a case in my when statement in the override fun onToolbarOptionsItemSelected and when R.id.bottom_bar_view_toggle_btn is selected I trigger the view toggle bottom sheet pdfViewCtrlTabHostFragment?.handleToolSwitcherClicked(binding.root). Here’s my full code inserting the toolbarSwitcher trigger in the ViewerConfig:

.bottomBarBuilder(
                BottomBarBuilder.withTag("customBottomNav")
                    .addCustomButton(
                        R.string.pref_viewmode_thumbnails,
                        R.drawable.ic_thumbnails_grid_black_24dp,
                        R.id.action_thumbnails
                    )
                    .addCustomButton(
                        R.string.action_search,
                        R.drawable.ic_search_white_24dp,
                        R.id.action_search
                    )
                    .addCustomSelectableButton(
                        R.string.pref_viewmode_reflow,
                        R.drawable.ic_view_mode_reflow_black_24dp,
                        R.id.action_reflow_mode
                    )
                    .addCustomSelectableButton(
                        R.string.billing_invoice,
                        R.drawable.ic_billing_icon,
                        R.id.bottom_bar_view_toggle_btn
                    )
            )

Ideally I would like to insert the ToolbarSwitcherButton instead of using the addCustomSelectableButton builder function.

Hi @seth.pacheco

You won’t be able to add the ToolbarSwitcher into the BottomBarBuilder by using addCustomSelectableButton. You will have to create your own native view which contains your own implementation of the ToolbarSwitcher using the methods I’ve included in my previous reply.

Thanks,
Andrew