1. Basic structure 1.1 JavaBeans Objects
1.2 Layout File
1.3 Activity
The above three steps complete the basic data binding 2. Dynamic Updates When the data of the JavaBean object changes, the View is automatically updated. Normal data sources can only be bound. If you want to update dynamically, you must use Observable to store data. The following are three ways to implement Observable. 2.1 Observable Object Implement android.databinding.Observable or inherit its implementation class
2.2 Observable Fields Basic data types have corresponding Observable classes public final ObservableField<String> firstName = new ObservableField<>(); 2.3 Observable Collections ObservableArrayMap<String, Object> mapUser = new ObservableArrayMap<>(); user.put("firstName", "Google"); 2.4 References Whether it is an object, field or collection, data is stored in the form of Observable. The next step is to reference it in the layout.
3. RecyclerView dynamic binding
|
<<: Interview experience: WeChat, NetEase Games, Jinshan Xishanju, Renren
>>: Looking for Easter eggs in the code, Google is no longer the Google you know
Step 1: Let us first understand the concept of we...
[[192056]] The core problem of deep learning is a...
The situation in the mobile phone market is not g...
Q: What to do if you forget your Mini Program APP...
On December 6, 2021, Sun Haiyang, the prototype o...
I believe many of you have heard of the tombstone...
In daily advertising , do our designers and artis...
June 2 Mars will "meet" with the Beehiv...
At the first stop of our journey to explore women...
1. What is the account used for logging in? The a...
Expert of this article: Dou Pan, deputy director ...
1. Basic Information of the Website 1. Website do...
What would you do if Hollywood sexy actress Amber...
Tik Tok is still in its wild growth period, with ...