toggleExpandState

fun View.toggleExpandState(duration: Long = 500): Boolean(source)

Return

true in case of expanding