Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4B95617CEE for ; Fri, 22 Jan 2016 10:27:42 +0000 (UTC) Received: (qmail 30967 invoked by uid 500); 22 Jan 2016 10:27:42 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 30945 invoked by uid 500); 22 Jan 2016 10:27:42 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 30936 invoked by uid 99); 22 Jan 2016 10:27:41 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jan 2016 10:27:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B02DAE0098; Fri, 22 Jan 2016 10:27:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: daserge@apache.org To: commits@cordova.apache.org Message-Id: <36f4b02f13574db8a54e91245e745fd9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cordova-plugin-splashscreen git commit: CB-9094: Smarter autohide logic on Android Date: Fri, 22 Jan 2016 10:27:41 +0000 (UTC) Repository: cordova-plugin-splashscreen Updated Branches: refs/heads/master 7a12204ba -> 5b3c2c8b1 CB-9094: Smarter autohide logic on Android When the plugin is initialized, the splash screen is shown with an auto-hide delay. If a subsequent call to show() comes in while the splashscreen is visible, it will still be automatically hidden, even though the user expectation is that it wouldn't be. This fix tracks the "hideAfterDelay" setting of the most recent call to show() -- and when the auto hide timer goes off, if the most recent call to show() did not set hideAfterDelay, then the splashscreen will not be automatically hidden. This provides a more consistent -- and expected -- behavior based on user action. https://issues.apache.org/jira/browse/CB-9094 Github: close #49 Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/commit/5b3c2c8b Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/tree/5b3c2c8b Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/diff/5b3c2c8b Branch: refs/heads/master Commit: 5b3c2c8b1423eb1f17adf1c89da50edfc46c2406 Parents: 7a12204 Author: Dan Polivy Authored: Thu May 28 16:20:21 2015 -0700 Committer: daserge Committed: Fri Jan 22 13:22:37 2016 +0300 ---------------------------------------------------------------------- src/android/SplashScreen.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/5b3c2c8b/src/android/SplashScreen.java ---------------------------------------------------------------------- diff --git a/src/android/SplashScreen.java b/src/android/SplashScreen.java index 7e27d49..833ebc2 100644 --- a/src/android/SplashScreen.java +++ b/src/android/SplashScreen.java @@ -51,6 +51,7 @@ public class SplashScreen extends CordovaPlugin { private static Dialog splashDialog; private static ProgressDialog spinnerDialog; private static boolean firstShow = true; + private static boolean lastHideAfterDelay; // https://issues.apache.org/jira/browse/CB-9094 /** * Displays the splash drawable. @@ -112,7 +113,7 @@ public class SplashScreen extends CordovaPlugin { } private int getFadeDuration () { - int fadeSplashScreenDuration = preferences.getBoolean("FadeSplashScreen", true) == true ? + int fadeSplashScreenDuration = preferences.getBoolean("FadeSplashScreen", true) ? preferences.getInteger("FadeSplashScreenDuration", DEFAULT_SPLASHSCREEN_DURATION) : 0; if (fadeSplashScreenDuration < 30) { @@ -265,6 +266,8 @@ public class SplashScreen extends CordovaPlugin { final int fadeSplashScreenDuration = getFadeDuration(); final int effectiveSplashDuration = splashscreenTime - fadeSplashScreenDuration; + lastHideAfterDelay = hideAfterDelay; + // If the splash dialog is showing don't try to show it again if (splashDialog != null && splashDialog.isShowing()) { return; @@ -317,7 +320,9 @@ public class SplashScreen extends CordovaPlugin { final Handler handler = new Handler(); handler.postDelayed(new Runnable() { public void run() { - removeSplashScreen(); + if (lastHideAfterDelay) { + removeSplashScreen(); + } } }, effectiveSplashDuration); } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org