[ https://issues.apache.org/jira/browse/CB-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabrizio Bottino updated CB-1263: --------------------------------- Attachment: splashscreenType.patch See attached patch. class affected: {{DroidGap}} new parameters: {{splashscreenType}} {{splashscreenResize}} example new code: {{super.setIntegerProperty("backgroundColor", Color.WHITE);}} {{super.setIntegerProperty("splashscreenType", DroidGap.SPLASHSCREEN_CENTERED);}} {{super.setDoubleProperty("splashscreenResize", 0.9);}} {{super.setIntegerProperty("splashscreen", R.drawable.splash);}} {{super.loadUrl("file:///android_asset/www/index.html", 15000);}} How it works: it takes splashscreen defined in usual {{splashscreen}} property and checks for {{splashscreenType}}. Default is {{SPLASHSCREEN_FULLSCREEN}} which takes classic behaviour (this means: patch is backward compatible) If {{splashscreenType}} equals {{SPLASHSCREEN_CENTERED}} then it adds a new ImageView on top of splashDialog and resizes it to fit it by {{splashscreenResize}} %. Background color is untouched from previous code, so you have to set property {{backgroundColor}} to have a background different from black. On device rotation during splashscreen it recalculates resize % with new width and height to always achieve same proportion on screen. > Android SplashScreen: landscape + portrait > ------------------------------------------ > > Key: CB-1263 > URL: https://issues.apache.org/jira/browse/CB-1263 > Project: Apache Cordova > Issue Type: Improvement > Components: Android > Affects Versions: 2.0.0 > Reporter: Fabrizio Bottino > Assignee: Simon MacDonald > Priority: Minor > Labels: splashscreen > Attachments: splash_l.png, splash_p.png, splashscreenType.patch > > > When you start your application helding your device in landscape mode the > splash screen image appears stretched. > Would be nice to be able to set two images to be used as splash screen for > portrait and landscape mode. Example: > {{super.setIntegerProperty("splashscreen-landscape", R.drawable.splash_l);}} > {{super.setIntegerProperty("splashscreen-portrait", R.drawable.splash_p);}} > {{super.loadUrl("file:///android_asset/www/index.html", 5000);}} > Just like you can do in iOS Xcode. > BTW: got screenshot instruction from > [http://simonmacdonald.blogspot.it/2012/04/phonegap-android-splashscreen-just-got.html] > but I couldn't find same information on official phonegap/cordova > documentation. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira