Android Weekly Issue #290

December 31st, 2017

Android Weekly Issue #290

本期内容包括介绍Kotlin逆变协变的一篇(虽然没说清楚,但我补充了),IoT相关制作MIDI Controler的Part two,以及比较炫酷的Shared Element Reveal动画,以及LiveData与DataBinding相关,Kotlin扩展Fragment/Activity方法做测试,Rx逐条打Log等等.

ARTICLES & TUTORIALS

Lessons learned implementing Redux on Android

文章介绍了模仿Web的Redux,实现其kotlin版本,实现Reducer,通过StateAction来驱动状态的转换.

State -> UI -> Action -> Reducer -> Store.

In and out type variant of Kotlin

文章介绍了Kotlin中泛型添加inout的意义.

实际上in作为参数表示的是consume方,可以将super type可以赋值给sub type.类似于Java里面的<? super X>,其作为泛型的Collection只能add数据,无法get访问内部成员.

out作为返回值表示producer,与in相反,它可以将sub type赋值给super type.类似于Java中的<? extends X>,其作为反省的Collection只能get访问,不能add数据.

Building a distributed MIDI Controller with Android Things and Nearby API #2

IoT的MIDI播放器第二篇,感兴趣的可以仔细看.

Meaningful Motion: Circular Reveal & Shared Elements

在Shared Element Transaction Animation的基础上加上了ViewAnimationUtils#createCircularReveal实现Reveal效果. 即Activity/Fragment跳转过程中Shared Element先移动再充满Container.

RxAndroid: Handle Interrupt With “switchMap”

通过switchMap将Happy与Unhappy的pass都加进来(Observer.merge)进行处理,switchMap与flatMap的区别是它内部只有一个active的observer,简单的来说,它不会对转换后的Observable进行merge,而是在新的来到的时候cancel之前的.

The curious case of haunting fragments

作者研究Fragment addToBackStack以及pop之间的事情,但是作者貌似没用对...

所以之后他居然推荐用Activity了,说Fragment太难用...

Unit testing protected lifecycle methods with Kotlin

作者写了个工具库,给Activity的生命周期方法都写了扩展,这样就可以直接通过对象调用了...可以用来写Activity的单元测试.

Kotlin Coding Conventions

Kotlin最新的code style,基本跟Java类似,但这里比较详细,包括什么时候换行,什么时候single line等等.

Lessons from my first multi-platform Kotlin project

作者对Kotlin Multiple Platform进行总结,首先platform层应该根据js/jvm/native进行划分,而不是操作系统,操作系统的划分应该属于之下的regular层,而最上层为common层.

MVP的应用非常重要,其次是下层可以访问上层的一切,上层需要访问下层应该通过expected与actual来实现.

Android Architecture Components LiveData with Data Binding

Google最新的Databinding已经支持LiveData了,通过与LiveData进行绑定,可以保证UI在后台的时候不会因为数据变化而刷新,避免了没有必要的操作.

Briefly about RxJava Logging

作者介绍了通过doOnEach (Flowable)以及doOnEvent(others)来了解Observable的状态,帮助你添加新的feature中debug遇到的问题,不至于整个Rx Chains出现问题而不知道问题处在哪里.

LIBRARIES & CODE

TableView

很项强大TableView,基于RecyclerView,用来显示复杂数据.有点类似数据库表格.

retrofit2-kotlin-coroutines-adapter

Jake Warthon写的支持Kotlin Coroutine的Retrofit2, 返回Deferred类型.

RxTest

像这个来测Rx的Observable,是不是很牛.

Observable.just("Hello RxTest!")
.test {
it shouldEmit "Hello RxTest!"
it should complete()
it shouldHave noErrors()
}

MockK

支持Koltin DSL的mock库, 叫mockk....

KotlinAndroidViewBindings

其实感觉跟ViewBinding没多大关系, 主要是实现了Delegate,可以取代findViewById,Butterknife以及Kotlin Android Extension.

直接通过by bindWithXX()来找到View.

litho-kotlin

Facebook litho的kotlin dsl support.

kotlin-math

支持很多vector计算的lib,帮助简化graphic math.

Android Weekly Notes Issue #290的更多相关文章

  1. Android Weekly Notes Issue #230

    Android Weekly Notes Issue #230 November 6th, 2016 Android Weekly Issue #230. Android Weekly笔记, 本期内容 ...

  2. Android Weekly Notes Issue #227

    Android Weekly Issue #227 October 16th, 2016 Android Weekly Issue #227. 本期内容包括: Google的Mobile Vision ...

  3. Android Weekly Notes Issue #237

    Android Weekly Issue #237 December 25th, 2016 Android Weekly Issue #237 这是本年的最后一篇issue, 感谢大家. 本期内容包括 ...

  4. Android Weekly Notes Issue #229

    Android Weekly Issue #229 October 30th, 2016 Android Weekly Issue #229 Android Weekly笔记, 本期内容包括: 性能库 ...

  5. Android Weekly Notes Issue #221

    Android Weekly Issue #221 September 4th, 2016 Android Weekly Issue #221 ARTICLES & TUTORIALS And ...

  6. Android Weekly Notes Issue #219

    Android Weekly Issue #219 August 21st, 2016 Android Weekly Issue #219 ARTICLES & TUTORIALS Andro ...

  7. Android Weekly Notes Issue #310 (Google IO特别篇)

    Android Weekly Issue #310 May 20th, 2018 Android Weekly Issue #290 本期既有本次Google IO对于Play Console的更新简 ...

  8. Android Weekly Notes Issue #236

    Android Weekly Issue #236 December 18th, 2016 Android Weekly Issue #236 本期内容包括: Google的物联网平台Android ...

  9. Android Weekly Notes Issue #235

    Android Weekly Issue #235 December 11th, 2016 Android Weekly Issue #235 本期内容包括: 开发一个自定义View并发布为开源库的完 ...

随机推荐

  1. mac xampp命令行调用mysql

    参考 http://www.cnblogs.com/machao/p/6206483.html 直接mysql不行,显示command not found 调用 sudo ln -s /applica ...

  2. 怎样备份Github博客至GitCafe

    原文链接:http://stackvoid.com/how-to-transfer-github-pages-to-gitcafe/ 开通博客半年多了,一直将博客托管到 Github 上,使用 Git ...

  3. 接口测试 rest-assured 使用指南

    转自:https://testerhome.com/topics/7060 原文:https://github.com/rest-assured/rest-assured/wiki/Usage本文gi ...

  4. JAVA Eclipse 创建android xml看不到预览怎么办

    电机安卓图标,设置为更低的API版本即可

  5. Flume 开发人员指南V1.5.2

    介绍 概述 Apache Flume是一个用来从非常多不同的源有效地收集.聚集和移动大量的日志数据到一个中心数据仓库的分布式的,可靠的和可用的系统. Apache Flume是Apache软件基金会的 ...

  6. Android 开发程序员必备网站

    开发必备网站: Android 开发各种工具下载 Android 开发国内大牛集合 Android 开发技术博客周刊 Android 开发技术周报中文版 Android 优秀开源项目集合以及源码分析 ...

  7. es6 includes(), startsWith(), endsWith()

    传统上,JavaScript 只有indexOf方法,可以用来确定一个字符串是否包含在另一个字符串中.ES6 又提供了三种新方法. includes():返回布尔值,表示是否找到了参数字符串. sta ...

  8. Qt on Android:将Qt调试信息输出到logcat中

    版权全部 foruok .如需转载敬请注明出处(http://blog.csdn.net/foruok). 假设你在目标 Android 设备上执行了 Qt on Android 应用,你可能希望看到 ...

  9. 阿里云官方教程 Linux 系统挂载数据盘

    适用系统:Linux(Redhat , CentOS,Debian,Ubuntu) *  Linux的云服务器数据盘未做分区和格式化,可以根据以下步骤进行分区以及格式化操作. 下面的操作将会把数据盘划 ...

  10. linux init->upstart->systemd

    http://en.wikipedia.org/wiki/Init init From Wikipedia, the free encyclopedia     This article is abo ...