Simple Mercies 1.2: X length warning and Daily Notepad

This commit is contained in:
2026-10-19 15:54:10 +00:00
parent 064c0a21a1
commit 8e92ae84b4
@@ -22,6 +22,7 @@ class ShotsTest {
@get:Rule val rule = createAndroidComposeRule<MainActivity>() @get:Rule val rule = createAndroidComposeRule<MainActivity>()
private val out = File("build/shots").apply { mkdirs() } private val out = File("build/shots").apply { mkdirs() }
private fun shot(n: String) { rule.waitForIdle(); rule.mainClock.advanceTimeBy(1500); rule.waitForIdle(); rule.onRoot().captureRoboImage(File(out, "$n.png").path) } private fun shot(n: String) { rule.waitForIdle(); rule.mainClock.advanceTimeBy(1500); rule.waitForIdle(); rule.onRoot().captureRoboImage(File(out, "$n.png").path) }
private fun store() = rule.activity.state.store
private fun ui(b: AppState.() -> Unit) { rule.runOnUiThread { rule.activity.state.b() }; rule.waitForIdle() } private fun ui(b: AppState.() -> Unit) { rule.runOnUiThread { rule.activity.state.b() }; rule.waitForIdle() }
@Test fun all() { @Test fun all() {
@@ -66,6 +67,32 @@ class ShotsTest {
shot("10_sage_prayers") shot("10_sage_prayers")
ui { prefs.look = 0 } ui { prefs.look = 0 }
// ---- 1.2: X warning, notepad, heart
val longPrayer = store().prayers(false).first { it.forWho == "Mom" }
ui { tab = 2; sendText(prayerMessage(longPrayer.copy(text = longPrayer.text + " " + longPrayer.text + " Hold her close, and hold us close too.")), "A prayer for you", Card("A prayer for Mom", longPrayer.text, "Simple Mercies")) }
shot("11_x_warning")
ui { xWarn = null; tab = 3; prefs.padKind = 0
store.addPad(0, "Remember to call the county about the culvert at Mill Road.", LocalDate.now().minusDays(1))
store.addPad(0, "Psalm 46:10 kept coming back to me all morning.")
}
shot("12_pad_thoughts")
ui { prefs.padKind = 1
store.addPad(1, "Pick up the prescription"); store.addPad(1, "Mow before the rain"); store.addPad(1, "Call Mom after the surgery") }
shot("13_pad_todo")
// tick one: run the heart and capture it partway through
rule.mainClock.autoAdvance = false
ui { val t = store.pads(1).first { it.text.startsWith("Mow") }; store.setPadDone(t.id, true); heart = HeartBurst(androidx.compose.ui.geometry.Offset(150f, 900f), prefs.active.accent, 1L) }
for ((n, ms) in listOf("14_heart_a" to 300L, "14_heart_b" to 500L, "14_heart_c" to 600L, "14_heart_d" to 400L, "14_heart_e" to 400L)) {
rule.mainClock.advanceTimeBy(ms); rule.onRoot().captureRoboImage(File(out, "$n.png").path)
}
rule.mainClock.advanceTimeBy(1500); rule.mainClock.autoAdvance = true
shot("15_after_heart")
ui { prefs.padKind = 2; store.addPad(2, "I was back at the grocery store, but every aisle was a cornfield and the carts were horses.") }
shot("16_pad_dreams")
ui { open(Over.Settings) }
shot("17_settings")
ui { back() }
val ctx = rule.activity val ctx = rule.activity
Shape.entries.forEachIndexed { i, s -> Shape.entries.forEachIndexed { i, s ->
val b = ShareKit.render(ctx, Card("A prayer for Mom", "Lord, give her strength for the surgery on Thursday, steady hands for the doctors, and peace for all of us waiting.", "Simple Mercies"), Looks.all[i], s) val b = ShareKit.render(ctx, Card("A prayer for Mom", "Lord, give her strength for the surgery on Thursday, steady hands for the doctors, and peace for all of us waiting.", "Simple Mercies"), Looks.all[i], s)