OK so now let's actually open our project structure.
So just click on this view tool windows and then click on Project.
So as you can see here here is our project structure.
So just click on this list folder here and then file new and then click on Android the source file.
And here for the filing just type in here right answer animation right.
This is going to be the filename rond underline and said underline animation and the resource type is
going to be animation as you can see here right.
So the resource type is going to be animation.
So choose this animation here.
The root element is set the source said is made and the directory name is going to be any right and
it be.
OK.
So as you can see here we have this folder.
This directory here inside our race folder here and in and inside this and in Folder we have this exemplified
rant on the line.
Answer an animation that makes them all white.
So this is our file.
So now let me actually double click on this tab here in order to make this area wider.
And now as you can see here we have a set.
Right.
So here we've got to actually to provide a set up animations.
So what do I mean by wrong answer animation.
So now let me show you the emulator here.
As you can see this is our emulator right.
And this is actually a peacock.
So let me actually choose our land animal for example elephant.
And now as you can see here we have an animation right and an animation actually is actually occurring
here right.
And animation is occurring here.
So for example let's choose another animal for example mouse.
And again as you can see an animation is occurring here.
So that's why we actually created this around under light and said underline any minute animation that
is modified.
So now inside this set here I went to actually pasting some lines of code 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 a pace that here.
So we have a tag here.
And as you can see the name is translate right Android duration.
So first we need to specify the duration of this translation here as you can see first as you can see
let's actually open our emulator for example if I choose and here as you can see a translation is occurring
here first of you want to actually move up right now as you can see it moves up first.
So translate and duration.
So this is going to be the first attribute first we're going to specify the duration of this specific
translation.
So the duration is 100 milliseconds right.
And then we need to specify the delta.
OK.
From what y Delta or from X Delta.
So let me show you a really important point here.
As you can see the eaks here is zero and the Y here is zero.
Right.
It starts from here.
As you can see the x and d y starts from here.
And here is the x 0 and the Y is 0.
And if you actually move to the right now it's going to actually increase the X.
And if I actually moved down here to the bottom it's going to I should increase the Y.
So if we actually move to the left as you can see it's going to actually decrease the X.
So it's going to keep us a minus value as you can see here a negative value.
And if we actually move to the top it's going to keep us it's going to actually decrease the Y.
So it's going to give us a negative value for the Y.
Right.
So here is the X and the white.
And if I move to the right as you can see it's going to increase the X and it's gonna actually give
us a positive value.
But if they move to the left as you can see from here if we move to the left is going to give us our
negative value for x.
And again the same scenario is occurring for divided Delta.
So for example here is the Y.
And if we move to the bottom as you can see here it's going to increase the Viceroy's can actually keep
us up positive value for the right and if we actually move to the top as you can see if we move to the
top it's going to give us a negative value for the actually y it's going to decrease the value of that
y.
So here is actually calculations for the for the delta and the X Delta.
So I want to move to the top if you want to move to the actually right or left to choose from X Delta.
But because I want to move to the top first it's going to actually specify the starting position of
R for example anima.
So this is that starting position.
So let's actually change this animal here.
Let me show you another element.
So for example this is our eagle right.
So the starting position is zero.
Here is our eagle and the starting position is zero here.
And as you can see from vitals is zero from their starting position and we have to Vidal Tursunov what
we want to move to vital stuff from vital to move to Vidal to write so much minus 4 percent.
So this means that we want to actually move minus 4 percent P to the top right minus 4 percent p means
we want to move to the top because if we actually move to the bottom it's going to give us a positive
value.
But if we move to the top is going to actually give us negative value right.
We have vital to hear right.
So the starting position is zero.
As you can see here and I want to move to the top because I used minus 4 percent.
So that's why I actually use this for here.
So if I actually changed I can actually change the value to other values in order to test this translation.
And now that this animal for example if I choose Lapworth here is going to move to the top right first
it's going to move to the top and after it moves to the top as you can see we have another translation
here.
So translate again we need to specify the duration of these translations so that duration is 100 milliseconds.
So the duration is 100 milliseconds.
And again if you want to move from Vidal to minus 4 percent speed as you can see we moved to Delta here
right.
As you can see this is our first translation if each view moved from vital to to vital to hear from
Viator 0 2 why Delta minus 4 percent.
Now we're here.
And again if you want to actually create another animation and other translation actually.
So again the duration is 100 milliseconds and now from Vidalia is minus 4 percent right from Delta minus
4 percent.
And we want to move to wider to 4 percent.
So again if you want to move down as you can see when we move to that bottom it's going to actually
give us a positive value and if we move to the top is going to give us a negative value.
So as you can see here what we want to move from the top which is minus 4 percent.
To that buy them which is 4 percent.
Right.
And here we have another attribute start offset 100 milliseconds.
So this start offset here is going to determine how many time it's going to actually determine actually
what is going to be the duration that we want to wait after this translation is actually occurred.
So for example this translation is accurate.
We want to wait 100 milliseconds.
As you can see here at the start of it is 100 milliseconds for this translation and then we want to
actually perform this translation and then we want to move from one Delta minus four percent to P2 delta
of 4 percent.
Right.
So this thart offset is going to determine when this translation is going to start.
This translation is going to start up 120 seconds after this translation has occurred.
And then as you can see 100 milliseconds later it's going to actually perform this translation.
So that's why we provided this start offset because it's going to actually determine that we are going
to perform this whole animation actually after each other in a sequence.
First we want this translation to a..
And then after 100 milliseconds as you can see here the start of that is 100 right after 100 milliseconds.
We want this translation to a..
And as you can see here we have another translation here.
So there's a lot of sort of this translation is 200 milliseconds.
So after 200 milliseconds we want this translation to occur.
So translation translate and the duration attribute is 100 milliseconds.
And again if you want to move from Vidalia which is now 4 percent p as you can see here to Lidl or minus
4 percent B again.
Right.
And this thought offset is 200 milliseconds.
So if you have any questions about this concept of animation in Android please post the discussion in
the course and then I'll do my best to answer all of your questions.
So now this is going to be our wrong answer animation.
So now let me explain again to duration for the first translation is one hundred milliseconds you want
to move from vital to zero to to minus 4 percent to pieces if you want to move up.
And then again if you have another translation and this thought offset is 100 milliseconds.
So this translation is going to occur after this translation is a carrot.
Right.
So this thought of these 100 millisecond to duration is 100 from vital to minus 4 percent to 4 percent.
And we have another translation.
Duration is 100 milliseconds from right at 4 percent petabyte to minus 4 percent.
And this part of that is 200 milliseconds.
Right.
And this means that these translations are going to occur in a sequence.
OK after each other.
So hopefully that makes sense.