Hello I'm Gaffigan and welcome Bob Dylan.
What you do realize in today's video we will be talking about floating action button.
So what is it.
It is a so-called globally floating above the user interface and can be used to trigger some positive
actions.
And when I say positive I mean share or create extra sexual it's available in two sizes.
Normal in many.
So let's discover floating action button today.
Let's create a new project
let's call the project during action button or fab tutorial.
So let's call it fab tutorial.
Let's hit the next button again.
We're going to keep on monuments that just repeat why so that we can do no obligation on almost 100
percent of the devices funding I'm doing in the world.
Let's hit the next button.
Let's start with an empty activity.
Let's go to first light duty as main activity.
Well onwards studio is building our project.
So let's wait while products build and we're ready to go on to use a floating action button.
We need to our dependency in the grid.
So let's do that first.
So coming to greater application to let's other dependence issues.
So implementation com dot Android dot support design the vision which is twenty six point one point
zero.
Let's sing the greater Well the greater St..
I'm willing to do the flooding option button.
So let's close this on let's close this file.
Moving on to the left file which is activity main example the floating action button needs to be close
in a coordinate rollout.
So let's do that.
So let's just get rid of this constraint cloud and order coordinate all melt.
OK let's start affording action button so loading action button where drop content high drop content
let's go I did it with an icon so a saucy we need a droid both so let's create one project resources
right click new Lecter asset let's click on this I can button and let's just use I can.
OK let's rename it let's the next button on just created well Joy is ready to use so let's just use
it to use it goes I see I know God got or I can use.
So that's this whole review.
OK let's bring it sure.
So as you can see it's on the top left corner.
So let's bring it to the bottom.
So let gravity bottom on and OK.
And as for Google's material design guidelines the floating action button needs to have at least 16
degree of margin.
So let's try.
OK.
So margin say 16 DP.
Well that looks good.
Let's give the top size as normal.
OK.
Let's below obligation and have a look.
Well our obligation is vote.
So let's have a look.
Okay offloading action button is visible on like nothing's happening.
Okay so let's order some animation here.
So let's be primary color dark and let's.
I don't want lip listening.
So let's just close this coming to our main activity.
But before that that's an idea for this loading option button.
So let's call it FOB.
So coming to the java file we need an instance of the floating action button so let's create one.
So private floating action button
let's call it
FOB.
Okay let's initialize it.
Farmers will do fine.
But Ida auto I.T. FOB.
That's a item on the listener now.
So far said on Good Listener new on good listener.
Okay.
That's is generally the those two so toast but made Dex.
That's the context so I may not do due to a loss.
Sorry may not do any of this lets out a message so let's say I clicked FOB and that's the duration so
we just lent short.
Let's just call the show function.
Give it to let's run an application again.
GIGOT.
Well the obligations both so let's have a look.
Let's click on this.
So as you can see there's some bluish ripple effect when I click on it shows a don't click FOB.
OK so we saw a normal hearing option but you know let's check out the many fine vision so coming here
and let's just change the font size too many.
Okay let's run our application again.
Well applications up so let's see.
And as you can see off loading my action button is small.
So the manifested vision is what and the normal vision is of the 60s.
Okay let's click here on it shows like FOB.
Well that's also floating action button guys.
If you have any doubts any queries so far feel free to drop a comment and we'll go through it.
But I think the.