use of com.fastaccess.data.dao.model.Release in project FastHub by k0shk0sh.
the class RepoReleasesFragment method onDownload.
@Override
public void onDownload(@NonNull Release item) {
ArrayList<SimpleUrlsModel> models = new ArrayList<>();
if (!InputHelper.isEmpty(item.getZipBallUrl())) {
String url = item.getZipBallUrl();
if (!url.endsWith(".tar.gz")) {
url = url + ".tar.gz";
}
models.add(new SimpleUrlsModel(getString(R.string.download_as_zip), url));
}
if (!InputHelper.isEmpty(item.getTarballUrl())) {
models.add(new SimpleUrlsModel(getString(R.string.download_as_tar), item.getTarballUrl()));
}
if (item.getAssets() != null && !item.getAssets().isEmpty()) {
ArrayList<SimpleUrlsModel> mapped = Stream.of(item.getAssets()).filter(value -> value != null && value.getBrowserDownloadUrl() != null).map(assetsModel -> new SimpleUrlsModel(String.format("%s (%s)", assetsModel.getName(), assetsModel.getDownloadCount()), assetsModel.getBrowserDownloadUrl())).collect(Collectors.toCollection(ArrayList::new));
if (mapped != null && !mapped.isEmpty()) {
models.addAll(mapped);
}
}
ListDialogView<SimpleUrlsModel> dialogView = new ListDialogView<>();
dialogView.initArguments(getString(R.string.releases), models);
dialogView.show(getChildFragmentManager(), "ListDialogView");
}
use of com.fastaccess.data.dao.model.Release in project FastHub by k0shk0sh.
the class FeedsViewHolder method appendReleaseEvent.
private void appendReleaseEvent(SpannableBuilder spannableBuilder, Event eventsModel) {
Release release = eventsModel.getPayload().getRelease();
spannableBuilder.bold("released").append(" ").append(release.getName()).append(" ").append(eventsModel.getRepo().getName());
}
Aggregations