So now I'm going to paste in some lines of code here and then I'm going to explain to you what's going
on here.
So as you can see here these are the lines of code that I pasted here.
Right now I'm going to explain to you what's going on here.
Exactly.
So now let's actually look at RMF at here as you can see if we have actually a method and the access
modifiers of the Smurfette is public the return type of this method is void and the name of the Smurfette
is modified by different colored.
Right.
And as you can see this method accepts one argument of type shared preferences and the name of this
argument is shared preferences.
So let's actually go inside the curly braces of the Smurfette And let's see what's going on here.
So in line number four hundred and seventy three as you can see if we have actually of the bell and
the name of this variable is actually back in color and the date or type of this variable is string.
And then I put an assignment operator here and then I referred to the name of this argument shared preferences
that gets strange.
So here I'm actually calling this method and this is shared preferences.
Main activity does cuius underline it and underline color.
So here I am actually calling this constant that we have inside the main activity our job.
So now let's actually go inside the main activity that are filed here as you can see here.
Inside this class main activity we have this key here right.
Public static final sprint cuius on the line Bigler underline color.
So this is actually a constant that holds this cheap as you can see here of actually assigned this value
which is of types 3 into this constant.
So this is the key settings underline quis Underland by going on on the line color.
So if I actually go inside the class Underland preferences that is then on file.
Now you can see that we have actually at least preference here.
Right.
And the entries is actually at site a slash colors.
And if I actually hold the command key on my keyboard.
So if you are using a Windows machine just hold the control on your keyboard and then click on this
value here as you can see we have this stunning area here.
So here we have the colors.
So as you can see here this value is the value that we specify here as the entries.
Right.
So now as you can see we have these values and these are the values that we're going to show to the
user.
And if we actually show you the emulator here and if I actually click on these settings here now if
I click on these two specular color as you can see we are actually showing these values white black
green red blue yellow as the values that you want to show to the user.
And now let's go back inside our quiz on the alleged preferences that exemplified and for the interest
values the also refers to this value as sign is an a slash colors.
So if we actually hold the comment on my keyboard and then click on this value here as you can see again
we are again using these values as the actually exact values that we want to actually work with.
Right.
So we actually have these values.
White black green red blue yellow.
And let's actually go back into our quiz underline preferences that exemplified.
And the key is settings underline quick underline Bagenal underline color and the title is this value
to going on color.
So if I actually hold the comment on my keyboard and if you are using a Windows machine just hold the
control on your keyboard and then click on this value as you can see we have this value here too.
Back at non-color.
So let's go back into our quiz Underland preferences them and find if we have this summary.
We have persistence which is actually true and the default value is a value that is specified inside
this string that XML file.
So now let's actually hold the Comanche on our keyboard.
So if you are using a Windows machine just hold the control on your keyboard and then click on these
different colored black as you can see.
Now I actually created this string the source inside these strings that exemplified.
And now you can see the value which is actually the black color right.
So now if I go back into the squeeze underline preferences for example file you can see that we have
this list preference here and we can actually interact with this preference by using this key here that
you specify here right.
So let's go back into our main activity fragment that of a file.
And now you can see that we are actually getting these values shared preferences that get strange you
are getting the value by using this key you are getting the value that is actually saved through the
shared preference shares preferences.
For example the value can be for example Blache the value can be white green red blue yellow.
So if you are getting that value by using this key main activity that quiz Underland by an underlined
color and for the default value of the past the value not because we actually actually specified a default
value inside the squeeze preferences that examined file you can see this value here right.
So we don't need to specify that value here.
So we passed the value not for the second argument and here it can actually assign that value to the
background color which is of type string.
And now I actually created a switch statement and I want to actually switch between the values of respect
and color.
So sweet.
And now let's actually go inside the curly braces of the switch statement and let's see what's going
on here.
So if you have subcase statements here.
Here we are saying that case white and this means that if the value of this by green color valuable
which is actually off the upstreams is white right.
If the value of this Speigel uncolored is white then it's going to execute these lines of code here.
First it's going to set a background color of the animalcules linearly out here to white.
So animal Quizon initially out that set back in on color color that white and then here we are actually
iterating over them actually over the bottoms that we have inside our cookies.
So let me actually show you the emulator for example now if you want to change the background color
to white right and now it says the new changes are applied.
And if I click on the spike back button here at the top as you can see now the Paglen color is white
right.
So here we can see the Bagian and color of the buttons as you can see here is blue.
So here and the text of the buttons is actually white.
So now we are actually either over these buttons so linearly of all rows of just spottiness in animal
cuius So it is actually either reading over the values of this trait which which actually holds the
values of linearly out.
And then here we have this for loop here.
And it is actually again it's going to go inside the rows of those buttons and it's going to actually
get the columns which is actually there at the bottom that we have here.
So for columns 0 and this loop here is going to be executed until the value of this column is less than
the value of the child count of that row.
So as you can see here and it's going actually increments the value of this column by 1 each time.
After each execution of this fall.
So here as you can see we are actually getting the bottom inside that specific row.
So Button button here we created our variable of type button and the name is button assignment operator.
And then he realized we are actually testing this object a button object.
And here we are referring to the row that get child at column.
Right.
So in this way we can actually access this button for example.
And then it can actually set the background color of the button to color that blue as you can see.
And here we are setting the text colored off that button to color that white.
And here after this will appear as you can see after the ending curly brace of this world we are setting
some other ideas.
TH The answer that text the text color color that blue.
So here if we actually just the name of this animal for example.
And now as you can see the color is blue the color of the answer is blue right.
To actually answer the text color color that blue she asks the question number the text color color
that black light.
So it can actually set the color actually.
Question number two black and now it's going to have actually a break statement.
And we have also this case black.
So if the value of this valuable baculum color is actually black then it's going to execute this case
statement.
These lines of code inside this case statement.
And now as you can see it's going to actually set the background color of this animal cuius linearly
out to Blache as you can see animal quizz linearly out that set by different color colors that black.
And that here again we actually created a for loop in order to eat right over the values or there actually
values of these laws of spottiness in animal cuius.
So it's going to eat right over them proteins that we have inside our crews as you can see here.
And we actually created a for loop and inner for loop in order to access those buttons.
So again we are actually accessing that button inside that specific row.
And we are actually sitting in the back of the uncolored to yellow.
So let's actually change that I get from color to black.
So by your own color black and now it says new changes are applied.
And if I actually click on the spike button here as you can see the back in uncolored is black.
Right.
So now I can actually set the background color of the buttons to yellow as you can see here.
So a button that said Get on colored colored yellow.
And as you can see if you are sitting there in cut the text color excuse me you are sitting just takes
the color of this button to color that black as you can see here the text color of these buttons is
actually a black right.
And finally we are sitting there thinking the answer to color that white as you can see here.
So if you take just the name of this animal here Dalfin now it says now as you can see here the text
color is white.
And of course that takes the question number and color to test the question number that takes color
to color that white.
And here we have a press statement and we hear we have chased green as you can see here.
So if the value of it is valuable as you can see if the value of this by your own color rowdier is actually
green.
Now is going to execute these lines of code here.
As you can see.
So first it's going to actually set the background and color to green.
So animal cuisine linearly out that set by green color color that's green.
So now let me show you the emulator.
Now let's get you to go inside the city's activity.
And now let's actually go and select this truth.
Back in color and just select green.
Now liturgically can dispatch button here at the top as you can see now the background color is green.
And here we have a full look and here it's going to either read all the values that we have inside these
rows of just buttons in animal keys.
So it's going to iterate over the laws that we have inside the squeeze.
And here we have an inner for loop and this inner for loop is going to iterate over the columns that
we have inside these rows.
So these buttons are actually the columns right.
So for in column and this for a of here is going to be executed until the value of this column is less
than the value of the trial count of the throw.
And it's going to add one value for the value of this color variable after each of each execution of
this for loop.
And here we are actually creating a reference to those buttons that we have here inside these rows.
So bottom part in here we created read a bit of a button and then I put an assignment operator here
and here you are casting this object a button object row that good child column.
And here we are setting the background color to blue as you can see here the background and color of
the buttons as you can see here is blue.
And here we are setting the text color of the buttons to white color that actually white as you can
see here.
But in the text color color that white as you can see here and here finally we are sitting.
Actually take the color of the text the answer to color that white.
So now let me guess the name of this animal as you can see here.
Th the answer colored is actually white right.
Take the takes color of the states and is white and that here is the question number that takes color
is actually color that yellow here is white.
But for our for our own application I chose the value yellow and that I put a brave statement here and
here we have case blue.
So if the value of the background color is actually blue so that it may actually change the background
color to blue here and choose Blue and if I click on this back button here as you can see now that back
in uncolored is blue.
And here we are sitting back in uncolored of this animal Chrisley out to actually blue and Quizon Quizon
out that said back in uncolored color that blue.
And here we created a for loop here as he conceived.
So this fall of here is going to actually eat right over the values of this tree which actually holds
values of probably nearly two rows of spottiness in animalcules.
So it can actually hold the rows of spottiness that we have inside our quiz.
Now it's going to overate even I should iterate over the values that we have in this.
And we have an actually in a for loop.
So again column 0.
So it does fall of here is going to be executed until the value of this column is actually less than
the value of the child count of this row.
And then second I should increment the value of this column by 1 after each execution of this for loop.
And here inside this full as you can see here we are actually creating a reference to the botanist that
we have inside these rows.
So button button assignment operator.
Here we are testing this object a button object so that your child at Klallam.
And here we are sitting back in uncolored of the spot and to read as you can see here the packet and
color of these buttons is right.
Right.
So button that text color color that white.
And we're also setting the color of these buttons to white.
And here we are sitting.
That takes colored off this is the answer to color that white.
So let me guess the name as you can see Lyon as you can see the back in uncolored.
Actually the text color of the answer is white and if you are sitting at your request question number
of this is to set the text color color that white right and via Here we be put a statement.
And now let me talk about this case red as you can see here.