1
00:00:00,430 --> 00:00:04,050
OK so now let's actually open our project structure.

2
00:00:04,110 --> 00:00:08,700
So just click on this view tool windows and then click on Project.

3
00:00:08,700 --> 00:00:11,880
So as you can see here here is our project structure.

4
00:00:12,060 --> 00:00:19,820
So just click on this list folder here and then file new and then click on Android the source file.

5
00:00:20,250 --> 00:00:29,200
And here for the filing just type in here right answer animation right.

6
00:00:29,280 --> 00:00:35,970
This is going to be the filename rond underline and said underline animation and the resource type is

7
00:00:35,970 --> 00:00:38,600
going to be animation as you can see here right.

8
00:00:38,670 --> 00:00:40,400
So the resource type is going to be animation.

9
00:00:40,410 --> 00:00:42,430
So choose this animation here.

10
00:00:42,810 --> 00:00:50,750
The root element is set the source said is made and the directory name is going to be any right and

11
00:00:50,750 --> 00:00:51,190
it be.

12
00:00:51,210 --> 00:00:52,050
OK.

13
00:00:52,440 --> 00:00:54,800
So as you can see here we have this folder.

14
00:00:54,840 --> 00:01:02,580
This directory here inside our race folder here and in and inside this and in Folder we have this exemplified

15
00:01:02,850 --> 00:01:04,110
rant on the line.

16
00:01:04,130 --> 00:01:06,720
Answer an animation that makes them all white.

17
00:01:06,780 --> 00:01:07,950
So this is our file.

18
00:01:08,130 --> 00:01:13,960
So now let me actually double click on this tab here in order to make this area wider.

19
00:01:13,970 --> 00:01:16,360
And now as you can see here we have a set.

20
00:01:16,440 --> 00:01:17,100
Right.

21
00:01:17,520 --> 00:01:21,270
So here we've got to actually to provide a set up animations.

22
00:01:21,270 --> 00:01:23,880
So what do I mean by wrong answer animation.

23
00:01:23,880 --> 00:01:26,910
So now let me show you the emulator here.

24
00:01:26,910 --> 00:01:28,770
As you can see this is our emulator right.

25
00:01:28,860 --> 00:01:30,360
And this is actually a peacock.

26
00:01:30,540 --> 00:01:34,860
So let me actually choose our land animal for example elephant.

27
00:01:34,950 --> 00:01:41,180
And now as you can see here we have an animation right and an animation actually is actually occurring

28
00:01:41,310 --> 00:01:42,130
here right.

29
00:01:42,180 --> 00:01:43,530
And animation is occurring here.

30
00:01:43,530 --> 00:01:47,190
So for example let's choose another animal for example mouse.

31
00:01:47,250 --> 00:01:50,070
And again as you can see an animation is occurring here.

32
00:01:50,130 --> 00:01:55,980
So that's why we actually created this around under light and said underline any minute animation that

33
00:01:55,980 --> 00:01:56,840
is modified.

34
00:01:57,060 --> 00:02:02,820
So now inside this set here I went to actually pasting some lines of code and then I'm going to explain

35
00:02:02,820 --> 00:02:05,000
to you what's going on here.

36
00:02:05,010 --> 00:02:09,650
So as you can see here these are the lines of code that a pace that here.

37
00:02:09,810 --> 00:02:11,270
So we have a tag here.

38
00:02:11,340 --> 00:02:15,960
And as you can see the name is translate right Android duration.

39
00:02:15,960 --> 00:02:21,030
So first we need to specify the duration of this translation here as you can see first as you can see

40
00:02:21,030 --> 00:02:26,330
let's actually open our emulator for example if I choose and here as you can see a translation is occurring

41
00:02:26,400 --> 00:02:32,740
here first of you want to actually move up right now as you can see it moves up first.

42
00:02:32,820 --> 00:02:35,960
So translate and duration.

43
00:02:35,960 --> 00:02:41,610
So this is going to be the first attribute first we're going to specify the duration of this specific

44
00:02:41,610 --> 00:02:42,560
translation.

45
00:02:42,600 --> 00:02:46,540
So the duration is 100 milliseconds right.

46
00:02:46,740 --> 00:02:49,910
And then we need to specify the delta.

47
00:02:49,980 --> 00:02:50,300
OK.

48
00:02:50,340 --> 00:02:53,700
From what y Delta or from X Delta.

49
00:02:53,700 --> 00:02:56,520
So let me show you a really important point here.

50
00:02:56,760 --> 00:03:01,320
As you can see the eaks here is zero and the Y here is zero.

51
00:03:01,350 --> 00:03:01,950
Right.

52
00:03:01,950 --> 00:03:03,170
It starts from here.

53
00:03:03,180 --> 00:03:07,430
As you can see the x and d y starts from here.

54
00:03:07,530 --> 00:03:09,940
And here is the x 0 and the Y is 0.

55
00:03:10,110 --> 00:03:15,660
And if you actually move to the right now it's going to actually increase the X.

