Skip to content

Commit d6e5a67

Browse files
bug: include name and dob in DiffUtil content comparison
Closes #1308
1 parent 311328a commit d6e5a67

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

demo/src/main/java/com/google/android/fhir/demo/PatientItemRecyclerViewAdapter.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021-2023 Google LLC
2+
* Copyright 2021-2025 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,7 +37,11 @@ class PatientItemRecyclerViewAdapter(
3737
override fun areContentsTheSame(
3838
oldItem: PatientListViewModel.PatientItem,
3939
newItem: PatientListViewModel.PatientItem,
40-
): Boolean = oldItem.id == newItem.id && oldItem.risk == newItem.risk
40+
): Boolean =
41+
oldItem.id == newItem.id &&
42+
oldItem.risk == newItem.risk &&
43+
oldItem.name == newItem.name &&
44+
oldItem.dob == newItem.dob
4145
}
4246

4347
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PatientItemViewHolder {

0 commit comments

Comments
 (0)