diff --git a/embedding/android/GeckoApp.java b/embedding/android/GeckoApp.java index 02765866361b..bfa9bf6fb5da 100644 --- a/embedding/android/GeckoApp.java +++ b/embedding/android/GeckoApp.java @@ -294,9 +294,13 @@ abstract public class GeckoApp if (mLibLoadThread != null) mLibLoadThread.join(); } catch (InterruptedException ie) {} - surfaceView.mSplashStatusMsg = - getResources().getString(R.string.splash_screen_loading); + + // Show the URL we are about to load, if the intent has one + if (Intent.ACTION_VIEW.equals(i.getAction())) { + surfaceView.mSplashURL = i.getDataString(); + } surfaceView.drawSplashScreen(); + // unpack files in the components directory try { unpackComponents(); @@ -413,11 +417,7 @@ abstract public class GeckoApp Configuration config = res.getConfiguration(); config.locale = locale; res.updateConfiguration(config, res.getDisplayMetrics()); - - }}); - surfaceView.mSplashStatusMsg = - getResources().getString(R.string.splash_screen_loading); mLibLoadThread.start(); } @@ -596,10 +596,6 @@ abstract public class GeckoApp componentsDir.mkdir(); componentsDir.setLastModified(applicationPackage.lastModified()); - surfaceView.mSplashStatusMsg = - getResources().getString(R.string.splash_firstrun); - surfaceView.drawSplashScreen(); - GeckoAppShell.killAnyZombies(); ZipFile zip = new ZipFile(applicationPackage); diff --git a/embedding/android/GeckoSurfaceView.java b/embedding/android/GeckoSurfaceView.java index 7eaecf1a4b6d..43ee71633be6 100644 --- a/embedding/android/GeckoSurfaceView.java +++ b/embedding/android/GeckoSurfaceView.java @@ -107,26 +107,79 @@ class GeckoSurfaceView } void drawSplashScreen(SurfaceHolder holder, int width, int height) { + // No splash screen for Honeycomb or greater + if (Build.VERSION.SDK_INT >= 11) { + Log.i(LOG_FILE_NAME, "skipping splash screen"); + return; + } + Canvas c = holder.lockCanvas(); if (c == null) { Log.i(LOG_FILE_NAME, "canvas is null"); return; } + Resources res = getResources(); - c.drawColor(res.getColor(R.color.splash_background)); - Drawable drawable = res.getDrawable(R.drawable.splash); - int w = drawable.getIntrinsicWidth(); - int h = drawable.getIntrinsicHeight(); - int x = (width - w)/2; - int y = (height - h)/2 - 16; - drawable.setBounds(x, y, x + w, y + h); - drawable.draw(c); - Paint p = new Paint(); - p.setTextAlign(Paint.Align.CENTER); - p.setTextSize(32f); - p.setAntiAlias(true); - p.setColor(res.getColor(R.color.splash_font)); - c.drawText(GeckoSurfaceView.mSplashStatusMsg, width/2, y + h + 16, p); + + File profiles = new File(GeckoApp.sGREDir, "files/mozilla/profiles.ini"); + if (profiles.exists() == false) { + // Just show the simple splash screen for "new profile" startup + c.drawColor(res.getColor(R.color.splash_background)); + Drawable drawable = res.getDrawable(R.drawable.splash); + int w = drawable.getIntrinsicWidth(); + int h = drawable.getIntrinsicHeight(); + int x = (width - w) / 2; + int y = (height - h) / 2 - 16; + drawable.setBounds(x, y, x + w, y + h); + drawable.draw(c); + + Paint p = new Paint(); + p.setTextAlign(Paint.Align.CENTER); + p.setTextSize(32f); + p.setAntiAlias(true); + p.setColor(res.getColor(R.color.splash_msgfont)); + c.drawText(res.getString(R.string.splash_firstrun), width / 2, y + h + 16, p); + } else { + // Show the static UI for normal startup + DisplayMetrics metrics = new DisplayMetrics(); + GeckoApp.mAppContext.getWindowManager().getDefaultDisplay().getMetrics(metrics); + + // Default to DENSITY_HIGH sizes + int toolbarHeight = 80; + int faviconOffset = 25; + float urlHeight = 24f; + int urlOffsetX = 80; + int urlOffsetY = 48; + if (metrics.densityDpi == DisplayMetrics.DENSITY_MEDIUM) { + toolbarHeight = 53; + faviconOffset = 10; + urlHeight = 16f; + urlOffsetX = 53; + urlOffsetY = 32; + } + + c.drawColor(res.getColor(R.color.splash_content)); + Drawable toolbar = res.getDrawable(Build.VERSION.SDK_INT > 8 ? + R.drawable.splash_v9 : + R.drawable.splash_v8); + toolbar.setBounds(0, 0, width, toolbarHeight); + toolbar.draw(c); + + // XUL/CSS always uses 32px width and height for favicon + Drawable favicon = res.getDrawable(R.drawable.favicon32); + favicon.setBounds(faviconOffset, faviconOffset, 32 + faviconOffset, 32 + faviconOffset); + favicon.draw(c); + + if (GeckoSurfaceView.mSplashURL != "") { + TextPaint p = new TextPaint(); + p.setTextAlign(Paint.Align.LEFT); + p.setTextSize(urlHeight); + p.setAntiAlias(true); + p.setColor(res.getColor(R.color.splash_urlfont)); + String url = TextUtils.ellipsize(GeckoSurfaceView.mSplashURL, p, width - urlOffsetX * 2, TextUtils.TruncateAt.END).toString(); + c.drawText(url, urlOffsetX, urlOffsetY, p); + } + } holder.unlockCanvasAndPost(c); } @@ -734,7 +787,7 @@ class GeckoSurfaceView int mDrawMode; static boolean mShowingSplashScreen = true; - static String mSplashStatusMsg = ""; + static String mSplashURL = ""; // let's not change stuff around while we're in the middle of // starting drawing, ending drawing, or changing surface diff --git a/embedding/android/locales/en-US/android_strings.dtd b/embedding/android/locales/en-US/android_strings.dtd index 19e20d9d450e..854f67d826a0 100644 --- a/embedding/android/locales/en-US/android_strings.dtd +++ b/embedding/android/locales/en-US/android_strings.dtd @@ -1,5 +1,4 @@ - diff --git a/embedding/android/resources/values/colors.xml b/embedding/android/resources/values/colors.xml index d50e243c64bf..27ad205941f9 100644 --- a/embedding/android/resources/values/colors.xml +++ b/embedding/android/resources/values/colors.xml @@ -1,6 +1,8 @@ #000000 - #ffffff + #ffffff + #000000 + #ffffff diff --git a/embedding/android/strings.xml.in b/embedding/android/strings.xml.in index 3c0e2b309e0e..58c4ee507386 100644 --- a/embedding/android/strings.xml.in +++ b/embedding/android/strings.xml.in @@ -5,7 +5,6 @@ #includesubst @STRINGSPATH@ ]> - &splash_screen_loading; &splash_firstrun; &no_space_to_start_error; &error_loading_file; diff --git a/mobile/branding/aurora/android-resources.mn b/mobile/branding/aurora/android-resources.mn index 0d9e481b12fc..0eb7e5d77e26 100644 --- a/mobile/branding/aurora/android-resources.mn +++ b/mobile/branding/aurora/android-resources.mn @@ -1,3 +1,6 @@ mobile/app/android/drawable/alertaddons.png mobile/app/android/drawable/alertdownloads.png mobile/branding/aurora/content/splash.png +mobile/branding/aurora/content/splash_v9.9.png +mobile/branding/aurora/content/splash_v8.9.png +mobile/branding/aurora/content/favicon32.png diff --git a/mobile/branding/aurora/content/splash_v8.9.png b/mobile/branding/aurora/content/splash_v8.9.png new file mode 100644 index 000000000000..418337f7de31 Binary files /dev/null and b/mobile/branding/aurora/content/splash_v8.9.png differ diff --git a/mobile/branding/aurora/content/splash_v9.9.png b/mobile/branding/aurora/content/splash_v9.9.png new file mode 100644 index 000000000000..f75084e6c655 Binary files /dev/null and b/mobile/branding/aurora/content/splash_v9.9.png differ diff --git a/mobile/branding/beta/android-resources.mn b/mobile/branding/beta/android-resources.mn index c66c3dd9dd50..d735648d6226 100644 --- a/mobile/branding/beta/android-resources.mn +++ b/mobile/branding/beta/android-resources.mn @@ -1,3 +1,6 @@ mobile/app/android/drawable/alertaddons.png mobile/app/android/drawable/alertdownloads.png mobile/branding/beta/content/splash.png +mobile/branding/beta/content/splash_v9.9.png +mobile/branding/beta/content/splash_v8.9.png +mobile/branding/beta/content/favicon32.png diff --git a/mobile/branding/beta/content/splash_v8.9.png b/mobile/branding/beta/content/splash_v8.9.png new file mode 100644 index 000000000000..418337f7de31 Binary files /dev/null and b/mobile/branding/beta/content/splash_v8.9.png differ diff --git a/mobile/branding/beta/content/splash_v9.9.png b/mobile/branding/beta/content/splash_v9.9.png new file mode 100644 index 000000000000..f75084e6c655 Binary files /dev/null and b/mobile/branding/beta/content/splash_v9.9.png differ diff --git a/mobile/branding/nightly/android-resources.mn b/mobile/branding/nightly/android-resources.mn index e97d67c9ace1..738e36c8402e 100644 --- a/mobile/branding/nightly/android-resources.mn +++ b/mobile/branding/nightly/android-resources.mn @@ -1,3 +1,6 @@ mobile/app/android/drawable/alertaddons.png mobile/app/android/drawable/alertdownloads.png mobile/branding/nightly/content/splash.png +mobile/branding/nightly/content/splash_v9.9.png +mobile/branding/nightly/content/splash_v8.9.png +mobile/branding/nightly/content/favicon32.png diff --git a/mobile/branding/nightly/content/splash_v8.9.png b/mobile/branding/nightly/content/splash_v8.9.png new file mode 100644 index 000000000000..418337f7de31 Binary files /dev/null and b/mobile/branding/nightly/content/splash_v8.9.png differ diff --git a/mobile/branding/nightly/content/splash_v9.9.png b/mobile/branding/nightly/content/splash_v9.9.png new file mode 100644 index 000000000000..f75084e6c655 Binary files /dev/null and b/mobile/branding/nightly/content/splash_v9.9.png differ diff --git a/mobile/branding/official/android-resources.mn b/mobile/branding/official/android-resources.mn index e5e89fb2d2d0..88c43acd9e83 100644 --- a/mobile/branding/official/android-resources.mn +++ b/mobile/branding/official/android-resources.mn @@ -1,3 +1,6 @@ mobile/app/android/drawable/alertaddons.png mobile/app/android/drawable/alertdownloads.png mobile/branding/official/content/splash.png +mobile/branding/official/content/splash_v9.9.png +mobile/branding/official/content/splash_v8.9.png +mobile/branding/official/content/favicon32.png diff --git a/mobile/branding/official/content/splash_v8.9.png b/mobile/branding/official/content/splash_v8.9.png new file mode 100644 index 000000000000..418337f7de31 Binary files /dev/null and b/mobile/branding/official/content/splash_v8.9.png differ diff --git a/mobile/branding/official/content/splash_v9.9.png b/mobile/branding/official/content/splash_v9.9.png new file mode 100644 index 000000000000..f75084e6c655 Binary files /dev/null and b/mobile/branding/official/content/splash_v9.9.png differ diff --git a/mobile/branding/unofficial/android-resources.mn b/mobile/branding/unofficial/android-resources.mn index 265b0fb2cdb6..c676f5332001 100644 --- a/mobile/branding/unofficial/android-resources.mn +++ b/mobile/branding/unofficial/android-resources.mn @@ -1,3 +1,6 @@ mobile/app/android/drawable/alertaddons.png mobile/app/android/drawable/alertdownloads.png mobile/branding/unofficial/content/splash.png +mobile/branding/unofficial/content/splash_v9.9.png +mobile/branding/unofficial/content/splash_v8.9.png +mobile/branding/unofficial/content/favicon32.png diff --git a/mobile/branding/unofficial/content/splash_v8.9.png b/mobile/branding/unofficial/content/splash_v8.9.png new file mode 100644 index 000000000000..418337f7de31 Binary files /dev/null and b/mobile/branding/unofficial/content/splash_v8.9.png differ diff --git a/mobile/branding/unofficial/content/splash_v9.9.png b/mobile/branding/unofficial/content/splash_v9.9.png new file mode 100644 index 000000000000..f75084e6c655 Binary files /dev/null and b/mobile/branding/unofficial/content/splash_v9.9.png differ