1
00:00:00,720 --> 00:00:06,990
So here I just need to double click on this text view and here for the text.

2
00:00:06,990 --> 00:00:12,140
Again I can just type in indices and other text.

3
00:00:12,690 --> 00:00:19,030
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.

4
00:00:19,050 --> 00:00:22,350
So now it's actually two buttons here.

5
00:00:22,350 --> 00:00:23,960
So just select this button inside.

6
00:00:23,990 --> 00:00:29,770
We just fold it and put it at the center of this linearly Ellsworthy call.

7
00:00:30,000 --> 00:00:37,250
And for the for the lay out we assign the value match parent and double click on it.

8
00:00:37,560 --> 00:00:47,930
And for the text just typing here font one and for the ideas that I've been here between four and one

9
00:00:48,680 --> 00:00:54,560
and then press Enter key on your keyboard and now it's actually right and other button into this linearly

10
00:00:54,560 --> 00:00:58,650
alphabetical so just put it at the center of this linearly or vertical.

11
00:00:58,880 --> 00:01:05,320
And for the lay out which is the value match apparent double click on it and for the text just type

12
00:01:05,320 --> 00:01:13,250
in here for it to and for the ID just type in here between and two and then present Enter key on your

13
00:01:13,250 --> 00:01:14,080
keyboard.

14
00:01:14,420 --> 00:01:20,810
So now let's actually go back to our main activity that job right here and now let's actually instantiate

15
00:01:21,170 --> 00:01:25,270
these buttons that actually create these buttons and then instantiate them.

16
00:01:25,280 --> 00:01:34,340
So after creating these text view object here I can just type in in between font 1 assignment operator

17
00:01:34,770 --> 00:01:41,420
and in say The Apprentice's I need to cast this object to a button object find view by I.

18
00:01:41,600 --> 00:01:49,120
Excuse me find view by ID are that ID that PTEN one.

19
00:01:49,250 --> 00:01:52,310
And then I need to put a semicolon at the end of my statement.

20
00:01:52,700 --> 00:02:00,100
Again I need to create another button object PTEN font to assignment operator and that I need to cestus

21
00:02:00,170 --> 00:02:08,260
object to a button object find view by ID are that already that PTEN fun too.

22
00:02:08,480 --> 00:02:12,690
And then I need to put a semicolon at the end of my statement.

23
00:02:12,740 --> 00:02:17,270
So now let's actually make these buttons are listening to the police of the user.

24
00:02:17,360 --> 00:02:19,830
So here I can just type in between phones.

25
00:02:19,850 --> 00:02:21,340
One data set.

26
00:02:21,390 --> 00:02:23,090
Unclick listener.

27
00:02:23,930 --> 00:02:30,230
And for the argument here we need to actually pass the context so the context is this class.

28
00:02:30,230 --> 00:02:35,990
I can just type in here main activity that this and again I can't just type in between form two that

29
00:02:35,990 --> 00:02:39,980
said Uncle Clisson our main activity that this.

30
00:02:40,280 --> 00:02:45,530
And now we need to actually implement the the view that actually listen or interface.

31
00:02:45,710 --> 00:02:53,210
So here I can just click on this error here and then hold the option key hold the option and then person

32
00:02:53,630 --> 00:02:55,190
Enter key on your keyboard.

33
00:02:55,220 --> 00:03:00,290
So if you are using a Windows machine you need to hold the old key and then press on the Enter key on

34
00:03:00,290 --> 00:03:01,390
your keyboard.

35
00:03:01,730 --> 00:03:07,120
So as you can see here here it is actually recommending us some solutions.

36
00:03:07,190 --> 00:03:13,730
So here just choose this one major main activity implement Android that view that view that unclick

37
00:03:13,730 --> 00:03:14,350
listener.

38
00:03:14,480 --> 00:03:20,180
So just select this option here and here it says of any to implement this Meffert and click to just

39
00:03:20,180 --> 00:03:21,320
click OK.

40
00:03:21,800 --> 00:03:27,560
And now as you can see I have this Smurfette here inside my main activity class and here it is actually

41
00:03:27,560 --> 00:03:30,250
implementing this and click this in an interface.

42
00:03:30,470 --> 00:03:35,330
Ok so now let's actually change the name of this argument.

43
00:03:35,360 --> 00:03:37,560
That is of typed view to view.

44
00:03:38,000 --> 00:03:42,970
And now I want to actually differentiate between clicking of these buttons.

45
00:03:42,980 --> 00:03:43,250
OK.

46
00:03:43,260 --> 00:03:45,720
BT and 12:56 and BT and front too.

