mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
CB-8079 Use activity class package name, but fallback to application
package name when looking for splash screen drawable Close #136
This commit is contained in:
parent
d80d532a2a
commit
56a3ee5fe6
@ -133,6 +133,9 @@ public class CordovaPreferences {
|
|||||||
} else if (name.equals("splashscreen")) {
|
} else if (name.equals("splashscreen")) {
|
||||||
// Note: We should probably pass in the classname for the variable splash on 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());
|
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);
|
action.getIntent().putExtra(name, resource);
|
||||||
}
|
}
|
||||||
else if(name.equals("backgroundcolor")) {
|
else if(name.equals("backgroundcolor")) {
|
||||||
|
@ -54,6 +54,9 @@ public class SplashScreenInternal extends CordovaPlugin {
|
|||||||
String splashResource = preferences.getString("SplashScreen", null);
|
String splashResource = preferences.getString("SplashScreen", null);
|
||||||
if (splashResource != null) {
|
if (splashResource != null) {
|
||||||
drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getClass().getPackage().getName());
|
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);
|
preferences.set("SplashDrawableId", drawableId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user