1. Introduction to Anko: http://blog.csdn.net/cjh_android/article/details/73121411
2. How to install:
Download the plugin:
Download the Anko plugin.
Process:
Click File -> setting -> plugin ->
-> in the upper left corner of the studio
配置gradle:https://github.com/Kotlin/anko
compile "org.jetbrains.anko:anko-commons:$anko_version"
Note: The value of ext.anko_version should be the same as the version of your Anko plugin
3. The pit about Anko: http://blog.csdn.net/cjh_android/article/details/73121411
4. Some usage of Anko:
1. Toast : Anko has included its own toast extension function, Anko provides some functions for CharSequence
and resource
, and two different toast and longToast methods:
toast("Hello world!") longToast(R.id.hello_world)
5. How to preview:
Reference: https://blog.mindorks.com/how-to-preview-dsl-layouts-made-using-anko-layouts-f885c6bf67b3