56
00:03:15,990 --> 00:03:20,410
And if I actually moved down here to the bottom it's going to I should increase the Y.

57
00:03:20,490 --> 00:03:24,490
So if we actually move to the left as you can see it's going to actually decrease the X.

58
00:03:24,600 --> 00:03:28,540
So it's going to keep us a minus value as you can see here a negative value.

59
00:03:28,800 --> 00:03:33,590
And if we actually move to the top it's going to keep us it's going to actually decrease the Y.

60
00:03:33,600 --> 00:03:36,650
So it's going to give us a negative value for the Y.

61
00:03:36,690 --> 00:03:37,190
Right.

62
00:03:37,230 --> 00:03:39,090
So here is the X and the white.

63
00:03:39,210 --> 00:03:44,760
And if I move to the right as you can see it's going to increase the X and it's gonna actually give

64
00:03:44,760 --> 00:03:46,170
us a positive value.

65
00:03:46,260 --> 00:03:52,390
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

66
00:03:52,590 --> 00:03:54,890
negative value for x.

67
00:03:54,900 --> 00:03:59,240
And again the same scenario is occurring for divided Delta.

68
00:03:59,400 --> 00:04:01,120
So for example here is the Y.

69
00:04:01,200 --> 00:04:06,570
And if we move to the bottom as you can see here it's going to increase the Viceroy's can actually keep

70
00:04:06,570 --> 00:04:12,600
us up positive value for the right and if we actually move to the top as you can see if we move to the

71
00:04:12,600 --> 00:04:18,930
top it's going to give us a negative value for the actually y it's going to decrease the value of that

72
00:04:18,930 --> 00:04:19,470
y.

73
00:04:19,710 --> 00:04:26,490
So here is actually calculations for the for the delta and the X Delta.

74
00:04:26,490 --> 00:04:33,280
So I want to move to the top if you want to move to the actually right or left to choose from X Delta.

75
00:04:33,420 --> 00:04:39,610
But because I want to move to the top first it's going to actually specify the starting position of

76
00:04:39,650 --> 00:04:41,050
R for example anima.

77
00:04:41,100 --> 00:04:43,080
So this is that starting position.

78
00:04:43,080 --> 00:04:45,790
So let's actually change this animal here.

79
00:04:46,080 --> 00:04:47,300
Let me show you another element.

80
00:04:47,320 --> 00:04:49,520
So for example this is our eagle right.

81
00:04:49,620 --> 00:04:51,600
So the starting position is zero.

82
00:04:51,630 --> 00:04:54,450
Here is our eagle and the starting position is zero here.

83
00:04:54,670 --> 00:05:02,650
And as you can see from vitals is zero from their starting position and we have to Vidal Tursunov what

84
00:05:02,650 --> 00:05:10,990
we want to move to vital stuff from vital to move to Vidal to write so much minus 4 percent.

85
00:05:11,290 --> 00:05:19,330
So this means that we want to actually move minus 4 percent P to the top right minus 4 percent p means

86
00:05:19,330 --> 00:05:24,670
we want to move to the top because if we actually move to the bottom it's going to give us a positive

87
00:05:24,670 --> 00:05:25,050
value.

88
00:05:25,060 --> 00:05:30,000
But if we move to the top is going to actually give us negative value right.

89
00:05:30,010 --> 00:05:32,020
We have vital to hear right.

90
00:05:32,020 --> 00:05:34,580
So the starting position is zero.

91
00:05:34,840 --> 00:05:40,960
As you can see here and I want to move to the top because I used minus 4 percent.

92
00:05:41,140 --> 00:05:43,780
So that's why I actually use this for here.

93
00:05:43,900 --> 00:05:50,590
So if I actually changed I can actually change the value to other values in order to test this translation.

94
00:05:50,830 --> 00:05:56,590
And now that this animal for example if I choose Lapworth here is going to move to the top right first

95
00:05:56,620 --> 00:06:02,470
it's going to move to the top and after it moves to the top as you can see we have another translation

96
00:06:02,500 --> 00:06:03,640
here.

97
00:06:03,670 --> 00:06:10,660
So translate again we need to specify the duration of these translations so that duration is 100 milliseconds.

98
00:06:10,780 --> 00:06:13,880
So the duration is 100 milliseconds.

99
00:06:13,900 --> 00:06:20,400
And again if you want to move from Vidal to minus 4 percent speed as you can see we moved to Delta here

100
00:06:20,410 --> 00:06:21,030
right.

101
00:06:21,040 --> 00:06:26,950
As you can see this is our first translation if each view moved from vital to to vital to hear from

102
00:06:26,950 --> 00:06:29,560
Viator 0 2 why Delta minus 4 percent.

103
00:06:29,590 --> 00:06:30,500
Now we're here.

104
00:06:30,940 --> 00:06:35,130
And again if you want to actually create another animation and other translation actually.

