fix message comparator
This commit is contained in:
parent
cc07f86bf4
commit
d52cbb8e8c
|
@ -13,7 +13,6 @@ public class ChatOverviewComparator extends DiffUtil.ItemCallback<ChatOverviewIt
|
|||
@Override
|
||||
public boolean areItemsTheSame(
|
||||
@NonNull ChatOverviewItem oldItem, @NonNull ChatOverviewItem newItem) {
|
||||
// LOGGER.info("areItemsTheSame({},{})", oldItem.id, newItem.id);
|
||||
return oldItem.id == newItem.id;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,10 +21,10 @@ public class MessageComparator extends DiffUtil.ItemCallback<MessageWithContentR
|
|||
public boolean areContentsTheSame(
|
||||
@NonNull MessageWithContentReactions oldItem,
|
||||
@NonNull MessageWithContentReactions newItem) {
|
||||
final var equals = oldItem.equals(newItem);
|
||||
if (!equals) {
|
||||
final var areContentsTheSame = oldItem.equals(newItem);
|
||||
if (!areContentsTheSame) {
|
||||
LOGGER.info("Message {} got modified", oldItem.id);
|
||||
}
|
||||
return false;
|
||||
return areContentsTheSame;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,10 +53,7 @@ public class ChatFragment extends Fragment {
|
|||
.getMessages()
|
||||
.observe(
|
||||
getViewLifecycleOwner(),
|
||||
pagingData -> {
|
||||
LOGGER.info("submitData()");
|
||||
messageAdapter.submitData(getLifecycle(), pagingData);
|
||||
});
|
||||
pagingData -> messageAdapter.submitData(getLifecycle(), pagingData));
|
||||
this.binding.materialToolbar.setNavigationOnClickListener(
|
||||
view -> {
|
||||
NavControllers.findNavController(requireActivity(), R.id.nav_host_fragment)
|
||||
|
|
|
@ -39,7 +39,7 @@ public class ChatViewModel extends AndroidViewModel {
|
|||
chatId -> {
|
||||
final Pager<Integer, MessageWithContentReactions> pager =
|
||||
new Pager<>(
|
||||
new PagingConfig(30),
|
||||
new PagingConfig(50),
|
||||
() -> chatRepository.getMessages(chatId));
|
||||
return PagingLiveData.getLiveData(pager);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue