Open Slake07 opened 4 years ago
Am also facing the same issue Am using RichLinkViewSkype and it is getting reset and blank view is set when we scroll through the recycler view for the second time !
The above solution by Slake07 seems to work thanks
@Slake07 Thanks for the solution it seems to work now
@PonnamKarthik You can close this issue now.
Actually here I am not using RichLinkview class as I am using Richpreview class and populating values to my own xml and getting same issues.
I solved it!!!
hey, do you guys just manually edited the code while downloading? I have implemented and the code is only readable? know any way bypassing? Or I also implement it manually?
@santhoshpr can you tell me how you edited the code? I am not familiar with manual installation.
@Mahato12nikhil can you help me build is not working for me
When in recycleview link fetch every time when scroll. So I also use a static map to hold url with metadata and check if previous url already successfully fetch for metadata or not.
private static Map<String, MetaData> linkMap=new HashMap<>();
public void setLink(String url, final ViewListener viewListener) {
MetaData data = linkMap.get(url);
if(data == null) {
main_url = url;
RichPreview richPreview = new RichPreview(new ResponseListener() {
@Override
public void onData(MetaData metaData) {
meta = metaData;
if (!meta.getTitle().isEmpty() || !meta.getTitle().equals("")) {
viewListener.onSuccess(true);
linkMap.put(url, metaData);
}
setData();
}
@Override
public void onError(Exception e) {
viewListener.onError(e);
}
});
richPreview.getPreview(url);
}else{
main_url = url;
meta = data;
viewListener.onSuccess(true);
setData();
}
}
When I am using RichLinkView into recycler view, it generates layout every time I scroll my recycler view.
I solved this issue with change in RichLinkView class. call below initView() method in every constructor of RichLinkView class.
Then call setData() method into setLink() method instend of initView().