And essentially create another takes object takes the two stars.
Student Okay and then puts an assignment operator here and it actually has this object to a text object
find view by ID or that Id dot DX the two stars.
Student Okay so now let's actually create another text view object text view the one star student OK.
And then it's actually put an assignment operator here and now this actually cast this object to a text
object.
Find your boy Id are that ID that TXI the one star student OK.
And let's actually put a semicolon at the end of our statement.
So now I try to create some rating but optics So OK so just type in here rating bar or TV five stars.
Student okay.
As you can see this is the name of our record breaking but object.
OK.
And then let's actually put an assignment operator.
And now this actually has this object or writing but object find view by ID are thought Id that are
to be five stars.
Student Okay.
So now let's actually put a semicolon at the end of our statement.
So now let's actually hold the Command key.
If you are using a match with this you can actually to actually hold the Command key.
And if you are using a Windows machine you need to actually hold the control key and then click on the
rating Bar class here as you can see here this rating Burke class is actually the inheriting all of
the features and behaviors that are inside of these apps.
Senior Class.
OK.
So just hold the command key and then click on these apps apps.
See here but here are secret class and this app secret world class is actually inheriting all of the
features that are actually the inside of this program SPARC class.
This and these programs spark class is actually inheriting that all of the features that are inside
of these viewless.
So now we can understand that this rating per class is actually a view class.
Ok there is and is our relationship between this rating world class and the view class.
OK.
Because this progress bar is actually inheriting all of the features and behaviors that are inside of
this of your class so that we can understand that this rating class is actually of your class.
There is and is our relationship between these two classes.
So now let's actually close these classes.
OK here.
Close this progress bar class 2 and here.
Now you can understand why we need to actually cast this object to a rating object.
OK.
So that the compiler knows that we are actually dealing with actually a real rating but object not our
view object.
OK.
So this actually creates an another rating but object are to be four stars.
STUDENT.
And then it's actually an assignment operator here and now let's actually cast this object to a rating
object.
OK fine.
View by our thoughts are ID that are TB that are TB for starters.
Student Okay and now let's actually put a semicolon at the end of our statement.
Let's actually create another rating board object rating bar r t b freestylers.
Student Okay and then let's actually put an assignment operator here.
And now this actually has this object to a rating object rating board.
OK fine view by id thought Id dot Arti be free of stars.
Student Okay let's actually create another rating but object rating about RTP to start.
Student
Okay and then let's actually has this object to a rating but object find view by ID or ID that Arti
be two stars.
Student Okay.
And now let's actually create another rating Bar object.
So just typing here 18 bar RTP one starts student OK and then it's actually an assignment operator here
and then it's actually cestus object or 18 but object find view by ID or that Id dot RTP.
One starts student.
OK so now let's actually create a button object.
OK.
So just type in here button PTEN results.
Ok this is the name of our button and let's just actually put an assignment operator here and now it's
actually the Chrestus object to our button object.
So just typing here a button inside the prentices as you can see here.
Find you by ID are thought Id dots between results.
OK.
So now let's actually run our project and see what happens.
So as you can see here and now our application is actually running on this emulator and here as you
can see these are my R-rating bars as you can see here.
And this is our button as you can see here we can interact with these rating boards for example as you
can see it is a five star rating but here as you can see I can actually make it two stars OK or four
stars or three stars.
OK.
By just interacting and clicking on these stars here.
OK.
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
of these rating words OK.
I don't want to use it to be able to interact with these rating bars.
I just want to show the user that these are the values.
OK.
And I don't want the user to actually to change the values of these rating bars.
So for that reason for that purpose I need to actually call Smurfette on these rating bars.
OK.
Let's actually referred to the name of this RTP five stars student here.
As you can see typing here.
DOT.
And now I want to actually call Smurfette.
And these are Tibe 5 stars.
The student set is indicator.
So we actually assign the value true to this method let's see what happens.
True.
And let's actually run our project and see what happens.
So as you can see here this is our rating but here this is our five star rating board here.
And I actually called this set is indicator method with this object RTP RTP five stars.
Student And I assigned the value true to this method.
OK so now if we actually click on this on these stars here as you can see I cannot change the value
of these five stars are RTP five stars.
Student here.
OK.
I cannot change the value of this rating but but for the other 18 bars I can still change the values
of these rating boards here.
OK.
So I need to actually call the Smurfette on other rating board objects too.
OK.
So let's actually go back inside this main activity or job of right here.
So RTP are TB.
For starters student data set is indicator.
True.
So by default the value of this Meffert is false.
OK.
De-value that is actually is assigned to the Smurfette is actually false.
So if we actually change that value I need to actually assign the value true to this method so that
they use that they use that cannot actually interact with these rating boards.
OK.
So that the user can change the values of these rating boards.
OK.
So again I need to just step in here RTP Freestar student that sets his indicator true RTP.
Two stars student.
That set is indicator.
True.
And RTP one starts student that set is indicator.
True as you can see here.
I can actually use the encapsulation technique here for these methods.
OK.
As you can see I am actually duplicating some lines of code here.
OK.
I'm actually calling this method to every one of these objects so here I can actually use that encapsulation.
And in this way by using in translation technique in your programs your applications would have a list
box.
OK so now I want to actually create a method inside this main activity class and outside of this uncreate
method.
So after the ending curly brace of this uncreate method here I want to actually create a method.
So just typing here public Voyt and the name of this method is make this rating bar.
OK.
The chapter and now I want to actually specify that this is going to actually accept an argument of
type rating but what the suit the name of this argument is rating board and that I need to actually
open and close the Smurfit by using these curly braces.
So as you can see here this method has actually a prime meter.
OK.
Listen if it has an argument and now I can't just refer to the name of this argument rating but that
set is indicator.
True.
OK.
So now instead of just writing these lines of code if we actually comment out these lines of code here
and now I can just only refer to the name of that.
Make these this rating bar indicator and inside the apprentice's I need to actually put a value of type
rating bar so I can just type in RTP Five-Star.
Student make this routine but indicator Arti be false starts.
Student make this rating but indicator RTP starts student make this rating bar indicator RTP to start
a student make these rating but indicate indicator RTP.
One star student.
OK so now let's actually run our project and see what happens.