From 4d707322782f28c70c4782fcdb5d2aae2050139a Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 25 Nov 2026 15:31:16 +0100 Subject: [PATCH] Bump floret-kit, test the theme opt-out (#177) --- .../agendula/ui/ImeInsetsResyncTest.kt | 26 +++++++++++++++---- floret-kit | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt b/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt index 9f6a548..4d45cb6 100644 --- a/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt +++ b/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt @@ -18,6 +18,9 @@ import androidx.test.filters.SdkSuppress import com.google.common.truth.Truth.assertThat import de.jeanlucmakiola.agendula.ui.theme.AgendulaTheme import de.jeanlucmakiola.floret.components.FullScreenPicker +import de.jeanlucmakiola.agendula.ui.theme.AgendulaDarkFallback +import de.jeanlucmakiola.agendula.ui.theme.AgendulaLightFallback +import de.jeanlucmakiola.floret.identity.FloretExpressiveTheme import de.jeanlucmakiola.floret.identity.ImeInsetsResync import org.junit.Rule import org.junit.Test @@ -54,11 +57,24 @@ class ImeInsetsResyncTest { rule.waitUntil(TIMEOUT_MS) { imeBottom == 0 } } + @Test + fun themeWithoutResyncLeavesKeyboardInsetsAlone() { + setContent { + FloretExpressiveTheme(AgendulaLightFallback, AgendulaDarkFallback, resyncImeInsets = false) { ImeReader() } + } + runUserDrivenKeyboardAnimation() + assertStaysStale() + } + /** Shows the Compose behaviour [ImeInsetsResync] works around; drop it and this once this fails. */ @Test fun withoutResyncKeyboardInsetsStayStale() { setContent { ImeReader() } runUserDrivenKeyboardAnimation() + assertStaysStale() + } + + private fun assertStaysStale() { val settled = runCatching { rule.waitUntil(STALE_WINDOW_MS) { imeBottom != KEYBOARD_PX } }.isSuccess assertThat(settled).isFalse() } @@ -84,16 +100,16 @@ class ImeInsetsResyncTest { val ime = WindowInsets.Type.ime() val animation = WindowInsetsAnimation(ime, null, -1) val keyboard = Insets.of(0, 0, 0, KEYBOARD_PX) - val root = checkNotNull(root) + val decor = checkNotNull(root) rule.runOnUiThread { val midway = WindowInsets.Builder().setInsets(ime, keyboard).setVisible(ime, true).build() - root.dispatchWindowInsetsAnimationPrepare(animation) - root.dispatchWindowInsetsAnimationStart(animation, WindowInsetsAnimation.Bounds(Insets.NONE, keyboard)) - root.dispatchWindowInsetsAnimationProgress(midway, listOf(animation)) + decor.dispatchWindowInsetsAnimationPrepare(animation) + decor.dispatchWindowInsetsAnimationStart(animation, WindowInsetsAnimation.Bounds(Insets.NONE, keyboard)) + decor.dispatchWindowInsetsAnimationProgress(midway, listOf(animation)) } rule.waitForIdle() assertThat(imeBottom).isEqualTo(KEYBOARD_PX) - rule.runOnUiThread { root.dispatchWindowInsetsAnimationEnd(animation) } + rule.runOnUiThread { decor.dispatchWindowInsetsAnimationEnd(animation) } rule.waitForIdle() } diff --git a/floret-kit b/floret-kit index 48e2599..0c8f536 160000 --- a/floret-kit +++ b/floret-kit @@ -1 +1 @@ -Subproject commit 48e25995fca6982a8df307b7e1e730b1c1b9fe2f +Subproject commit 0c8f5367f5d4e2e611cc6d4e9761e4b41428dd02