Broadcasts now cause a refresh on timelines after a post is composed instead of listeners.

As a side effect, pagers don't have to keep track of "registered fragments", which was a bad idea and caused crashes.
This commit is contained in:
Vavassor 2017-06-06 18:20:55 -04:00
commit a4ee128e26
8 changed files with 36 additions and 108 deletions

View file

@ -94,7 +94,7 @@ public class ViewThreadFragment extends SFragment implements
mastodonApi = null;
thisThreadsStatusId = null;
timelineReceiver = new TimelineReceiver(adapter);
timelineReceiver = new TimelineReceiver(adapter, this);
LocalBroadcastManager.getInstance(context.getApplicationContext())
.registerReceiver(timelineReceiver, TimelineReceiver.getFilter(null));
@ -187,12 +187,6 @@ public class ViewThreadFragment extends SFragment implements
sendThreadRequest(thisThreadsStatusId);
}
@Override
public void onSuccessfulStatus() {
onRefresh();
super.onSuccessfulStatus();
}
public void onReply(int position) {
super.reply(adapter.getItem(position));
}