markormesher / android-fab

Floating action button (FAB) for Android with speed-dial menu functionality
Apache License 2.0
211 stars 29 forks source link

Make the menu items easier to customize #33

Closed ddinchev closed 5 years ago

ddinchev commented 6 years ago

Hey there!

First, thanks for this brilliant small library.

I have one issue though - I've been trying to customize the round menu items - to make them slightly larger. This became a quite involved exercise as there are sizes (which programatically require conversions of dp to px), multiple offsets, paddings and margins to realign. Is it possible that such customizations are easier to do - via the SpeedDialAdapter for example? Or maybe there is an easy way to override the library resource files (menu_item_icon.xml) that I don't know about? If there is an easy way to achieve what I want, can we document it in the README?

Thanks!

markormesher commented 6 years ago

Hey @ddinchev - glad you like the library so far! I'm curious to know what your use case is for making them larger than standard? The icon sizes are based on the Material Design spec from Google, but that doesn't mean you shouldn't customise them if it's more suitable for your application.

As for actually making them bigger, you're right that there are quite a few moving pieces to alter, so it's something that would be easiest to achieve in the library and expose as a setting, rather than requiring developers to change them manually and risk breaking capabilities in the future. I'll probably have time to build something in the next week or two. I'm thinking that the best way will be to expose a setting that makes the speed dial icons either their current size or the same size as the FAB - what do you think?

pascalguizard commented 5 years ago

Hey, I relaunch this subject because i want to customize SpeedDialMenuItem background-color but i can't. You think is possible to update SpeedDialMenuItem class or anything else to allow some visual updating ?

Thanks !

pascalguizard commented 5 years ago

Oh it's already possible ! We can use override fun getBackgroundColour(position: Int): Int in SpeedDialMenuAdapter to change background color for item at specific position.

Sorry for my previous post. Already is OK

Thanks !

markormesher commented 5 years ago

Closing due to inactivity.