android - How can I redraw an Anko frameLayout when my model changes? -


i have anko component create view code this:

override fun createview(ui: ankocontext<t>) = with(ui) {     framelayout {         var imgview = imageview(r.drawable.ic_1).lparams {             horizontalmargin = ...             topmargin = ...             width = ...             height = ...         }         imgview.backgroundcolor = gamemodel.colour     } } 

the background of imgview depends on colour in model.

let's imagine update model elsewhere. how 'refresh' anko component ui reflect new gamemodel.colour? i've never done android before seems 1 use either invalidate() or requestlayout() don't seem work.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -