Android Weekly Notes Issue #252
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的更多相关文章
- Android Weekly Notes Issue #230
Android Weekly Notes Issue #230 November 6th, 2016 Android Weekly Issue #230. Android Weekly笔记, 本期内容 ...
- Android Weekly Notes Issue #227
Android Weekly Issue #227 October 16th, 2016 Android Weekly Issue #227. 本期内容包括: Google的Mobile Vision ...
- Android Weekly Notes Issue #237
Android Weekly Issue #237 December 25th, 2016 Android Weekly Issue #237 这是本年的最后一篇issue, 感谢大家. 本期内容包括 ...
- Android Weekly Notes Issue #229
Android Weekly Issue #229 October 30th, 2016 Android Weekly Issue #229 Android Weekly笔记, 本期内容包括: 性能库 ...
- Android Weekly Notes Issue #221
Android Weekly Issue #221 September 4th, 2016 Android Weekly Issue #221 ARTICLES & TUTORIALS And ...
- Android Weekly Notes Issue #219
Android Weekly Issue #219 August 21st, 2016 Android Weekly Issue #219 ARTICLES & TUTORIALS Andro ...
- Android Weekly Notes Issue #236
Android Weekly Issue #236 December 18th, 2016 Android Weekly Issue #236 本期内容包括: Google的物联网平台Android ...
- Android Weekly Notes Issue #235
Android Weekly Issue #235 December 11th, 2016 Android Weekly Issue #235 本期内容包括: 开发一个自定义View并发布为开源库的完 ...
- Android Weekly Notes Issue #234
Android Weekly Issue #234 December 4th, 2016 Android Weekly Issue #234 本期内容包括: ConstraintLayout的使用; ...
随机推荐
- Reveal.js演讲幻灯片框架
摘要 还需学习参考的链接 https://www.tuicool.com/articles/2AFFj2j 无意中看到这个插件,很喜欢,可以作用在演讲ppt,幻灯片,用户指引上等.代码简单,易维护 ...
- Spring Cloud系列文,Feign整合Ribbon和Hysrix
在本博客之前的Spring Cloud系列里,我们讲述了Feign的基本用法,这里我们将讲述下Feign整合Ribbon实现负载均衡以及整合Hystrix实现断路保护效果的方式. 1 准备Eureka ...
- git移除上一次的commit中误添加的文件
在使用git进行版本管理时,往往会出现一些误操作,比如将一些不加上传的文件放到了暂存区,即上传到了上一次commit中 比如: commit c134ab90ca7c4daf8bfa22e3ad706 ...
- C# 生成二维码(带Logo)
C# 生成二维码(带Logo) 第一种方式 我们需要引用 ThoughtWorks.QRCode.dll 生成带logo二维码(framework4.0以上) 下载地址:https://pan.ba ...
- FileChannel指南
推荐关注公众号:锅外的大佬 每日推送国外技术好文,帮助每位开发者更优秀地成长 原文链接:https://www.baeldung.com/java-filechannel 作者:baeldung 译者 ...
- python2.7升python3.2
1. 安装python3.2 sudo apt-get install python3.2 2. 删除usr/bin/目录下的默认python link文件. cd /usr/bin sudo ...
- Jquery实现的图标抖动效果
原文:http://www.webdm.cn/webcode/75de64a9-3fb4-473d-bc2c-97a0a063be79.html <!DOCTYPE html PUBLIC &q ...
- python_获得列表中重复的项的索引
a = ['b','a', 'b', 'c', 'a', 'c','d'] b=[] f=[] for i in a: c=[] for item in enumerate(a): if item[1 ...
- 蜗牛—Android基础之button监听器
XML文件中有一个textView 和 一个button. <LinearLayout xmlns:android="http://schemas.android.com/apk/re ...
- mysqldump导入导出详解
mysqldump可以指定路径的,如果没指定路径,而只写了文件名的话,那么就在当前进入mysql命令行所在的目录,也就是mysql安装目录下 mysqldump --default-characte ...