cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [2/2] android commit: CB-8079 Use activity class package name, but fallback to application package name when looking for splash screen drawable
Date Thu, 11 Dec 2014 02:19:40 GMT
CB-8079 Use activity class package name, but fallback to application
package name when looking for splash screen drawable

Close #136


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/56a3ee5f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/56a3ee5f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/56a3ee5f

Branch: refs/heads/master
Commit: 56a3ee5fe66c4eb0ac67b2f258d4f1f9a0536ff8
Parents: d80d532
Author: Daniel Toplak <d.toplak@cadenas.de>
Authored: Wed Nov 26 08:31:45 2014 +0100
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Wed Dec 10 21:19:28 2014 -0500

----------------------------------------------------------------------
 framework/src/org/apache/cordova/CordovaPreferences.java   | 3 +++
 framework/src/org/apache/cordova/SplashScreenInternal.java | 3 +++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/56a3ee5f/framework/src/org/apache/cordova/CordovaPreferences.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaPreferences.java b/framework/src/org/apache/cordova/CordovaPreferences.java
index 536f25a..ed0b9b8 100644
--- a/framework/src/org/apache/cordova/CordovaPreferences.java
+++ b/framework/src/org/apache/cordova/CordovaPreferences.java
@@ -133,6 +133,9 @@ public class CordovaPreferences {
             } else if (name.equals("splashscreen")) {
                 // Note: We should probably pass in the classname for the variable splash
on splashscreen!
                 int resource = action.getResources().getIdentifier(value, "drawable", action.getClass().getPackage().getName());
+                if(resource == 0) {
+                    resource = action.getResources().getIdentifier(value, "drawable", action.getPackageName());
+                }
                 action.getIntent().putExtra(name, resource);
             }
             else if(name.equals("backgroundcolor")) {

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/56a3ee5f/framework/src/org/apache/cordova/SplashScreenInternal.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/SplashScreenInternal.java b/framework/src/org/apache/cordova/SplashScreenInternal.java
index 605fce7..715e418 100644
--- a/framework/src/org/apache/cordova/SplashScreenInternal.java
+++ b/framework/src/org/apache/cordova/SplashScreenInternal.java
@@ -54,6 +54,9 @@ public class SplashScreenInternal extends CordovaPlugin {
             String splashResource = preferences.getString("SplashScreen", null);
             if (splashResource != null) {
                 drawableId = cordova.getActivity().getResources().getIdentifier(splashResource,
"drawable", cordova.getActivity().getClass().getPackage().getName());
+                if (drawableId == 0) {
+                    drawableId = cordova.getActivity().getResources().getIdentifier(splashResource,
"drawable", cordova.getActivity().getPackageName());
+                }
                 preferences.set("SplashDrawableId", drawableId);
             }
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message