-
Notifications
You must be signed in to change notification settings - Fork 112
Closed
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededmodalsuiRelated to UI integrationRelated to UI integration
Milestone
Description
When rendering two different AlertScreens in back-to-back render passes, the button contents do not seem to be updated by the AlertContainer properly.
| First Rendering | Second Rendering |
|---|---|
AlertScreen(message = "Starting Checkout...", onEvent = {}) |
AlertScreen(message = "Waiting for checkout...", buttons = mapOf(NEGATIVE to "Cancel"), onEvent = { ... }) |
![]() |
![]() |
At first I was able to work around this locally by using some reflection to manually force the buttons to be re-bound to the UI again:
val buttonPanel = dialog.findViewById<ViewGroup>(androidx.appcompat.R.id.buttonPanel)
dialog.javaClass.getDeclaredField("mAlert")
.let { mAlert ->
mAlert.isAccessible = true
mAlert[dialog].javaClass.getDeclaredMethod("setupButtons", ViewGroup::class.java)
.let { setupButtons ->
setupButtons.isAccessible = true
setupButtons(mAlert[dialog], buttonPanel)
}
}
Eventually I just decided to implement my own AlertContainer-like container to subvert this entirely.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededmodalsuiRelated to UI integrationRelated to UI integration

