-
Notifications
You must be signed in to change notification settings - Fork 605
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
[Insets] Setup migration for accompanist/insets #1034
Conversation
fe591f4
to
4ef088e
Compare
...src/main/java/com/google/accompanist/sample/swiperefresh/SwipeRefreshContentPaddingSample.kt
Show resolved
Hide resolved
@@ -28,6 +30,7 @@ import androidx.compose.runtime.setValue | |||
* offsets which describe changes to the four edges of a rectangle. | |||
*/ | |||
@Stable | |||
@Deprecated("accompanist/insets is deprecated") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better in cases without a replaceWith to mention something like "it has been superseded by ..." so the user at least knows where to go and look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I updated the deprecated descriptions to briefly explain the equivalents of methods and classes that don't have exact equivalents, and also linked to the migration doc.
@@ -14,6 +14,8 @@ | |||
* limitations under the License. | |||
*/ | |||
|
|||
@file:Suppress("DEPRECATION") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please leave a comment on the sample uses of this with something like "to be replaced in a later PR to test the migration"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't planning to publish those in-place to the repo, although I have a branch with those changes here working off of the migrations:
https://github.com/google/accompanist/tree/av/deprecated-insets-replace-samples
...src/main/java/com/google/accompanist/sample/swiperefresh/SwipeRefreshContentPaddingSample.kt
Show resolved
Hide resolved
9ab97c7
to
4424a71
Compare
@bentrengrove and @simona-anomis this is ready for another look! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM! Just the one comment, wondering if we should write the docs first before merging this and pointing people to docs that don't exist.
""" | ||
accompanist/insets is deprecated. | ||
The androidx.compose equivalent of LocalWindowInsets is the extensions on WindowInsets. | ||
For more migration information, please visit https://google.github.io/accompanist/insets/#migration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to publish those docs first before merging this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure what the doc publishing process is, will those go out immediately after publishing?
If so, the updated docs/insets.md
in this PR should make this link real after the merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry! I completely missed that you had changed it because GitHub had collapsed it
Thanks @bentrengrove and @simona-anomis ! |
An initial PR beginning the process of deprecating accompanist/insets in favor of built-in
androidx.compose.foundation
support.Most of the accompanist/insets APIs have been deprecated, with
ReplaceWith
s where possible. There are cases whereReplaceWith
doesn't exactly match the new behavior and where complete auto-migration isn't possible (parameters became specific types), so this was a best-effort to help along the way.The insets doc has been updated with a migration guide, along with a more complete table of migrations and an explanation of behavior differences.
There are some things that are not yet supported in
androidx
:androidx.compose.foundation
insets, and I am tracking upstreaming those if possible.TODO: