1
00:00:00,690 --> 00:00:05,680
So as you can see here these are the lines of code that I pasted here.

2
00:00:05,850 --> 00:00:11,430
So now let's run our project but before that we need to actually comment out this line of code here

3
00:00:11,970 --> 00:00:14,580
and now we can actually run our project.

4
00:00:14,580 --> 00:00:21,220
So as you can see here our application is running on this emulator here and if we actually want to.

5
00:00:21,360 --> 00:00:27,420
Let me add to be selective edits here and now I can actually assign a numeric value here so that's value

6
00:00:27,420 --> 00:00:31,130
is going to be divided by 100 that I actually am against it.

7
00:00:31,140 --> 00:00:35,070
I put this line of code here in order to divide that value by 100.

8
00:00:35,220 --> 00:00:38,530
As soon as I assign that value into the edit text.

9
00:00:38,580 --> 00:00:44,010
So here as you can see we have this value for example 500 is now $5 right.

10
00:00:44,160 --> 00:00:50,850
So $5 and here $5 is actually the value of the spill amount and that value is going to be assigned to

11
00:00:51,270 --> 00:00:52,330
the bill amount.

12
00:00:52,620 --> 00:00:54,960
So this is that value right.

13
00:00:55,020 --> 00:00:57,050
So hopefully that makes sense.

14
00:00:57,450 --> 00:01:05,190
And now if the user actually enters a non-numeric value on that as it takes here we can actually catch

15
00:01:05,460 --> 00:01:06,560
that exception.

16
00:01:06,570 --> 00:01:07,030
OK.

17
00:01:07,260 --> 00:01:13,620
So if the user enters on a non-numeric value in that inside that edit takes here it's going to actually

18
00:01:13,710 --> 00:01:16,770
throw this number form an exception here.

19
00:01:16,830 --> 00:01:21,630
So we actually put this catch block here in order to catch that exception.

20
00:01:21,630 --> 00:01:24,410
And then the Apple application is not going to crash.

21
00:01:24,420 --> 00:01:29,880
So in light 93 I when I truly said the text of this text the bill amount to an empty value as you can

22
00:01:29,880 --> 00:01:34,210
see here and here you are actually assigning the value zero point zero to our bill amount.

23
00:01:34,370 --> 00:01:34,970
OK.

24
00:01:35,100 --> 00:01:41,520
So this block of code here is going to it is going to be executed if our text is actually empty or if

25
00:01:41,520 --> 00:01:46,140
the user actually enters a non-numerical value inside that Eadie text.

26
00:01:46,140 --> 00:01:52,920
So now let's actually uncomment this line of code here and here I need to actually create a handler

27
00:01:52,930 --> 00:01:55,520
46 percent as you can see here.

28
00:01:55,600 --> 00:01:57,900
Tepes part changelessness right.

29
00:01:57,930 --> 00:02:03,120
So here after the end in Kerley place of this table takes the water handler here as you can see it to

30
00:02:03,120 --> 00:02:06,110
actually create a handler for that Sebald percent.

31
00:02:06,120 --> 00:02:11,610
So now I'm going to paste in some lines of code here and then I'm going to explain to you what's going

32
00:02:11,610 --> 00:02:12,830
on here.

33
00:02:12,840 --> 00:02:16,310
So let's actually write this handler by hand here.

34
00:02:16,500 --> 00:02:25,560
So just type in here Plevna its final and here just type in search bar dot on See Spot change listener.

35
00:02:25,930 --> 00:02:28,500
And now you need to specify the name of this handler.

36
00:02:28,530 --> 00:02:33,900
So as you can see here via specified that name here keep C.P.R. change the center of just copy this

37
00:02:33,900 --> 00:02:40,700
value here and then just put this value here and put an assignment operator here.

38
00:02:40,880 --> 00:02:46,130
You on Six-Party change list and also as you can see here we have this option here.

39
00:02:46,140 --> 00:02:49,300
Just select this option and then present in Turkey on your keyboard.

40
00:02:49,630 --> 00:02:54,470
And now as you can see here the ID actually put these lines of code here automatically for us.

41
00:02:54,690 --> 00:02:56,250
So here as you can see we have an error.

