Hello this is Martez Arkadi and in Israel you're ready to learn about floating a view over other views
in Android.
The feature that you may see on other apps such as Facebook.
So let's see how we can create this feature.
Let's create a new site actually and you Andrew it's your project.
I'm here for the application name just in here.
Floating view.
So here you can specify the company domain and the project location.
So here you can see these two checkboxes here.
The first one says include C++ support and the second one says include Kathleen support.
So we use neither of these options.
We do not want to actually support the C++ or programming language or the code in programming language
so to not check these boxes here and just click on next.
So here for the minimum STK to Android a five point one lollipop.
Or you can actually choose Actually the kid chats 4.4.
But I think 5.1 is good because by targeting API 22 and later your app will run on approximately sixty
two point six percent of the devices that are out there that are registered on Google Play.
So here just choose Android 5.1 lollipop as the mini SDK and then click Caloocan next.
So here is interactivity next.
And here make sure that the activity name is actually the main activity you can change this name if
you want to but I recommend that you leave it as default and make sure that this box is checked generate
lay out fine.
And this is the lay out name.
So it is good activity and there like Maine and make sure that these safe boxes are back for compatibility
app compact is actually checked.
So this could become finished so now that the product is created lets go into this activity underlayment
at them in here.
So if you want to open this file you just need to open the Android you at the left hand side by just
clicking on the file at the top menu or they you just click on and they view the top menu tool windows
and then click on project and then it's going to open the view here for you make sure that here it is
Android.
If it is not Android just click on these two little triangles here and click on Android to open the
Android view.
And here in this race for lay out folder double click on this activity and alignment of this image here.
So let me remind you that in order to make this area wider here.
Now let's delete this hello world takes three here at the center and here take a look at this company.
This componentry section here at the bottom left corner.
It says a componentry.
So here we have this constraint play out as the parents let parents play out.
So let's change these concerns into play out to really play out at the bottom.
We have these two taps the design tab and the text tab.
Let's assume to the design tab.
And here we have this one android that supports the strength that comes through intellect.
Let's delete this value just highlights its value here and then delete it and instead just type in your
relative with capital or relatively out and now you can see that for the end tag here.
It's also relatively out.
Let's use the design tab.
Now inside this componentry section it says relatively out as the parents lay out.
So now I want to add a button to these relatively up here inside this pallet section.
Just click on all and then select a spot in and drag it here into this relatively let's put it at the
center.
So now first let's change the background and color of related play and just select is relatively out
here.
And inside these attributes section we have this search.
I can just click on it.
Now I can actually search for a specific attribute.
So it's going to be background attributes.
And here I wanted the background color of this relatively out here to be read.
So just for typing here hash tag.
So we have all the G-B values right.
R stands for red G stands for green and B stands for Blue.
Each of these letters represent two numbers.
So here for they are just going to be red.
I'm going to type in here if it is going to be pure red and I don't want to have the blue color or the
green green color.
So for the green color I just put 0 0 and for the blue color I also put 0 0 and then press enter on
your keyboard.
Now the background color is actually a pure red light.
So now let's change the background color of this button at the center of this relatively out to blue.
So just select this pattern here and again inside this attribute section.
Here we have this back and an attribute.
So just typing here hash tag.
Now I want you to pause the video and specify the background color of these button to be blue OK by
using our G-B values.
So when you are ready to play the bit you get ready go.
So now let me show you how you can actually change the background color of this button by using B values
so you just need to put hash tag you don't want to have a red not a color right.
So we just put 0 0 we have G which stands for clean.
Again we don't want to have a green color which we again put 0 0 here and we have to be stands for blue.
So we want pure blue.
So I just put f f if you want to you can actually use Phi Phi.
It's going to actually give you a blue color but it's not going to be an intense blue color.
It's going to be more light blue color.
So let's trews if you want to you can actually test this color with other values for example number
1 2 3 5 6 7 8 9.
Or if and then press enter key on your keyboard.
Now the background color of this button is pure blue.
And he wants to text the color of this button to be white.
So select the spot in here and inside this search section let's search for text color text color.
Now we have this text color attributes.
So I want that back and uncle that takes color of this button to be white.
So I just need to put it if it f f f and that person into chair on your keyboard.
OK so as you can see I forgot to put hash tag before this f f f here for the value of this text color
and that's why it's not giving us the result that we are actually after.
So before this if if if we must put a hash tag.
So just select it and put a hash tag here and then press on into your keyboard.
Now it's giving us the result that we are looking for.
So that's it.
And now let's actually change the text of the spot in so select the spot.
And here inside the search area you can see this close icon.
Just click on it in order to close this specific attribute and in order actually to see other attributes
you're right.
And again inside this search bar search for the text attributes.
Now we have this text attribute here.
So for the value I can put a floating point in floating bottom and then press on and to key on your
keyboard.
So that's it.
Now let's also give an ID to the Spartan.
Again let's actually close this search and let's search for ID attribute and for the ID just put PTEN
floating in between had floated and then press on into the key on your keyboard in order to separate
this value.
Now it's time to go inside our Java code.
So open the main activity of a file if you don't know how to open this file.
You just need to open the entry to view.
So at the top menu you just need to click on view to leave windows and then click on project you will
Vino's project and then it's going to actually show you the Android view here and then open the app
for there.
We have this Java for that open it and we have this first package here.
Just open it and then you can see this file.
This main activity fight.
So let me tell you on this that you know there's to make this area wider So this video is already very
long and I think that's enough for this tutorial.
If you have any questions about the concepts that you've have that you have learned so far please post
the discussion in the course and then I do my best to answer all of your questions.
And in the next story are we going to continue building the floating view application.
And I look forward to seeing you then.