1
00:00:00,150 --> 00:00:05,640
Hire everyone now it's time to actually use our colorful class.

2
00:00:05,940 --> 00:00:11,800
So inside this main activity class I'm going to actually show you how you can create an entire class.

3
00:00:11,820 --> 00:00:17,340
So what is an inner class and in that class is that that is the class that you create inside another

4
00:00:17,340 --> 00:00:17,700
class.

5
00:00:17,700 --> 00:00:19,950
So we have this main activity class here right.

6
00:00:19,950 --> 00:00:22,740
This is our main I have the class inside this class.

7
00:00:22,740 --> 00:00:24,720
I can create another class.

8
00:00:24,720 --> 00:00:31,000
So let's scroll down here before the end in Kerley place of this main activity class.

9
00:00:31,140 --> 00:00:35,910
I'm going to create another class and this class is going to be private what US private means that only

10
00:00:36,210 --> 00:00:42,920
private means that only main and main activity class can actually create instances of type.

11
00:00:42,930 --> 00:00:45,690
Actually it is in a class so private.

12
00:00:46,200 --> 00:00:49,480
And here it is meant to be class right class.

13
00:00:49,500 --> 00:00:52,410
Now I need to specify the name of this class.

14
00:00:52,410 --> 00:00:53,910
So what is going to be the name.

15
00:00:54,120 --> 00:01:02,530
The name is going to be colorization handler conduct colorization handler right.

16
00:01:02,870 --> 00:01:07,480
And then here I just need to open and close this class by using these curly braces.

17
00:01:07,490 --> 00:01:10,460
So this is an in class as simple as that.

18
00:01:10,640 --> 00:01:14,390
But this class is going to actually implement an interface.

19
00:01:14,390 --> 00:01:15,680
So what is that interface.

20
00:01:15,830 --> 00:01:19,490
That interface is called actually unsichtbare change listener.

21
00:01:19,520 --> 00:01:28,060
So after this class name I'm going to say implements colorization handler implements unsichtbare change

22
00:01:28,080 --> 00:01:35,150
listener so because this class is actually conforming to this interface or it is implementing this interface

23
00:01:35,480 --> 00:01:42,750
this class is in a class must provide an implementation for free methods that you have inside Ismir

24
00:01:43,130 --> 00:01:43,640
interface.

25
00:01:43,640 --> 00:01:49,040
The first one is going to be on start tracking touch.

26
00:01:49,040 --> 00:01:54,710
So this it is going to be called whenever the user actually starts interacting with the search bar.

27
00:01:55,100 --> 00:02:03,230
So now it's time to actually implement the second method which is going to be on progress changed.

28
00:02:03,320 --> 00:02:07,640
So this method is going to be called when the use is actually when the progress is changed.

29
00:02:07,670 --> 00:02:07,960
OK.

30
00:02:07,970 --> 00:02:13,910
When the progress is being manipulated and it is being changed and the final effect is going to be on

31
00:02:14,010 --> 00:02:16,760
stop on stop tracking touch.

32
00:02:16,890 --> 00:02:24,000
So this is going to be called when they use that stops interacting with Cuba the method that are going

33
00:02:24,000 --> 00:02:28,380
to use inside our application is this not only this one on progress changed.

34
00:02:28,380 --> 00:02:31,640
This is the only method that we actually care about.

35
00:02:31,770 --> 00:02:34,340
But we are not going to actually use these methods.

36
00:02:34,350 --> 00:02:39,960
For example this unstarted I can touch or unstopped I can touch because it's not necessary to actually

37
00:02:40,170 --> 00:02:44,010
work with these benefits but it's necessary to implement them.

38
00:02:44,010 --> 00:02:46,120
Otherwise it's going to show us an error.

39
00:02:46,170 --> 00:02:50,400
The compiler is going to be unsatisfied and it's going to show us an error and it's going to prevent

40
00:02:50,400 --> 00:02:51,730
us to run the application.

41
00:02:51,750 --> 00:02:54,640
So we must implement these methods.

