android camera about
Android相机开发那些坑
作者:MagiLu
链接:http://zhuanlan.zhihu.com/p/20559606
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
最近我负责开发了一个跟Android相机有关的需求,新功能允许用户使用手机摄像头,快速拍摄特定尺寸(1:1或3:4)的照片,并支持在拍摄出的照片上做贴纸相关的操作。由于之前没有接触过Android相机开发,所以在整个开发过程中踩了不少坑,费了不少时间和精力。这篇文章总结了Android相机开发的相关知识、流程,以及容易遇到的坑,希望能帮助今后可能会接触Android相机开发的朋友快速上手,节省时间,少走弯路。
底部导航栏(Bottom navigator)规范指南
底部导航栏(Bottom navigation)规范指南
Original Link:https://github.com/LittleFriendsGroup/BottomNavigation/blob/master/README.md
前言:
最近 Google 在Material Design设计规范中加入底部导航栏(Bottom navigation)设计,对此,我会在文末给出个人看法!现在我们先来学习Bottom navigation
在设计、使用、交互、风格、尺寸的一些规范。水平有限,如理解有误,请多多吐槽。
创建一个宽高比固定的视图容器
有时候,我们需要将一个View固定为指定比例,比如16:9,4:3,1:1等等。
一般的做法有两种:
- 一种是预先知道宽高的值,直接在xml中给出指定的dp值
- 一种是根据当前的宽/高值,根据给定的比例值动态计算另一个值
kotlin项目开发过程中遇到的几个小问题
无论在哪种编程语言里,**vararg**可变参数应该都是存在的,在kotlin里自然也不例外,本文讲述了两个有关vararg在实际使用中的方法。
Android 监听连续点击次数的方法
android开发过程中有时候会需要判断某个view多次被点击的事件,
采用Google的方法很简单的可以实现.
Kotlin recipes for Android (I): OnGlobalLayoutListener
Original Link: http://antonioleiva.com/kotlin-ongloballayoutlistener/
Today a mate asked me how he could do an OnGlobalLayoutListener properly without incurring in the need of too much boilerplate. This was a tricky question because of a couple of things, let’s see it a little more deeply.
Functional Android (II): Collection operations in Kotlin
Original Link: http://antonioleiva.com/collection-operations-kotlin/
Lambdas are a great powerful tool to simplify code, but also to do things that were not possible before. We talked about them in the [first part of the series](Unleash functional power on Android (I): Kotlin lambdas).
In the end, lambdas are the basis to implement lots of functional features, such as the ones we are talking today: Collection operations. Kotlin provides an awesome set of operations that wouldn’t be possible (or really verbose) when using a language which doesn’t support lambdas.
Kotlin awesome tricks for Android
I’ve been talking a lot about Kotlin in this blog, but now that Google is also talking about Kotlin, and that Kotlin 1.0 RC has been released, there’s no doubt that Kotlin is much more than just an alternative for Android. Kotlin is here to stay, and I recommend you to start learning about it.