Kotlin 在android studio下的初次使用

技术void 发表了文章 • 0 个评论 • 1265 次浏览 • 2017-05-22 11:01 • 来自相关话题

Kotlin社区交流群 :302755325<!--里面有怎么集成和一些资料收集,欢迎加入Kotlin社区交流群共同进步-->
http://blog.csdn.net/sinat_366 ... 29986
  查看全部
Kotlin社区交流群 :302755325
<!--里面有怎么集成和一些资料收集,欢迎加入Kotlin社区交流群共同进步-->
http://blog.csdn.net/sinat_366 ... 29986

 

kotlin国外社区(中文版)和大牛一起学习

教程void 发表了文章 • 0 个评论 • 1448 次浏览 • 2017-05-22 10:29 • 来自相关话题

 Kotlin社区交流群:302755325//欢迎大家来社区交流群交流学习
//这里只粘贴了地址,无需翻墙
https://www.kotlincn.net/docs/ ... .html
  查看全部
 Kotlin社区交流群:302755325
//欢迎大家来社区交流群交流学习
//这里只粘贴了地址,无需翻墙
https://www.kotlincn.net/docs/ ... .html

 

kotlin 如何拿到方法参数名

回复

技巧zly 发起了问题 • 1 人关注 • 0 个回复 • 739 次浏览 • 2017-05-20 15:42 • 来自相关话题

kotlin 的干货搜集 ,不能错过

技术void 发表了文章 • 0 个评论 • 2246 次浏览 • 2017-05-19 17:19 • 来自相关话题

1.官方资料
首发的肯定是kotlin的官方github地址了:https://github.com/JetBrains/kotlin

首发的肯定是kotlin的官方github地址了:

https://github.com/JetBrains/kotlin

晚上看了下trending,稳稳的站在第一。

平时大家没事,可以看看github trending,会有很多的新新优质资源。https://github.com/trending/java

Readme中包含官方的tutorials、推荐的图书《Kotlin in Action》、《Kotlin for Android Developers》以及其他资源。

英文不太好的不要担心,有官方中文翻译站点:

https://www.kotlincn.net/docs/reference/
https://www.gitbook.com/book/h ... tails

(2)《Kotlin for android developers》中文版翻译

https://github.com/wangjiegulu ... ME.md

支持在线阅读和下载pdf~

(3)张涛的开源实验室

之前在推送中推荐过张涛的博客,博客质量都很高,在很早的时候就开始编写Kotlin相关博客,此外还有很多比较新的知识~

https://kymjs.com/column/kotlin.html

(4)大精-wing的地方酒馆

让你的代码量减少3倍!使用kotlin开发Android系列~
http://androidwing.net/index.php/89

还有个Kotlin项目:
https://github.com/githubwing/GankClient-Kotlin

(5)Kotlin 视频教程
竟然还有视频教程~~

Kotlin从入门到『放弃』系列 视频教程
随着Kotlin越来越成熟稳定,我已经开始在生产环境中使用它。考虑到目前国内资料较少,我录制了一套视频教程,希望以此抛砖引玉,让 Kotlin 在国内火起来。
https://github.com/enbandari/Kotlin-Tutorials

可以百度云下载或者腾讯视频在线观看。

腾讯视频:http://v.qq.com/boke/gplay/903 ... .html
百度云:
http://pan.baidu.com/s/1nvGYAfB

(6)开源项目
一个用Kotlin写的简单漫画APP
https://github.com/wuapnjie/PoiShuhui-Kotlin

这个是我从俊林的文章中偷来的,如果有推荐可以留言~

(7)其他文章

为什么我要改用Kotlin
http://droidyue.com/blog/2017/ ... tlin/
by:技术小黑屋

Android开发必备知识:为什么说Kotlin值得一试
https://mp.weixin.qq.com/s%3F_ ... 151b6
by:腾讯Bugly公众号

使用Kotlin进行Android开发
http://ragnraok.github.io/usin ... .html
by:Ragnarok Zhou

最后要非常感谢,今天给我投稿的朋友(汇总资料,就直接放出了链接啦)~

使用Kotlin在Android Studio上开发App
http://blog.csdn.net/qq_258671 ... 75330
by:Blincheng

好文有很多,感谢所有人的分享~

Kotlin社区交流群:302755325
  查看全部
1.官方资料
首发的肯定是kotlin的官方github地址了:https://github.com/JetBrains/kotlin

首发的肯定是kotlin的官方github地址了:

https://github.com/JetBrains/kotlin

晚上看了下trending,稳稳的站在第一。

平时大家没事,可以看看github trending,会有很多的新新优质资源。https://github.com/trending/java

Readme中包含官方的tutorials、推荐的图书《Kotlin in Action》、《Kotlin for Android Developers》以及其他资源。

英文不太好的不要担心,有官方中文翻译站点:

https://www.kotlincn.net/docs/reference/
https://www.gitbook.com/book/h ... tails

(2)《Kotlin for android developers》中文版翻译

https://github.com/wangjiegulu ... ME.md

支持在线阅读和下载pdf~

(3)张涛的开源实验室

之前在推送中推荐过张涛的博客,博客质量都很高,在很早的时候就开始编写Kotlin相关博客,此外还有很多比较新的知识~

https://kymjs.com/column/kotlin.html

(4)大精-wing的地方酒馆

让你的代码量减少3倍!使用kotlin开发Android系列~
http://androidwing.net/index.php/89

还有个Kotlin项目:
https://github.com/githubwing/GankClient-Kotlin

(5)Kotlin 视频教程
竟然还有视频教程~~

Kotlin从入门到『放弃』系列 视频教程
随着Kotlin越来越成熟稳定,我已经开始在生产环境中使用它。考虑到目前国内资料较少,我录制了一套视频教程,希望以此抛砖引玉,让 Kotlin 在国内火起来。
https://github.com/enbandari/Kotlin-Tutorials

可以百度云下载或者腾讯视频在线观看。

腾讯视频:http://v.qq.com/boke/gplay/903 ... .html
百度云:
http://pan.baidu.com/s/1nvGYAfB

(6)开源项目
一个用Kotlin写的简单漫画APP
https://github.com/wuapnjie/PoiShuhui-Kotlin

这个是我从俊林的文章中偷来的,如果有推荐可以留言~

(7)其他文章

为什么我要改用Kotlin
http://droidyue.com/blog/2017/ ... tlin/
by:技术小黑屋

Android开发必备知识:为什么说Kotlin值得一试
https://mp.weixin.qq.com/s%3F_ ... 151b6
by:腾讯Bugly公众号

使用Kotlin进行Android开发
http://ragnraok.github.io/usin ... .html
by:Ragnarok Zhou

最后要非常感谢,今天给我投稿的朋友(汇总资料,就直接放出了链接啦)~

使用Kotlin在Android Studio上开发App
http://blog.csdn.net/qq_258671 ... 75330
by:Blincheng

好文有很多,感谢所有人的分享~

Kotlin社区交流群:302755325
 

自己用的一些kotlin的资源,希望对大家有点帮助

教程氢电公敌 发表了文章 • 0 个评论 • 3118 次浏览 • 2016-08-27 23:01 • 来自相关话题

1. 如何评价 Kotlin 语言? 来自知乎,可以看看广大道友是如何评价这个新生代的,不过好不好用还是要看自己
2. Kotlin 官网 英文版,里面的东西很全,但是不是很详细,用来入门是没什么问题了
3. Kotlin 官网 - 中文版 这个和上面一样,只不过是中文的,有需要的可以看一看
4. Kotlin 中文翻译项目  这个在本人爬坑的时候也参考了一部分,只不过好像项目停止更新了
 
姑且先这么多吧,以后友好的资源再拿来分享(PS : 难道只有我一个人在吐槽不能用MD吗?) 查看全部
1. 如何评价 Kotlin 语言? 来自知乎,可以看看广大道友是如何评价这个新生代的,不过好不好用还是要看自己
2. Kotlin 官网 英文版,里面的东西很全,但是不是很详细,用来入门是没什么问题了
3. Kotlin 官网 - 中文版 这个和上面一样,只不过是中文的,有需要的可以看一看
4. Kotlin 中文翻译项目  这个在本人爬坑的时候也参考了一部分,只不过好像项目停止更新了
 
