Skip to content

Adds initializer for Rive for use at app startup#91

Merged
mjohnsullivan merged 4 commits intomasterfrom
initialization_provider
Apr 28, 2021
Merged

Adds initializer for Rive for use at app startup#91
mjohnsullivan merged 4 commits intomasterfrom
initialization_provider

Conversation

@mjohnsullivan
Copy link
Copy Markdown
Contributor

@mjohnsullivan mjohnsullivan commented Apr 27, 2021

Creates an Initializer for Rive that can used to initialize the runtime at startup either through declaring an InitializationProvider in the manifest, or calling AppInitializer directly in the code:

<provider
     android:name="androidx.startup.InitializationProvider"
     android:authorities="${applicationId}.androidx-startup"
     android:exported="false"
     tools:node="merge">
     <meta-data android:name="app.rive.runtime.kotlin.RiveInitializer"
         android:value="androidx.startup" />
 </provider>
AppInitializer.getInstance(applicationContext)
  .initializeComponent(RiveInitializer::class.java)

This follow Android's current guidance for initializing components at startup: https://developer.android.com/topic/libraries/app-startup

@mjohnsullivan mjohnsullivan requested a review from mjtalbot April 27, 2021 21:08
@mjohnsullivan
Copy link
Copy Markdown
Contributor Author

Documented in RiveInitializer.kt

Copy link
Copy Markdown
Contributor

@mjtalbot mjtalbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as before, you mentioned you may have another idea here. so i will leave this sitting fttb. lgtm though

@mjohnsullivan
Copy link
Copy Markdown
Contributor Author

Moved initializer to module and appears to be working; ready for merging.

@mjohnsullivan mjohnsullivan merged commit 38a8fc9 into master Apr 28, 2021
@mjohnsullivan mjohnsullivan deleted the initialization_provider branch April 28, 2021 18:13
mjtalbot pushed a commit that referenced this pull request Jun 26, 2022
Adds initializer for Rive for use at app startup
mjtalbot pushed a commit that referenced this pull request Jun 26, 2022
Adds initializer for Rive for use at app startup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants