양방향 바인딩을 어떻게 설명할까 생각해봤는데 잘 설명된 글은 맨 아래 링크를 참고하시면 됩니다.
간단하게 한마디로 설명하면
데이터 <-> View 다이렉트 결합이라고 생각하시면 됩니다.
한번 나이를 올리는 예제를 two - way binding이 아닌 일반적인 방식으로 아래글에서 만들어봤었는데
https://philosopher-chan.tistory.com/1598
DataBinding - 1 (two - way binding)
간단한 데이터바인딩에 대해서 알아보겠습니다. 한번정도는 쓰거나 들어보셨을 텐데, 기존에 방법을 한번 보고 가보도록 하겠습니다. 간단하게 나이를 조금씩 올리는 앱입니다.
philosopher-chan.tistory.com
Two way binding을 이용해서 한번 만들어보겠습니다.
- 참조
데이터바인딩 two-way binding 원리
EditText 로 알아보는 BindingAdapter
improve777.medium.com
https://bignerdranch.com/blog/two-way-data-binding-on-android-observing-your-view-with-xml/
[Updated] Two-Way Data Binding on Android: Observing Your View with XML
Data Binding is a powerful library that's built around the idea of keeping your views up-to-date with your model. One of the lesser-known features is that it also lets you go backwards here. Using two-way Data Binding lets your model objects observe your v
bignerdranch.com
'Android Jetpack' 카테고리의 다른 글
DataBinding - 4 (BindingAdapter) (0) | 2023.01.20 |
---|---|
DataBinding - 3 (BindingAdapter) (0) | 2023.01.20 |
DataBinding - 1 (two - way binding) (0) | 2023.01.16 |
Simple Paging3 (0) | 2022.12.24 |
dataStore - 2 (0) | 2022.08.15 |