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

Please add a posibility to change menu programly #61

Open
Kolyall opened this issue Mar 24, 2017 · 4 comments
Open

Please add a posibility to change menu programly #61

Kolyall opened this issue Mar 24, 2017 · 4 comments

Comments

@Kolyall
Copy link

Kolyall commented Mar 24, 2017

Please add a possibility to change menu programmatically, because now it can be set only from layout:
app:fabMenu="@menu/menu_fab"

@Henriquedn
Copy link

@Kolyall I also wanted to change menu at runtime.
For now its much easier and expressive to create multiple fabs on the xml with your menus and set visibility of the fab at runtime to the one you want to display.

@Kolyall
Copy link
Author

Kolyall commented Mar 27, 2017

@Henriquedn can you post an example how you change visibility for menu items?

@Henriquedn
Copy link

@Kolyall am assuming there is something (data) on your fragment/activity that determines which menu you want to be inflated by the fab.
assume data boolean x show menu A when true, show menu B when false.

Create two Fabs
fab one with menu A and
fab two with menu B

if(x) show fab one
if(!x) show fab two

this is just a quick fix not the actual implementation

@Kolyall
Copy link
Author

Kolyall commented Mar 28, 2017

@Henriquedn
There is no any data that determines which menu you want to be inflated by the fab,because inflate is in xml of the FAB
for ex:

<io.github.yavski.fabspeeddial.FabSpeedDial
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        app:fabGravity="bottom_end"
        app:fabMenu="@menu/menu_fab"//here is inflate of the menu
        />

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

2 participants