コード例 #1
0
  @Override
  public void onDownloadFailed(DownloadException de) {

    downloadStatus.setDe(de);
    downloadStatus.setStatus(DownloadStatus.STATUS_FAILED);
    downloadStatusDelivery.post(downloadStatus);
  }
コード例 #2
0
  @Override
  public void onStarted() {

    // 已经开始,设置状态
    downloadStatus.setStatus(DownloadStatus.STATUS_STARTED);
    downloadStatus.getCallBack().onStarted();
  }
コード例 #3
0
 @Override
 public void onDownloadProgress(long finished, long length, int percent) {
   downloadStatus.setFinished(finished);
   downloadStatus.setLength(length);
   downloadStatus.setPercent(percent);
   downloadStatus.setStatus(DownloadStatus.STATUS_PROGRESS);
   downloadStatusDelivery.post(downloadStatus);
 }
コード例 #4
0
  @Override
  public void onConnected(long time, long length, boolean acceptRanges) {

    downloadStatus.setTime(time);
    //        downloadStatus.setLength(length);
    downloadStatus.setAcceptRanges(acceptRanges);
    downloadStatus.setStatus(DownloadStatus.STATUS_CONNECTED);
    downloadStatusDelivery.post(downloadStatus);
  }
コード例 #5
0
 @Override
 public void onDownloadPaused() {
   downloadStatus.setStatus(DownloadStatus.STATUS_PAUSED);
   downloadStatusDelivery.post(downloadStatus);
 }
コード例 #6
0
  @Override
  public void onDownloadCompleted() {

    downloadStatus.setStatus(DownloadStatus.STATUS_COMPLETED);
    downloadStatusDelivery.post(downloadStatus);
  }
コード例 #7
0
  @Override
  public void onDownloadCanceled() {

    downloadStatus.setStatus(DownloadStatus.STATUS_CANCELED);
    downloadStatusDelivery.post(downloadStatus);
  }
コード例 #8
0
  @Override
  public void onConnecting() {

    downloadStatus.setStatus(DownloadStatus.STATUS_CONNECTING);
    downloadStatusDelivery.post(downloadStatus);
  }
コード例 #9
0
 public DownloadResponseImpl(DownloadStatusDelivery downloadStatusDelivery, CallBack callBack) {
   this.downloadStatusDelivery = downloadStatusDelivery;
   downloadStatus = new DownloadStatus();
   downloadStatus.setCallBack(callBack);
 }