105
00:06:35,290 --> 00:06:44,020
So again the duration is 100 milliseconds and now from Vidalia is minus 4 percent right from Delta minus

106
00:06:44,020 --> 00:06:44,970
4 percent.

107
00:06:45,130 --> 00:06:48,270
And we want to move to wider to 4 percent.

108
00:06:48,400 --> 00:06:53,440
So again if you want to move down as you can see when we move to that bottom it's going to actually

109
00:06:53,440 --> 00:06:58,360
give us a positive value and if we move to the top is going to give us a negative value.

110
00:06:58,360 --> 00:07:02,240
So as you can see here what we want to move from the top which is minus 4 percent.

111
00:07:02,600 --> 00:07:05,520
To that buy them which is 4 percent.

112
00:07:05,710 --> 00:07:06,550
Right.

113
00:07:06,640 --> 00:07:11,850
And here we have another attribute start offset 100 milliseconds.

114
00:07:11,920 --> 00:07:19,090
So this start offset here is going to determine how many time it's going to actually determine actually

115
00:07:19,630 --> 00:07:26,660
what is going to be the duration that we want to wait after this translation is actually occurred.

116
00:07:26,710 --> 00:07:28,650
So for example this translation is accurate.

117
00:07:28,750 --> 00:07:31,220
We want to wait 100 milliseconds.

118
00:07:31,240 --> 00:07:36,010
As you can see here at the start of it is 100 milliseconds for this translation and then we want to

119
00:07:36,010 --> 00:07:43,750
actually perform this translation and then we want to move from one Delta minus four percent to P2 delta

120
00:07:43,750 --> 00:07:44,910
of 4 percent.

121
00:07:45,100 --> 00:07:46,100
Right.

122
00:07:46,180 --> 00:07:50,870
So this thart offset is going to determine when this translation is going to start.

123
00:07:51,070 --> 00:07:59,240
This translation is going to start up 120 seconds after this translation has occurred.

124
00:07:59,380 --> 00:08:06,000
And then as you can see 100 milliseconds later it's going to actually perform this translation.

125
00:08:06,100 --> 00:08:12,010
So that's why we provided this start offset because it's going to actually determine that we are going

126
00:08:12,010 --> 00:08:18,110
to perform this whole animation actually after each other in a sequence.

127
00:08:18,170 --> 00:08:20,930
First we want this translation to a..

128
00:08:21,160 --> 00:08:27,390
And then after 100 milliseconds as you can see here the start of that is 100 right after 100 milliseconds.

129
00:08:27,400 --> 00:08:29,520
We want this translation to a..

130
00:08:29,830 --> 00:08:32,710
And as you can see here we have another translation here.

131
00:08:33,010 --> 00:08:36,210
So there's a lot of sort of this translation is 200 milliseconds.

132
00:08:36,340 --> 00:08:40,120
So after 200 milliseconds we want this translation to occur.

133
00:08:40,240 --> 00:08:46,210
So translation translate and the duration attribute is 100 milliseconds.

134
00:08:46,210 --> 00:08:52,630
And again if you want to move from Vidalia which is now 4 percent p as you can see here to Lidl or minus

135
00:08:52,630 --> 00:08:54,830
4 percent B again.

136
00:08:55,180 --> 00:08:55,920
Right.

137
00:08:56,000 --> 00:08:59,130
And this thought offset is 200 milliseconds.

138
00:08:59,200 --> 00:09:06,290
So if you have any questions about this concept of animation in Android please post the discussion in

139
00:09:06,290 --> 00:09:09,720
the course and then I'll do my best to answer all of your questions.

140
00:09:09,730 --> 00:09:13,980
So now this is going to be our wrong answer animation.

141
00:09:16,170 --> 00:09:22,340
So now let me explain again to duration for the first translation is one hundred milliseconds you want

142
00:09:22,340 --> 00:09:27,590
to move from vital to zero to to minus 4 percent to pieces if you want to move up.

143
00:09:27,890 --> 00:09:33,180
And then again if you have another translation and this thought offset is 100 milliseconds.

144
00:09:33,200 --> 00:09:37,670
So this translation is going to occur after this translation is a carrot.

145
00:09:37,700 --> 00:09:38,270
Right.

146
00:09:38,420 --> 00:09:46,770
So this thought of these 100 millisecond to duration is 100 from vital to minus 4 percent to 4 percent.

147
00:09:47,090 --> 00:09:48,970
And we have another translation.

148
00:09:48,980 --> 00:09:54,640
Duration is 100 milliseconds from right at 4 percent petabyte to minus 4 percent.

149
00:09:54,770 --> 00:09:57,170
And this part of that is 200 milliseconds.

150
00:09:57,260 --> 00:09:57,760
Right.

151
00:09:57,800 --> 00:10:02,940
And this means that these translations are going to occur in a sequence.

152
00:10:02,980 --> 00:10:04,730
OK after each other.

153
00:10:04,820 --> 00:10:06,700
So hopefully that makes sense.

