Skip to content

Commit dd28836

Browse files
committed
StartupScreen: new screen with an animated spinner to display on startup while the configuration is loading
1 parent 8c89b60 commit dd28836

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

source/FeathersSDKManager.mxml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ limitations under the License.
2626

2727
<f:pushTransition>{Slide.createSlideLeftTransition()}</f:pushTransition>
2828
<f:popTransition>{Slide.createSlideRightTransition()}</f:popTransition>
29+
30+
<f:StackScreenNavigatorItem id="startup">
31+
<fx:Class>view.StartupScreen</fx:Class>
32+
<f:pushEvents>
33+
<fx:Object complete="{SCREEN_ID_STARTUP}"/>
34+
</f:pushEvents>
35+
</f:StackScreenNavigatorItem>
2936

3037
<!-- Step 1: Choose which binary distribution to download. -->
3138
<f:StackScreenNavigatorItem id="chooseProduct">
@@ -116,6 +123,7 @@ limitations under the License.
116123
import feathers.motion.Reveal;
117124
import feathers.motion.Slide;
118125
126+
public static const SCREEN_ID_STARTUP:String = "startup";
119127
public static const SCREEN_ID_CHOOSE_PRODUCT:String = "chooseProduct";
120128
public static const SCREEN_ID_CHOOSE_RUNTIME:String = "chooseRuntime";
121129
public static const SCREEN_ID_CHOOSE_INSTALL_DIRECTORY:String = "chooseInstallDirectory";

source/view/StartupScreen.mxml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Feathers SDK Manager
4+
Copyright 2015 Bowler Hat LLC
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<f:Screen xmlns:fx="http://ns.adobe.com/mxml/2009"
19+
xmlns:f="library://ns.feathersui.com/mxml">
20+
21+
<f:layout>
22+
<f:VerticalLayout gap="10" padding="10"
23+
horizontalAlign="center" verticalAlign="middle"/>
24+
</f:layout>
25+
26+
<f:LayoutGroup id="spinnerGroup" styleName="{CustomStyleNames.ALTERNATE_STYLE_NAME_SPINNER_GROUP}"/>
27+
28+
<fx:Script><![CDATA[
29+
import utils.CustomStyleNames;
30+
]]></fx:Script>
31+
</f:Screen>

source/view/mediators/FeathersSDKManagerMediator.as

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ package view.mediators
2828
import feathers.core.PopUpManager;
2929
import feathers.data.ListCollection;
3030
import feathers.layout.AnchorLayout;
31+
import feathers.motion.Fade;
3132

3233
import flash.desktop.NativeApplication;
3334
import flash.display.Stage;
@@ -111,6 +112,8 @@ package view.mediators
111112
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, nativeApplication_invokeHandler, false, 0, true);
112113

113114
this.createContextMenu();
115+
116+
this.navigator.rootScreenID = FeathersSDKManager.SCREEN_ID_STARTUP;
114117

115118
this.sdkManagerModel.log("Feathers SDK Manager " + this.applicationVersion + " " + this.sdkManagerModel.operatingSystem);
116119
}
@@ -361,7 +364,7 @@ package view.mediators
361364
{
362365
this.checkForUpdate();
363366
this._allowContextMenu = true;
364-
this.navigator.rootScreenID = FeathersSDKManager.SCREEN_ID_CHOOSE_PRODUCT;
367+
this.navigator.pushScreen(FeathersSDKManager.SCREEN_ID_CHOOSE_PRODUCT, null, Fade.createFadeOutTransition());
365368
}
366369

367370
private function context_acquireBinaryDistributionStartHandler(event:starling.events.Event):void

0 commit comments

Comments
 (0)