美文网首页Android开发成长
Android Weekly Notes #411

Android Weekly Notes #411

作者: 圣骑士wind | 来源:发表于2020-04-30 16:02 被阅读0次

    Android Weekly Issue #411

    Dagger navigation support in Android Studio

    Android Studio的dagger工具.

    Replacing Custom Views with View Binding

    为啥View Binding可以取代自定义View呢?

    一些基础:

    这是介绍View Binding的:
    https://medium.com/androiddevelopers/use-view-binding-to-replace-findviewbyid-c83942471fc

    ViewBinding还可以用代理属性简化写:

    class MainActivity : AppCompatActivity() {
        private val binding by viewBinding(MainActivityBinding::inflate)
    
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            setContentView(binding.root)
    
            binding.button.onClick {
                showToast("hello world!")
            }
    

    https://medium.com/@Zhuinden/simple-one-liner-viewbinding-in-fragments-and-activities-with-kotlin-961430c6c07c

    感觉他们的custom view其实是view holder.

    Unit Testing ViewModel with Coroutines and LiveData

    ViewModel的单元测试.

    代码

    扫雷小游戏: https://github.com/lucasnlm/antimine-android

    协程的使用cases:
    https://github.com/LukasLechnerDev/Kotlin-Coroutine-Use-Cases-on-Android

    想用协程的推荐看看.

    视频

    一个教程: https://www.youtube.com/playlist?list=PLU4MI50rsBvaSyQvDeMRADo2Q_MOBevo1

    这个Now in Android的系列视频会说一些最近进展:
    https://www.youtube.com/watch?index=2&list=PLWz5rJ2EKKc9AtgKMBBdphI-mrx8XzW56&v=C4nursAx-hY&app=desktop

    文字版: https://medium.com/androiddevelopers/tagged/now-in-android

    相关文章

      网友评论

        本文标题:Android Weekly Notes #411

        本文链接:https://www.haomeiwen.com/subject/ejxtghtx.html