姑且先这么多吧,以后友好的资源再拿来分享(PS : 难道只有我一个人在吐槽不能用MD吗?)

关于kotlin资源

回复

技术LC_Lin 发起了问题 • 1 人关注 • 0 个回复 • 1952 次浏览 • 2016-06-11 22:35 • 来自相关话题

KBinding - 使用Kotlin实现的Android下的MVVM框架

技术benny 发表了文章 • 0 个评论 • 2791 次浏览 • 2015-12-17 17:32 • 来自相关话题

项目地址:https://github.com/BennyWang/KBinding
 
KBinding
Android View Model binding framework write in kotlin, base on anko, simple but powerful.ContentsBindingMode
OneWay: Binding from model to viewTwoWay: Binding from model to view and view to modelOneWayToSource: Binding from view to modelOneTime: Binding from model to view, and auto release after first emit
 Simple BindingverticalLayout {
editText {
bind { text("name", mode = TwoWay) }
}
button {
bind { click("hello") }
}
}
class SimpleViewModel() : ViewModel() {
var name: String by bindProperty("name") { "Jason" }
val hello: Command by bindCommand("hello") { params, canExecute ->
toast("Hello, ${name}!")
}
}Multiple Binding//login button enabled only when name and password not empty
class ArrayToBooleanConverter : MultipleConverter<Boolean> {
override fun convert(params: Array<Any>): Boolean {
params.forEach {
if(it.toString().isEmpty()) return false
}
return true
}
}
verticalLayout {
editText {
bind { text("name", mode = TwoWay) }
}
editText {
bind { text("password", mode = TwoWay) }
}
button {
bind { enabled("name", "password", mode = OneWay, converter = ArrayToBooleanConverter()
bind { click("login") }
}
}
class LoginViewModel() : ViewModel() {
var name: String by bindProperty("name") { "xxx@xxxx.com" }
var password: String by bindProperty("password") { "xxxxxx" }
val login: Command by bindCommand("login") { params, canExecute ->
//login processing
}
}View Model property depends on other properties//name and price property will be updated when new stock is set
class StockViewModel() : ViewModel() {
var stock: Stock? by bindProperty("stock")
val name: String? by bindProperty("name", "stock") { stock!!.name }
val price: Float by bindProperty("price", "stock") { stock!!.price }
}Wait/Until//wait/until just like OneTime binding, but it need apply action, for example below, it wait for market from model, then decide how to display
relativeLayout {
wait { until("market", converter = viewOfMarket) { inflate(it, this@verticalLayout) }
}Extend Binding Property(Depend on RxBinding heavily)Event fun View.click(path: String) : PropertyBinding = commandBinding(path, clicks(), enabled())Propertyfun View.enabled(vararg paths: String, mode: OneWay = BindingMode.OneWay, converter: OneWayConverter<Boolean> = EmptyOneWayConverter()) : PropertyBinding = oneWayPropertyBinding(enabled(), false, converter, *paths)


//this implements four binding mode for TextView, if just need OneWay mode, remove last three lines, some for other mode
fun TextView.text(vararg paths: String, mode: OneWay = BindingMode.OneWay, converter: OneWayConverter<out CharSequence> = EmptyOneWayConverter()) : PropertyBinding = oneWayPropertyBinding(text(), false, converter, *paths)
fun TextView.text(vararg paths: String, mode: OneTime, converter: OneWayConverter<out CharSequence> = EmptyOneWayConverter()) : PropertyBinding = oneWayPropertyBinding(text(), true, converter, *paths)
fun TextView.text(path: String, mode: OneWayToSource, converter: OneWayConverter<*> = EmptyOneWayConverter<String>()) : PropertyBinding = oneWayPropertyBinding(path, textChanges2(), convert)
fun TextView.text(path: String, mode: TwoWay, converter: TwoWayConverter<String, *> = EmptyTwoWayConverter<String, String>()) : PropertyBinding = twoWayPropertyBinding(path, textChanges2(), text(), converter)

Using with Gradledependencies {
compile 'com.benny.kbinding:library:0.1.0'
}Contribute
Now is just the beginning of KBinding, so everyone interested in this library, just fork it and pull requests to me. Let's make it a little better.
 
Discussion
QQ Group: 516157585
  查看全部
项目地址:https://github.com/BennyWang/KBinding
 
KBinding
Android View Model binding framework write in kotlin, base on anko, simple but powerful.ContentsBindingMode
  • OneWay: Binding from model to view
  • TwoWay: Binding from model to view and view to model
  • OneWayToSource: Binding from view to model
  • OneTime: Binding from model to view, and auto release after first emit

 Simple Binding
verticalLayout {
editText {
bind { text("name", mode = TwoWay) }
}
button {
bind { click("hello") }
}
}
class SimpleViewModel() : ViewModel() {
var name: String by bindProperty("name") { "Jason" }
val hello: Command by bindCommand("hello") { params, canExecute ->
toast("Hello, ${name}!")
}
}
Multiple Binding
//login button enabled only when name and password not empty
class ArrayToBooleanConverter : MultipleConverter<Boolean> {
override fun convert(params: Array<Any>): Boolean {
params.forEach {
if(it.toString().isEmpty()) return false
}
return true
}
}
verticalLayout {
editText {
bind { text("name", mode = TwoWay) }
}
editText {
bind { text("password", mode = TwoWay) }
}
button {
bind { enabled("name", "password", mode = OneWay, converter = ArrayToBooleanConverter()
bind { click("login") }
}
}
class LoginViewModel() : ViewModel() {
var name: String by bindProperty("name") { "xxx@xxxx.com" }
var password: String by bindProperty("password") { "xxxxxx" }
val login: Command by bindCommand("login") { params, canExecute ->
//login processing
}
}
View Model property depends on other properties
//name and price property will be updated when new stock is set
class StockViewModel() : ViewModel() {
var stock: Stock? by bindProperty("stock")
val name: String? by bindProperty("name", "stock") { stock!!.name }
val price: Float by bindProperty("price", "stock") { stock!!.price }
}
Wait/Until
//wait/until just like OneTime binding, but it need apply action, for example below, it wait for market from model, then decide how to display
relativeLayout {
wait { until("market", converter = viewOfMarket) { inflate(it, this@verticalLayout) }
}
Extend Binding Property(Depend on RxBinding heavily)Event
    fun View.click(path: String) : PropertyBinding = commandBinding(path, clicks(), enabled())
Property
fun View.enabled(vararg paths: String, mode: OneWay = BindingMode.OneWay, converter: OneWayConverter<Boolean> = EmptyOneWayConverter()) : PropertyBinding = oneWayPropertyBinding(enabled(), false, converter, *paths)    


//this implements four binding mode for TextView, if just need OneWay mode, remove last three lines, some for other mode
fun TextView.text(vararg paths: String, mode: OneWay = BindingMode.OneWay, converter: OneWayConverter<out CharSequence> = EmptyOneWayConverter()) : PropertyBinding = oneWayPropertyBinding(text(), false, converter, *paths)
fun TextView.text(vararg paths: String, mode: OneTime, converter: OneWayConverter<out CharSequence> = EmptyOneWayConverter()) : PropertyBinding = oneWayPropertyBinding(text(), true, converter, *paths)
fun TextView.text(path: String, mode: OneWayToSource, converter: OneWayConverter<*> = EmptyOneWayConverter<String>()) : PropertyBinding = oneWayPropertyBinding(path, textChanges2(), convert)
fun TextView.text(path: String, mode: TwoWay, converter: TwoWayConverter<String, *> = EmptyTwoWayConverter<String, String>()) : PropertyBinding = twoWayPropertyBinding(path, textChanges2(), text(), converter)

Using with Gradle
dependencies {
compile 'com.benny.kbinding:library:0.1.0'
}
Contribute
Now is just the beginning of KBinding, so everyone interested in this library, just fork it and pull requests to me. Let's make it a little better.
 
Discussion
QQ Group: 516157585