[go: nahoru, domu]

Skip to content
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

Fix: IllegalStateException: AppCompatDialog#addContentView(AbstractComposeView(...), ...) #686

Closed
wants to merge 5 commits into from

Conversation

bytebeats
Copy link
Contributor
@bytebeats bytebeats commented Jun 26, 2024

Issues Fixed

Fixes: 349502140
Relnote: "Fixed an IllegalStateException when attempting to use ComposeView in an AppCompatDialog when using addContentView"

Description

In the AppCompatDialog, initViewTreeOwners() is called inside all of setContentView but no addContentView. While in ComponentDialog, initializeViewTreeOwners() is called inside all of setContentView and addContentView, so AppCompatDialog has no complete solution for the IllegalStateException.

@bytebeats
Copy link
Contributor Author

Hi @ianhanniballake what's the lint result mean? It's something wrong about the description above? Could you help me fix that?

@ianhanniballake
Copy link
Member

Hi @ianhanniballake what's the lint result mean? It's something wrong about the description above? Could you help me fix that?

The 'Fixes' line should just mention the ID of the issue, so you probably want to edit your description to be something like:

Fixes: 349502140
Relnote: "Fixed an `IllegalStateException` when attempting to use `ComposeView` in an `AppCompatDialog` when using `addContentView`"

As the Relnote is the line we use to describe the change to developers, while the 'Fixes' line is read by the tooling to associate the issue and PR together.

@bytebeats
Copy link
Contributor Author

Hi @ianhanniballake what's the lint result mean? It's something wrong about the description above? Could you help me fix that?

The 'Fixes' line should just mention the ID of the issue, so you probably want to edit your description to be something like:

Fixes: 349502140
Relnote: "Fixed an `IllegalStateException` when attempting to use `ComposeView` in an `AppCompatDialog` when using `addContentView`"

As the Relnote is the line we use to describe the change to developers, while the 'Fixes' line is read by the tooling to associate the issue and PR together.

@ianhanniballake Am I allowed to rerun the androidx lint workflow? I saw no entrance for me to do that?

@ianhanniballake
Copy link
Member

Only Googlers can re-run tasks, so that part is expected, but it seems like changes to the description don't get reflected in re-runs unless there's a code change - can you add another commit here (say, changing ViewGroup.LayoutParams.MATCH_PARENT to ViewGroup.LayoutParams.WRAP_CONTENT in the test) just to trigger the new description being filled in? Then I can try re-running it again.

@copybara-service copybara-service bot closed this in 7de3eab Jul 1, 2024
@ianhanniballake
Copy link
Member

We were able to fix it on the AndroidX side (the errors were Github specific), so the fix has been merged now 🎉

tribalfs pushed a commit to tribalfs/sesl-androidx that referenced this pull request Sep 2, 2024
…actComposeView(...), ...)

## Issues Fixed

Fixes: [AppCompatDialog] The bug on [IssueTracker - 349502140](https://issuetracker.google.com/issues/349502140) being fixed

## Description

In the `AppCompatDialog`, `initViewTreeOwners()` is called inside all of `setContentView` but no `addContentView`. While in `ComponentDialog`, `initializeViewTreeOwners()` is called inside all of `setContentView` and `addContentView`, so `AppCompatDialog` has no complete solution for the `IllegalStateException`.

This is an imported pull request from androidx#686.

Resolves androidx#686
Github-Pr-Head-Sha: 960e5ec
GitOrigin-RevId: db858ec
Change-Id: I4aae2e2a07a56f29e6aa13fd7f9178f4c60bdf34

Signed-off-by: tribalfs <tribalfs@gmail.com>
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