42
00:02:54,930 --> 00:03:00,160
So now let's go inside the curly braces of this unprogressive change in effect and let's see what we

43
00:03:00,160 --> 00:03:01,170
are going to do next.

44
00:03:01,200 --> 00:03:06,520
But before that let's actually let's our search bars.

45
00:03:06,570 --> 00:03:11,330
You can see that the insight or activity or the limited example we have these freesheet parts right.

46
00:03:11,700 --> 00:03:18,780
Let's allow these sequel's to know that they have actually a handler so that we can be notified when

47
00:03:18,780 --> 00:03:21,240
the user is actually interacting with these parts.

48
00:03:21,240 --> 00:03:23,010
Let's go to the main activity class.

49
00:03:23,460 --> 00:03:28,630
Let's scroll to the top here and inside this uncreate.

50
00:03:28,710 --> 00:03:35,670
This is actually here it is the best place to lead our sick birds know that they have a handler right

51
00:03:35,700 --> 00:03:39,720
because this is going to be called as soon as the user runs the application.

52
00:03:39,960 --> 00:03:48,910
So here I can actually say read bar that said on search bar change listener.

53
00:03:49,040 --> 00:03:51,940
So here we must pass the listener right.

54
00:03:51,950 --> 00:03:55,690
We already created a class in order to handle that right.

55
00:03:55,700 --> 00:04:03,800
Colorization handler but we must first create an instance of type colorization handler class.

56
00:04:03,830 --> 00:04:06,290
This is actually a private class and in a class right.

57
00:04:06,290 --> 00:04:11,960
So after this line of code here that's just the listener for the spot in between and save the picture

58
00:04:11,960 --> 00:04:13,220
in say this and create it.

59
00:04:13,250 --> 00:04:19,280
And before this line of code that actually sets the search bar change listener I'm going to create an

60
00:04:19,340 --> 00:04:25,370
instance of type colorization handler class I'm going to just refer to this class colorization handler

61
00:04:26,150 --> 00:04:31,730
and the name of this instance is going to be colorization handler assignment operator new colorization

62
00:04:31,730 --> 00:04:34,810
handler right semicolon.

63
00:04:34,940 --> 00:04:38,670
So now we have an instance of type colorization handler class.

64
00:04:38,870 --> 00:04:43,130
Here we created the actual instance and we assigned this instance to this valuable.

65
00:04:43,280 --> 00:04:51,680
Right now I can't pass this instance to this set on Six-Party change listener which is going to play

66
00:04:51,680 --> 00:04:56,260
the role of the listener when they use that interacts with the switchboard.

67
00:04:56,870 --> 00:05:03,800
So I'm going to specify actually the listener for the green actually the green part and the Brucey parts

68
00:05:03,800 --> 00:05:09,370
so green bar but sit on bar change.

69
00:05:09,430 --> 00:05:13,550
Listener as it colorization handler again.

70
00:05:14,140 --> 00:05:22,080
And finally the prusik part that said honestly pro-change change listener colorization handler.

71
00:05:22,420 --> 00:05:24,060
That's it.

72
00:05:24,070 --> 00:05:31,210
So now that we actually specified the handler for this sequence Albi and let these people know that

73
00:05:31,210 --> 00:05:37,180
they have a handler whenever the user interacts with those six bottles inside a screen.

74
00:05:37,450 --> 00:05:43,860
These misfits here for example the OnStar tracking touch MF'er the unprogressive a Meffert address and

75
00:05:43,900 --> 00:05:46,040
start tracking change and start tracking.

76
00:05:46,180 --> 00:05:48,190
Post-movie is going to be executed.

77
00:05:48,250 --> 00:05:49,820
So we are going to use this method.

78
00:05:49,870 --> 00:05:52,150
Unprogressive changed.

79
00:05:52,150 --> 00:05:54,870
So let's go inside the curly braces of the Smif.

80
00:05:54,950 --> 00:05:57,020
Let's see what we're going to do now.

