So that we implemented our own trauma that we need to add our custom view to our activity underline
main that example.
So let's open our activity and illuminate exemplified here.
Let's delete this hello world takes you here let's switch to the text tab.
Let's go inside these constraints.
Lay out and here let's say this actually of an attack and let's say that we have our my second he had
my custom view as you can see as I'm typing my custom view is referring to this package to this class
that we have inside the spec is my custom view.
Let's use this font and the press and enter the channel.
But it has calmed that example that Martha saw that this is the name of a package that custom view app
that my custom view class.
Now we can specify that lay.
Beat the rap content against that content.
Let's specify an I.D. for disgusting views.
Second here ID outside Plus Id slash.
So the idea is going to be custom view and also we have some specific attributes that we provided for
this custom view.
Inside are my custom view attributes that example we have for example the view color right the view
color attribute.
And here we can put a hash tag.
For example I want the color of the view to be blue.
We can use R.G. be colors.
So for the R which is red we put 0 for the green again 0 0 and for the blue if we put nine of and for
example if we have the text the color frequency takes color attribute hash stack and I want to text
color to be red.
So I put 9 9 0 0 0 0.
And finally we have the text as your attribute so we can say just type in a text.
As you can see it starts with app called in view text.
It is related to our custom view right view text and the text is going to be awesome.
So now we can run the app.
So just like Just click on this play button run button.
This use that emulator and then click on OK.
Here we have our custom view inside our layout and we have this text here inside our view this circle.
So that's it.
Let's go back and read Sudoku as you can see.
These errors are actually shown here.
Now we can go inside is my custom we have a file.
And if you want we can actually change these values.
For example let's change this radius to 300.
Let's run the app again.
Let me show you the emulator.
And here we have this awesome or for the X and for the circle X and the circle y we can change these
values for we can say 500 for the second X and 500 for the circle Y.
And as you can see the awesome text is here.
But the shape or the circle is here and that's why we didn't put the x and y for these text.
We also need to specify the x and y of the text.
So let's change this one to five hundred and five on that.
And that's why I told you you should specify to x and y the same as the circle.
Let's run the app again.
And here we have the awesome text at the center of our circle.
We can also change the text size of our text.
For example free let's change this thirty two for example 60 this Irania.
Now we have this awesome.
At the center of our circle.
That's it.
In the next tutorial we're going to show you how to manipulate this custom view how for example what
happens when the user clicks or taps on this view.
We're going to show you how to do that.
Thank you very much for watching.
And I will see you in the next tutorial.