1
00:00:00,210 --> 00:00:01,010
Hi everyone.

2
00:00:01,050 --> 00:00:05,810
So now it's time to create another class inside our project.

3
00:00:05,910 --> 00:00:09,020
So let me actually just show you the Android view here.

4
00:00:09,030 --> 00:00:13,170
If you don't have the outward view opened here you just need to add a puppy and you just click on real

5
00:00:13,520 --> 00:00:17,220
tool windows and then click on project and then you can see the Android view.

6
00:00:17,220 --> 00:00:23,410
So inside this app for that we have this job folder inside this double folder we have this package right.

7
00:00:23,430 --> 00:00:28,570
So just click on this package that actually holds these main activity class likely.

8
00:00:28,580 --> 00:00:34,740
Right click on this by each year new and current job class for the name of the class here.

9
00:00:34,830 --> 00:00:35,830
Just typing here.

10
00:00:35,850 --> 00:00:40,960
Colorful colorful here you can see that the type is class.

11
00:00:40,980 --> 00:00:42,770
Just click on OK.

12
00:00:42,790 --> 00:00:46,020
Right here we have the colorful class.

13
00:00:46,140 --> 00:00:50,610
So now it's time to actually implement this class.

14
00:00:50,610 --> 00:00:53,140
It's time to add some implementations inside this class.

15
00:00:53,340 --> 00:00:58,290
So just double click on this colorful dot dot happy in order to make this area wider.

16
00:00:58,290 --> 00:01:04,170
Now I can't say first of all we mean it will have some instance variables.

17
00:01:04,170 --> 00:01:08,940
So the first is that an instance variable is going to be private the data type of this instance variable

18
00:01:08,940 --> 00:01:13,560
is going to be a bitmap and the name of this valley is going to be bitmapped semi-colon.

19
00:01:13,800 --> 00:01:22,080
The second instance valuable is again private float and the name is going to be a red color value semi-colon

20
00:01:22,560 --> 00:01:33,060
private float and the name of this instance variable is going to be green color value semi-colon private

21
00:01:33,480 --> 00:01:41,150
float and the name of this instance variable is going to be a blue color value blue color value semi-colon.

22
00:01:41,180 --> 00:01:43,790
So these are our instance variables.

23
00:01:43,790 --> 00:01:49,070
Now it's time to create a constructor for this colorful class.

24
00:01:49,070 --> 00:01:53,570
So here I can say publish the access modifier of my constructor is public.

25
00:01:53,780 --> 00:01:59,310
So remember I told you that the name of your constructor must be the same as the name of your class.

26
00:01:59,360 --> 00:02:04,940
So the name of the class is colorful bright colorful and that I put a pair of prentices in order to

27
00:02:04,940 --> 00:02:09,330
specify that this constructor is going to accept some after the arguments.

28
00:02:09,330 --> 00:02:16,010
So if we need to specify the prime intercede for the first trimester is going to be off the bitmap bitmap.

29
00:02:16,430 --> 00:02:19,530
And here I can say bitmapped comma.

30
00:02:20,120 --> 00:02:26,000
And here I need to specify the second trimester which is going to be off that floats and the name is

31
00:02:26,000 --> 00:02:37,490
going to be again read value Rillette value comma floats green value green value.

32
00:02:37,730 --> 00:02:43,260
Come on floats below value blue value.

33
00:02:43,340 --> 00:02:48,730
Let's open and close this constructed by using these curly braces and opening curly brace followed by

34
00:02:48,800 --> 00:02:49,730
closing calibrates.

35
00:02:49,760 --> 00:02:56,300
Let's go inside the body of this constructor and now it's time to initialize our instance variables

36
00:02:56,690 --> 00:02:59,220
the first instance variable is actually the bitmap.

37
00:02:59,600 --> 00:03:02,440
But you can see that the name of my instance variable.

38
00:03:02,450 --> 00:03:07,780
And then even the name of my actually parameter here is the same is exactly the same.

39
00:03:08,090 --> 00:03:14,540
So in this case you must put this dot bitmap in order to refer to this instance variable.

40
00:03:14,540 --> 00:03:22,210
Remember I told you this refers to an instance of type color for class.

41
00:03:22,280 --> 00:03:28,160
So when I say this that be bitmap I am referring to an instance variable of this class.

42
00:03:28,190 --> 00:03:33,770
So it is going to actually refer to this bitmapped instance value an assignment operator and I can refer

43
00:03:33,770 --> 00:03:36,140
to this privater bitmap semicolon.

