cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AlexTalis <...@git.apache.org>
Subject [GitHub] cordova-plugin-splashscreen pull request: CB-8753 Maintain splash ...
Date Mon, 30 Mar 2015 19:28:27 GMT
Github user AlexTalis commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27423375
  
    --- 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) {
    --- End diff --
    
    ImageView.setImageDrawable documentation does not say anything about how smart it is about
reloading and repainting the drawable, so I assumed the worst and added an explicit preference.
I originally tried using ImageView.setImageResource, but that does nothing if resource ID
did not change. To fix that I used ImageView.setImageDrawable and it reloaded the drawable,
but I can only assume that it reloads it every time.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message