1
00:00:00,240 --> 00:00:05,100
And essentially create another takes object takes the two stars.

2
00:00:05,100 --> 00:00:13,650
Student Okay and then puts an assignment operator here and it actually has this object to a text object

3
00:00:14,880 --> 00:00:19,710
find view by ID or that Id dot DX the two stars.

4
00:00:19,710 --> 00:00:30,630
Student Okay so now let's actually create another text view object text view the one star student OK.

5
00:00:32,600 --> 00:00:37,980
And then it's actually put an assignment operator here and now this actually cast this object to a text

6
00:00:38,110 --> 00:00:39,100
object.

7
00:00:39,770 --> 00:00:46,050
Find your boy Id are that ID that TXI the one star student OK.

8
00:00:46,430 --> 00:00:49,870
And let's actually put a semicolon at the end of our statement.

9
00:00:49,880 --> 00:00:58,690
So now I try to create some rating but optics So OK so just type in here rating bar or TV five stars.

10
00:00:58,700 --> 00:01:00,530
Student okay.

11
00:01:00,680 --> 00:01:04,350
As you can see this is the name of our record breaking but object.

12
00:01:04,550 --> 00:01:05,290
OK.

13
00:01:05,690 --> 00:01:08,090
And then let's actually put an assignment operator.

14
00:01:08,090 --> 00:01:16,180
And now this actually has this object or writing but object find view by ID are thought Id that are

15
00:01:16,260 --> 00:01:18,170
to be five stars.

16
00:01:18,170 --> 00:01:19,130
Student Okay.

17
00:01:19,310 --> 00:01:23,000
So now let's actually put a semicolon at the end of our statement.

18
00:01:23,030 --> 00:01:25,870
So now let's actually hold the Command key.

19
00:01:26,090 --> 00:01:30,320
If you are using a match with this you can actually to actually hold the Command key.

20
00:01:30,620 --> 00:01:36,160
And if you are using a Windows machine you need to actually hold the control key and then click on the

21
00:01:36,290 --> 00:01:42,920
rating Bar class here as you can see here this rating Burke class is actually the inheriting all of

22
00:01:42,920 --> 00:01:46,220
the features and behaviors that are inside of these apps.

23
00:01:46,250 --> 00:01:47,080
Senior Class.

24
00:01:47,090 --> 00:01:47,520
OK.

25
00:01:47,690 --> 00:01:51,890
So just hold the command key and then click on these apps apps.

26
00:01:51,960 --> 00:01:58,430
See here but here are secret class and this app secret world class is actually inheriting all of the

27
00:01:58,430 --> 00:02:02,670
features that are actually the inside of this program SPARC class.

28
00:02:02,820 --> 00:02:09,260
This and these programs spark class is actually inheriting that all of the features that are inside

29
00:02:09,260 --> 00:02:10,940
of these viewless.

30
00:02:10,970 --> 00:02:15,700
So now we can understand that this rating per class is actually a view class.

31
00:02:15,710 --> 00:02:20,920
Ok there is and is our relationship between this rating world class and the view class.

32
00:02:21,020 --> 00:02:21,670
OK.

33
00:02:22,040 --> 00:02:28,610
Because this progress bar is actually inheriting all of the features and behaviors that are inside of

34
00:02:28,610 --> 00:02:34,170
this of your class so that we can understand that this rating class is actually of your class.

35
00:02:34,190 --> 00:02:37,690
There is and is our relationship between these two classes.

36
00:02:37,700 --> 00:02:40,420
So now let's actually close these classes.

37
00:02:40,460 --> 00:02:41,270
OK here.

38
00:02:41,330 --> 00:02:44,350
Close this progress bar class 2 and here.

39
00:02:44,610 --> 00:02:48,730
Now you can understand why we need to actually cast this object to a rating object.

40
00:02:48,880 --> 00:02:49,290
OK.

41
00:02:49,370 --> 00:02:55,900
So that the compiler knows that we are actually dealing with actually a real rating but object not our

42
00:02:55,910 --> 00:02:56,550
view object.

43
00:02:56,570 --> 00:02:57,020
OK.

44
00:02:57,140 --> 00:03:02,130
So this actually creates an another rating but object are to be four stars.

45
00:03:02,150 --> 00:03:02,930
STUDENT.

46
00:03:02,960 --> 00:03:07,790
And then it's actually an assignment operator here and now let's actually cast this object to a rating

47
00:03:08,330 --> 00:03:09,180
object.

48
00:03:09,290 --> 00:03:10,410
OK fine.

49
00:03:10,410 --> 00:03:19,480
View by our thoughts are ID that are TB that are TB for starters.

50
00:03:19,560 --> 00:03:24,770
Student Okay and now let's actually put a semicolon at the end of our statement.

51
00:03:24,890 --> 00:03:30,930
Let's actually create another rating board object rating bar r t b freestylers.

