Skip to content

Commit 4c95952

Browse files
committed
InstallProgressScreen: more tweaks to ensure that the animated spinner is displayed when tasks that don't report progress are running
1 parent f204682 commit 4c95952

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

source/services/RunInstallerScriptService.as

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ package services
4343
private static const MISSING_SCRIPT_ERROR:String = "Installation of the Feathers SDK failed. Cannot find SDK installer script.";
4444
private static const UNKNOWN_ERROR:String = "Installation of the Feathers SDK failed due to an unexpected error.";
4545

46+
private static const DEFAULT_PROGRESS_LABEL:String = "Installing...";
4647
private static const COPY_TASK_PROGRESS_LABEL:String = "Copying files...";
4748
private static const GET_TASK_PROGRESS_LABEL:String = "Downloading file...";
4849
private static const CHECKSUM_TASK_PROGRESS_LABEL:String = "Verifying checksum...";
@@ -201,12 +202,18 @@ package services
201202

202203
private function ant_progressHandler(event:ProgressEvent):void
203204
{
204-
var progressLabel:String = "Installing...";
205+
var progressLabel:String = DEFAULT_PROGRESS_LABEL;
205206
var progressValue:Number = Number.POSITIVE_INFINITY;
206207
var progressClass:Object = this._ant.progressClass;
207208
if(progressClass && event.bytesTotal !== 0)
208209
{
209210
progressValue = event.bytesLoaded / event.bytesTotal;
211+
if(progressValue === 1)
212+
{
213+
//we're done with this task, we don't want to display
214+
//progress anymore
215+
progressValue = Number.POSITIVE_INFINITY;
216+
}
210217
}
211218
if(progressValue < 1)
212219
{

source/view/InstallProgressScreen.mxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ limitations under the License.
4141
import utils.CustomStyleNames;
4242
4343
[Bindable]
44-
public var progressValue:Number = 0;
44+
public var progressValue:Number = Number.POSITIVE_INFINITY;
4545
4646
[Bindable]
4747
public var progressText:String;

source/view/mediators/InstallProgressScreenMediator.as

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ package view.mediators
4646
override public function onRegister():void
4747
{
4848
this.updateTitle();
49-
this.screen.progressValue = 0;
49+
this.screen.progressValue = Number.POSITIVE_INFINITY;
5050
this.screen.progressText = null;
5151
this.addContextListener(AcquireProductServiceEventType.START, context_acquireBinaryDistributionStartHandler);
5252
this.addContextListener(AcquireProductServiceEventType.PROGRESS, context_acquireBinaryDistributionProgressHandler);

0 commit comments

Comments
 (0)