81
00:05:57,550 --> 00:06:01,500
Let's take a look at these arguments of this method on progress change.

82
00:06:01,510 --> 00:06:03,490
The first one is the search bar.

83
00:06:03,490 --> 00:06:08,390
So this is actually the actual search bar that is being manipulated.

84
00:06:08,410 --> 00:06:14,820
The second argument is the progress the value of the progress of the bar and the first argument that

85
00:06:14,830 --> 00:06:18,160
is going to be is very important is from user.

86
00:06:18,160 --> 00:06:18,940
What does this mean.

87
00:06:18,940 --> 00:06:23,730
This means that Vidur the user is actually interacting with the skipper or not.

88
00:06:23,820 --> 00:06:24,220
OK.

89
00:06:24,430 --> 00:06:30,610
This means that the user is actually interacting with the search bar.

90
00:06:30,700 --> 00:06:36,620
So we have this value but in order to specify that whether the user started interacting with the secret

91
00:06:36,670 --> 00:06:43,080
or not so we can't say enough from user and that open and close this if statement by using this calibrated.

92
00:06:43,080 --> 00:06:48,610
This means that if this really is true this is from user is actually true then it's going to execute

93
00:06:48,750 --> 00:06:51,600
the code inside this if statement.

94
00:06:51,690 --> 00:06:55,910
So now it's time to go into the activity and illuminate examine here.

95
00:06:55,980 --> 00:07:03,400
And I'm going to specify the progress value and the maximum value that these six bars can actually have.

96
00:07:03,690 --> 00:07:07,980
So select is first search part which is going to be this this red color sick all right.

97
00:07:07,980 --> 00:07:08,960
Select it.

98
00:07:09,390 --> 00:07:14,030
And here you can see all these attributes here the farm Max progress.

99
00:07:14,040 --> 00:07:22,980
So for the max attribute here just assign the value of 100 and then enter on your keyboard for the Proclus

100
00:07:22,980 --> 00:07:26,700
attribute assign the value 0 and in person and then on your keyboard.

101
00:07:27,620 --> 00:07:30,040
Selectees so you can see spot here.

102
00:07:31,090 --> 00:07:38,800
For the max chip you assign a value 100 and for the progress zero into general keyboard and finally

103
00:07:38,800 --> 00:07:45,850
select this first search bar for the max attribute assign the value 100 and for the progress attribute

104
00:07:45,880 --> 00:07:50,440
assign the value 0 and that person interntional cheaper that's it.

105
00:07:50,440 --> 00:07:58,570
Now it's time to go to our main activity class inside this if statement here.

106
00:07:58,570 --> 00:08:06,190
I can't say if search bar so I am referring to this sitch But object this argument right.

107
00:08:06,980 --> 00:08:12,180
Is equal to read search but right.

108
00:08:12,380 --> 00:08:15,960
And then I just need to open and close this if they can by using curly braces.

109
00:08:15,980 --> 00:08:22,120
So here I am a hundred and fifty percent sure that this sick part that they use it is interactive with

110
00:08:22,280 --> 00:08:27,230
is actually let's see part right because I created an if statement for this.

111
00:08:27,260 --> 00:08:31,130
So here I need to have an object of type colorful class.

112
00:08:31,460 --> 00:08:38,090
So let's scroll to the top of the file here and below this variable declaration here for the Spaeth

113
00:08:38,090 --> 00:08:41,380
map I'm going to create and actually another variable private.

114
00:08:41,660 --> 00:08:47,660
And this time the data type of this value but it's going to be colorful colorful and the name of this

115
00:08:47,660 --> 00:08:49,660
variable is going to be colorful semicolon.

116
00:08:49,760 --> 00:08:50,280
Right.

117
00:08:50,540 --> 00:08:56,720
Let's scroll down here and let's go inside these actually.

118
00:08:56,870 --> 00:09:01,310
Let's go inside this unactivated resolved method here.

119
00:09:02,160 --> 00:09:09,540
And before before actually setting the bitmap here as the image of the IMJ photo I'm going to actually

