ViewBinding vs Kotlin Android Extensions with synthetic views

后端 未结 5 1273
予麋鹿
予麋鹿 2020-12-13 03:33

How does the new ViewBinding compare with the Kotlin Android Extensions with synthetic views bindings?

Apart form the NullSafety and TypeSafety provided by new ViewB

5条回答
  •  不思量自难忘°
    2020-12-13 03:58

    According to previous answers we can summary them.

    Null Safe

    both are null safe but sometimes they may suffer from NPE like with KAE when use view after view is destroyed also with viewBinding may occur when access view before inflating or after lifecycle is over.

    Clean &Concise code

    draw

    Support Kotlin & Java

    viewBinding win here, but if your project is pure Kotlin so this feature valueless

提交回复
热议问题