42
00:02:56,250 --> 00:03:03,910
So at the end actually the after the ending curly brace of this handler of these it's Tepes each bar

43
00:03:03,910 --> 00:03:07,020
change to the Senate you need to actually put a semicolon.

44
00:03:07,320 --> 00:03:09,150
Now as you can see we have some efforts here.

45
00:03:09,150 --> 00:03:11,460
The first one is unprogressive changed.

46
00:03:11,670 --> 00:03:17,540
The second one is on start tracking touch and the first one is unstop tracking touch.

47
00:03:17,550 --> 00:03:18,200
Right.

48
00:03:18,240 --> 00:03:21,360
We need to use the Smurfette on progress changed.

49
00:03:21,360 --> 00:03:21,800
OK.

50
00:03:21,900 --> 00:03:23,100
So let's actually choose this.

51
00:03:23,130 --> 00:03:26,010
And let's go inside the curly braces of this method.

52
00:03:26,130 --> 00:03:31,440
And now I'm going to pasting some lines of code here inside this on progress change method and then

53
00:03:31,440 --> 00:03:33,950
I'm going to explain to you what's going on here.

54
00:03:34,170 --> 00:03:37,870
So here as you can see this is the line of code that I pasted here.

55
00:03:38,100 --> 00:03:41,730
And are you referring to the name of this 3 percent variable.

56
00:03:41,880 --> 00:03:43,480
So let's look at our class here.

57
00:03:43,500 --> 00:03:49,110
As you can see I actually created this 3 percent variable which is actually type double here in line

58
00:03:49,110 --> 00:03:53,910
21 and I assigned these values 0.25 to this value.

59
00:03:53,920 --> 00:03:56,570
But for the first value right.

60
00:03:56,910 --> 00:04:00,230
As you can see here I initialized this valuable by disvalue.

61
00:04:00,540 --> 00:04:03,060
And now let's go back to our method here again.

62
00:04:03,300 --> 00:04:05,810
And here you refer to the name of this progress here.

63
00:04:05,820 --> 00:04:10,270
As you can see so many use for example 6 on that CPR.

64
00:04:10,290 --> 00:04:12,380
So let's open our emulator here.

65
00:04:12,510 --> 00:04:18,240
When we use them for example 6 on this six but we can actually get that integer value.

66
00:04:18,360 --> 00:04:18,960
OK.

67
00:04:19,170 --> 00:04:24,450
In the previous section of this course I talked about this part and how you can actually get that integer

68
00:04:24,450 --> 00:04:30,900
value by using this argument and that he had because I want to actually convert that value to a person's

69
00:04:30,900 --> 00:04:31,580
value.

70
00:04:31,680 --> 00:04:34,820
I actually divided that value by 100 here.

71
00:04:34,980 --> 00:04:35,470
Right.

72
00:04:35,490 --> 00:04:38,670
So progress divided by one hundred point zero.

73
00:04:39,060 --> 00:04:47,010
So now it's actually assigned that the result of this operation is the person here and now as you can

74
00:04:47,010 --> 00:04:52,570
see we have two other MFX which we don't use them but we need to we need to override them here.

75
00:04:52,620 --> 00:04:56,690
So now as you can see here we have these actually these handlers.

76
00:04:56,880 --> 00:05:01,810
And here we need to create another method and then I'll talk about that Nefert here.

77
00:05:01,950 --> 00:05:06,570
So first let me actually paste this method here and then I'm going to explain to you what's going on

78
00:05:06,570 --> 00:05:07,340
here.

79
00:05:07,350 --> 00:05:11,990
So as you can see here these are the lines of code that I pasted here.

80
00:05:12,120 --> 00:05:18,840
So the access modifier of my method is actually private the return type of My method is void and the

81
00:05:18,840 --> 00:05:24,930
name of my method is actually the calculate type and decide if it actually accepts no arguments.

82
00:05:24,930 --> 00:05:29,150
So now let's actually to go inside the body of this method and let's see what's going on here.

83
00:05:29,460 --> 00:05:35,320
First of all in line one hundred and fifty I actually referred to the name of this takes.

84
00:05:35,330 --> 00:05:37,880
You object to 63 percent.