120
00:09:09,540 --> 00:09:16,980
initialize my colorful variable that I actually create declared inside our main activity class so I

121
00:09:16,980 --> 00:09:22,700
can say colorful assignment operator new color fool.

122
00:09:22,710 --> 00:09:28,830
So now the constructor of this colorful class the custom constructor that we created inside this colorful

123
00:09:28,830 --> 00:09:30,170
class is going to be called.

124
00:09:30,240 --> 00:09:32,880
So you can see that we need to pass these arguments.

125
00:09:32,880 --> 00:09:38,490
The first argument is going to be this actually bitmap which is a bitmap so we have the Spizz map right.

126
00:09:38,490 --> 00:09:40,380
So I'm going to pass the map here.

127
00:09:40,430 --> 00:09:44,830
Bitmap comma and then we need to specify the red color.

128
00:09:44,840 --> 00:09:52,020
So because of the user here the n and active The result is going to be called as soon as the the camera

129
00:09:52,020 --> 00:09:54,180
activity is actually being disappeared.

130
00:09:55,270 --> 00:10:01,420
Here for the red color value I just want to pass the value zero point zero F because this is going to

131
00:10:01,420 --> 00:10:02,060
be off the floor.

132
00:10:02,060 --> 00:10:03,620
We must put the letter here.

133
00:10:03,700 --> 00:10:10,390
Otherwise the compiler may think that we are we mean a double value not a float value.

134
00:10:10,480 --> 00:10:15,400
So here I'm going to for the record I passed the value 0 and 0 again for the green color.

135
00:10:15,400 --> 00:10:18,990
I'm going to get past the value zero point zero F comma.

136
00:10:19,210 --> 00:10:25,070
And finally for the blue value I'm going to again pass the value zero point zero semicolon.

137
00:10:25,390 --> 00:10:26,020
Right.

138
00:10:26,020 --> 00:10:33,550
So here we initialized our colorful object inside is an activity result so you already know when this

139
00:10:33,550 --> 00:10:35,570
method is being called right.

140
00:10:35,700 --> 00:10:40,690
In the previous tutorials I actually showed you Venditte method is called.

141
00:10:41,230 --> 00:10:46,170
So here inside this method I have initializing my colorful object with these values.

142
00:10:46,180 --> 00:10:53,730
I passed the bitmap here the bitmap that we get from the bundle and then we specified the red color

143
00:10:54,090 --> 00:10:55,990
the green color and the blue color.

144
00:10:55,990 --> 00:10:58,550
We passed the value zero here.

145
00:10:58,550 --> 00:11:04,240
So now let's scroll down here and let's go inside this on progress changed Meffert inside the colorization

146
00:11:04,240 --> 00:11:10,040
handler class and let's go inside the statement that specifies if the part that is being interacted

147
00:11:10,040 --> 00:11:12,500
with is actually there it's the red Six-Party.

148
00:11:12,670 --> 00:11:17,180
So now that we have the colorful object here I can say colorful.

149
00:11:17,370 --> 00:11:23,940
That sets the red color colorful that set red color value actually.

150
00:11:24,130 --> 00:11:28,780
So here I am calling the setter method for these red colored value is this valuable that we have inside

151
00:11:28,780 --> 00:11:35,920
these colorful class this if it needs a value of type float and let's go inside this colorful class.

152
00:11:36,010 --> 00:11:38,280
So here it is the colorful class right.

153
00:11:38,290 --> 00:11:40,630
Let's look at this settlement efforts of our.

154
00:11:40,630 --> 00:11:43,230
Instance variables for example look at this method here.

155
00:11:43,230 --> 00:11:44,830
Set red color value.

156
00:11:44,860 --> 00:11:52,600
This method has an if statement that actually specifies if the argument read value is greater than or

157
00:11:52,630 --> 00:11:57,090
equal to zero and that value is less than or equal to 1.

158
00:11:57,160 --> 00:12:03,370
Only in that case we are going to assign this argument to this red colored value instance variable.

