[UI] Add Pull & Release Counter Badge to TabLable #350

Merged
mmarif merged 10 commits from 6543/GitNex:218-PR-Tab_OpenNumber into master 2020-04-04 19:20:30 +00:00
Showing only changes of commit 578283b10e - Show all commits

@ -329,6 +329,8 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
private void getRepoInfo(String instanceUrl, String token, final String owner, String repo) {
TinyDB tinyDb = new TinyDB(getApplicationContext());
Call<UserRepositories> call = RetrofitClient
.getInstance(instanceUrl, getApplicationContext())
.getApiInterface()
@ -345,21 +347,23 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF

This line is the culprit from my testing. It need to be inside if statement like others.

This line is the culprit from my testing. It need to be inside if statement like others.
Outdated
Review

I'll fix it

I'll fix it
if (response.code() == 200) {
assert repoInfo != null;
if(tinyDb.getBoolean("enableCounterBadges")) {
assert repoInfo != null;
if(repoInfo.getOpen_pull_count() != null) {
textViewBadgeIssue.setVisibility(View.VISIBLE);
textViewBadgeIssue.setText(repoInfo.getOpen_issues_count());
}
if(repoInfo.getOpen_pull_count() != null) {

if(repoInfo.getOpen_pull_count() != null) { typo error here. Suppose to be getOpen_issues_count()

`if(repoInfo.getOpen_pull_count() != null) {` typo error here. Suppose to be `getOpen_issues_count()`
textViewBadgeIssue.setVisibility(View.VISIBLE);
textViewBadgeIssue.setText(repoInfo.getOpen_issues_count());
}
if(repoInfo.getOpen_pull_count() != null) {
textViewBadgePull.setVisibility(View.VISIBLE);
textViewBadgePull.setText(repoInfo.getOpen_pull_count());
}
if(repoInfo.getOpen_pull_count() != null) {
textViewBadgePull.setVisibility(View.VISIBLE);
textViewBadgePull.setText(repoInfo.getOpen_pull_count());
}
if(repoInfo.getRelease_count() != null) {
textViewBadgeRelease.setVisibility(View.VISIBLE);
textViewBadgeRelease.setText(repoInfo.getRelease_count());
if(repoInfo.getRelease_count() != null) {
textViewBadgeRelease.setVisibility(View.VISIBLE);
textViewBadgeRelease.setText(repoInfo.getRelease_count());
}
}
}