You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/07/28 15:15:45 UTC

[GitHub] [cordova-android] breautek commented on issue #1468: No splashscreen for home/launcher app + unable to reshow splashscreen

breautek commented on issue #1468:
URL: https://github.com/apache/cordova-android/issues/1468#issuecomment-1198295897

   > splashscreen is always displayed at startup
   
   This is enforced by Android starting with Android 12, and mimicked by the android compatibility layer for older android versions. Cordova cannot disable splashscreens.
   
   > Also the inability to reshow the splashscreen is a real regression IMO. I understand the limitation of the new SplashScreen API, but maybe it would have been better to design the new cordova splaschreen system as a complement to the legacy system, with opt-in capability for the legacy system, instead of fully replacing the legacy system with loss of functionality.
   
   The general stance the community took was it was better to support the Android splashscreen API, as it essentially enforced. That splashscreen API is definitely far more restrictive (I agree, personally I don't like it either). Reshowing the splashscreen is part of those limitations, as you noted. I don't think it's possible to reshow it because I don't think Cordova has access to that view programmatically. I think we would essentially need to rebuild the view and have it match, which I think would be rather error-prone. Do correct me if I'm wrong.
   
   > with opt-in capability for the legacy system, instead of fully replacing the legacy system with loss of functionality.
   
   The legacy system as already explained above is incompatible with the Android's splashscreen API. The best this can reach us is having 2 splashscreens (one from native android which **will** be unavoidable, and the one from the old cordova splashscreen plugin) where you can only control the splashscreen plugin's splashscreen. An example of this could be seen if you ran a cordova-android@10 app on an Android 12 device/emulator.
   
   The splashscreen plugin has been updated to not install on cordova-android@11, because they both clobbers the same namespaces and cause conflicts. Some preferences are reused, but outside of that, if similar behaviour is wanted, I suppose a workaround is to fork the splashscreen plugin, and change the namespaces / JS clobber points so that you have access to both cordova-android@11 splashscreen APIs as well as the legacy splashscreen APIs. But I don't see this being a supported feature at an Apache level.
   
   Personally in my apps, I dealt with this issue by recreating the splashscreen in the webview. Native splashscreen is sitll used for app launch, but may proceed to the webview-based splashscreen for remaining lifecycle of the app. If you're reloading the app as in `window.reload()`, then this probably won't work for you however. And this would also require a SPA-style appication.
   
   Regarding splashscreen drawing issues, there is are bugs in the android emulator surrounding drawing the splashscreen. It's noted in our [documentation](https://cordova.apache.org/docs/en/11.x/core/features/splashscreen/index.html#android).
   
   As a somewhat related side note... one of Android's largest problems is the fact that not a lot of experiences are standardised and different features work very differently across different devices which has put quite a burden to android developers in the past. It seems like Google / Android team has started putting a focus on providing a standard means of doing things in the apps. This is a personal observation of Android 12 introducing a standardised Splashscreen, and Android 13 is going to be including a standardised [Photo Picker](https://developer.android.com/about/versions/13/features#photo-picker). As Android rolls out these changes, it's going to be inevitable that their APIs won't be 100% compatible existing solutions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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