我如何将 Robobinding 的 AdapterView 与动态图像加载器(如 ion 或 picasso)一起使用?
我从 REST 服务获取位置列表,其中一个属性是我想在视图中显示的图像的 url。
这就是我所拥有的:
@org.robobinding.annotation.PresentationModel
public class LocationAdapterPresentationModel implements HasPresentationModelChangeSupport {
private final PresentationModelChangeSupport changeSupport;
private final Activity activity;
List<Location> locations;
public LocationAdapterPresentationModel(Activity activity, List<Location> locs){
locations = locs;
this.changeSupport = new PresentationModelChangeSupport(this);
this.activity = activity;
}
@ItemPresentationModel(LocationPresentationModel.class)
public List<Location> getLocations(){
return new ArrayList<Location>(locations);
}
public void refreshLocations() {
changeSupport.firePropertyChange("locations");
}
public void setLocations(List<Location> locs){
this.locations = locs;
}
@Override
public PresentationModelChangeSupport getPresentationModelChangeSupport() {
return changeSupport;
}
}
@org.robobinding.annotation.PresentationModel
public class LocationPresentationModel implements ItemPresentationModel<Location> {
...
my getter / setter
...
}
但是在哪里放置动态加载器。当它只是一个项目时会很容易,但是如何让它与位置列表中的每个条目一起工作?