From 61324a0072f91fa2fa174bb142fe2e79b1a56461 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 25 Nov 2026 12:09:15 +0100 Subject: [PATCH 1/9] Resync keyboard insets after a back-gesture dismissal (#177) --- CHANGELOG.md | 5 ++ .../agendula/ui/ImeInsetsResyncTest.kt | 79 +++++++++++++++++++ .../jeanlucmakiola/agendula/MainActivity.kt | 2 + floret-kit | 2 +- 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index ca31fa1..8e0ee08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,11 @@ All notable changes to this project are documented here. The format follows all-day reminder time. With a tasks app as the store, both ends gain or drop their time together (#101). +### Fixed +- Closing the keyboard with the back gesture no longer leaves the task lists + squeezed into the top half of the screen, as if the keyboard were still open, + until it was opened again (#177). + ## [1.3.2] - 2026-11-13 ### Added diff --git a/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt b/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt new file mode 100644 index 0000000..02d0382 --- /dev/null +++ b/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt @@ -0,0 +1,79 @@ +package de.jeanlucmakiola.agendula.ui + +import android.graphics.Insets +import android.view.View +import android.view.WindowInsets +import android.view.WindowInsetsAnimation +import androidx.compose.foundation.layout.WindowInsets as ComposeInsets +import androidx.compose.foundation.layout.ime +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.LocalView +import androidx.compose.ui.test.junit4.v2.createComposeRule +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.filters.SdkSuppress +import com.google.common.truth.Truth.assertThat +import de.jeanlucmakiola.floret.components.ImeInsetsResync +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith + +/** + * A keyboard hidden by a predictive back gesture runs an insets animation without a + * duration; Compose then keeps the last keyboard height it saw (#177). + */ +@RunWith(AndroidJUnit4::class) +@SdkSuppress(minSdkVersion = 30) +class ImeInsetsResyncTest { + + @get:Rule + val rule = createComposeRule() + + private var imeBottom = -1 + private lateinit var view: View + + @Test + fun keyboardInsetsSettleAfterUserDrivenAnimation() { + setContent(resync = true) + runUserDrivenKeyboardAnimation() + rule.waitUntil(TIMEOUT_MS) { imeBottom == 0 } + assertThat(imeBottom).isEqualTo(0) + } + + /** Shows the Compose behaviour [ImeInsetsResync] works around; drop both once this fails. */ + @Test + fun withoutResyncKeyboardInsetsStayStale() { + setContent(resync = false) + runUserDrivenKeyboardAnimation() + rule.waitForIdle() + assertThat(imeBottom).isEqualTo(KEYBOARD_PX) + } + + private fun setContent(resync: Boolean) { + rule.setContent { + if (resync) ImeInsetsResync() + view = LocalView.current + imeBottom = ComposeInsets.ime.getBottom(LocalDensity.current) + } + rule.waitForIdle() + } + + private fun runUserDrivenKeyboardAnimation() { + rule.runOnUiThread { + val root = view.rootView + val ime = WindowInsets.Type.ime() + val animation = WindowInsetsAnimation(ime, null, -1) + val keyboard = Insets.of(0, 0, 0, KEYBOARD_PX) + 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)) + root.dispatchWindowInsetsAnimationEnd(animation) + } + rule.waitForIdle() + } + + private companion object { + const val KEYBOARD_PX = 500 + const val TIMEOUT_MS = 2_000L + } +} diff --git a/app/src/main/java/de/jeanlucmakiola/agendula/MainActivity.kt b/app/src/main/java/de/jeanlucmakiola/agendula/MainActivity.kt index cc3aff0..c636d91 100644 --- a/app/src/main/java/de/jeanlucmakiola/agendula/MainActivity.kt +++ b/app/src/main/java/de/jeanlucmakiola/agendula/MainActivity.kt @@ -36,6 +36,7 @@ import de.jeanlucmakiola.agendula.ui.navigation.NavRequest import de.jeanlucmakiola.agendula.ui.settings.SettingsViewModel import de.jeanlucmakiola.agendula.ui.theme.AgendulaTheme import de.jeanlucmakiola.agendula.ui.theme.SystemTheme +import de.jeanlucmakiola.floret.components.ImeInsetsResync import de.jeanlucmakiola.floret.crash.CrashReportDialog import de.jeanlucmakiola.floret.crash.CrashReporter import de.jeanlucmakiola.floret.crash.submitCrashReport @@ -99,6 +100,7 @@ class MainActivity : ComponentActivity() { launchHooks.forEach { hook -> lifecycleScope.launch { runCatching { hook.onLaunch(intent) } } } } setContent { + ImeInsetsResync() val settingsViewModel: SettingsViewModel = hiltViewModel() val ui by settingsViewModel.state.collectAsStateWithLifecycle() val darkTheme = ui.settings.themeMode.isDark(isSystemInDarkTheme()) diff --git a/floret-kit b/floret-kit index 31281bb..2d40749 160000 --- a/floret-kit +++ b/floret-kit @@ -1 +1 @@ -Subproject commit 31281bb2245776f7f793e26fc8086c4233c77615 +Subproject commit 2d407495dbb908a4c415d16f401c5d0b37d86821 From d8b64fb3e1d662692bfc17faf86fa3bfd4e5a122 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 25 Nov 2026 12:16:27 +0100 Subject: [PATCH 2/9] Bump floret-kit, tighten the insets test (#177) --- .../java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt | 2 +- floret-kit | 2 +- 2 files changed, 2 insertions(+), 2 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 02d0382..e0a95c6 100644 --- a/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt +++ b/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt @@ -28,6 +28,7 @@ class ImeInsetsResyncTest { @get:Rule val rule = createComposeRule() + @Volatile private var imeBottom = -1 private lateinit var view: View @@ -36,7 +37,6 @@ class ImeInsetsResyncTest { setContent(resync = true) runUserDrivenKeyboardAnimation() rule.waitUntil(TIMEOUT_MS) { imeBottom == 0 } - assertThat(imeBottom).isEqualTo(0) } /** Shows the Compose behaviour [ImeInsetsResync] works around; drop both once this fails. */ diff --git a/floret-kit b/floret-kit index 2d40749..b6ca2d3 160000 --- a/floret-kit +++ b/floret-kit @@ -1 +1 @@ -Subproject commit 2d407495dbb908a4c415d16f401c5d0b37d86821 +Subproject commit b6ca2d3e6e66378825fd228eab8811ac8c2c39a7 From acf482246b614bbdea995caa27b9cbe38f2cae21 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 25 Nov 2026 12:25:08 +0100 Subject: [PATCH 3/9] Bump floret-kit, check the fake keyboard lands in the test (#177) --- .../jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt | 10 ++++++---- floret-kit | 2 +- 2 files changed, 7 insertions(+), 5 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 e0a95c6..45c75bd 100644 --- a/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt +++ b/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt @@ -58,18 +58,20 @@ class ImeInsetsResyncTest { } private fun runUserDrivenKeyboardAnimation() { + val ime = WindowInsets.Type.ime() + val animation = WindowInsetsAnimation(ime, null, -1) + val keyboard = Insets.of(0, 0, 0, KEYBOARD_PX) rule.runOnUiThread { val root = view.rootView - val ime = WindowInsets.Type.ime() - val animation = WindowInsetsAnimation(ime, null, -1) - val keyboard = Insets.of(0, 0, 0, KEYBOARD_PX) 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)) - root.dispatchWindowInsetsAnimationEnd(animation) } rule.waitForIdle() + assertThat(imeBottom).isEqualTo(KEYBOARD_PX) + rule.runOnUiThread { view.rootView.dispatchWindowInsetsAnimationEnd(animation) } + rule.waitForIdle() } private companion object { diff --git a/floret-kit b/floret-kit index b6ca2d3..2e0fbea 160000 --- a/floret-kit +++ b/floret-kit @@ -1 +1 @@ -Subproject commit b6ca2d3e6e66378825fd228eab8811ac8c2c39a7 +Subproject commit 2e0fbeae267f32d966a05aed40f4fb061c9f83b9 From 9f11adf63b60d64e0c4ea9ea8c7ce997137bb507 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 25 Nov 2026 12:33:02 +0100 Subject: [PATCH 4/9] Bump floret-kit, run the insets test edge-to-edge (#177) --- .../de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt | 9 ++++++--- floret-kit | 2 +- 2 files changed, 7 insertions(+), 4 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 45c75bd..2583b00 100644 --- a/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt +++ b/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt @@ -4,11 +4,13 @@ import android.graphics.Insets import android.view.View import android.view.WindowInsets import android.view.WindowInsetsAnimation +import androidx.activity.ComponentActivity +import androidx.activity.enableEdgeToEdge import androidx.compose.foundation.layout.WindowInsets as ComposeInsets import androidx.compose.foundation.layout.ime import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalView -import androidx.compose.ui.test.junit4.v2.createComposeRule +import androidx.compose.ui.test.junit4.v2.createAndroidComposeRule import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SdkSuppress import com.google.common.truth.Truth.assertThat @@ -22,11 +24,11 @@ import org.junit.runner.RunWith * duration; Compose then keeps the last keyboard height it saw (#177). */ @RunWith(AndroidJUnit4::class) -@SdkSuppress(minSdkVersion = 30) +@SdkSuppress(minSdkVersion = 35) class ImeInsetsResyncTest { @get:Rule - val rule = createComposeRule() + val rule = createAndroidComposeRule() @Volatile private var imeBottom = -1 @@ -49,6 +51,7 @@ class ImeInsetsResyncTest { } private fun setContent(resync: Boolean) { + rule.runOnUiThread { rule.activity.enableEdgeToEdge() } rule.setContent { if (resync) ImeInsetsResync() view = LocalView.current diff --git a/floret-kit b/floret-kit index 2e0fbea..b4cda7f 160000 --- a/floret-kit +++ b/floret-kit @@ -1 +1 @@ -Subproject commit 2e0fbeae267f32d966a05aed40f4fb061c9f83b9 +Subproject commit b4cda7f441290f6a8a38f20f7f173059e9973055 From 86b09708f27ab94ff8f8c2d1d892f899b6163fa2 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 25 Nov 2026 12:40:28 +0100 Subject: [PATCH 5/9] Bump floret-kit, harden the insets canary test (#177) --- CHANGELOG.md | 3 ++- .../agendula/ui/ImeInsetsResyncTest.kt | 12 ++++-------- floret-kit | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e0ee08..237e200 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,7 +62,8 @@ All notable changes to this project are documented here. The format follows ### Fixed - Closing the keyboard with the back gesture no longer leaves the task lists squeezed into the top half of the screen, as if the keyboard were still open, - until it was opened again (#177). + until it was opened again. The editor, task details and pickers kept the same + keyboard-sized gap at the bottom (#177). ## [1.3.2] - 2026-11-13 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 2583b00..1e9f3aa 100644 --- a/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt +++ b/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt @@ -1,7 +1,6 @@ package de.jeanlucmakiola.agendula.ui import android.graphics.Insets -import android.view.View import android.view.WindowInsets import android.view.WindowInsetsAnimation import androidx.activity.ComponentActivity @@ -9,7 +8,6 @@ import androidx.activity.enableEdgeToEdge import androidx.compose.foundation.layout.WindowInsets as ComposeInsets import androidx.compose.foundation.layout.ime import androidx.compose.ui.platform.LocalDensity -import androidx.compose.ui.platform.LocalView import androidx.compose.ui.test.junit4.v2.createAndroidComposeRule import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SdkSuppress @@ -32,7 +30,6 @@ class ImeInsetsResyncTest { @Volatile private var imeBottom = -1 - private lateinit var view: View @Test fun keyboardInsetsSettleAfterUserDrivenAnimation() { @@ -46,15 +43,14 @@ class ImeInsetsResyncTest { fun withoutResyncKeyboardInsetsStayStale() { setContent(resync = false) runUserDrivenKeyboardAnimation() - rule.waitForIdle() - assertThat(imeBottom).isEqualTo(KEYBOARD_PX) + val settled = runCatching { rule.waitUntil(TIMEOUT_MS) { imeBottom != KEYBOARD_PX } }.isSuccess + assertThat(settled).isFalse() } private fun setContent(resync: Boolean) { rule.runOnUiThread { rule.activity.enableEdgeToEdge() } rule.setContent { if (resync) ImeInsetsResync() - view = LocalView.current imeBottom = ComposeInsets.ime.getBottom(LocalDensity.current) } rule.waitForIdle() @@ -65,7 +61,7 @@ class ImeInsetsResyncTest { val animation = WindowInsetsAnimation(ime, null, -1) val keyboard = Insets.of(0, 0, 0, KEYBOARD_PX) rule.runOnUiThread { - val root = view.rootView + val root = rule.activity.window.decorView val midway = WindowInsets.Builder().setInsets(ime, keyboard).setVisible(ime, true).build() root.dispatchWindowInsetsAnimationPrepare(animation) root.dispatchWindowInsetsAnimationStart(animation, WindowInsetsAnimation.Bounds(Insets.NONE, keyboard)) @@ -73,7 +69,7 @@ class ImeInsetsResyncTest { } rule.waitForIdle() assertThat(imeBottom).isEqualTo(KEYBOARD_PX) - rule.runOnUiThread { view.rootView.dispatchWindowInsetsAnimationEnd(animation) } + rule.runOnUiThread { rule.activity.window.decorView.dispatchWindowInsetsAnimationEnd(animation) } rule.waitForIdle() } diff --git a/floret-kit b/floret-kit index b4cda7f..1b41628 160000 --- a/floret-kit +++ b/floret-kit @@ -1 +1 @@ -Subproject commit b4cda7f441290f6a8a38f20f7f173059e9973055 +Subproject commit 1b41628a4d7e73e42a68a3c8aabdc82ffff7507a From 4044d0c37fce260f17408831e315aef138890934 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 25 Nov 2026 15:07:10 +0100 Subject: [PATCH 6/9] Let the floret theme install the insets resync (#177) --- .../agendula/ui/ImeInsetsResyncTest.kt | 47 ++++++++++++++----- .../jeanlucmakiola/agendula/MainActivity.kt | 2 - floret-kit | 2 +- 3 files changed, 35 insertions(+), 16 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 1e9f3aa..e71d681 100644 --- a/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt +++ b/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt @@ -1,18 +1,24 @@ package de.jeanlucmakiola.agendula.ui import android.graphics.Insets +import android.view.View import android.view.WindowInsets import android.view.WindowInsetsAnimation import androidx.activity.ComponentActivity import androidx.activity.enableEdgeToEdge import androidx.compose.foundation.layout.WindowInsets as ComposeInsets import androidx.compose.foundation.layout.ime +import androidx.compose.runtime.Composable +import androidx.compose.runtime.SideEffect import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.LocalView import androidx.compose.ui.test.junit4.v2.createAndroidComposeRule import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SdkSuppress import com.google.common.truth.Truth.assertThat -import de.jeanlucmakiola.floret.components.ImeInsetsResync +import de.jeanlucmakiola.agendula.ui.theme.AgendulaTheme +import de.jeanlucmakiola.floret.components.FullScreenPicker +import de.jeanlucmakiola.floret.identity.ImeInsetsResync import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith @@ -31,37 +37,52 @@ class ImeInsetsResyncTest { @Volatile private var imeBottom = -1 + @Volatile + private var root: View? = null + @Test - fun keyboardInsetsSettleAfterUserDrivenAnimation() { - setContent(resync = true) + fun themeSettlesKeyboardInsetsAfterUserDrivenAnimation() { + setContent { AgendulaTheme { ImeReader() } } runUserDrivenKeyboardAnimation() rule.waitUntil(TIMEOUT_MS) { imeBottom == 0 } } - /** Shows the Compose behaviour [ImeInsetsResync] works around; drop both once this fails. */ + @Test + fun pickerSettlesKeyboardInsetsAfterUserDrivenAnimation() { + setContent { FullScreenPicker(title = "", onDismiss = {}) { ImeReader() } } + runUserDrivenKeyboardAnimation() + rule.waitUntil(TIMEOUT_MS) { imeBottom == 0 } + } + + /** Shows the Compose behaviour [ImeInsetsResync] works around; drop it and this once this fails. */ @Test fun withoutResyncKeyboardInsetsStayStale() { - setContent(resync = false) + setContent { ImeReader() } runUserDrivenKeyboardAnimation() val settled = runCatching { rule.waitUntil(TIMEOUT_MS) { imeBottom != KEYBOARD_PX } }.isSuccess assertThat(settled).isFalse() } - private fun setContent(resync: Boolean) { + private fun setContent(content: @Composable () -> Unit) { rule.runOnUiThread { rule.activity.enableEdgeToEdge() } - rule.setContent { - if (resync) ImeInsetsResync() - imeBottom = ComposeInsets.ime.getBottom(LocalDensity.current) - } - rule.waitForIdle() + rule.setContent(content) + rule.waitUntil(TIMEOUT_MS) { root != null } + } + + /** Reports the keyboard insets, and the window it sits in, as Compose sees them. */ + @Composable + private fun ImeReader() { + val view = LocalView.current + imeBottom = ComposeInsets.ime.getBottom(LocalDensity.current) + SideEffect { root = view.rootView } } private fun runUserDrivenKeyboardAnimation() { val ime = WindowInsets.Type.ime() val animation = WindowInsetsAnimation(ime, null, -1) val keyboard = Insets.of(0, 0, 0, KEYBOARD_PX) + val root = checkNotNull(root) rule.runOnUiThread { - val root = rule.activity.window.decorView val midway = WindowInsets.Builder().setInsets(ime, keyboard).setVisible(ime, true).build() root.dispatchWindowInsetsAnimationPrepare(animation) root.dispatchWindowInsetsAnimationStart(animation, WindowInsetsAnimation.Bounds(Insets.NONE, keyboard)) @@ -69,7 +90,7 @@ class ImeInsetsResyncTest { } rule.waitForIdle() assertThat(imeBottom).isEqualTo(KEYBOARD_PX) - rule.runOnUiThread { rule.activity.window.decorView.dispatchWindowInsetsAnimationEnd(animation) } + rule.runOnUiThread { root.dispatchWindowInsetsAnimationEnd(animation) } rule.waitForIdle() } diff --git a/app/src/main/java/de/jeanlucmakiola/agendula/MainActivity.kt b/app/src/main/java/de/jeanlucmakiola/agendula/MainActivity.kt index c636d91..cc3aff0 100644 --- a/app/src/main/java/de/jeanlucmakiola/agendula/MainActivity.kt +++ b/app/src/main/java/de/jeanlucmakiola/agendula/MainActivity.kt @@ -36,7 +36,6 @@ import de.jeanlucmakiola.agendula.ui.navigation.NavRequest import de.jeanlucmakiola.agendula.ui.settings.SettingsViewModel import de.jeanlucmakiola.agendula.ui.theme.AgendulaTheme import de.jeanlucmakiola.agendula.ui.theme.SystemTheme -import de.jeanlucmakiola.floret.components.ImeInsetsResync import de.jeanlucmakiola.floret.crash.CrashReportDialog import de.jeanlucmakiola.floret.crash.CrashReporter import de.jeanlucmakiola.floret.crash.submitCrashReport @@ -100,7 +99,6 @@ class MainActivity : ComponentActivity() { launchHooks.forEach { hook -> lifecycleScope.launch { runCatching { hook.onLaunch(intent) } } } } setContent { - ImeInsetsResync() val settingsViewModel: SettingsViewModel = hiltViewModel() val ui by settingsViewModel.state.collectAsStateWithLifecycle() val darkTheme = ui.settings.themeMode.isDark(isSystemInDarkTheme()) diff --git a/floret-kit b/floret-kit index 1b41628..695907a 160000 --- a/floret-kit +++ b/floret-kit @@ -1 +1 @@ -Subproject commit 1b41628a4d7e73e42a68a3c8aabdc82ffff7507a +Subproject commit 695907aa82b0517800a02460c7b5c3b539646cab From 624eb4bfed1dbb5e73567b250918821506c6f630 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 25 Nov 2026 15:20:17 +0100 Subject: [PATCH 7/9] Bump floret-kit, steadier insets test (#177) --- .../agendula/ui/ImeInsetsResyncTest.kt | 12 ++++++++---- floret-kit | 2 +- 2 files changed, 9 insertions(+), 5 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 e71d681..9f6a548 100644 --- a/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt +++ b/app/src/androidTest/java/de/jeanlucmakiola/agendula/ui/ImeInsetsResyncTest.kt @@ -59,7 +59,7 @@ class ImeInsetsResyncTest { fun withoutResyncKeyboardInsetsStayStale() { setContent { ImeReader() } runUserDrivenKeyboardAnimation() - val settled = runCatching { rule.waitUntil(TIMEOUT_MS) { imeBottom != KEYBOARD_PX } }.isSuccess + val settled = runCatching { rule.waitUntil(STALE_WINDOW_MS) { imeBottom != KEYBOARD_PX } }.isSuccess assertThat(settled).isFalse() } @@ -73,8 +73,11 @@ class ImeInsetsResyncTest { @Composable private fun ImeReader() { val view = LocalView.current - imeBottom = ComposeInsets.ime.getBottom(LocalDensity.current) - SideEffect { root = view.rootView } + val bottom = ComposeInsets.ime.getBottom(LocalDensity.current) + SideEffect { + imeBottom = bottom + root = view.rootView + } } private fun runUserDrivenKeyboardAnimation() { @@ -96,6 +99,7 @@ class ImeInsetsResyncTest { private companion object { const val KEYBOARD_PX = 500 - const val TIMEOUT_MS = 2_000L + const val TIMEOUT_MS = 10_000L + const val STALE_WINDOW_MS = 2_000L } } diff --git a/floret-kit b/floret-kit index 695907a..1cde6f6 160000 --- a/floret-kit +++ b/floret-kit @@ -1 +1 @@ -Subproject commit 695907aa82b0517800a02460c7b5c3b539646cab +Subproject commit 1cde6f6b938973147e0cfa52996b9b7427daf3ee From 1938991a6b7b597928f99176507489cb20e148d6 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 25 Nov 2026 15:20:23 +0100 Subject: [PATCH 8/9] Bump floret-kit (#177) --- floret-kit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/floret-kit b/floret-kit index 1cde6f6..48e2599 160000 --- a/floret-kit +++ b/floret-kit @@ -1 +1 @@ -Subproject commit 1cde6f6b938973147e0cfa52996b9b7427daf3ee +Subproject commit 48e25995fca6982a8df307b7e1e730b1c1b9fe2f From 4d707322782f28c70c4782fcdb5d2aae2050139a Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 25 Nov 2026 15:31:16 +0100 Subject: [PATCH 9/9] 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