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. HDU 3534 Tree (经典树形dp)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3534 题意: 给你一棵树,问你有多少对点的距离等于树的直径. 思路: dp[i][0]表示在i的子树中 ...

  2. Oracle SOA Suite OverView

    SOA是一场架构的变革,那既然是变革,那就一定是有内在的原因来推动这个架构的变革.在过去几十年的时间里面,应用程序架构已经经历了3次巨大的变革,从Terminal/主机--> Client/Se ...

  3. CapIp.pas

    unit CapIp; interface uses Windows, Messages,Classes,winsock,sysutils; const WM_CapIp = WM_USER + ; ...

  4. JavaSE入门学习6:Java基础语法之运算符和语句(上)

    继续接着上篇:JavaSE入门学习5:Java基础语法(一)来看Java的基础语法. 五运算符 运算符是一种"功能"符号,用以通知Java进行相关的运算.比方.我们须要将变量age ...

  5. git 强制覆盖,分支合并

    强制合并 git fetch --all && git reset --hard origin/master && git pull 合并代码 git commit - ...

  6. class文件结构浅析(2)

    欢迎转载,转载需声明出处 ------------------ 请先看上一篇:Class类文件结构浅析 上一篇讲的都是理论.以下我们亲自实践一下. 首先编写一个简单的java类: public cla ...

  7. 直接返回list不封装的结果集

    直接返回list不封装的结果集,在Jsp访问方式: 1.封装成map访问 2.用jstl: <c:forEach var="images" items="${lis ...

  8. Vue 字面量语法 vs 动态语法

    初学者常犯的一个错误是使用字面量语法传递数值: <!-- 传递了一个字符串 "1" --> <comp some-prop="1">&l ...

  9. 设计模式之中介者模式(Mediator)摘录

    23种GOF设计模式一般分为三大类:创建型模式.结构型模式.行为模式. 创建型模式抽象了实例化过程.它们帮助一个系统独立于怎样创建.组合和表示它的那些对象.一个类创建型模式使用继承改变被实例化的类,而 ...

  10. 怎样创建.NET Web Service http://blog.csdn.net/xiaoxiaohai123/article/details/1546941

    为什么需要Web Service 在通过internet网购买商品后,你可能对配送方式感到迷惑不解.经常的情况是因配送问题找配送公司而消耗你的大量时间,对于配送公司而言这也不是一项增值服务. 为了解决 ...