Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,804,353 Members 40,910 Now Online
XDA Developers Android and Mobile Development Forum

[Library] Floating Action Button from Android L on Kitkat and below

Tip us?
 
EMINEM786
Old
#11  
EMINEM786's Avatar
Senior Member
Thanks Meter 51
Posts: 217
Join Date: Oct 2013
Location: Lcom/eminem786/warlock/MainActivity.smali

 
DONATE TO ME
Quote:
Originally Posted by Quinny899 View Post
Hi @Faiz Malkani

I managed to backport this to 2.1+, sources are here:
https://github.com/Quinny898/Floatin...nButton-Compat

Here's what the sample project looks like (not included, it's the same + AppCompat, which is complicated to add):
great work
 
prithvee
Old
(Last edited by prithvee; 18th July 2014 at 07:01 AM.)
#12  
prithvee's Avatar
Senior Member
Thanks Meter 328
Posts: 272
Join Date: Oct 2012
Location: Mangalore
looks FABULOUS using it in my next app .. thanks
Love an icon?? Keep it!! Hate an Icon?? Change it!! Do it all with Universal Icons



UNIVERSAL ICONS ON GOOGLE PLAY

SYSTEMUI ICONS ON GOOGLE PLAY


Checkout all my apps on

www.axndx.com


 
Exquisite Apps
Old
#13  
Exquisite Apps's Avatar
Member
Thanks Meter 29
Posts: 43
Join Date: May 2014
Lightbulb Idea

Hey, thank you for your effort. The FAB looks really good.

To further follow the new design guideline I would suggest that you extend your
Code:
setFabDrawable(Drawable fabDrawable)
method by one line.


Code:
public void setFabDrawable(Drawable fabDrawable)
    {
        Drawable myDrawable = fabDrawable;
        mBitmap = ((BitmapDrawable) myDrawable).getBitmap();
        mBitmap = Bitmap.createScaledBitmap(mBitmap, dpToPx(24), dpToPx(24), true);
        invalidate();
    }
This makes the fabIcon as big as it should be regardless the source.


Thanks anyways.
The Following User Says Thank You to Exquisite Apps For This Useful Post: [ Click to Expand ]
 
Gilbert_Sarip
Old
#14  
Member
Thanks Meter 17
Posts: 74
Join Date: Dec 2011
Location: Commewijne, Meerzorg
Thanks
HTC Wildfire >> LG Optimus G E975 >>???
Device: LG Optimus G E975
OS & Kernel: Stock LG Rom (KitKat 4.4.2)
 
brb123
Old
#15  
Member
Thanks Meter 5
Posts: 41
Join Date: Feb 2010
For some reason I keep getting this error, although I think all files are in the right place..

"Rendering Problems The following classes could not be found:
-*com.faizmalkani.floatingactionbutton.Fab (Fix Build Path, Create Class)
Tip: Try to build the project. "

What could I do to fix this?
Galaxy nexus
Paranoid Android
Franco or Trinity Kernel

 
ywwynm
Old
#16  
Junior Member
Thanks Meter 1
Posts: 1
Join Date: Aug 2014
Thanks for your contribution.

But can you teach me how to import the class?

I have imported the jar but I can't use the Fab in .XML file.
There is no mistake but log told me that 1. com.faizmalkani.floatingactionbutton.FloatingActio nButton failed to instantiate
and 2. Paint.setShadowLayer is not supported...

So I need a hand. Can anyone help me?
The Following User Says Thank You to ywwynm For This Useful Post: [ Click to Expand ]
 
Yes4g4me
Old
#17  
Junior Member
Thanks Meter 1
Posts: 17
Join Date: Jul 2014
I can test an apk if its ready. drop me a load don't be shy
 
Quinny899
Old
#18  
Quinny899's Avatar
Recognized Contributor
Thanks Meter 3,888
Posts: 6,266
Join Date: Jan 2011
Location: Bolton le Sands, Near Lancaster, UK

 
DONATE TO ME
Quote:
Originally Posted by ywwynm View Post
Thanks for your contribution.

But can you teach me how to import the class?

I have imported the jar but I can't use the Fab in .XML file.
There is no mistake but log told me that 1. com.faizmalkani.floatingactionbutton.FloatingActio nButton failed to instantiate
and 2. Paint.setShadowLayer is not supported...

So I need a hand. Can anyone help me?
It's working, it just doesn't render in the XML builder

Sent from my Nexus 7 using Tapatalk

 
Devices:
Nexus 5
Galaxy Nexus
Nexus 7 FHD
Archos 80 G9
LG GT540
The Following 2 Users Say Thank You to Quinny899 For This Useful Post: [ Click to Expand ]
 
kitkat85
Old
#19  
Junior Member
Thanks Meter 0
Posts: 1
Join Date: Aug 2014
Quote:
Originally Posted by Faiz Malkani View Post
FABulous

So, Material Design is here and its beautiful. But wait. Its not here yet. And its not for everyone either. So while Google does its thing and squashes bugs and whatnot, why not give your pre-L apps a Material look? Making the ActionBar 56dp high is the most obvious way to go. But why not take it a step further and add the floating action button like the one that the Google+ app has? Too complicated? This library has got you covered. With just a few lines of code, FABulous allows you to add the button and customize its color and drawable too.
It seems you completely miss to recycle the typed array with a try finally block in the constructor of your custom view.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes