use of com.gh4a.adapter.ReleaseAssetAdapter in project gh4a by slapperwan.
the class ReleaseInfoActivity method fillData.
private void fillData() {
ImageView gravatar = findViewById(R.id.iv_gravatar);
AvatarHandler.assignAvatar(gravatar, mRelease.author());
gravatar.setOnClickListener(this);
StyleableTextView details = findViewById(R.id.tv_releaseinfo);
String detailsText = getString(R.string.release_details, ApiHelpers.getUserLogin(this, mRelease.author()), StringUtils.formatRelativeTime(this, mRelease.createdAt(), true));
StringUtils.applyBoldTagsAndSetText(details, detailsText);
TextView releaseType = findViewById(R.id.tv_releasetype);
if (mRelease.draft()) {
releaseType.setText(R.string.release_type_draft);
} else if (mRelease.prerelease()) {
releaseType.setText(R.string.release_type_prerelease);
} else {
releaseType.setText(R.string.release_type_final);
}
TextView tag = findViewById(R.id.tv_releasetag);
tag.setText(getString(R.string.release_tag, mRelease.tagName()));
tag.setOnClickListener(this);
if (mRelease.assets() != null && !mRelease.assets().isEmpty()) {
RecyclerView downloadsList = findViewById(R.id.download_list);
ReleaseAssetAdapter adapter = new ReleaseAssetAdapter(this);
adapter.addAll(mRelease.assets());
adapter.setOnItemClickListener(this);
downloadsList.setLayoutManager(new LinearLayoutManager(this));
downloadsList.setNestedScrollingEnabled(false);
downloadsList.setAdapter(adapter);
} else {
findViewById(R.id.downloads).setVisibility(View.GONE);
}
}
Aggregations