@@ -8,36 +8,24 @@ Trace.enable();
88
99class LaunchAnimation extends GridLayout implements AppLaunchView {
1010 circle : GridLayout ;
11- animatedContainer : GridLayout ;
1211 finished = false ;
1312 complete : ( ) => void ;
1413
1514 constructor ( ) {
1615 super ( ) ;
16+ this . backgroundColor = "#4caef7" ;
17+ this . className = "w-full h-full" ;
1718
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
2520 this . circle = new GridLayout ( ) ;
2621 this . circle . width = 30 ;
2722 this . circle . height = 30 ;
2823 this . circle . borderRadius = 15 ;
2924 this . circle . horizontalAlignment = "center" ;
3025 this . circle . verticalAlignment = "middle" ;
3126 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 ) ;
3727
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 ) ;
4129 }
4230
4331 async startAnimation ( ) {
@@ -71,14 +59,10 @@ class LaunchAnimation extends GridLayout implements AppLaunchView {
7159 }
7260
7361 async fadeOut ( ) {
74- await this . animatedContainer . animate ( {
62+ await this . animate ( {
7563 opacity : 0 ,
7664 duration : 400 ,
7765 } ) ;
78- // done with animation, can safely remove to reveal bootstrapped app
79- this . removeChild ( this . animatedContainer ) ;
80- this . animatedContainer = null ;
81- this . circle = null ;
8266 this . complete ( ) ;
8367 }
8468}
0 commit comments