159
00:12:03,380 --> 00:12:09,700
So inside this main activity class when I say colorful That said Rose colored right you must pass a

160
00:12:09,730 --> 00:12:11,820
value between 0 and 1.

161
00:12:11,860 --> 00:12:13,060
How we can do that.

162
00:12:13,420 --> 00:12:16,100
So we have to progress right.

163
00:12:16,240 --> 00:12:22,920
And we know that the maximum value is 100 and the progress the current progress is zero.

164
00:12:23,230 --> 00:12:29,530
So here in order to have a value between 0 and 1 here we can say progress.

165
00:12:29,530 --> 00:12:30,240
So I'm going.

166
00:12:30,300 --> 00:12:32,460
I am referring to is progress value right.

167
00:12:32,590 --> 00:12:34,930
Divided by 100.

168
00:12:34,930 --> 00:12:39,980
So now the result of this operation is going to be of value between 0 and 1.

169
00:12:40,240 --> 00:12:46,160
So now we can actually pass that value to the Smif etc cetera is colored value.

170
00:12:46,180 --> 00:12:52,320
So after this line of code I can say now we need to specify the value of the Red Sea bar.

171
00:12:52,450 --> 00:12:52,970
Right.

172
00:12:53,020 --> 00:12:54,410
So I'm going to say let's see.

173
00:12:54,430 --> 00:13:01,440
But that said progress so we need to specify the progress of the Red Sea.

174
00:13:01,460 --> 00:13:11,360
But right now again we are going to have to progress which is going to be of value that is between 0

175
00:13:11,360 --> 00:13:17,840
and 100 right here because the value of this of this colored value instance variable of this color for

176
00:13:17,840 --> 00:13:22,110
instance is actually of value between 0 and 1.

177
00:13:22,280 --> 00:13:30,010
We need to multiply this value by 100 so that we have a value between 0 and 100.

178
00:13:30,140 --> 00:13:36,350
So here inside the apprentice's I can say 100 multiplied by.

179
00:13:36,560 --> 00:13:42,470
So let me put a set of practices here and here I just need to refer to this colorful instance that gets

180
00:13:43,070 --> 00:13:44,840
red colored value.

181
00:13:45,720 --> 00:13:47,270
And now it's not an error.

182
00:13:47,290 --> 00:13:52,960
If I hover over this area it says the result of this operation is actually of type float.

183
00:13:52,970 --> 00:13:53,510
Right.

184
00:13:53,810 --> 00:13:58,740
But this set progress Smurfette needs an argument of type integer.

185
00:13:58,910 --> 00:14:04,980
So we must cast this operation the result of this operation to an integer value how we can do that first

186
00:14:04,990 --> 00:14:12,170
first let's actually put this operation inside the to just put a of here and put this operation as you

187
00:14:12,170 --> 00:14:17,480
can see 100 multiplied by colorful that get red colored value right.

188
00:14:17,480 --> 00:14:23,930
So let's put this operation inside Apprentice's in this way and here inside these practices of this

189
00:14:23,990 --> 00:14:25,130
set Procrustes Merfeld.

190
00:14:25,160 --> 00:14:29,020
I can actually put a pair of practices here and I can put integers.

191
00:14:29,180 --> 00:14:29,750
That's it.

192
00:14:29,750 --> 00:14:36,380
Now we have no errors because this operation here is now inside the prentices and here the result of

193
00:14:36,380 --> 00:14:39,190
this operation is going to be tested to an integer value.

194
00:14:39,470 --> 00:14:41,790
And here we have no errors.

195
00:14:41,840 --> 00:14:45,940
So that's the value of these red red switchboard.

196
00:14:46,010 --> 00:14:47,120
That's progress.

197
00:14:47,120 --> 00:14:56,510
And finally let's actually update our takes the view so takes the red colored value that text that actually

198
00:14:56,810 --> 00:14:58,170
said text it.

199
00:14:58,240 --> 00:15:04,630
I can easily refer to this colorful object that gets a red color value right.

