Obsolete
Status Update
Comments
le...@gmail.com <le...@gmail.com> #2
same problem here
ke...@gmail.com <ke...@gmail.com> #3
2.3.1 still has this problem.
le...@gmail.com <le...@gmail.com> #4
2.3.2 still has this problem.
Whats the problem to fix that GOOGLE!
Whats the problem to fix that GOOGLE!
ke...@gmail.com <ke...@gmail.com> #5
I found a difference in generated code. See the attached diff image. Left panel is 2.3.2, right panel is 2.2.3.
In this case, 2.3.2 does not detect change of BR.name.
Using "notifyPropertyChanged(BR._all)" instead of "notifyPropertyChanged(BR.name)" is working in "User.java".
In this case, 2.3.2 does not detect change of BR.name.
Using "notifyPropertyChanged(BR._all)" instead of "notifyPropertyChanged(BR.name)" is working in "User.java".
ke...@gmail.com <ke...@gmail.com> #6
ke...@gmail.com <ke...@gmail.com> #7
Fixed in 3.0 Beta 1.
sa...@google.com <sa...@google.com> #8
Thank you for your feedback. We have tried our best to address the issue reported, however our product team has shifted work priority which doesn't include this issue. For now, we will be closing the issue as "Won't Fix (Obsolete)". If this issue still currently exists, we request that you log a new issue along with the latest bug report here: https://goo.gl/TbMiIO and reference this bug for context.
Description
supply all required information.
(NDK bugs should be filed at
instead.)
Gradle version: 3.3
Android Plugin Version: 2.3.0
SDK Version: 25.3.1
Module Compile Sdk Version: API 25
Module Build Tools Version: 25.0.2
notifyPropertyChanged of DataBinding is not working in below code. I executed notifyPropertyChanged, but it did not change view. The below code was working in 2.2.3.
* DataModel
```
public class User extends BaseObservable {
private static final String TAG = User.class.getSimpleName();
private String name;
@Bindable
public String getName() {
return name;
}
public void setName(String name) {
// not working in 2.3.0
notifyPropertyChanged(BR.name);
}
public void changeName(String name) {
Log.d(TAG, "changeName");
setName(name);
}
}
```
* ViewModel
```
public class ViewModel extends BaseObservable {
public final ObservableField<User> user = new ObservableField<>();
ViewModel() {
User user = new User();
user.setName("Name");
this.user.set(user);
}
public void onClickButton(View view) {
user.get().changeName("Change name");
}
}
```
* Layout XML
```
<layout>
<data>
<variable
name="viewModel"
type="com.star_zero.example.checkbug.ViewModel" />
</data>
...
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{
...
</layout>
```
If using getter/setter(@bindable) instead of ObservableField in ViewModel, It is working.
I attached a project file to reproduce.