kotlin
1 人感兴趣 · 51 次引用
- 最新
- 推荐

Kotlin 学习笔记(二)—— 数据类、密闭类、循环写法以及常用集合操作符
在上篇笔记中,我们对 Kotlin 的基本类型、关键字、类与对象,以及与 Java 之间互调的内容有了一些认识,这篇笔记来看看 Kotlin 中几种特殊的类,以及集合相关的常用操作。

Compose 把 Text 组件玩出新高度
探索如何在 Compose UI 中绘制好玩的文本段落动画效果,君如觉好,记得点赞❤️+评论❤️+关注❤️

浅谈 Kotlin 与 Java 互操作 (下)
Kotlin is 100% interoperable with Java and Android Kotlin官网的一句标语,其旨意是表达kotlin的`Interoperable-互操作特性 互操作就表示Kotlin中可以调用 Java的开放接口来访问成员属性和成员方法,同时在Java代码中也百分百兼容Kotlin代码

浅谈 Kotlin 与 Java 互操作 (上)
Kotlin is 100% interoperable with Java and Android Kotlin官网的一句标语,其旨意是表达kotlin的Interoperable-互操作特性 互操作就表示Kotlin中可以调用 Java的开放接口来访问成员属性和成员方法,同时在Java代码中也百分百兼容Kotlin代码

Kotlin 中 Regex 正则表达式 (下)
在正则表达式上篇介绍了Kotlin的 regex 标准库中提供的几个常用正则函数containsMatchIn find findAll matchEntire matches replace以及这些常用函数的用法举例。那本篇就来介绍一下Kotlin中的正则表达式的通配符相关知识点。

Kotlin 中 Regex 正则表达式 (上)
回想一下,在学Java时接触的正则表达式,其实Kotlin中也是类似。只不过使用Kotlin 的语法来表达,更为简洁。正则(Regex)用于搜索字符串或替换正则表达式对象,需要使用Regex(pattern:String)类。 在Kotlin中 Regex 是在 kotlin.text.regex 包。

Kotlin 用高阶函数处理集合数据
一个函数f(x) 的接收参数是另一个函数(g(x))或者它的返回值是另一个函数(h(x)),在Kotlin中f(x)就是一个高阶函数。Kotlin标准库中为开发者提供了丰富的高阶函数,有sumBy, reduce, fold, map,filter,forEach等。本篇文章就来学习这些高阶函数的使用。

Kotlin 使用 lateinit 的一些考虑
如何看待 lateinit?有的开发者对它敬而远之,特别是使用 lateinit 踩坑之后。因为被 lateinit 修饰的变量,不再接受空安全检查,它更像是一个普通的 Java 变量。也有开发者喜欢尽可能的用它,把 lateinit 作为介于 nonnull 和 nullable 之间的一个状态:对象

Kotlin 作用域函数 [Scope Function](下)
上一篇文章介绍过Kotlin中作用域函数,并以函数run为例,介绍作用域函数的特点和使用。除run之外,Kotlin 标准库还内置了let,apply,also等几个常用作用域函数,下面介绍它们用法和使用场景。

Kotlin 作用域函数 [Scope Function](上)
Kotlin中的作用域函数是标准库中包含的几个常用函数,let、run、with、apply以及also。从本篇起来介绍一下 Kotlin 中的作用域函数,分上下两篇。上篇会说明几个常见作用域函数,分析一下run函数,以及对比一下 Java 中没有作用域函数情况。

Kotlin 伴生对象 (Companion Object)
Kotlin相对于Java还是有不少新特性的,本文就来介绍一下 伴生对象(companion object)的知识点。





Kotlin 函数声明与闭包
本文介绍闭包。闭包其实不算是新东西了,Kotlin 就基本没有多少新东西,甚至可以说新型编程语言基本都没有新东西。是把先前编程语言好用的特性组装起来,再加一部分拓展。

Kotlin 变量的空安全 (Null Safety)
Kotlin 类型系统里最重要的特性:空安全(Void Safety/Null Safety)。在 Kotlin 中,不可为空的变量和可为空的变量被强行分开了(Java 有 @Nullable 和 @NonNull 注解) Kotlin 为什么要这样设计呢?


从 HelloWorld 看 Java 与 Kotlin
本系列主要是介绍Kotlin好用特性的文章。记录下自己在团队中推广Kotlin的历程,不求鞭辟入里,但尽可能保证有趣不枯燥。这系列文章就是从前期“拒绝” Kotlin,到逐渐接受并使用而积累起来的“真香”部分。
Kotlin 协程解析系列(上):协程调度与挂起
Kotlin协程是学习Kotlin的重中之重,也是运用koitlin的关键。本篇文章主要介绍Kotlin协程的创建、协程调度与协程挂起部分内容,对相关内容进行细致解析。
Android App 首页主流框架搭建
这是一个比较常见的APP首页的结构,侧边栏+主页,侧边栏里是一些菜单,主页由底部菜单控制内容区,内容区是可滑动的子页面。整体比较舒服合理,各自为阵,却又能关联在一起,加上又是大众喜爱的Material Design风格,所以成为了当下APP首页的主流结构。


博文干货|在 Kotlin 中使用 Apache Pulsar
Apache Pulsar 通常被描述为下一代 Kafka,是开发人员工具集中一颗冉冉升起的新星。Pulsar 是用于 server-to-server 消息传递的多租户、高性能解决方案,通常用作可扩展应用程序的核心。...

Kotlin 语法手册(四)
在使用kotlin时,由于掌握的不够牢靠,好多时候也还是Java编程的习惯,浪费了kotlin提供的语言特性,方便性,间接性,在阅读一些Android开源库的时候,由于好多都是kotlin语法编写的,看的比较费劲,还得去查阅kotlin的语法,比较不方便,故把kotlin的语法记

Kotlin 语法手册(三)
在使用kotlin时,由于掌握的不够牢靠,好多时候也还是Java编程的习惯,浪费了kotlin提供的语言特性,方便性,间接性,在阅读一些Android开源库的时候,由于好多都是kotlin语法编写的,看的比较费劲,还得去查阅kotlin的语法,比较不方便,故把kotlin的语法记