From 647844eb4910be56d7fcafc0eca095ccc1ab4ab9 Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Fri, 27 Aug 2010 16:22:57 -0400 Subject: [PATCH] bug 591153 - Show progress dialog on start up for android r=mwu a=blocking-fennec --- embedding/android/GeckoApp.java | 8 +++++++- embedding/android/GeckoSurfaceView.java | 10 +++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/embedding/android/GeckoApp.java b/embedding/android/GeckoApp.java index 01a6ef1bf39..5c6c4b2d0c3 100644 --- a/embedding/android/GeckoApp.java +++ b/embedding/android/GeckoApp.java @@ -1,4 +1,5 @@ -/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-/ * ***** BEGIN LICENSE BLOCK ***** +/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- + * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -59,6 +60,7 @@ abstract public class GeckoApp public static FrameLayout mainLayout; public static GeckoSurfaceView surfaceView; public static GeckoApp mAppContext; + ProgressDialog mProgressDialog; void launch() { @@ -102,6 +104,10 @@ abstract public class GeckoApp ViewGroup.LayoutParams.FILL_PARENT)); if (!GeckoAppShell.sGeckoRunning) { + + mProgressDialog = + ProgressDialog.show(GeckoApp.this, "", getAppName() + + " is loading", true); // Load our JNI libs; we need to do this before launch() because // setInitialSize will be called even before Gecko is actually up // and running. diff --git a/embedding/android/GeckoSurfaceView.java b/embedding/android/GeckoSurfaceView.java index 3f7e5e9977b..25f2042d015 100644 --- a/embedding/android/GeckoSurfaceView.java +++ b/embedding/android/GeckoSurfaceView.java @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 20; indent-tabs-mode: nil; -*- +/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -135,12 +135,12 @@ class GeckoSurfaceView mSurfaceLock.unlock(); } } - + public void surfaceCreated(SurfaceHolder holder) { if (GeckoAppShell.sGeckoRunning) mSurfaceNeedsRedraw = true; } - + public void surfaceDestroyed(SurfaceHolder holder) { Log.i("GeckoAppJava", "surface destroyed"); mSurfaceValid = false; @@ -211,6 +211,10 @@ class GeckoSurfaceView } public void draw2D(ByteBuffer buffer) { + if (GeckoApp.mAppContext.mProgressDialog != null) { + GeckoApp.mAppContext.mProgressDialog.dismiss(); + GeckoApp.mAppContext.mProgressDialog = null; + } Canvas c = getHolder().lockCanvas(); if (c == null) return;