@@ -8,36 +8,24 @@ Trace.enable();
8
8
9
9
class LaunchAnimation extends GridLayout implements AppLaunchView {
10
10
circle : GridLayout ;
11
- animatedContainer : GridLayout ;
12
11
finished = false ;
13
12
complete : ( ) => void ;
14
13
15
14
constructor ( ) {
16
15
super ( ) ;
16
+ this . backgroundColor = "#4caef7" ;
17
+ this . className = "w-full h-full" ;
17
18
18
- // setup container to house launch animation
19
- this . animatedContainer = new GridLayout ( ) ;
20
- this . animatedContainer . style . zIndex = 100 ;
21
- this . animatedContainer . backgroundColor = "#4caef7" ;
22
- this . animatedContainer . className = "w-full h-full" ;
23
-
24
- // any creative animation can be put inside
19
+ // construct any creative animation
25
20
this . circle = new GridLayout ( ) ;
26
21
this . circle . width = 30 ;
27
22
this . circle . height = 30 ;
28
23
this . circle . borderRadius = 15 ;
29
24
this . circle . horizontalAlignment = "center" ;
30
25
this . circle . verticalAlignment = "middle" ;
31
26
this . circle . backgroundColor = "#fff" ;
32
- this . animatedContainer . addRow ( new ItemSpec ( 1 , GridUnitType . STAR ) ) ;
33
- this . animatedContainer . addRow ( new ItemSpec ( 1 , GridUnitType . AUTO ) ) ;
34
- this . animatedContainer . addRow ( new ItemSpec ( 1 , GridUnitType . STAR ) ) ;
35
- GridLayout . setRow ( this . circle , 1 ) ;
36
- this . animatedContainer . addChild ( this . circle ) ;
37
27
38
- // add animation to top row since booted app will insert into bottom row
39
- GridLayout . setRow ( this . animatedContainer , 1 ) ;
40
- this . addChild ( this . animatedContainer ) ;
28
+ this . addChild ( this . circle ) ;
41
29
}
42
30
43
31
async startAnimation ( ) {
@@ -71,14 +59,10 @@ class LaunchAnimation extends GridLayout implements AppLaunchView {
71
59
}
72
60
73
61
async fadeOut ( ) {
74
- await this . animatedContainer . animate ( {
62
+ await this . animate ( {
75
63
opacity : 0 ,
76
64
duration : 400 ,
77
65
} ) ;
78
- // done with animation, can safely remove to reveal bootstrapped app
79
- this . removeChild ( this . animatedContainer ) ;
80
- this . animatedContainer = null ;
81
- this . circle = null ;
82
66
this . complete ( ) ;
83
67
}
84
68
}
0 commit comments