Android的全球数据绑定 [英] Android Global Data Binding

查看:166
本文介绍了Android的全球数据绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人可以给我为Android数据绑定的建议。

我希望我的Andr​​oid应用程序视图组件绑定到一个全球性的数据模型。

这个数据模型可以在应用对象的应用加载阶段设置好的。

后来,一旦这种模式的数据进行修改,可以在应用程序立即出现。

Can anybody give me a suggestion for android data binding.
I want my android application view components tied to a global data model.
This data model might be setted in Application object in application loading phase.
And later, once this data modal be modified, can appear in application immediately.

推荐答案

由于指向的@icastell,如果你想在Android上使用数据绑定新的Andr​​oid数据绑定库是最好的。然而,还是有相同的极少数很好的例子。

As pointed by @icastell, the new Android Databinding library is best if you want to use databinding on Android. However, there are still very few good examples for the same.

我已经上传Github上显示数据绑定的各种用例场景一些样本项目。您可以点击这里查看他们 -

I have uploaded some sample projects on Github showing various use case scenarios of data binding. You can visit them here -


  1. 数据与RecyclerView
  2. 绑定
  3. 数据绑定2路通信(数据模型 - >对象,反之亦然)

  4. 基本登录表单,使用数据绑定验证

  1. Data binding with RecyclerView
  2. Data binding 2 way communication (data model -> object and vice versa)
  3. Basic login form with validation using data binding

虽然这些都是基本的例子,但你可以用它们来获得数据绑定挂起。

Although these are basic examples but you can use them to get a hang on data binding.

这篇关于Android的全球数据绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