200
00:15:04,970 --> 00:15:10,730
And because it is going to be off the float and this takes some of it needs a value of that integer

201
00:15:11,600 --> 00:15:16,970
to actually just convert this value to us three values we just put a concatenation operator and then

202
00:15:16,970 --> 00:15:18,630
just two coats you're right.

203
00:15:18,710 --> 00:15:19,430
That's it.

204
00:15:19,430 --> 00:15:21,630
This is for our red spot.

205
00:15:21,920 --> 00:15:25,660
Now let's create an elusive statement for the green search.

206
00:15:25,670 --> 00:15:26,510
So I can say.

207
00:15:26,510 --> 00:15:32,210
Else if so each part is equal to green bar.

208
00:15:33,030 --> 00:15:33,440
Right.

209
00:15:33,510 --> 00:15:37,050
I can open and close this elusive statement by using this curly braces.

210
00:15:37,050 --> 00:15:40,210
So here it is going to be the same in the same scenario here.

211
00:15:40,250 --> 00:15:46,950
Again we're going to refer to this colorful object that sets green color value.

212
00:15:47,130 --> 00:15:51,870
And here I just need to divide the value of the progress by this 100.

213
00:15:51,870 --> 00:15:52,670
That's it.

214
00:15:52,680 --> 00:15:57,960
Now we need to actually update the value of the progress of the green search part so I can say green

215
00:15:57,960 --> 00:16:01,480
search bar that said progress.

216
00:16:01,980 --> 00:16:06,020
So here again we need to actually cast this object to an integer value and that here.

217
00:16:06,060 --> 00:16:10,690
Let's actually put our operation inside Apprentice's 100 multiplied by.

218
00:16:10,770 --> 00:16:12,410
Let's put another of parenthesis here.

219
00:16:12,420 --> 00:16:17,990
Colorful dot gets green while you get green color value.

220
00:16:18,000 --> 00:16:18,810
That's it.

221
00:16:18,810 --> 00:16:20,620
As you can see we have no errors here.

222
00:16:20,670 --> 00:16:22,710
So let's also update our takes.

223
00:16:22,710 --> 00:16:24,370
Beauty is the green color value.

224
00:16:24,370 --> 00:16:26,560
That set text.

225
00:16:26,810 --> 00:16:34,490
And here I just type in color food that gets green colored value plus two coats.

226
00:16:34,510 --> 00:16:42,470
Now we need to add also updates are actually are blue a search bar so after the curly brace of this

227
00:16:42,740 --> 00:16:50,130
statement does create another LCF statement so LCF CPR is equal to blue CPR.

228
00:16:50,170 --> 00:16:57,010
I just need to open and close this if they can by using its curly braces so colorful That said Green

229
00:16:57,490 --> 00:16:59,260
set blue color value.

230
00:17:00,100 --> 00:17:06,720
Progress divided by 100 and then I can say blue color value blue color.

231
00:17:06,730 --> 00:17:12,880
A sequel actually pollutes the report that said progress and here I need to cast is of value to an integer

232
00:17:12,880 --> 00:17:13,450
value.

233
00:17:13,450 --> 00:17:15,700
Let's put another parenthesis here.

234
00:17:15,730 --> 00:17:17,550
So here I can say 100.

235
00:17:17,770 --> 00:17:19,210
Multiplied by.

236
00:17:19,330 --> 00:17:26,200
Let's put another pair of pants this year in order to put this colorful dot get blue color value.

237
00:17:26,200 --> 00:17:26,820
That's it.

238
00:17:26,830 --> 00:17:28,050
Now we have no errors.

239
00:17:28,270 --> 00:17:32,780
And finally we need to update our text so it takes the blue color value.

240
00:17:32,770 --> 00:17:35,450
That said text.

241
00:17:35,570 --> 00:17:43,500
And here I just need to refer to this colorful object that gets blue color value plus two coats.

242
00:17:44,350 --> 00:17:45,440
So that's it.

243
00:17:45,460 --> 00:17:46,360
This is very important.

