安卓SetText不会更改Button的文本

I have custom view - custom keyboard. Each button is MaterialButton. I need to implement shift button to change letters case, so I've done it this way

private fun onCaseChanged() {
    buttons.forEach { button ->
        (button as? TextView)?.let {
            val text = it.text.toString()
            it.text = if (isUpperCase)
                text.toUpperCase(Locale.getDefault())
            else
                text.toLowerCase(Locale.getDefault())
        }
    }
}

All is working correct except UI - text on buttons doesn't change. When I change buttons to TextViews - all works fine. But not with any type of Button. So for now it seems like only way for me.

Bu I'm still curious - if there's another way to fix this problem with leaving MaterialButtons