Broadcasts now used everywhere for signalling to remove accounts' posts instead of listeners.
This commit is contained in:
parent
19f140f9c6
commit
9c56f0e7bc
15 changed files with 64 additions and 127 deletions
|
@ -209,11 +209,13 @@ public class NotificationsAdapter extends RecyclerView.Adapter implements Adapte
|
|||
notifyItemRangeInserted(end, new_notifications.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeItem(int position) {
|
||||
notifications.remove(position);
|
||||
notifyItemChanged(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAllByAccountId(String id) {
|
||||
for (int i = 0; i < notifications.size();) {
|
||||
Notification notification = notifications.get(i);
|
||||
|
|
|
@ -62,11 +62,13 @@ public class ThreadAdapter extends RecyclerView.Adapter implements AdapterItemRe
|
|||
return statuses.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeItem(int position) {
|
||||
statuses.remove(position);
|
||||
notifyItemRemoved(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAllByAccountId(String accountId) {
|
||||
for (int i = 0; i < statuses.size();) {
|
||||
Status status = statuses.get(i);
|
||||
|
|
|
@ -140,16 +140,13 @@ public class TimelineAdapter extends RecyclerView.Adapter implements AdapterItem
|
|||
notifyItemRangeInserted(end, newStatuses.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeItem(int position) {
|
||||
statuses.remove(position);
|
||||
notifyItemRemoved(position);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
statuses.clear();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAllByAccountId(String accountId) {
|
||||
for (int i = 0; i < statuses.size();) {
|
||||
Status status = statuses.get(i);
|
||||
|
@ -162,6 +159,11 @@ public class TimelineAdapter extends RecyclerView.Adapter implements AdapterItem
|
|||
}
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
statuses.clear();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Status getItem(int position) {
|
||||
if (position >= 0 && position < statuses.size()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue