So as you can see here these are the lines of code that I pasted here.
So we have our method.
And as you can see today the access modifier of this method is private.
The return type of the Smurfette is void and the name of this method is disable cookies spottiness.
So the purpose of this Smurfit is actually to disable the quiz spottiness right.
So as you can see here this method doesn't accept any arguments.
So let's actually go inside the curly braces of the Smurfette And let's see what's going on here.
So as you can see we have a for loop here.
Right.
And this fall of here I actually created of the habit of type integer and the name is row.
And then initially I assigned the value 0 to this rally.
And here I actually created a condition that actually determines how many times this for loop here is
going to be executed.
So until the value of this the row here is actually less than the value of this number of animals gets
grows.
So if I scroll to the top here as you can see inside this classman activity fragment we actually declared
this variable here.
Number of animals guess Rose.
Right.
Which is actually after integer.
So this variable is going to actually hold the number of rows that we have inside our quiz.
Right.
So now let me show you the emulator.
So as you can see here our application is running on the simulator and here as you can see we have a
free guestrooms right.
So this variable here is actually expected to hold the number of animals Jethro's right.
We have free throws and six buttons.
And now if you click on these settings here as you can see we have number of guesses right.
So here we can actually determine that how many buttons that we want to be included in the quiz for
us.
For example for buttons.
And if I click on this back button here at the top as you can see.
Now we have two guests throws right to just rules that actually include that.
Each of them include two buttons.
The first row actually as as you can see here the first row contains two buttons.
And the second row here actually contains two buttons.
So and this variable is deter is actually expected to hold the number of guests.
So here we have to guess rules.
So let's actually scroll down here and now inside the Smurfette.
I actually think I'm saying that until the value of this low value is actually less than the number
of animals gets throws then it's going I to execute this follow up here and here.
And finally here I am actually saying that after each execution of this follow up increment the value
of this roll a variable by one.
OK.
So let's actually go inside is follow up and let's see what's going on here.
First of all in line number 100 an 89 as you can see we have actually our variable of type linear layout
and the name of this rowdier but is just a row linearly out or if it's an assignment operator here and
then here as you can see I am actually referring to the name of this variable.
The rows of guest buttons in animalcules right rows of buttons in animalcules.
So now let's actually scroll to the top here.
As you can see inside this class I actually declare this variable here in line number 51.
As you can see here we have an array of linear layouts here.
Right.
And Arey of linearly outs and then Aimee's rows of spottiness in animal queries.
And here in line I should be in insights uncreate view Mefford we actually initialized this lose of
spottiness valuable sort of rows of spottiness in any Mercuries assignment operator new linearly out
free.
So this is actually is going to hold our free values of type linearly out.
So this is that this is actually the size of this Arey free.
And then here as you can see in lines of 79 flew 81.
He had actually initialising up this at 8.
For example inside as you can see this inside the index zero of this Auret we want to actually put this
value first throw linearly out inciting the x number of one of these already.
We want to assign second rule in linearly out and inside the index number to have this and we want to
assign first row linearly.
So we already initialized this arey.
Right.
So unless I actually scroll down here as you can see here I am saying that rows of just spottiness in
animalcules which is actually an array sup row right.
So for example.
Now let me show you the emulator here.
Let's actually click on the Settings button and number of guesses for example to get this right to number
of actually just options.
If I actually click on Patch button here at the top.
Now as you can see here we have only two buttons and one gets through.
So what does this mean.
This means that here I actually created a full upright and he had this four loops says that until the
value of the stroke which is actually zero is less than number of animals just throws.
So as you can see here we have only one through.
So this value is number one right.
So 0 is less than number one right.
So this follow up here is going to be executed now.
And now here in line number 100 an 89 it we actually created a variable of type linearly out guess linearly
out right.
Assignment operator rows of guess spottiness in animalcules.
So these are 8.
Now actually contains this row here as you can see we have only one row here that contains two buttons
right now.
These are a later.
I'll actually show you here we haven't still puts the lines of code that are related to there actually
are two.
Adding or actually removing rows of buttons rows of just buttons and later I will show you that when
I went they're going to.
And we want to actually for example a change the number of guesses.
But for now just know that here this a is going to hold that that gets through.
So here we have only one guess rule.
And here is Suppe row and this means for example now the value of this low is zero right.
So it's going to go inside this Arey and it's going to actually get a value that is inside of the index
0.
So this row here as you can see is inside the index 0 right.
And it's going to assign that role to this role in your layout.
As you can see here and then here we have another for loop.
So for it bought an index so now we want to actually go inside this classroom here.
And we want to access these buttons inside this linearly out.
So for it but an index assignment operator to zero.
So here we created another variable and we assign the value 0 initially to the spot an index variable.
And then here as you can see we created a condition that actually determines how many times this fall
here is going to be executed.
So until the value of the Spartan index as you can see here is less than the value of this just throw
linearly out as you can see here.
This gets through here right.
Get child count get child count means the children of this linearly out which are actually that is two
buttons right.
These two buttons are actually the children of that linear layout.
Right.
So now as you can see just scroll linearly out that get child count button index plus plus.
So here are they finally you are actually saying that are after effects each execution of this follow
up increment the value of the spot an index.
So the button index Z is 0 right.
So now it's going to actually go inside this loop.
So just throw linearly out.
So here I am referring to this gets through linear layouts that actually holds this linearly out here
right.
This row gets thrown linearly out that get child at.
So it can actually go inside this row get child at bottom index.
So the pattern index is zero right.
So now we can actually get this birth button this button but an index is now 0.
So this button here this actually this birth the button is inside the index 0 of this linear left right
disrobe button index that set enable to false.
So it can actually disable this button.
Right.
And after after executing this for Lapeer is going to try to increment the value of the Spartan index
by Yvonne.
So now the value of what an index is 1.
Right.
So number one is actually less than two.
So as you can see here this row here actually contains two buttons right.
So now button index is actually less than the value of the Get child count of this just rolling out
right.
One is less than two.
And then it's going to again.
It's the cutest thing I've got here it gets through linearly out that child.
But index for about an index now is number one that's set enabled.
So the button here holds is inside the index number one of this row.
So that set enable false.
So it can actually disable this spot in here.
And after that it's going to increment the value of the button indexed by one.
So now the value of this spot an index is two.
And then again it's going to take this condition here so to is not less than the value of this just
linearly out just throw linearly that get child child child because number two is not less than two.
We have two buttons and number two is that is not less than two.
So it's not going to execute this follow up here any more.
As you can see here and it's going to go again to the top here.
It's going to increments the value of this law by what you want.
So here we have only one rule.
OK.
So here now the value of this rule is one.
And number one is not less than number of animals kestrels as you can see here.
We have only one guess through.
So one is not less than one.
And that it's not going to actually execute this for loop here anymore.
And this method here is not going to be executed.
So now as you can see here this is how this effort works in this way we can actually disable our guest
Spartans.
It doesn't really matter that how many good options that we have this method here that we created is
going to actually do that job for us.
So hopefully that makes sense.
And now we need to actually provide another method here as you can see if I scroll to the top here.
Inside this listener we actually provided some of these methods.
For example just get the exact animal name and disable quis guest buttons and we also need to provide
the Smurfette here research animal quiz and animate animal quiz.
So now let's actually create this reset animalcules here inside this class.
So I'm going actually pasting some lines of code here and then I'm going to explain to you what's going
on here.