52
00:03:30,980 --> 00:03:34,710
Student Okay and then let's actually put an assignment operator here.

53
00:03:34,910 --> 00:03:38,730
And now this actually has this object to a rating object rating board.

54
00:03:38,870 --> 00:03:45,170
OK fine view by id thought Id dot Arti be free of stars.

55
00:03:45,170 --> 00:03:53,720
Student Okay let's actually create another rating but object rating about RTP to start.

56
00:03:53,750 --> 00:03:54,350
Student

57
00:03:58,030 --> 00:04:06,430
Okay and then let's actually has this object to a rating but object find view by ID or ID that Arti

58
00:04:06,460 --> 00:04:07,810
be two stars.

59
00:04:07,820 --> 00:04:09,100
Student Okay.

60
00:04:10,220 --> 00:04:14,460
And now let's actually create another rating Bar object.

61
00:04:14,510 --> 00:04:22,910
So just typing here 18 bar RTP one starts student OK and then it's actually an assignment operator here

62
00:04:23,360 --> 00:04:31,460
and then it's actually cestus object or 18 but object find view by ID or that Id dot RTP.

63
00:04:31,470 --> 00:04:32,590
One starts student.

64
00:04:32,590 --> 00:04:36,360
OK so now let's actually create a button object.

65
00:04:36,380 --> 00:04:36,880
OK.

66
00:04:37,040 --> 00:04:41,290
So just type in here button PTEN results.

67
00:04:41,930 --> 00:04:48,690
Ok this is the name of our button and let's just actually put an assignment operator here and now it's

68
00:04:48,690 --> 00:04:51,350
actually the Chrestus object to our button object.

69
00:04:51,350 --> 00:04:55,840
So just typing here a button inside the prentices as you can see here.

70
00:04:56,270 --> 00:05:02,790
Find you by ID are thought Id dots between results.

71
00:05:02,930 --> 00:05:03,380
OK.

72
00:05:03,590 --> 00:05:06,450
So now let's actually run our project and see what happens.

73
00:05:06,500 --> 00:05:11,720
So as you can see here and now our application is actually running on this emulator and here as you

74
00:05:11,720 --> 00:05:15,030
can see these are my R-rating bars as you can see here.

75
00:05:15,050 --> 00:05:20,840
And this is our button as you can see here we can interact with these rating boards for example as you

76
00:05:20,840 --> 00:05:26,810
can see it is a five star rating but here as you can see I can actually make it two stars OK or four

77
00:05:26,820 --> 00:05:28,280
stars or three stars.

78
00:05:28,280 --> 00:05:28,580
OK.

79
00:05:28,590 --> 00:05:32,070
By just interacting and clicking on these stars here.

80
00:05:32,090 --> 00:05:32,900
OK.

81
00:05:33,200 --> 00:05:40,790
So now I I don't want for this application I don't want to allow the user to be able to change the values

82
00:05:40,790 --> 00:05:42,640
of these rating words OK.

83
00:05:42,650 --> 00:05:47,790
I don't want to use it to be able to interact with these rating bars.

84
00:05:47,810 --> 00:05:51,070
I just want to show the user that these are the values.

85
00:05:51,110 --> 00:05:51,720
OK.

86
00:05:51,950 --> 00:05:57,460
And I don't want the user to actually to change the values of these rating bars.

87
00:05:57,590 --> 00:06:02,390
So for that reason for that purpose I need to actually call Smurfette on these rating bars.

88
00:06:02,400 --> 00:06:02,870
OK.

89
00:06:02,960 --> 00:06:07,140
Let's actually referred to the name of this RTP five stars student here.

90
00:06:07,160 --> 00:06:08,600
As you can see typing here.

91
00:06:08,600 --> 00:06:09,510
DOT.

92
00:06:09,980 --> 00:06:11,910
And now I want to actually call Smurfette.

93
00:06:11,930 --> 00:06:13,660
And these are Tibe 5 stars.

94
00:06:13,670 --> 00:06:17,520
The student set is indicator.

95
00:06:17,990 --> 00:06:22,760
So we actually assign the value true to this method let's see what happens.

96
00:06:22,760 --> 00:06:23,570
True.

97
00:06:24,050 --> 00:06:26,870
And let's actually run our project and see what happens.

98
00:06:26,870 --> 00:06:32,020
So as you can see here this is our rating but here this is our five star rating board here.

99
00:06:32,330 --> 00:06:39,130
And I actually called this set is indicator method with this object RTP RTP five stars.

100
00:06:39,150 --> 00:06:41,780
Student And I assigned the value true to this method.

101
00:06:41,780 --> 00:06:48,290
OK so now if we actually click on this on these stars here as you can see I cannot change the value

102
00:06:48,290 --> 00:06:51,340
of these five stars are RTP five stars.

103
00:06:51,340 --> 00:06:51,980
Student here.

104
00:06:51,980 --> 00:06:52,290
OK.

105
00:06:52,340 --> 00:06:58,940
I cannot change the value of this rating but but for the other 18 bars I can still change the values

106
00:06:59,270 --> 00:07:01,230
of these rating boards here.

107
00:07:01,230 --> 00:07:01,730
OK.

108
00:07:01,850 --> 00:07:06,440
So I need to actually call the Smurfette on other rating board objects too.

109
00:07:06,440 --> 00:07:07,080
OK.

110
00:07:07,640 --> 00:07:11,750
So let's actually go back inside this main activity or job of right here.

111
00:07:11,900 --> 00:07:15,790
So RTP are TB.

112
00:07:15,910 --> 00:07:19,870
For starters student data set is indicator.

113
00:07:19,910 --> 00:07:20,260
True.

114
00:07:20,300 --> 00:07:24,550
So by default the value of this Meffert is false.

115
00:07:24,560 --> 00:07:25,160
OK.

116
00:07:25,280 --> 00:07:29,030
De-value that is actually is assigned to the Smurfette is actually false.

117
00:07:29,060 --> 00:07:34,220
So if we actually change that value I need to actually assign the value true to this method so that

118
00:07:34,220 --> 00:07:38,450
they use that they use that cannot actually interact with these rating boards.

119
00:07:38,750 --> 00:07:39,220
OK.

120
00:07:39,290 --> 00:07:42,790
So that the user can change the values of these rating boards.

121
00:07:42,790 --> 00:07:43,360
OK.

122
00:07:43,400 --> 00:07:53,800
So again I need to just step in here RTP Freestar student that sets his indicator true RTP.

123
00:07:54,480 --> 00:07:55,980
Two stars student.

124
00:07:56,240 --> 00:07:58,350
That set is indicator.

125
00:07:58,370 --> 00:07:59,680
True.

126
00:08:00,570 --> 00:08:06,860
And RTP one starts student that set is indicator.

127
00:08:07,130 --> 00:08:09,380
True as you can see here.

128
00:08:09,620 --> 00:08:14,640
I can actually use the encapsulation technique here for these methods.

129
00:08:14,660 --> 00:08:15,020
OK.

130
00:08:15,140 --> 00:08:17,980
As you can see I am actually duplicating some lines of code here.

131
00:08:17,990 --> 00:08:18,260
OK.

132
00:08:18,270 --> 00:08:25,490
I'm actually calling this method to every one of these objects so here I can actually use that encapsulation.

133
00:08:25,490 --> 00:08:32,570
And in this way by using in translation technique in your programs your applications would have a list

134
00:08:32,570 --> 00:08:33,080
box.

135
00:08:33,080 --> 00:08:40,370
OK so now I want to actually create a method inside this main activity class and outside of this uncreate

136
00:08:40,370 --> 00:08:40,920
method.

137
00:08:41,060 --> 00:08:47,080
So after the ending curly brace of this uncreate method here I want to actually create a method.

138
00:08:47,090 --> 00:08:55,630
So just typing here public Voyt and the name of this method is make this rating bar.

139
00:08:55,730 --> 00:08:56,430
OK.

140
00:08:56,920 --> 00:09:04,790
The chapter and now I want to actually specify that this is going to actually accept an argument of

141
00:09:04,790 --> 00:09:11,940
type rating but what the suit the name of this argument is rating board and that I need to actually

142
00:09:11,960 --> 00:09:14,870
open and close the Smurfit by using these curly braces.

143
00:09:14,870 --> 00:09:17,950
So as you can see here this method has actually a prime meter.

144
00:09:17,960 --> 00:09:18,590
OK.

145
00:09:18,800 --> 00:09:24,980
Listen if it has an argument and now I can't just refer to the name of this argument rating but that

146
00:09:24,990 --> 00:09:27,240
set is indicator.

147
00:09:27,270 --> 00:09:28,360
True.

148
00:09:29,210 --> 00:09:29,870
OK.

149
00:09:30,110 --> 00:09:36,260
So now instead of just writing these lines of code if we actually comment out these lines of code here

150
00:09:37,220 --> 00:09:40,160
and now I can just only refer to the name of that.

151
00:09:40,160 --> 00:09:48,620
Make these this rating bar indicator and inside the apprentice's I need to actually put a value of type

152
00:09:48,650 --> 00:09:52,590
rating bar so I can just type in RTP Five-Star.

153
00:09:52,640 --> 00:09:57,990
Student make this routine but indicator Arti be false starts.

154
00:09:57,990 --> 00:10:09,830
Student make this rating but indicator RTP starts student make this rating bar indicator RTP to start

155
00:10:09,850 --> 00:10:15,940
a student make these rating but indicate indicator RTP.

156
00:10:16,250 --> 00:10:17,800
One star student.

157
00:10:18,080 --> 00:10:21,680
OK so now let's actually run our project and see what happens.

