举个例子,UI 需要展示一个评论框,允许展示评论,也允许用户修改,那么我们可以直接把 EditText 双向绑定到一个 LiveData 之上,只要用户有输入,我们就可以收到通知,完全不需要通过 Kotlin/Java 来操控 UI: android:text="@={viewModel.commentText}" /> 注意,如果要在 xml 中使用 LiveData,需要把 lifecycle owner ...
youlookwhat/CloudReader 云阅:一款基于网易云音乐UI,使用玩安卓、Gank.Io及时光网api开发的符合Google Material Design的Android客户端。项目的是MVVM-DataBinding架构开发,主要包括:玩安卓区、干货区和电影区三个子模块。 4.1 Java 01/14 85DingMouRen/LayoutManagerGroup 👉 Customize the LayoutManager of ...