st235 / ExpandableBottomBar

A new way to implement navigation in your app 🏎
MIT License
777 stars 58 forks source link

ExpandableBottomBarNavigationUI navigation not working when onItemSelectedListener added #59

Closed dino-sunny closed 3 years ago

dino-sunny commented 3 years ago

ExpandableBottomBarNavigationUI navigation not working when onItemSelectedListener added to disable notification when tab clicked

st235 commented 3 years ago

Hi @dino-sunny 👋,

Thank you for provided info.

It's sounds like expected behavior. Can you, please, explain why you need listen item selection with navigation ui?

Kind regards, Alexander Dadukin

dino-sunny commented 3 years ago

I need to hide the notification dot when the user clicks on a specific menu item.

st235 commented 3 years ago

Sounds fair Yeah, will update the library then

st235 commented 3 years ago

@dino-sunny,

by the way, looks like default BottomNavigationView view behaves in the same strange way. Moreover, looks like it was done by intention, not by an incident. Probably, you need to listen to onDestinationChanged callback in your case

notjedi commented 3 years ago

@st235 sorry to bother about something silly but how do you create pr's to your own repo. i know you could crate a pr if you have a branch but you don't seem to have any. how do you do it? thanks and sorry.

st235 commented 3 years ago

@jedi2610, hi 👋

Thank you for reaching me out. However, this issue is not related to your problem and may confuse other participants in the conversation. I would recommend you to open another issue further. Moreover, there are a lot of different ways to contact me if you have some unspecified topic question. For example, you can drop me a letter via email.

Answering your question: as you can see at closed PRs there are always existed a branch, but when the feature (or any work in the branch) is over it's no longer needed to keep this branch separately, so, I would prefer to delete it. Hopefully, provided explanation gave you a brief summary of how does it actually work at this repo.

Kind regards, Alexander Dadukin

dino-sunny commented 3 years ago

Sure, Thank you

On Tue, 29 Sep 2020 at 01:49, Alexander Dadukin notifications@github.com wrote:

@jedi2610 https://github.com/jedi2610, hi 👋

Thank you for reaching me out. However, this issue is not related to your problem and may confuse other participants in the conversation. I would recommend you to open another issue further. Moreover, there are a lot of different ways to contact me if you have some unspecified topic question. For example, you can drop me a letter via email.

Answering your question: as you can see at closed PRs there are always existed a branch, but when the feature (or any work in the branch) is over it's no longer needed to keep this branch separately, so, I would prefer to delete such branches. Hopefully, provided explanation gave you a brief summary of how it's actually working at this repo.

Kind regards, Alexander Dadukin

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/st235/ExpandableBottomBar/issues/59#issuecomment-700259464, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGM7XE4H4BF65GVMEZK5KRTSIDVWFANCNFSM4RUDZQNQ .

-- Thanks and Regards Dino Sunny ph:7293720790

notjedi commented 3 years ago

@st235 okay thanks. and if there is anything else i'll reach you out via email.

st235 commented 3 years ago

Hi @dino-sunny 👋

Thank you for your patience, I really appreciate it. Yeah, my initial guess was right - when you're using NavigationUI you don't need to listen to onItemSelected event separately. All you need to do is subscribe to destinationChangedListener and implement the desired behaviour in it, for example like in:

        navigationController.addOnDestinationChangedListener { controller, destination, arguments ->
            if(destination.id != R.id.fragment1) {
                val navigation = bottomNavigation.getNotificationFor(R.id.fragment1)
                navigation.clear()
            }
        }

Hopefully, it helps.

PS: BottomNavigationView follows exactly the same behaviour

Best wishes, Alexander Dadukin