85
00:05:37,890 --> 00:05:39,720
So let's go inside our class.

86
00:05:39,740 --> 00:05:45,780
Main activity and here as you can see if we have this object we actually declare this object here to

87
00:05:45,780 --> 00:05:47,420
60 percent.

88
00:05:47,760 --> 00:05:49,700
And this is of type takes you right.

89
00:05:49,710 --> 00:05:53,410
So here you can see inside is uncreate me they're actually initialized.

90
00:05:53,470 --> 00:05:55,180
This takes 30 percent.

91
00:05:55,350 --> 00:05:58,750
And if you want to show you that in a emulator.

92
00:05:59,100 --> 00:06:04,230
So here it is our emulator and here is this 80 percent right.

93
00:06:04,260 --> 00:06:11,210
So now inside these calculated Meffert I am actually setting the text of this 80 percent.

94
00:06:11,310 --> 00:06:15,330
So to 60 percent that said text present format value.

95
00:06:15,480 --> 00:06:20,850
So here are you referred to the name of this object that I actually created inside this main activity

96
00:06:20,850 --> 00:06:21,480
class.

97
00:06:21,720 --> 00:06:27,150
So as you can see here in say this main activity class I created this object per cent format's value

98
00:06:27,570 --> 00:06:29,220
which is a type number format.

99
00:06:29,340 --> 00:06:35,040
And here as you can see I initialized this number format here as you can see this number for my object

100
00:06:35,280 --> 00:06:37,240
by typing number format.

101
00:06:37,300 --> 00:06:39,790
I've referred to the name of this class number format.

102
00:06:39,840 --> 00:06:45,990
And I actually called this strategem if it gets percent instance so this dispersant instance is going

103
00:06:45,990 --> 00:06:53,040
to ask you to return an instance of type number format and then it's going to actually return this present

104
00:06:53,040 --> 00:06:58,260
instance and that instance is going to be assigned to dispersant format's value.

105
00:06:58,260 --> 00:07:02,300
So now let's go inside this calculated method here.

106
00:07:02,570 --> 00:07:08,600
And now here as you can see I referred to the name of this person's format's value data format.

107
00:07:08,640 --> 00:07:12,290
So I actually called this method on this object person format's value.

108
00:07:12,510 --> 00:07:15,730
And then I passed this t percent.

109
00:07:15,780 --> 00:07:22,850
So as you can see here we actually declared this this person here this person inside this may mean activity

110
00:07:22,850 --> 00:07:23,150
class.

111
00:07:23,160 --> 00:07:30,870
I actually created this 80 percent here and I assign this value 0.25 as an initial value to this valuable

112
00:07:30,960 --> 00:07:31,470
person.

113
00:07:31,470 --> 00:07:32,100
Right.

114
00:07:32,460 --> 00:07:39,210
And then here as you can see inside this inside this on progress changed Smurfette as you can see I

115
00:07:39,210 --> 00:07:44,070
actually assigned another value to this 80 percent variable progress.

116
00:07:44,070 --> 00:07:49,000
So here I referred to the name of this progress argument divided by 100.

117
00:07:49,140 --> 00:07:49,790
OK.

118
00:07:50,160 --> 00:07:53,880
So for example when you use that are two to six on this sick bar here.

119
00:07:54,030 --> 00:08:00,660
It's going to actually give us an integer value and then it's going to divide that value by 100.

120
00:08:00,690 --> 00:08:06,810
As you can see here and then we can have actually a pair sent by the right because I want to convert

121
00:08:06,870 --> 00:08:08,280
that value to a person's value.

122
00:08:08,310 --> 00:08:13,720
So we need to divide that value to a 100 and then I assign that value to these two percent.

123
00:08:13,800 --> 00:08:14,250
OK.

124
00:08:14,370 --> 00:08:17,550
So if any use changes the value of the sick part.

125
00:08:17,640 --> 00:08:20,490
Now I actually assign that value to wristy percent.

126
00:08:20,490 --> 00:08:23,980
So this person now holds that value right.

127
00:08:24,000 --> 00:08:30,740
So here inside our calculated method we can actually use that value 80 percent in order to set the text

128
00:08:30,760 --> 00:08:31,980
of this to 60 percent.

