Android Weekly Issue #408
App Standby Buckets In Android
Android Pie (Version 9 API level 28)推出的新的电量管理: App Standby Buckets.
根据用户使用习惯, priority buckets.
可以调用这个方法: getAppStandbyBucket查看app目前是哪个standby bucket.
Orientation, Spanning and Insets
微软的Surface Duo.
Jetpack ViewModel initialization
ViewModel的目的: to survive destruction and recreation of those system view classes (e.g. on device rotation).
用代理属性:
val model by viewModels<MyScreenViewModel>()
有参数的时候需要一个factory:
private val model by viewModels<MyScreenViewModel> {
MyScreenViewModelFactory("Hello world")
}
Android Multi-Module & Dagger: a real use case
多个module的dagger依赖注入.
Surviving Configuration Change with ViewModel
ViewModel一些基本的东西.
Layout Inspector
Android Studio 4.0.
Layout Inspector
可以像Chrome dev tools一样debug布局.
有3D模式可以分层查看.
Dagger code generation cheat sheets
Dagger的cheatsheet.
Merge adapters sequentially with MergeAdapter
RecyclerView的MergeAdapter: https://developer.android.com/reference/androidx/recyclerview/widget/MergeAdapter
可以把多个Adapter接在一起, 放在一个RecyclerView中使用:
val firstAdapter: FirstAdapter = …
val secondAdapter: SecondAdapter = …
val thirdAdapter: ThirdAdapter = …
val mergeAdapter = MergeAdapter(firstAdapter, secondAdapter,
thirdAdapter)
recyclerView.adapter = mergeAdapter
Code
FloorPlan
把Room的schemas转换成DBML: https://www.dbml.org/home/#intro
chip-navigation-bar
一个bottom navigation bar.
PowerPermission
一个动态请求的封装库.
有各种支持的实现: Rx, 协程, LiveData.
News
Meet the finalists of the Google Play Indie Games Festival
独立游戏.
网友评论