44
00:03:36,260 --> 00:03:37,250
Right.

45
00:03:37,280 --> 00:03:43,280
If you don't want to use this here this syntax actually I can comment out this line of code and instead

46
00:03:43,280 --> 00:03:49,270
of bitmapped I can say for example new bitmap new beats map right.

47
00:03:49,360 --> 00:03:55,090
So in this case we do not have to put the keyboard this year in order to refer to this instance variable

48
00:03:55,270 --> 00:04:02,500
because the name of my instance variable is actually different from this new bitmap parameter name from

49
00:04:02,500 --> 00:04:03,260
the Internet.

50
00:04:03,280 --> 00:04:09,490
So here I can just easily say bitmap assignment operator new bitmap byte semicolon.

51
00:04:09,640 --> 00:04:10,960
So that's possible.

52
00:04:10,960 --> 00:04:15,640
I just wanted to actually let you know about this syntaxes because it is very important to know about

53
00:04:15,960 --> 00:04:20,080
this syntax in Java because later you want to actually look at other projects.

54
00:04:20,080 --> 00:04:25,270
So you may be actually look at some codes that are similar to this one here.

55
00:04:25,300 --> 00:04:26,470
Right.

56
00:04:26,470 --> 00:04:32,100
So now let's initialize our red color values so here I have a red color value.

57
00:04:33,290 --> 00:04:36,450
Assignment operator read value semicolon.

58
00:04:36,800 --> 00:04:45,020
So instead of actually allowing this constructor to access my instance variables directly I can actually

59
00:04:45,020 --> 00:04:47,010
use this setter.

60
00:04:47,090 --> 00:04:51,180
So I haven't still created a certain method for this instance variables.

61
00:04:51,290 --> 00:04:52,230
Yet in this class.

62
00:04:52,310 --> 00:04:56,470
So I want to just type them in here either I'm going to create this little later.

63
00:04:56,570 --> 00:05:04,640
So here I can just see a set of red colored values set red color value and I put a pair of prentices.

64
00:05:04,670 --> 00:05:12,740
And here I can pass the right value to dismiss that semicolon or for example I can say set green color

65
00:05:12,740 --> 00:05:13,600
value green

66
00:05:17,340 --> 00:05:18,640
color value.

67
00:05:20,830 --> 00:05:25,150
And I put up at Apprentice's and here I can see green value semi-hollow.

68
00:05:25,520 --> 00:05:29,610
And here I can say said blue color value.

69
00:05:29,930 --> 00:05:33,170
And here I can say who value same color.

70
00:05:33,560 --> 00:05:34,460
Right.

71
00:05:34,460 --> 00:05:35,620
So that's it.

72
00:05:35,840 --> 00:05:41,390
Now after it's constructive it's time to actually create some setter's so you can see it is so term

73
00:05:41,400 --> 00:05:42,410
remove it see it right.

74
00:05:42,500 --> 00:05:45,540
But we haven't still created these sitters.

75
00:05:45,560 --> 00:05:48,860
The first move it is going to be this one set with color value.

76
00:05:48,860 --> 00:05:50,250
So let's see how we can do that.

77
00:05:51,540 --> 00:05:59,800
So public void and the name of this method is going to be set a red color value right.

78
00:05:59,810 --> 00:06:04,980
I put a pair of practices and I need to specify the argument which is going to be off that float.

79
00:06:05,060 --> 00:06:09,220
And here I can say for example read value right.

80
00:06:09,500 --> 00:06:12,610
And then I just open and close dismiss it by using this curly braces.

81
00:06:12,860 --> 00:06:19,850
So here I'm going to create an if statement so if now I'm going to refer to this prime turning red value

82
00:06:20,690 --> 00:06:24,660
is actually greater than or equal to zero.

83
00:06:25,010 --> 00:06:30,700
And rate value is less than or equal to number one.

84
00:06:30,840 --> 00:06:31,250
Right.

85
00:06:31,270 --> 00:06:34,510
Because here we are specifying a value for the color.

86
00:06:35,050 --> 00:06:39,080
We must actually choose a value that is between 0 and 1.

87
00:06:39,280 --> 00:06:40,110
Right.

88
00:06:40,240 --> 00:06:46,990
So that value is actually just a kind of a formula if you want to specify if you want to create a colorful

89
00:06:46,990 --> 00:06:50,950
application if you want to for example make your image Acuff colorful.

90
00:06:51,070 --> 00:06:51,540
Right.

