Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first:init #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import com.example.android.databinding.basicsample.util.ObservableViewModel
* changes to any of the exposed observables automatically refresh the UI. *
*/
class ProfileLiveDataViewModel : ViewModel() {
private val _name = MutableLiveData("Ada")
private val _lastName = MutableLiveData("Lovelace")
private val _name = MutableLiveData("Yamashita")
private val _lastName = MutableLiveData("Hiroyuki")
private val _likes = MutableLiveData(0)

val name: LiveData<String> = _name
Expand Down Expand Up @@ -61,8 +61,8 @@ class ProfileLiveDataViewModel : ViewModel() {
* `notifyPropertyChanged` when any of the dependent properties change (`likes` in this case).
*/
class ProfileObservableViewModel : ObservableViewModel() {
val name = ObservableField("Ada")
val lastName = ObservableField("Lovelace")
val name = ObservableField("Yamashita")
val lastName = ObservableField("Hiroyuki")
val likes = ObservableInt(0)

fun onLike() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import com.example.android.databinding.basicsample.databinding.ObservableFieldPr
*/
class ObservableFieldActivity : AppCompatActivity() {

private val observableFieldProfile = ObservableFieldProfile("Ada", "Lovelace", ObservableInt(0))
private val observableFieldProfile = ObservableFieldProfile("Yamashita", "Hiroyuki", ObservableInt(0))

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down