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实现.
最新文章
- 十天精通CSS3学习笔记 part4
- iOS-打电话、发短信、发邮件、打开浏览器
- Moqui学习之 Step by Step OrderProcureToPayBasicFlow
- CSS 编码规范
- 在HibernateTemplate里执行Sql语句
- C语言中的程序终止函数
- [OJ] Find Minimum in Rotated Sorted Array
- 【剑指Offer学习】【面试题40:数组中仅仅出现一次的数字】
- 唯品会安卓版app分析
- mysql server5.6.28 修改数据目录
- Github Atom
- mySQL:两表更新(用一个表更新另一个表)的SQL语句
- VisualStudio程序运行后控制台窗口一闪就没了
- Codeforces-8VC Venture Cup 2016-Elimination Round-626A.暴力 626B.水题 626C.二分
- idea快捷键(后续更新)
- oracle创建表空间 授权
- 【转】[Android] NDK独立编译——独立工具链
- scala快速一览
- date命令的用法
- webstorm上svn的安装使用
热门文章
- Codeforces Round #423 (Div. 2, rated, based on VK Cup Finals) E DNA Evolution
- Codeforces Gym101502 A.Very Hard Question
- Codeforces 877E Danil and a Part-time Job(dfs序 + 线段树)
- Ural 1774 Barber of the Army of Mages 最大流
- 东方14模拟赛之noip2015/day1/3/神奇的幻方
- xshell配置
- SpringMVC整合fastdfs-client-java实现web文件上传下载
- iphone坐标系统
- Android图片加载神器之Fresco,基于各种使用场景的讲解
- SilverLight: 数据绑定(1)-绑定到数据对象