129
00:08:31,980 --> 00:08:37,920
So the excessive 80 percent that's it takes per cent format's value that format.

130
00:08:37,980 --> 00:08:45,420
So this Meffert format is going to actually give us the specific format of that specific actually for

131
00:08:45,420 --> 00:08:50,920
example Chaddock their percent that is actually regarded to our specific locale.

132
00:08:51,000 --> 00:08:51,260
Okay.

133
00:08:51,270 --> 00:08:56,700
So for example when the user is actually in a country in the U.S. or in Europe it can actually give

134
00:08:56,700 --> 00:09:02,630
us a specific character that is actually a look at that specific to those locales.

135
00:09:02,640 --> 00:09:03,140
OK.

136
00:09:03,360 --> 00:09:06,170
But here in the U.S. this is this person's character.

137
00:09:06,210 --> 00:09:09,870
So we use this up person character as you can see here.

138
00:09:09,880 --> 00:09:13,560
So person for value that format type person.

139
00:09:13,560 --> 00:09:14,320
Right.

140
00:09:14,840 --> 00:09:21,480
And now as you can see here this remember that this formats MFL is going to return a string value.

141
00:09:21,600 --> 00:09:27,840
So we can assign value here this person here into this into the practices of this text.

142
00:09:27,900 --> 00:09:31,550
So it takes some effort and in line 152.

143
00:09:31,770 --> 00:09:38,410
I actually created a variable of type double and the name of this value is actually the tip value.

144
00:09:38,430 --> 00:09:42,450
OK so now I want to actually get the tip value and assign that value here.

145
00:09:42,690 --> 00:09:45,520
So double tip value assignment operator.

146
00:09:45,900 --> 00:09:51,990
And then I referred to the name of this bill amount variable that I created inside this main activity

147
00:09:51,990 --> 00:09:52,710
class.

148
00:09:52,710 --> 00:09:58,330
So inside this main main activity class we have this bill outwardly about right and I assigned this

149
00:09:58,350 --> 00:10:02,490
value zero point it all to this amount of valuable.

150
00:10:02,900 --> 00:10:11,780
So here as you can see inside these antics the changed Mefford that is actually related to this interface

151
00:10:11,780 --> 00:10:17,180
takes whatever we can see that here I am actually assigning another value to the spill amount double

152
00:10:17,180 --> 00:10:19,120
that part double is that was thrilling.

153
00:10:19,120 --> 00:10:25,280
So for example if the user assigns a value into these edits here for example 1000.

154
00:10:25,730 --> 00:10:30,270
So here this is the value of this amount as you can see here.

155
00:10:30,710 --> 00:10:36,830
And then here it's going actually after we assign that value into it it takes it's going to actually

156
00:10:36,890 --> 00:10:41,930
add that value to this takes the bid amount to CTX the bill amount that takes currency from value that

157
00:10:41,930 --> 00:10:43,520
formats bill amount.

158
00:10:43,520 --> 00:10:49,910
So now the value of this bill amount is the value that we actually assign here divided by 100.

159
00:10:49,910 --> 00:10:52,280
So now that is actually put for example number two.

160
00:10:52,370 --> 00:10:58,370
Soon as we can see here as soon as I assign the value numbers to interest it takes here it's going to

161
00:10:58,370 --> 00:11:00,500
divide that number two by 100.

162
00:11:00,620 --> 00:11:06,560
So that's what you can see the value here zero point zero to right this value was two and then it is

163
00:11:06,560 --> 00:11:08,800
actually a divided by one hundred.

164
00:11:08,840 --> 00:11:15,680
And now it is zero point zero two and then it's going to actually put that value into these peaks the

165
00:11:15,880 --> 00:11:17,010
amount here.

166
00:11:17,020 --> 00:11:17,500
Right.

167
00:11:17,510 --> 00:11:20,470
Currency format value that format amount.

168
00:11:20,540 --> 00:11:23,420
So now this bill amount has this value for example.

169
00:11:23,420 --> 00:11:28,540
Now can I should I want to assign up for example the value of 200.

170
00:11:29,120 --> 00:11:31,610
So I need to put the right value here.

