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
Post a Comment