@Override public void onDownloadComplete(DownloadItem item) { LOGD("download", "completed"); String localPath = getLocalPath(item.getItemId()); VideoItem videoItem = findItemByMediaId(item.getItemId()); if (localPath != null && videoItem != null) { LocalAssetsManager.registerAsset( mContext, videoItem.config, videoItem.flavorId, localPath, new LocalAssetsManager.AssetRegistrationListener() { @Override public void onRegistered(String assetPath) { LOGD("download", "Register successful"); } @Override public void onFailed(String assetPath, Exception error) { LOGD("download", "Register failed " + error.getMessage()); } }); } DownloadItemView view = getView(getItemPositionByMediaId(item.getItemId())); if (view != null) { view.bind(item); } }
@Override public void onDownloadStop(DownloadItem item) { LOGD("onDownloadStop", ""); DownloadItemView view = getView(getItemPositionByMediaId(item.getItemId())); if (view != null) { view.bind(item); } }
@Override public void onProgressChange(DownloadItem item, long downloadedBytes) { LOGD("onProgressChange", "downloaded " + downloadedBytes); DownloadItemView view = getView(getItemPositionByMediaId(item.getItemId())); if (view != null) { view.bind(item); } }