47
00:03:46,100 --> 00:03:53,630
So here I can just create a switch statement and here I can just type in your view that gets ID and

48
00:03:53,630 --> 00:03:56,110
then I need to open and close the switch statement.

49
00:03:56,120 --> 00:03:58,090
And he had a They've statement here case.

50
00:03:58,100 --> 00:04:05,280
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

51
00:04:05,300 --> 00:04:07,650
one colon break.

52
00:04:08,210 --> 00:04:15,460
And if the user clicks and is PTEN phone to here I can just type in art that ID that PTEN phone to call

53
00:04:15,650 --> 00:04:17,540
Colin bridge.

54
00:04:17,900 --> 00:04:23,670
So if the user clicks on this button Pythian 12:56 I want to actually use this phone here for phone

55
00:04:23,770 --> 00:04:24,640
to name one.

56
00:04:24,710 --> 00:04:29,600
And if they use that Corisande city and phone to I want to use these phone to name two.

57
00:04:29,660 --> 00:04:32,910
So here I can just typing.

58
00:04:33,030 --> 00:04:37,580
So me actually did it start this line of code here that actually that is actually setting the typeface

59
00:04:37,580 --> 00:04:39,310
of this text the value.

60
00:04:39,320 --> 00:04:46,580
So now when the user clicks on the city and one you want to actually use the default one here as you

61
00:04:46,580 --> 00:04:52,060
can see here I have this form to name one so I can just type in here takes the value.

62
00:04:52,190 --> 00:04:58,880
So as you can see here I cannot be fair to the name of this ATX the value because this takes the value

63
00:04:58,880 --> 00:05:02,950
takes view is actually created inside this uncreate method.

64
00:05:03,170 --> 00:05:07,880
And I cannot refer to the name of this the value object in sight.

65
00:05:07,880 --> 00:05:11,720
My uncle each method that is outside of this uncreate method.

66
00:05:11,720 --> 00:05:14,470
So how do I fix this problem.

67
00:05:14,570 --> 00:05:21,530
The solution for this problem is that we need to actually declare this object outside of this uncreate

68
00:05:21,680 --> 00:05:24,620
method and inside of this main activity class.

69
00:05:24,650 --> 00:05:27,930
So here I can't just delete this text view here.

70
00:05:28,310 --> 00:05:34,850
And as you can see here we have this error because it cannot understand where this takes the value is

71
00:05:34,850 --> 00:05:35,870
actually declared.

72
00:05:36,140 --> 00:05:41,260
And inside our main activity class here I can just create a text view.

73
00:05:41,890 --> 00:05:49,160
The value and I just need to put in a semicolon here so here I'm just declaring this object.

74
00:05:49,160 --> 00:05:55,510
And now inside our uncreate Mefford we are just instantiating DCX the value and insight are unclear

75
00:05:55,520 --> 00:06:02,880
uncooked Metford I can't actually refer to the name of this object takes the value that sets type face.

76
00:06:03,440 --> 00:06:06,290
And now you want to refer to the name of this form to name one.

77
00:06:06,310 --> 00:06:13,610
So because these two objects that are of type typeface for name one and Phonte to name two are actually

78
00:06:13,610 --> 00:06:15,920
declared inside this main activity class.

79
00:06:15,950 --> 00:06:16,600
OK.

80
00:06:16,640 --> 00:06:21,150
And these are actually instantiated in it is uncreate never the case here.

81
00:06:21,300 --> 00:06:23,120
Inside is unclear Smurfette.

82
00:06:23,140 --> 00:06:27,360
I can actually fair to the name of these typeface objects.

83
00:06:27,380 --> 00:06:34,800
So here I can just type in the value that set typeface for example font name one.

84
00:06:35,000 --> 00:06:43,760
And when that user clicks and this PTEN form to here I can just typing TXI the value that said typeface

85
00:06:44,840 --> 00:06:52,740
font name to and here as you can see I have this error and I forgot to put the case here Case statement.

86
00:06:52,850 --> 00:06:54,800
And now as you can see the error is gone.

87
00:06:54,800 --> 00:07:00,770
Case r that I'd eat that between two DXi value that said typeface Fontenay to break.

88
00:07:01,100 --> 00:07:06,350
And here I have this case are that ID that bitti and one takes the value that said typeface font.

89
00:07:06,350 --> 00:07:07,420
Name one page.

90
00:07:07,580 --> 00:07:12,640
So when the user clicks on this bit here and one here is going to actually use this Fontenay 1:46 the

91
00:07:12,640 --> 00:07:13,330
value.

