java - Android L - Floating Action Button (FAB) -
did google released defined style or component new circular fab button or should implement design on own?
the button described here: google design | floating action buttons
edit (05/2015): check lukas' answer / gabriele's answer showing easy way implement design support library.
update: there's official widget fab: floatingactionbutton, see gabriele mariotti reply full information.
according adam powell , chet haase didn't create widget fab button cause it's easy component reproduce.
there question in google io 2014 speech "google i/o 2014 - material science: developing android applications material design", @ end of speech (at 37:50) there question, can hear here: https://www.youtube.com/watch?v=lsh9akxjgt8#t=2280
chet haase says there's roundedbitmapdrawable (i didn't check if that's name) should job of defining outline.
but can own drawable, set elevation , define circle outline programmatically.
this should give round button shadow on l release. think you'll have build shadow pre-l on own.
i should check code cardview see how reproduce shadow pre-l. i'll that, not have time now. if no 1 pops in details i'll after i've found time go , check up.
edit:
gabriele mariotti (see answer below, thank you) added code show how it.
thanks @shomeser comments, wrote library make fab button:
https://github.com/shamanland/floating-action-button
to use it:
dependencies { compile 'com.shamanland:fab:0.0.3' }
you can read answer question: how can add new "floating action button" between 2 widgets/layouts
Comments
Post a Comment