91
00:06:51,610 --> 00:06:55,440
So the value should be between 0 and 1.

92
00:06:55,480 --> 00:07:03,040
Now inside this if statement I can't say if this condition is actually true I can't say I have referred

93
00:07:03,030 --> 00:07:10,110
to this instance valuable red colored values or red color value assignment operator red value semicolon

94
00:07:10,440 --> 00:07:12,750
that that's this is or settle for the red color.

95
00:07:12,850 --> 00:07:20,810
So let's create another set at my fifth year public Voyt and the name of this is going to be set green

96
00:07:20,810 --> 00:07:22,450
color value right.

97
00:07:22,470 --> 00:07:24,280
A pair of Apprentice's floats.

98
00:07:24,410 --> 00:07:32,590
So here the name of this parameter is going to be green value when value add an open and close the set

99
00:07:32,630 --> 00:07:36,460
by using these curly braces and opening curly brace followed by a closing calibrates.

100
00:07:36,470 --> 00:07:38,180
So let's create an if statement.

101
00:07:38,180 --> 00:07:40,030
Again the same scenario here right.

102
00:07:40,040 --> 00:07:46,640
I can't say if green value is actually greater than or equal to zero.

103
00:07:46,880 --> 00:07:52,950
And green value is less than or equal to number one.

104
00:07:53,180 --> 00:08:01,050
Then only in that case we want to actually assign a value to our clean cut value instance value.

105
00:08:01,130 --> 00:08:07,980
So green color value assignment operator green value SEMI-CHORUS that's it.

106
00:08:07,990 --> 00:08:11,240
Now let's actually create a set here for this method.

107
00:08:11,260 --> 00:08:14,420
This blue colored value is valuable.

108
00:08:14,870 --> 00:08:21,280
So before the end he can elaborate of this class I can say Puplick void.

109
00:08:21,410 --> 00:08:26,900
So the name of this month the name of this effort is going to be set to blue color value and then put

110
00:08:26,900 --> 00:08:31,390
up in our practices again that heat up of this apartment and it's going to be flawed.

111
00:08:31,460 --> 00:08:36,370
And the name of this parameter is going to be blue value blue value.

112
00:08:36,400 --> 00:08:40,540
And I just need to open and close this center by using these curly braces.

113
00:08:40,610 --> 00:08:49,000
So if you value I am referring to this parameter turning right is actually greater than or equal to

114
00:08:49,000 --> 00:08:55,850
zero and value is less than or equal to number one then only in that case.

115
00:08:55,900 --> 00:09:00,310
I want to initialize my blue collar about you instance variable.

116
00:09:00,430 --> 00:09:05,560
So here I just need to assign this blue value to this particular value instance value of a semi-colon.

117
00:09:05,560 --> 00:09:06,250
That's it.

118
00:09:06,490 --> 00:09:08,030
So these are our setters.

119
00:09:08,050 --> 00:09:13,490
Now it's time to create get here for our instance variables here.

120
00:09:13,600 --> 00:09:18,650
So I am going to create a getter for the red color value green color value and the blue color value.

121
00:09:18,670 --> 00:09:25,900
So before adding calibers of this class I'm going to say publish a float.

122
00:09:26,050 --> 00:09:33,780
I'm here in the name of this method is going to be get light colored value and then put a pair of parenthesis.

123
00:09:33,780 --> 00:09:37,590
This method is not going to accept any arguments any parameter.

124
00:09:37,800 --> 00:09:43,890
So just open and close this method by using the curly braces and instead just return the value of the

125
00:09:44,160 --> 00:09:47,180
red colored value instance variable right.

126
00:09:47,280 --> 00:09:56,430
So again public float and again get a green colored value open and closed is perfect but using curly

127
00:09:56,430 --> 00:10:00,850
braces really turn green color value semi-colon.

128
00:10:01,050 --> 00:10:08,490
And finally let's create a for our blue colored value instance variables so public float gets blue color

129
00:10:08,490 --> 00:10:12,640
value and just open and close this method by using these curly braces.

130
00:10:12,670 --> 00:10:15,790
Return blue color value semicolon.

131
00:10:16,110 --> 00:10:19,590
So these are all getters for instance variables.

132
00:10:19,590 --> 00:10:29,970
Now it's time to create a method in order to allow an object an instance of this class to colorize the

133
00:10:29,970 --> 00:10:34,320
image that the user has taken by using the camera of the device.

134
00:10:34,350 --> 00:10:35,870
So I'm going to create an effort here.