92
00:07:13,610 --> 00:07:18,580
And when the user clicks and expedient form to button here it's going to actually use this phone.

93
00:07:18,590 --> 00:07:21,050
Named to 40 sticks the value.

94
00:07:21,170 --> 00:07:24,340
So let's let's actually run our project and see what happens.

95
00:07:24,440 --> 00:07:28,910
So now as you can see our application is running on this emulator.

96
00:07:28,910 --> 00:07:32,510
So here I just need to click on this the front one.

97
00:07:32,720 --> 00:07:35,990
And now as you can see the front of this takes is actually changed.

98
00:07:35,990 --> 00:07:37,930
So let's actually click on this one too.

99
00:07:38,270 --> 00:07:41,590
And now as you can see the font of this text is changed.

100
00:07:41,600 --> 00:07:44,790
OK font 1 and 4 2.

101
00:07:44,870 --> 00:07:46,920
So hopefully that makes sense.

102
00:07:47,480 --> 00:07:53,870
And I think that's enough for this tutorial so if you have any questions please post the discussion

103
00:07:53,870 --> 00:07:59,330
in the course and then I'll do my best to answer all of your questions.

104
00:07:59,330 --> 00:08:01,000
Thank you very much for watching.

105
00:08:01,280 --> 00:08:07,310
And another important point that I want actually mention is that a lot is that when I actually click

106
00:08:07,310 --> 00:08:08,420
on this phone to name one.

107
00:08:08,420 --> 00:08:14,180
Now as you can see the height of this text is actually changed according to the text that is inside

108
00:08:14,180 --> 00:08:15,320
of this text view.

109
00:08:15,320 --> 00:08:16,980
And if I click on his phone too.

110
00:08:17,090 --> 00:08:19,810
Now again the height of this text is changed.

111
00:08:19,910 --> 00:08:25,410
And that's because of this rap content attribute that we set for this takes.

112
00:08:25,430 --> 00:08:33,880
So if I actually select this text view here as you can see the height of this text is rap content.

113
00:08:33,920 --> 00:08:39,520
And if we actually change the slab content to for example of value for example 100.

114
00:08:39,590 --> 00:08:42,770
Now if I press an interviewee on my keyboard.

115
00:08:43,040 --> 00:08:46,260
Now let's actually on our project and see what happens.

116
00:08:46,550 --> 00:08:50,340
So now as you can see our application is running on this emulator.

117
00:08:50,510 --> 00:08:54,410
So here you can see that the height of this text view is 100.

118
00:08:54,770 --> 00:08:59,430
And we cannot see the entire text that is inside of the stakes view.

119
00:08:59,480 --> 00:09:04,630
So if you click on this one here now you can see disvalue is here.

120
00:09:04,640 --> 00:09:10,250
And if I click on this phone to here now which we can only see this this is here and another takes is

121
00:09:10,250 --> 00:09:12,970
actually hidden from us.

122
00:09:13,070 --> 00:09:15,460
So it is you can it is your option.

123
00:09:15,470 --> 00:09:21,050
It is you can actually choose what would be the value of the height of your text.

124
00:09:21,050 --> 00:09:25,950
So for example I chose one high that he had I could choose for example 500.

125
00:09:26,300 --> 00:09:28,920
So let's actually run our project again.

126
00:09:29,000 --> 00:09:36,290
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

127
00:09:36,320 --> 00:09:39,820
but I cannot see the buttons here in my layout.

128
00:09:39,980 --> 00:09:42,390
So I think the 500 is too much.

129
00:09:42,410 --> 00:09:47,690
So let's actually to change 500 to another value for example 200.

130
00:09:48,380 --> 00:09:51,410
And now let's run our project again and see what happens.

131
00:09:51,410 --> 00:09:55,130
So here you can see that our application is running on the simulator.

132
00:09:55,160 --> 00:09:58,820
So if I click on this front one here now you can see this value.

133
00:09:58,970 --> 00:10:00,890
And if I click on this I want to hear.

134
00:10:01,010 --> 00:10:02,270
Now you can see this value.

135
00:10:02,330 --> 00:10:07,060
But part of this vort here text is actually hidden from us.

136
00:10:07,070 --> 00:10:14,060
This is another text but you can actually specify the height of your text view or you can actually use

137
00:10:14,660 --> 00:10:21,050
a vertical scroll view and then put your user interface components inside that scroll view and you can

138
00:10:21,050 --> 00:10:23,740
actually customize your layouts.

139
00:10:24,240 --> 00:10:25,550
And I think that it.

140
00:10:25,580 --> 00:10:29,560
So thank you very much for watching and I'll see you in the next tutorial.

