And now I want to talk about boolean logical operators.
So now let's actually go back inside this content underline minute example because I want to actually
put in lots of components into this screen.
OK.
So as you can see here again is now seen as an error.
So I just need to click on this clear cache here.
Now as you can see the error is gone.
So OK everyone now actually dragging a linearly out horizontal into this linearly out vertical.
OK so now let's actually put in some more components into this are linearly out horizontal OK.
So let's actually dragging our large takes you here.
So just click on this large takes you and then you can actually click on this linearly out horizontal
here.
OK.
So as you can see here now this takes two views here.
So double click on this text view.
And for the text just type in here through and through and for the ID just typing the XTi through and
through.
OK.
And it's actually tracking two more checkboxes into this linearly horizontal.
So as you can see here we've got this checkbox here.
So just click on this checkbox and then click on this linearly out horizontal here.
OK.
So as you can see here now this checkbox is here.
So double click on the checkbox and for the text just type in here yes.
And for the ID just type in it just type in here see it x true and true.
Yes.
OK.
Let's actually rake in another checkbox into this linearly or horizontal.
So just click on this checkbox here and then put it in.
Inside these are linearly and horizontal and then double click.
And this is a checkbox here.
And for the text just type in here no.
And for the ID just type in here see Edge X through and through.
No.
OK.
And then they actually click and these are linearly out horizontal.
And as you can see here we've got our lay out gravity and we've got this gravity attribute OK.
So just click on this gravity attribute and then open this attribute by just clicking on this little
triangle here and then click on this center horizontal here.
OK check this checkbox.
So as you can see here now are components inside this linearly of horizontal is actually positioned
at the center of this linearly of horizontal OK.
So hopefully that makes sense.
And let's actually go back inside this main activity the job of right here and then let's actually create
some more objects from those components as you can see inside this content underline mean that it may
not examine example we need to actually create a text view and two more checkboxes.
OK.
So inside this main activity that over here I can just type in text view.
OK.
XTi.
True and true.
And then I put an assignment operator here and then I need to cast this object to text through this
view find view by id r that ID that T is the true and true.
OK.
So let's actually create a comment here in order to specify that these components are actually related
to this are true and true.
Text.
OK.
So I can just type in True
and true here.
OK.
And now let's actually create two more checkboxes so I can just type in checkbox see X true and true.
Yes.
OK.
And then I put an assignment operator and then I need to actually cast this object to the checkbox object
and then I just need to type in find the way Id are that Id dot see X true and true.
Yes.
OK.
Again I need to create another checkbox object C H x true and true.
No I put an assignment operator here checkbox find view by id r that Id dot see Edge X true and true.
No.
OK.
So hopefully that makes sense.
So now let's actually work on these components.
OK.
So at the bottom here as you can see we can actually create a comment here.
True and true.
OK.
OK everyone.
Now let's actually create a boolean variable here.
So I just need to type in Boolean OK and then the name of my variable is true and true.
OK and then I need to get an assignment operator here and then I want to actually assign a value to
this value.
OK.
So as you can see the data type of a variable is boolean.
So we need to actually assign a value of type Boolean.
So as a result we can only assign either true or false to this true and true valuable.
So I can't just create a boolean expression here.
OK so I just need to put in a pair of round brackets here and then inside Apprentice's can just type
in true.
And so as you can see here I put in two and are symbols here.
OK.
True and true.
OK.
So as you can see here this is actually a boolean expression.
OK.
And the result of this expression is going to be assigned to this a boolean variable.
Ok so now let's actually create an if statement here.
So if and then say the prentices I need to actually specify the condition.
So true and true.
So as you can see here I specified that if the value of this actual and true value above is true.
OK if the result of this expression is true then that true value is going to be assigned to this variable.
OK.
And if the value of this variable is true.
So as you can see here that's the meaning of this statement here.
If the value of this true and true variable is true.
So now I can actually put in my own codes inside of these curly braces.
So C H x true and true.
Yes that said checked.
True.
OK.
And this means that please if the value of this true and true variable is true then we can actually
check this checkbox here.
As you can see it is.
Yes checkbox.
OK and else.
Else if the value of this true and true variable is not true so it is false.
So I can just put it.
I just need to put in an exclamation mark here.
True and true.
And this means if the value of this true and true value bet is false.
So I can just put in another pair of curly braces here.
So as you can see inside these curly braces I can just type in C H x true and true no dot said checked.
So C is true and true.
No that said check it.
True.
OK.
So hopefully that makes sense.
So now let me actually explain again.
First of all we actually created a boolean valuable named true and true and then we assigned a boolean
expression to this idea.
OK and then we actually created an if statement here.
OK so first of all we specify that if the value of these two and two variable is true and that means
if the value of this expression is true then that true value is going to be assigned to this value.
OK.
And if the value of this variable is true then executes this line of code here and LS If the value of
this variable is not true then execute this line of code here.
And if the value of this true and true variable is false it's going to actually check this a no checkbox
here.
OK.
Because we actually specified that is that C is x true and true.
No that said checked.
True.
So it's true it's true value means it's going to actually check this checkbox.
So remember that I told you then that this checkbox is actually checked the value of the 6 X is true.
And when this checkbox is actually is checked of the value of this checkbox is false.
OK.
So hopefully that makes sense.
And let's actually run our project and see what happens.
OK.
Now as you can see our application is actually running on this emulator.
And as you can see here now this checkbox is checked on OK true and true yes.
And this means that the value of this tool and true valuable is true.
So this line of code is actually get executed.
OK.
C S C H x true and true yes.
So this checkbox that checked.
True.
OK.
So hopefully that makes sense.