Anko: Anko Preview Does not Refresh layout immediately

Created on 13 May 2017  路  3Comments  路  Source: Kotlin/anko

Hi.
I edited my AnkoComponent code, but layout not refresh my code.

I hope issue feedback is helpful.
Thanks.

IDE problem

Most helpful comment

Is there any particular reason why the whole project needs to be built to show preview? In plugin code I see there are fake XML gets generated from Anko Code, could we use some button to trigger the conversion of AnkoComponent to XML without compilation?

All 3 comments

As the DSL layout is Kotlin code, the project build is required in order to get the updated preview.
After the code modification, press Ctrl+F9 (or Cmd+F9 on Mac) and the updated preview will be shown after the successful build.

btw 'make project' builds whole set of flavors/build variants. so it is sometimes faster just to build current flavor apk. anyway google promised to fix it in upcoming gradle plugin releases.

Is there any particular reason why the whole project needs to be built to show preview? In plugin code I see there are fake XML gets generated from Anko Code, could we use some button to trigger the conversion of AnkoComponent to XML without compilation?

Was this page helpful?
0 / 5 - 0 ratings