So here I just need to double click on this text view and here for the text.
Again I can just type in indices and other text.
And for the idea I just I can't just type into the value OK and then press on into the key on your keyboard.
So now it's actually two buttons here.
So just select this button inside.
We just fold it and put it at the center of this linearly Ellsworthy call.
And for the for the lay out we assign the value match parent and double click on it.
And for the text just typing here font one and for the ideas that I've been here between four and one
and then press Enter key on your keyboard and now it's actually right and other button into this linearly
alphabetical so just put it at the center of this linearly or vertical.
And for the lay out which is the value match apparent double click on it and for the text just type
in here for it to and for the ID just type in here between and two and then present Enter key on your
keyboard.
So now let's actually go back to our main activity that job right here and now let's actually instantiate
these buttons that actually create these buttons and then instantiate them.
So after creating these text view object here I can just type in in between font 1 assignment operator
and in say The Apprentice's I need to cast this object to a button object find view by I.
Excuse me find view by ID are that ID that PTEN one.
And then I need to put a semicolon at the end of my statement.
Again I need to create another button object PTEN font to assignment operator and that I need to cestus
object to a button object find view by ID are that already that PTEN fun too.
And then I need to put a semicolon at the end of my statement.
So now let's actually make these buttons are listening to the police of the user.
So here I can just type in between phones.
One data set.
Unclick listener.
And for the argument here we need to actually pass the context so the context is this class.
I can just type in here main activity that this and again I can't just type in between form two that
said Uncle Clisson our main activity that this.
And now we need to actually implement the the view that actually listen or interface.
So here I can just click on this error here and then hold the option key hold the option and then person
Enter key on your keyboard.
So if you are using a Windows machine you need to hold the old key and then press on the Enter key on
your keyboard.
So as you can see here here it is actually recommending us some solutions.
So here just choose this one major main activity implement Android that view that view that unclick
listener.
So just select this option here and here it says of any to implement this Meffert and click to just
click OK.
And now as you can see I have this Smurfette here inside my main activity class and here it is actually
implementing this and click this in an interface.
Ok so now let's actually change the name of this argument.
That is of typed view to view.
And now I want to actually differentiate between clicking of these buttons.
OK.
BT and 12:56 and BT and front too.
So here I can just create a switch statement and here I can just type in your view that gets ID and
then I need to open and close the switch statement.
And he had a They've statement here case.
So if the user clicks on this BT and found one now I can't just type in our thought Id that's PTEN font
one colon break.
And if the user clicks and is PTEN phone to here I can just type in art that ID that PTEN phone to call
Colin bridge.
So if the user clicks on this button Pythian 12:56 I want to actually use this phone here for phone
to name one.
And if they use that Corisande city and phone to I want to use these phone to name two.
So here I can just typing.
So me actually did it start this line of code here that actually that is actually setting the typeface
of this text the value.
So now when the user clicks on the city and one you want to actually use the default one here as you
can see here I have this form to name one so I can just type in here takes the value.
So as you can see here I cannot be fair to the name of this ATX the value because this takes the value
takes view is actually created inside this uncreate method.
And I cannot refer to the name of this the value object in sight.
My uncle each method that is outside of this uncreate method.
So how do I fix this problem.
The solution for this problem is that we need to actually declare this object outside of this uncreate
method and inside of this main activity class.
So here I can't just delete this text view here.
And as you can see here we have this error because it cannot understand where this takes the value is
actually declared.
And inside our main activity class here I can just create a text view.
The value and I just need to put in a semicolon here so here I'm just declaring this object.
And now inside our uncreate Mefford we are just instantiating DCX the value and insight are unclear
uncooked Metford I can't actually refer to the name of this object takes the value that sets type face.
And now you want to refer to the name of this form to name one.
So because these two objects that are of type typeface for name one and Phonte to name two are actually
declared inside this main activity class.
OK.
And these are actually instantiated in it is uncreate never the case here.
Inside is unclear Smurfette.
I can actually fair to the name of these typeface objects.
So here I can just type in the value that set typeface for example font name one.
And when that user clicks and this PTEN form to here I can just typing TXI the value that said typeface
font name to and here as you can see I have this error and I forgot to put the case here Case statement.
And now as you can see the error is gone.
Case r that I'd eat that between two DXi value that said typeface Fontenay to break.
And here I have this case are that ID that bitti and one takes the value that said typeface font.
Name one page.
So when the user clicks on this bit here and one here is going to actually use this Fontenay 1:46 the
value.
And when the user clicks and expedient form to button here it's going to actually use this phone.
Named to 40 sticks the value.
So let's let's actually run our project and see what happens.
So now as you can see our application is running on this emulator.
So here I just need to click on this the front one.
And now as you can see the front of this takes is actually changed.
So let's actually click on this one too.
And now as you can see the font of this text is changed.
OK font 1 and 4 2.
So hopefully that makes sense.
And I think that's enough for this tutorial so if you have any questions please post the discussion
in the course and then I'll do my best to answer all of your questions.
Thank you very much for watching.
And another important point that I want actually mention is that a lot is that when I actually click
on this phone to name one.
Now as you can see the height of this text is actually changed according to the text that is inside
of this text view.
And if I click on his phone too.
Now again the height of this text is changed.
And that's because of this rap content attribute that we set for this takes.
So if I actually select this text view here as you can see the height of this text is rap content.
And if we actually change the slab content to for example of value for example 100.
Now if I press an interviewee on my keyboard.
Now let's actually on our project and see what happens.
So now as you can see our application is running on this emulator.
So here you can see that the height of this text view is 100.
And we cannot see the entire text that is inside of the stakes view.
So if you click on this one here now you can see disvalue is here.
And if I click on this phone to here now which we can only see this this is here and another takes is
actually hidden from us.
So it is you can it is your option.
It is you can actually choose what would be the value of the height of your text.
So for example I chose one high that he had I could choose for example 500.
So let's actually run our project again.
So now as you can see the height of my takes view is 500 and now I can see the text of these takes few
but I cannot see the buttons here in my layout.
So I think the 500 is too much.
So let's actually to change 500 to another value for example 200.
And now let's run our project again and see what happens.
So here you can see that our application is running on the simulator.
So if I click on this front one here now you can see this value.
And if I click on this I want to hear.
Now you can see this value.
But part of this vort here text is actually hidden from us.
This is another text but you can actually specify the height of your text view or you can actually use
a vertical scroll view and then put your user interface components inside that scroll view and you can
actually customize your layouts.
And I think that it.
So thank you very much for watching and I'll see you in the next tutorial.