Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Mixing ActionBar and Toolbar?

StephanSteinerStephanSteiner CHMember
edited November 2016 in Xamarin.Android

Hi

I need to extend my trusted old Android app that still targets JellyBean. One of the things to add is a search. When you search for search functionality, a lot of responses these days are about the toolbar, so I figured, why not give it a shot. So I tested out this sample: https://developer.xamarin.com/samples/monodroid/Supportv7/AppCompat/Toolbar/

Works fine.. but if I add another activity, gone are is the Actionbar that held the title (and that I'm using for menu options), and with that, the navigation option as well.

So, I'm wondering - is there a way to mix the two? Changing everything to use Toolbars would take quite a bit of time, especially since I'm using ActionBar Tabs.

Thanks

Posts

  • BerayBentesenBerayBentesen TRUniversity ✭✭✭✭

    @StephanSteiner ActionBar is dead. You need to update your project with Support Design Library which has TabLayout and combine that with ViewPager. It will work with 7.1 to Jelly Bean.

    Check here for detailed info about backward compatibility and library specs.

    Check here for view pager with tab layout example. You can inflate anything you want, not only recycler view that used in example.

  • @BerayBentesen : I was afraid of that. But, the app is not under active development, more like a one shot, so now that I have an order for an extension, I can't well go back and ask to rewrite everything (especially since my primary customer still runs and (locked down) Android4 devices). I've managed to get the search working in the Action bar, so for now, I'll stay with that.

    One question regarding your article.. why using the V4 lib, and not V7? (I had a look at what kind of backcompat libs there are.. and my head started spinning..).

  • BerayBentesenBerayBentesen TRUniversity ✭✭✭✭
    edited November 2016

    @StephanSteiner Support Design Library has dependencies which you can see in attachment I did not mention them. I forgot v4 since it's almost like a default library :smile:

Sign In or Register to comment.