-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Separate android initialization from Activity #11891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Very cool! |
Whilst on the topic of the java library, Android Studio picked up a few errors:
|
All relevant test environments are passing now. Failures match base branch. |
Ready for review! |
Merged, thanks! |
This reverts commit d14c93c. This is a major breaking change for activities that inherit SDLActivity
This ended up being a major breaking change for activities that inherit from SDLActivity, so we don't want this to go in so close to 3.2.0 release. Here's a sample of the kinds of things that broke:
|
Would you accept a second PR that addresses the backwards compatibility more? Providing more overridable methods in SDLActivity to configure the component? |
Sure. |
Separates initialization and JNI hooks from
SDLActivity
, into a separate classSDLActivityComponent
.SDLActivity
uses this to apply the functionality onto the activity.Description
Currently, all SDL initialization on Android is done within an
Activity
. Whilst this is good for simplicity, it doesn't allow a lot of flexibility for Android apps; some apps' activities may already inherit something else, making it extremely impractical to get SDL to work.Removing all functionality from the activity into a separate class,
SDLActivityComponent
, allows developers to compose the SDL glue code into their existing activity.SDLActivity
remains, as a simple semi-backwards-compatible way that also demonstrates how to use the newSDLActivityComponent
.Existing Issue(s)
#11890