use of com.winsonchiu.reader.links.LinksController in project Reader by TheKeeperOfPie.
the class FragmentComments method subscribe.
private void subscribe() {
CommentsTopModel data = controllerCommentsTop.getEventHolder().getData().getValue();
Link linkStart = data.getLinkModel().getLink();
Source source = data.getSource();
LinksController linksController = getLinksControllerFromSource(source);
if (linksController == null) {
this.linksModel.getLinks().clear();
this.linksModel.getLinks().add(linkStart);
} else {
subscriptionLinks = linksController.getEventHolder().getData().subscribe(linksModel -> {
this.linksModel = linksModel;
if (indexStart == 0) {
indexStart = UtilsList.indexOf(linksModel.getLinks(), link -> linkStart.getId().equals(link.getId()));
positionCurrent = indexStart;
}
adapterComments.notifyDataSetChanged();
pagerComments.setCurrentItem(positionCurrent, false);
});
}
}
Aggregations