Github user AlexTalis commented on a diff in the pull request:

    
https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27416895
  
    --- Diff: src/android/SplashScreen.java ---
    @@ -151,13 +193,40 @@ public Object onMessage(String id, Object data) {
             }
             return null;
         }
    +    
    +    @Override
    +    public void onConfigurationChanged(Configuration newConfig) {
    +        super.onConfigurationChanged(newConfig);
    +
    +        // Reload splash drawable when orientation changes if so 
configured.
    +        if (newConfig.orientation != orientation) {
    +            orientation = newConfig.orientation;
    +            reloadDrawable();
    +        }
    +    }
     
    -    private void removeSplashScreen() {
    +    private void reloadDrawable() {
    +        if (isReloadOnOrientationChange() && splashImageView != null) {
    +            final int drawableId = 
preferences.getInteger("SplashDrawableId", 0);
    +            if (drawableId != 0) {
    +                cordova.getActivity().runOnUiThread(new Runnable() {
    --- End diff --
    
    Originally (in 3.7.x) reload of the drawable was triggered from onMessage 
and I just followed the pattern I saw in the code of explicitly calling 
"runOnUiThread". You're probably right that onConfigurationChanged is always 
called on UI thread. I'll verify and remove the Runnable.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to