You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO(jwilson): this is a backwards-compatibility shim. Emit a simpler event.
override val savedStateRegistry: SavedStateRegistry? = null
override fun contentState(loadCount: Int, attached: Boolean, uncaughtException: Throwable?) {
// Remove all child views in case the previous content state left some behind.
if (attached) children.views.clear()
// Canonicalize "java.lang.Exception(boom!)" to "kotlin.Exception(boom!)".
val exceptionString = uncaughtException?.toString()?.replace("java.lang.", "kotlin.")
// TODO(jwilson): this is a backwards-compatibility shim. Emit a simpler event.
eventLog += when {
loadCount == 0 && !attached -> "codeListener.onInitialCodeLoading()"
attached -> "codeListener.onCodeLoaded($loadCount)"
else -> "codeListener.onCodeDetached($exceptionString)"
}
}
override fun restart(restart: (() -> Unit)?) {
}
override fun toString() = name
internal class FakeChildren(
private val childrenDelegate: MutableListChildren<WidgetValue> = MutableListChildren(),
) : Widget.Children<WidgetValue> by childrenDelegate {
/** A private copy of the child views that isn't cleared by `detach()`. */
val views = mutableListOf<WidgetValue>()
override fun insert(index: Int, widget: Widget<WidgetValue>) {
views.add(index, widget.value)
childrenDelegate.insert(index, widget)
}
override fun remove(index: Int, count: Int) {
views.subList(index, index + count).clear()
childrenDelegate.remove(index, count)
}
}
}
The text was updated successfully, but these errors were encountered:
redwood/redwood-treehouse-host/src/commonTest/kotlin/app/cash/redwood/treehouse/FakeTreehouseView.kt
Line 85 in 12420a5
The text was updated successfully, but these errors were encountered: