美文网首页Android Weekly Notes
Android Weekly Notes #416

Android Weekly Notes #416

作者: 圣骑士wind | 来源:发表于2020-06-02 15:51 被阅读0次

Android Weekly Issue #416

在相关链接里看到这个文章:
https://zsmb.co/lets-review-pokedex/

这个大哥把pokedex给review了.

Modern Security in Android (part 1)

安全的系列文章.

Make your apps fold; Make it work with foldable displays

可折叠设备的app.

A hidden Kotlin gem: Deprecations with ReplaceWith

如果@Deprecated加上replaceWith:

@Deprecated(
    message = "Use simpler logout() instead",
    replaceWith = ReplaceWith("logout()")
)
fun doLogout() {
    logout()
}

点击Alt + Enter就可以自动替换成建议的方法.

还可以有参数和加import:

@Deprecated(
    message = "Use simpler login with Credentials",
    replaceWith = ReplaceWith(
        expression = "login(Credentials(usr, pwd))",
        imports = ["auth.Credentials"]
    )
)
fun doLogin(pwd: String, usr: String) {
}

@Deprecated默认的等级是warning, 其实还有error和hidden.

Kotlin Collection Functions Cheat Sheet

Kotlin集合方法的小抄.

Stop using Gradle buildSrc. Use composite builds instead

buildSrc的一些缺点: 慢, 缓存失效等.

解决方法: https://docs.gradle.org/current/userguide/composite_builds.html

News

Android Studio 4.0

几个比较重要的改变:

  • motion layout的编辑器
  • Smart editor feature when writing rules for R8
  • 项目配置:
android {
    // The default value for each feature is shown below.
    // You can change the value to override the default behavior.
    buildFeatures {
        // Determines whether to support View Binding.
        // Note that the viewBinding.enabled property is now deprecated.
        viewBinding = false
        // Determines whether to support Data Binding.
        // Note that the dataBinding.enabled property is now deprecated.
        dataBinding = false
        ...
    }
}

相关文章

网友评论

    本文标题:Android Weekly Notes #416

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