171
00:11:31,610 --> 00:11:37,560
For example we have two hundred dollars and now the value of this bill amount is actually 200 right.

172
00:11:37,580 --> 00:11:40,700
So here inside this calculator tip F-ed.

173
00:11:41,060 --> 00:11:46,000
When I created this variable which is of type double type value assignment operator bill amount.

174
00:11:46,010 --> 00:11:49,190
So now for example the value of this bid amount is two hundred.

175
00:11:49,430 --> 00:11:54,210
And then it's going to actually multiply these 200 by this 2 percent.

176
00:11:54,230 --> 00:11:58,450
So this person actually holds the value of this search bar here.

177
00:11:58,550 --> 00:11:59,040
OK.

178
00:11:59,150 --> 00:12:06,590
So for example the user wants to pay 40 percent of the actually the meals that they actually ate.

179
00:12:06,590 --> 00:12:09,780
So here we can actually put that value here.

180
00:12:09,980 --> 00:12:13,490
And then you can actually use that value here to present.

181
00:12:13,490 --> 00:12:18,540
So now let's actually run our project here at this point because I want to show you an important point

182
00:12:19,710 --> 00:12:24,960
so it's going to actually multiply the value of this spill amount which is now two hundred by disvalue

183
00:12:24,960 --> 00:12:25,920
80 percent.

184
00:12:25,980 --> 00:12:32,670
For example 80 percent and the value of the 80 person is for example of 25 percent and then it's going

185
00:12:32,670 --> 00:12:34,510
to assign that value to the steep value.

186
00:12:34,650 --> 00:12:35,110
OK.

187
00:12:35,220 --> 00:12:39,390
And that value is going to be the tip value that the user should pay in line.

188
00:12:39,390 --> 00:12:40,710
One hundred and fifty.

189
00:12:40,910 --> 00:12:47,150
We actually created another variable in order to calculate the total value that the user should pay.

190
00:12:47,310 --> 00:12:49,880
So double total value assignment operator.

191
00:12:50,010 --> 00:12:52,770
And then here you referred to the name of this bill amount.

192
00:12:52,770 --> 00:12:55,650
For example 200 plus tip value.

193
00:12:55,830 --> 00:12:58,690
And this is the total value that the user should pay.

194
00:12:59,100 --> 00:13:05,160
And here in line one hundred and fifty five I'll refer to the name of the state's beauty tip that said

195
00:13:05,190 --> 00:13:05,830
text.

196
00:13:06,000 --> 00:13:11,760
So here I'll refer to the name of this place with you is to keep the state's currency format value that

197
00:13:11,790 --> 00:13:14,440
format type value.

198
00:13:14,850 --> 00:13:22,310
OK currency formats value that format is going to actually return a specific format of data.

199
00:13:22,530 --> 00:13:24,630
For example value type value.

200
00:13:24,990 --> 00:13:31,160
According to that specific locale that is actually that is actually set up in that in the user's device.

201
00:13:31,200 --> 00:13:31,730
OK.

202
00:13:31,980 --> 00:13:34,260
So now it's going to return that value.

203
00:13:34,470 --> 00:13:38,210
And then it's going to assign that value here as this the tip.

204
00:13:38,220 --> 00:13:39,840
So these are steep.

205
00:13:39,900 --> 00:13:42,750
And here we have these TXI the total amount.

206
00:13:42,930 --> 00:13:48,420
And here as you can see for this total we have this takes the total amount that takes currency format

207
00:13:48,450 --> 00:13:50,250
value that format total value.

208
00:13:50,250 --> 00:13:52,900
So he had referred to the name of the value of it.

209
00:13:52,980 --> 00:13:58,750
So now we should actually call this method can actually teep after first we need to call this Meffert

210
00:13:58,770 --> 00:14:01,480
inside this unprogressive change method.

211
00:14:01,770 --> 00:14:08,790
So here I just need to type in calculator tip and we need to also call this method inside this on text

212
00:14:08,820 --> 00:14:09,930
change method.

213
00:14:09,930 --> 00:14:17,000
So here after this try catch block here I can actually call that method track too late.

214
00:14:17,150 --> 00:14:19,720
So now let's run our project and see what happens.