244
00:17:46,360 --> 00:17:47,990
Just pay attention here.

245
00:17:48,010 --> 00:17:54,970
Finally we must update the value of our bitmap object right because when the user interacts with this

246
00:17:55,060 --> 00:18:00,170
sequel's you want to change the color of each pixel of our image.

247
00:18:00,250 --> 00:18:00,830
Right.

248
00:18:00,880 --> 00:18:02,230
So in that is it.

249
00:18:02,260 --> 00:18:05,260
This means that the bitmap is going to be updated.

250
00:18:05,530 --> 00:18:12,700
So we need to actually update our bitmap so after the in curly brace of this LCF statement and I mean

251
00:18:12,700 --> 00:18:15,280
say it is if from Use a statement here.

252
00:18:15,280 --> 00:18:15,740
Right.

253
00:18:15,880 --> 00:18:22,240
So before the adding curly brace of this if statement that specifies that if the interaction was actually

254
00:18:22,240 --> 00:18:27,160
performed by the user or not here I can actually say bitmap.

255
00:18:27,610 --> 00:18:28,850
That's the spirit here.

256
00:18:28,850 --> 00:18:32,260
Bitmapped assignment operator here.

257
00:18:32,270 --> 00:18:39,320
I'm going to refer to this colorful object that return actually call this method the return the colorized

258
00:18:39,320 --> 00:18:41,130
the bitmap semi-colon.

259
00:18:41,240 --> 00:18:49,160
Right and in here I just need to type in IMT for two dot image that set is actually the set image set

260
00:18:49,180 --> 00:18:53,020
the image bitmap choose this Misfit's that image bitmap.

261
00:18:53,200 --> 00:18:56,170
And I just need to pass bitmapped with this method.

262
00:18:56,260 --> 00:18:58,550
So let's run our application now.

263
00:18:58,600 --> 00:19:01,370
And let's see if this works or not.

264
00:19:01,390 --> 00:19:05,010
So here you can say that our application is running on the simulator.

265
00:19:05,470 --> 00:19:07,670
And let's take a picture here.

266
00:19:08,080 --> 00:19:10,390
So here is our picture and let's accept it.

267
00:19:10,390 --> 00:19:14,020
So here is our picture in place of this actually inside this image view.

268
00:19:14,230 --> 00:19:20,950
But now when I am going to actually interact with these six bars our application is going to crash.

269
00:19:21,040 --> 00:19:21,670
OK.

270
00:19:21,880 --> 00:19:29,710
But here I want you to pause the video and use the debugging techniques that I taught you so far in

271
00:19:29,710 --> 00:19:31,300
order to debug the application.

272
00:19:31,300 --> 00:19:36,970
This is very important because later when you want to create your own Android apps or if you want to

273
00:19:36,970 --> 00:19:41,370
create Android apps for the clients you're going to definitely encounter bugs.

274
00:19:41,410 --> 00:19:43,020
Actually nasty box.

275
00:19:43,090 --> 00:19:48,270
So you have to get actually get into the habit of debugging your applications.

276
00:19:48,430 --> 00:19:53,280
And I want you to actually not to panic and start thinking about the source of the bug.

277
00:19:53,290 --> 00:19:55,990
And if you don't know anything about the bug in Android.

278
00:19:55,990 --> 00:19:58,240
Make sure to watch at twenty eight.

279
00:19:58,340 --> 00:20:06,430
Their final part their of that it says debugging the app that I actually talk talked about debugging

280
00:20:06,430 --> 00:20:10,590
Android applications by using the debugging techniques in Android studio.

281
00:20:10,630 --> 00:20:17,770
So please post the video and debug the app yourself and when you're ready try to actually run actually

282
00:20:17,950 --> 00:20:19,060
play the video again.

283
00:20:19,210 --> 00:20:24,020
And here I'm going to let you know where is the source of the buck.

284
00:20:24,160 --> 00:20:29,590
So now let me tell you that let me actually interact with these sequoias as you can see our application

285
00:20:29,590 --> 00:20:30,300
crashed.

286
00:20:30,370 --> 00:20:31,140
Right.

287
00:20:31,150 --> 00:20:32,630
So let's go to Andrew it's you.

288
00:20:32,650 --> 00:20:38,650
I told you you just need to click on Android monitor here and here you can see these red texts here.

289
00:20:38,650 --> 00:20:39,140
Right.

290
00:20:39,310 --> 00:20:46,200
If you scroll to the top it says a fatal exception made made means the error occurred on the mainframe.

291
00:20:46,540 --> 00:20:53,590
And you can see these it takes here it says Return the colorized map and you have also this text that

292
00:20:53,590 --> 00:20:56,160
it says on progress changed.

293
00:20:56,200 --> 00:20:58,070
So let's click on this link here.

294
00:20:58,070 --> 00:21:03,670
Main activity that over here so it says that the source of the error is this one here bitmap assignment

295
00:21:03,670 --> 00:21:06,550
operator colorful that returned the colorized bitmap.

296
00:21:06,940 --> 00:21:10,860
And here it says that we have this colorful that Jubba.

297
00:21:10,960 --> 00:21:17,040
Let's go to the colorful Dobber class and here you can see that it says the error is occurring here.

298
00:21:17,050 --> 00:21:19,240
So what's wrong with this line of code.

299
00:21:19,360 --> 00:21:24,980
If there is something wrong with this line of code here here instead of passing bitmapped with and built

300
00:21:25,090 --> 00:21:34,150
a bitmap height we must pass a row and column right because we must pass the specific rule and the specific

301
00:21:34,150 --> 00:21:35,260
column.

302
00:21:35,350 --> 00:21:42,100
And here we are going to actually specify the pixel color of that specific pixel right.

303
00:21:42,280 --> 00:21:42,980
So that's it.

304
00:21:43,040 --> 00:21:45,580
This is the source of the error if you run the application.

305
00:21:45,580 --> 00:21:49,990
Now you can see that our application is going to work fine and properly.

306
00:21:49,990 --> 00:21:51,390
Let me run on the application now.

307
00:21:51,400 --> 00:21:54,330
Let's click on take a picture let's take a picture here.

308
00:21:54,370 --> 00:21:55,000
Accepted.

309
00:21:55,240 --> 00:21:57,470
And now let me interact with these words.

310
00:21:57,490 --> 00:22:01,210
Now you can see that the color of this image is now red.

311
00:22:01,210 --> 00:22:02,800
Let me interact with this one.

312
00:22:02,800 --> 00:22:04,030
Now it is green.

313
00:22:04,060 --> 00:22:05,190
Let me interact with this one.

314
00:22:05,190 --> 00:22:07,090
Now it is actually this color.

315
00:22:07,120 --> 00:22:14,020
Let me just for example in there interact is a green color you can see this green S'pore or this one

316
00:22:14,430 --> 00:22:14,920
right.

317
00:22:14,950 --> 00:22:15,470
That's it.

318
00:22:15,580 --> 00:22:20,350
And you can also see that these actually takes views are also updated here.

319
00:22:20,350 --> 00:22:22,870
So hopefully that makes sense.

320
00:22:22,870 --> 00:22:27,480
And in the next tutorial we're going to continue building this application we're going to add another

321
00:22:27,490 --> 00:22:29,110
functionality to this application.

322
00:22:29,140 --> 00:22:35,920
For example I actually took a picture here and I for example changed the color of this image.

323
00:22:35,920 --> 00:22:42,790
Now I want to save the picture into the internal memory so let's see how how we can do that in the next

324
00:22:42,790 --> 00:22:43,150
story.

325
00:22:43,180 --> 00:22:44,380
Thank you very much for watching.

326
00:22:44,380 --> 00:22:49,930
If you have any questions about the concepts that I taught you in this lesson please post the discussion

327
00:22:49,930 --> 00:22:53,220
in the course and then I'll do my best to answer all of your questions.

