Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting Badges #14

Open
craigathon opened this issue Apr 6, 2018 · 10 comments
Open

Setting Badges #14

craigathon opened this issue Apr 6, 2018 · 10 comments

Comments

@craigathon
Copy link

craigathon commented Apr 6, 2018

Is it possible to set badges with this solution? I found it is exposed in bottomnavigationviewex but I'm not seing how to access the instance.

Is there a way I pull it out similar to
FindViewById<BottomNavigationViewEx>(Resource.Id.bnve);

https://github.com/NAXAM/bottomnavigationviewex-android-binding/blob/72c6718d47f31ecd5f53cd14d51f094ade89694b/BottomNavExtentionExample/code/BadgeViewActivity.cs

@tuyen-vuduc
Copy link
Contributor

Badges aren't supported by now. It'll be great if you could make a PR for that feature.

@craigathon
Copy link
Author

@tuyen-vuduc I'll implement in my own project and see how it fits in. Thanks for the response.

@Axemasta
Copy link

@craigathon I am currently in the middle of combining this library with Xabre's badge library. I'll probably know on Monday whether the 2 are compatible, I'll keep you informed!

@craigathon
Copy link
Author

@Axemasta Awesome, let me know if you need help checking anything out. I'm very interested in that approach. I too already use that badge library for iOS. The clean way badges can be set from xamarin forms is ideal.

@Axemasta
Copy link

@craigathon No luck so far, it seem that tab badge overrides bottomtabbedpage so that you get a nav bar with badges.... rendered at the top of the screen. I'm just sort of leaving the badge feature for android (as it's more important that the tab bar is at the bottom) and will visit it in my own time.

@vivekshah-zymr
Copy link

@craigathon @Axemasta @tuyen-vuduc
I want to implement bottom tab bar with badges for Android and iOS platform, tried several ways but can't find a proper solution.
Can anyone help me with this?

@Phenek
Copy link

Phenek commented Oct 25, 2018

Any workAround?

@Axemasta
Copy link

@vivekshah-zymr You can use Xabre's Tab Badge Library to add badges, it is not compatible with this library however.

My app sacrificed badges on android to have a bottom tabbed page (pre 3.1). You won't get badges with this library, you could try and combine the Xabre library with the new bottom nav that coems natively in Xamarin Forms.

@Phenek
Copy link

Phenek commented Oct 26, 2018

Hey @Axemasta,
First thanks you bring me to the right Librairy 👍
Maybe you already known? But with Xamarin.Forms 3.x you can put the Android Tabbed page at the Bottom and it's official!

I found this https://montemagno.com/xamarin-forms-official-bottom-navigation-bottom-tabs-on-android/

And the Xabre's Tab Badge Library , they did a Pre-release 2.1.0-pre.3 to support it

@Axemasta
Copy link

@vivekshah-zymr @Phenek

You guys have probably overcome this issue by now but I thought I'd let you know anyway. I suggested the Xabre Plugin Badge Library and they now have full support for the native bottom tab page. This obviously invalidates this library (sorry guys) but everything this lib does is not available out of the box, thanks for the workaround!

All you need to do now is set the following attributes on your tabbed page:

On<Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);
On<Xamarin.Forms.PlatformConfiguration.Android>().SetIsSwipePagingEnabled(false);
On<Xamarin.Forms.PlatformConfiguration.Android>().SetIsSmoothScrollEnabled(false);

You also need to set the LabelVisibilityMode (>= 28) or ShiftMode (>= 27). This is covered in a James Montemagno blog.

Now finally my app does on android what it's done on iOS for a while now! 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants