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

[Android] Fix dialog being offset for non edge-to-edge windows #206

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

chrisbanes
Copy link
Owner

Currently our window offset logic assumes that the host content is drawn at [0,0], which usually happens when content is drawn edge-to-edge. There are still apps which don't use that, or tools which don't (i.e. deploy previews), so we need to handle those cases too. The issue why we don't is that we currently use the host ComposeView's screen location, but that isn't quite correct in these situations, we need to use the window's decor view.

Fixes #200

Currently our window offset logic assumes that the host content is drawn
at [0,0], which usually happens when content is drawn edge-to-edge.
There are still apps which don't use that, or tools which don't
(i.e. deploy previews), so we need to handle those cases too. The issue
why we don't is that we currently use the host ComposeView's screen location,
but that isn't quite correct in these situations, we need to use the window's
decor view.
@chrisbanes chrisbanes enabled auto-merge (squash) April 29, 2024 17:31
@chrisbanes chrisbanes merged commit 96163ae into main Apr 29, 2024
2 checks passed
@chrisbanes chrisbanes deleted the cb/double-set-windowoffset branch April 29, 2024 17:37
ZacSweers pushed a commit to ZacSweers/CatchUp that referenced this pull request May 2, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [dev.chrisbanes.haze:haze](https://togithub.com/chrisbanes/haze) |
`0.7.0` -> `0.7.1` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/dev.chrisbanes.haze:haze/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/dev.chrisbanes.haze:haze/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/dev.chrisbanes.haze:haze/0.7.0/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/dev.chrisbanes.haze:haze/0.7.0/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>chrisbanes/haze (dev.chrisbanes.haze:haze)</summary>

### [`v0.7.1`](https://togithub.com/chrisbanes/haze/releases/tag/0.7.1)

[Compare
Source](https://togithub.com/chrisbanes/haze/compare/0.7.0...0.7.1)

##### What's Changed

- Update dependency androidx.compose.ui:ui-test-manifest to v1.6.5 by
[@&#8203;renovate](https://togithub.com/renovate) in
[chrisbanes/haze#185
- Update agp to v8.3.2 by
[@&#8203;renovate](https://togithub.com/renovate) in
[chrisbanes/haze#184
- Update plugin com.gradle.enterprise to v3.17.1 by
[@&#8203;renovate](https://togithub.com/renovate) in
[chrisbanes/haze#187
- Update dependency org.robolectric:robolectric to v4.12.1 by
[@&#8203;renovate](https://togithub.com/renovate) in
[chrisbanes/haze#186
- Update roborazzi to v1.12.0 by
[@&#8203;renovate](https://togithub.com/renovate) in
[chrisbanes/haze#188
- Update dependency androidx.activity:activity-compose to v1.9.0 by
[@&#8203;renovate](https://togithub.com/renovate) in
[chrisbanes/haze#192
- Update roborazzi to v1.13.0 by
[@&#8203;renovate](https://togithub.com/renovate) in
[chrisbanes/haze#194
- Update dependency macos to v14 by
[@&#8203;renovate](https://togithub.com/renovate) in
[chrisbanes/haze#195
- Add scroll behavior to Scaffold sample by
[@&#8203;chrisbanes](https://togithub.com/chrisbanes) in
[chrisbanes/haze#197
- Update dependency androidx.compose.ui:ui-test-manifest to v1.6.6 by
[@&#8203;renovate](https://togithub.com/renovate) in
[chrisbanes/haze#191
- Update androidx.benchmark to v1.2.4 by
[@&#8203;renovate](https://togithub.com/renovate) in
[chrisbanes/haze#190
- Update plugin com.gradle.enterprise to v3.17.2 by
[@&#8203;renovate](https://togithub.com/renovate) in
[chrisbanes/haze#189
- Update dependency androidx.core:core-ktx to v1.13.0 by
[@&#8203;renovate](https://togithub.com/renovate) in
[chrisbanes/haze#193
- Remove usage of LFS by
[@&#8203;chrisbanes](https://togithub.com/chrisbanes) in
[chrisbanes/haze#198
- Kotlin 1.9.23 + CMP 1.6.2 by
[@&#8203;chrisbanes](https://togithub.com/chrisbanes) in
[chrisbanes/haze#199
- Don't include test sources in API files by
[@&#8203;chrisbanes](https://togithub.com/chrisbanes) in
[chrisbanes/haze#204
- Fix glitch with clipping content out by
[@&#8203;chrisbanes](https://togithub.com/chrisbanes) in
[chrisbanes/haze#205
- Reset state when LazyLayout reuses node by
[@&#8203;chrisbanes](https://togithub.com/chrisbanes) in
[chrisbanes/haze#203
- \[Android] Fix dialog being offset for non edge-to-edge windows by
[@&#8203;chrisbanes](https://togithub.com/chrisbanes) in
[chrisbanes/haze#206
- Fix content clip path at edges by
[@&#8203;chrisbanes](https://togithub.com/chrisbanes) in
[chrisbanes/haze#207

**Full Changelog**:
chrisbanes/haze@0.7.0...0.7.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ZacSweers/CatchUp).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMzEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjMzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.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.

Dialog blur offset
1 participant