From 7cc1ed9844161ce4dfbf75d53ea34d67d977d18f Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Fri, 1 Dec 2017 22:13:47 +0100 Subject: [PATCH] fix problem with spark buttons behaving weirdly --- .../com/keylesspalace/tusky/adapter/NotificationsAdapter.java | 2 +- .../java/com/keylesspalace/tusky/adapter/TimelineAdapter.java | 2 +- .../keylesspalace/tusky/fragment/NotificationsFragment.java | 4 ++-- .../com/keylesspalace/tusky/fragment/TimelineFragment.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java index f116473fa..9638c3801 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java @@ -204,7 +204,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter { public void updateItemWithNotify(int position, NotificationViewData notification, boolean notifyAdapter) { notifications.set(position, notification); - if (notifyAdapter) notifyDataSetChanged(); + if (notifyAdapter) notifyItemChanged(position); } public void addItems(List newNotifications) { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/TimelineAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/TimelineAdapter.java index 1041551da..d3c69f8d9 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/TimelineAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/TimelineAdapter.java @@ -122,7 +122,7 @@ public class TimelineAdapter extends RecyclerView.Adapter { public void changeItem(int position, StatusViewData newData, boolean notifyAdapter) { statuses.set(position, newData); - if (notifyAdapter) notifyDataSetChanged(); + if (notifyAdapter) notifyItemChanged(position); } public void clear() { diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java index 772467f13..7bf0126d2 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java @@ -288,7 +288,7 @@ public class NotificationsFragment extends SFragment implements notifications.setPairedItem(position, newViewData); - adapter.updateItemWithNotify(position, newViewData, true); + adapter.updateItemWithNotify(position, newViewData, false); } } @@ -325,7 +325,7 @@ public class NotificationsFragment extends SFragment implements notifications.setPairedItem(position, newViewData); - adapter.updateItemWithNotify(position, newViewData, true); + adapter.updateItemWithNotify(position, newViewData, false); } } diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java index f3294d58e..c5ddfafa6 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java @@ -312,7 +312,7 @@ public class TimelineFragment extends SFragment implements .setReblogged(reblog) .createStatusViewData(); statuses.setPairedItem(actual.second, newViewData); - adapter.changeItem(actual.second, newViewData, true); + adapter.changeItem(actual.second, newViewData, false); } } @@ -347,7 +347,7 @@ public class TimelineFragment extends SFragment implements .setFavourited(favourite) .createStatusViewData(); statuses.setPairedItem(actual.second, newViewData); - adapter.changeItem(actual.second, newViewData, true); + adapter.changeItem(actual.second, newViewData, false); } }