Android Weekly Issue #252

April 9th, 2017

Android Weekly Issue #252.

本期内容: 变化的渐变背景实现; Kotlin 1.1特性; Parcelable数据处理; RecyclerView动画实现; MVI模式的实现; 远程team的合作; 面向对象的原则: Law of Demeter; 用JUnit 5和Kotlin结合写测试.

(本期内容有点水, 不知道是我的状态不好还是Weekly的状态不好).

ARTICLES & TUTORIALS

Make a moving Gradient Background in Android

用AnimationList做一个不断改变的渐变色背景.

用根节点是<的drawable作为View的背景:

<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"> <item
android:drawable="@drawable/gradient_blue"
android:duration="5000"/> <item
android:drawable="@drawable/gradient_red"
android:duration="5000"/> <item
android:drawable="@drawable/gradient_teal"
android:duration="5000"/> <item
android:drawable="@drawable/gradient_purple"
android:duration="5000"/> <item
android:drawable="@drawable/gradient_indigo"
android:duration="5000"/> </animation-list>

其中的item是不同的渐变色drawable, 比如:

<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <gradient
android:angle="135"
android:endColor="#34e89e"
android:startColor="#0f3443" /> </shape>

在Java代码中获取, 然后start它即可:

LinearLayout linearLayout = (LinearLayout) findViewById(R.id.linear_layout);

AnimationDrawable animationDrawable = (AnimationDrawable) linearLayout.getBackground();

animationDrawable.setEnterFadeDuration(2500);
animationDrawable.setExitFadeDuration(5000); animationDrawable.start();

另外, 作者推荐一个发现渐变色组合的网站: UiGradients.

Kotlin 1.1 is also for Android Developers

Kotlin 1.1带来的一些很酷的features.

Proper Parcelable Testing

作者写了一个继承Parcelable接口的类, 然后把它存在savedInstanceState的Bundle里, 本文是他使用时的一些小建议.

RecyclerView interaction with Animated Markers - Part 3

动画实现: 当滚动列表的时候, 对应的Marker在地图上突出显示.

My take on Model View Intent (MVI) — Part 1: State Renderer

作者很推荐MVI模式, 讲了自己的应用是如何实现这种模式的.

简要说了用Espresso对本程序进行自动化UI测试的方法.

Effective Remote Teams

remote team如何工作.

Object Oriented Tricks: #2 Law of Demeter

面向对象编程Tricks系列之2: Law of Demeter, 德米特法则.

每一个单元应该尽量少地知道其他单元的业务, 仅知道和自己紧密联系的单元业务. Tell Don't Ask.

JUnit 5: Kotlin

如何结合Kotlin和JUnit 5来写测试.

LIBRARIES & CODE

spruce-android

一个轻量级的动画库.

Traceur

一个RxJava2的debug工具, 可以打出异步调用的最初崩溃信息.

scratch

清除用户数据然后重启应用.

what_the_thing

拿着相机对着东西, 然后学习如何用不同的语言来说它们的一个app, 用React Native实现.

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

  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 #236

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

  8. Android Weekly Notes Issue #235

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

  9. Android Weekly Notes Issue #234

    Android Weekly Issue #234 December 4th, 2016 Android Weekly Issue #234 本期内容包括: ConstraintLayout的使用; ...

随机推荐

  1. Codeforces 919 C. Seat Arrangements

    C. Seat Arrangements   time limit per test 1 second memory limit per test 256 megabytes input standa ...

  2. Xamarin XAML语言教程对象元素的声明方式

    Xamarin XAML语言教程对象元素的声明方式 XAML的对象元素的声明有两种形式,分别为包含属性的特性语法形式以及对象元素语法形式.在1.4小节中,我们看到了其中一种对XAML对象元素的声明方式 ...

  3. 缓存区溢出漏洞工具Doona

    缓存区溢出漏洞工具Doona   Doona是缓存区溢出漏洞工具BED的分支.它在BED的基础上,增加了更多插件,如nttp.proxy.rtsp.tftp等.同时,它对各个插件扩充了攻击载荷,这里也 ...

  4. Springboot 集成 Thymeleaf 及常见错误

    Thymeleaf模板引擎是springboot中默认配置,与freemarker相似,可以完全取代jsp,在springboot中,它的默认路径是src/main/resources/templat ...

  5. IDEA查看源码时提示:Library source does not match the bytecode for class的问题分析

    通过Maven查看依赖的源码时,通常是Maven自动下载JAR包附属的source包,但是会出现一个问题,由于使用lombok插件会造成编写的Java文件和编译后的class上有差别,所以IDEA打开 ...

  6. Eclipse安装Spring工具套件

    前言: 安装spring工具套件是为了更快捷的使用spring,但是我觉得既然已经有了maven,工具套件其实不那么重要. 而且装好后我发觉没什么两样,只是新建bean文件时比较爽一点. 安装步骤: ...

  7. 【grpc】spring boot+grpc的使用

    spring boot+grpc的使用 参考:https://baijiahao.baidu.com/s?id=1573961922096412&wfr=spider&for=pc

  8. install nfs and share file

    介绍一下NFS的安装,以及共享文件 NFS(Net File System),通过使用NFS,可以像使用本地文件一样访问远程文件. 它主要解决了数据共享的问题,可以备份容灾. 安装配置 1.以linu ...

  9. php-fpm.conf配置说明(重点要改动和优化的地方)

    <?xml version="1.0" ?> <configuration> All relative paths in this config are r ...

  10. jQeury入门:遍历

    一旦用jQuery创建一个初始的包装集.你就能深度遍历刚刚选择的包装集. 遍历能够被分为三个基础元件:父级.子级,同级.jQuery为全部这些元件提供丰富易用的方法.注意每个方法都能轻易的传递给字符串 ...