Move objects to PlatformContext - #3217
Conversation
… Autofill and AutofillManager to PlatformContext. Remove PlatformScreenReader in favour of PlatformAutofillManager, it seems like a good place to put it and we avoid double allocation (in iOS) or allocation at all (in all other)
as it was in fact needed (fixes tests)
|
tests should not fail now (i made a similar error in another PR, |
…s and for future lazy init improvements
|
All changes are reconciled with 1.13 merging to jb-main (compatible with the minimalistCompositionLocals) |
…rs. Please note that it does not come with an implementation and using it at runtime will throw an exception (same behavior as before, nothing really changed)
| @Suppress("DEPRECATION") | ||
| val clipboardManager : ClipboardManager | ||
|
|
||
| @Suppress("DEPRECATION") | ||
| val autofillTree : AutofillTree | ||
| get() = AutofillTree() | ||
|
|
||
| @Suppress("DEPRECATION") | ||
| val autofill: androidx.compose.ui.autofill.Autofill? | ||
| get() = null |
There was a problem hiding this comment.
I'd avoid exposing deprecated types here, especially with @Suppress.
What's the reason for it?
There was a problem hiding this comment.
Some of these were creating objects in Rootnodeowner even though they are not used anymore and are deprecated. This way we centralize the creation of these once for all other nodes (since PlatformContext is reused) and avoid initializing eagerly and each time for each node. I would keep it as is without the deprecation suppression. This way, its usages have the deprecation notice and once it is gone, we can clean it all up easily.
There was a problem hiding this comment.
once it is gone
Deprecations from common/Google are there forever (or unless 2.x that is ~the same), so it's not a temporary shape. And since PlatformContext is "semi-public" I'd try to find a way how to avoid exposing it here
There was a problem hiding this comment.
it being an interface prevents easily hiding internally the values. I have been trying to add some other internals like shareddrawscope (since it is an internal class, and cant be exposed in PlatCtx) but it requires PlatformContext to have another shape. It is not trivial
Fixes https://youtrack.jetbrains.com/issue/CMP-10480/Move-Clipboard-ClipboardManager-AccessibilityManager-AutofillTree-Autofill-UriHandler-and-AutofillManager-to-PlatformContext
Release Notes
N/A