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

Selected on item does not work #77

Open
Polyterative opened this issue Feb 13, 2020 · 0 comments
Open

Selected on item does not work #77

Polyterative opened this issue Feb 13, 2020 · 0 comments

Comments

@Polyterative
Copy link

when declaring an item, selected is never listened to. It always puts the first item as selected no matter what I set (trueor false).

I rebuild the drawer on each activity change (even if I know that fragments are better, bear with me) taking care to set selected on the item in relation to the Activity i'm building. Still it does not work.

Demo

CKDon1XHH4

Code

        drawer {
            toolbar = localToolbar
            onClosed { drawerClosedStream.onNext(0) }
            primaryItem(R.string.title_activity_tracking) {
                onClick { _ ->
                    drawerClicksStream.onNext(AppConstants.Activities.TRACKING)
                    false
                }
                selected = origin == AppConstants.Activities.TRACKING
            }
            divider { }
            primaryItem(R.string.title_activity_manager) {
                onClick { _ ->
                    drawerClicksStream.onNext(AppConstants.Activities.MANAGER)
                    false
                }
                selected = origin == AppConstants.Activities.MANAGER
            }
            primaryItem(R.string.title_activity_pin_manager) {
                onClick { _ ->
                    drawerClicksStream.onNext(AppConstants.Activities.PIN)
                    false
                }
                selected = origin == AppConstants.Activities.PIN
            }
            divider { }
            secondaryItem(R.string.title_activity_settings) {
                onClick { _ ->
                    drawerClicksStream.onNext(AppConstants.Activities.SETTINGS)
                    false
                }
                selected = origin == AppConstants.Activities.SETTINGS
            }
            secondaryItem("Help") { selectable = false }
            footer {
            }
        }

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

1 participant