Пример #1
0
  private void loadEntity(final Context context, final View view, final MutableEntity m) {
    final Downloadable downloadable = (Downloadable) m.getEntity();
    Object downloadParams = downloadable.onDownloadParams();

    Map<String, String> params = objToMap(downloadParams);

    String uri = downloadable.onDownLoadUrl(context);

    AbsDataProvider dataProvider = configurations.dataProvider;
    handleData(dataProvider, context, view, m, uri, downloadable, params);
  }
Пример #2
0
  private void handleDownloadObject(Context context, View view, MutableEntity m, Downloadable obj) {
    if (obj != null) {
      // TODO save in local?
      //            if(obj instanceof Entity){
      //                saveInDatabase((Entity) obj);
      //            }

      // TODO what about more
      //            if(obj instanceof Moreable){
      //                //clone params etc
      //                Object original = (Object) m.getEntity();
      //                if(original != null){
      //                    ((Moreable)obj).loadMore(original);
      //                }
      //                //set content
      ////				setContent(context, view, obj, m);
      //            }else{
      //            }

      setContent(context, view, obj);
      //			if(obj instanceof Downloadable){
      m.setEntity(obj);
      m.onStoring();
      obj.onDownLoadResponse(context);
      if (m.getNotifiable() != null) {
        m.getNotifiable().onDownloadResponse();
      }
      //			}
    }
  }