Skip to content

Replace Android-only WindowInsets.isImeVisible with expect/actual for iOS compatibility#6795

Open
michaelabon wants to merge 1 commit intostreetcomplete:masterfrom
michaelabon:fix/address-input-ios-compat
Open

Replace Android-only WindowInsets.isImeVisible with expect/actual for iOS compatibility#6795
michaelabon wants to merge 1 commit intostreetcomplete:masterfrom
michaelabon:fix/address-input-ios-compat

Conversation

@michaelabon
Copy link
Copy Markdown

AnAddressNumberInput.kt in commonMain uses WindowInsets.isImeVisible, which is a Jetpack Compose Android-only API not available in Compose Multiplatform 1.10.0 for iOS targets.

This introduces a small isImeVisible() expect/actual function in ui/util/:

  • commonMain: expect declaration
  • androidMain: delegates to WindowInsets.isImeVisible (preserving existing behaviour)
  • iosMain: returns false for now (proper keyboard visibility detection can be wired up later)

Follows the existing expect/actual conventions in the codebase (e.g. util/locale/, util/platform/).

Part of the iOS port effort (#5421).

… iOS compatibility

AnAddressNumberInput.kt used `WindowInsets.isImeVisible`, which is a
Jetpack Compose Android-only API unavailable in Compose Multiplatform
for iOS targets.

Introduce an `isImeVisible()` expect/actual function in ui/util/:
- commonMain: expect declaration
- androidMain: delegates to WindowInsets.isImeVisible
- iosMain: returns false (keyboard detection can be added later)

Part of the iOS port effort (streetcomplete#5421).
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.

1 participant