You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add setResourceReaderAndroidContext to configure Android context for resource reading (#5434)
Fixes https://youtrack.jetbrains.com/issue/CMP-6676
## Release Notes
### Features - Resources
- Add `setResourceReaderAndroidContext` to configure Android context in
cases when a provider initialization is not available.
Copy file name to clipboardExpand all lines: components/resources/library/src/androidMain/kotlin/org/jetbrains/compose/resources/AndroidContextProvider.kt
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,19 @@ fun PreviewContextConfigurationEffect() {
38
38
}
39
39
}
40
40
41
+
/**
42
+
* Sets the android context to be used for resource read functions in cases
43
+
* when `org.jetbrains.compose.components.resources.resources.AndroidContextProvider` cannot be initialized.
44
+
*
45
+
* Be careful when using this function! The context will be retained for the whole application lifetime.
46
+
*
47
+
* See https://youtrack.jetbrains.com/issue/CMP-6676 for more details.
0 commit comments