From 2c60f092f1208bc8caad8608df76dbbf21ba8c25 Mon Sep 17 00:00:00 2001 From: M M Arif Date: Thu, 19 Sep 2019 11:21:15 +0500 Subject: [PATCH] Fix open issues tab color bug, dim color for info tab headers --- .../org/mian/gitnex/activities/RepoDetailActivity.java | 10 +++++++++- app/src/main/res/layout/badge.xml | 2 +- app/src/main/res/layout/fragment_repo_info.xml | 4 ++-- app/src/main/res/values/colors.xml | 1 + 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java b/app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java index 0e845ef9..b1dded86 100644 --- a/app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java @@ -10,7 +10,9 @@ import androidx.fragment.app.FragmentStatePagerAdapter; import androidx.viewpager.widget.ViewPager; import retrofit2.Call; import retrofit2.Callback; +import android.annotation.SuppressLint; import android.content.Intent; +import android.content.res.ColorStateList; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; @@ -80,13 +82,19 @@ public class RepoDetailActivity extends AppCompatActivity implements RepoBottomS if(tinyDb.getBoolean("enableCounterIssueBadge")) { - View tabHeader = LayoutInflater.from(this).inflate(R.layout.badge, null); + @SuppressLint("InflateParams") View tabHeader = LayoutInflater.from(this).inflate(R.layout.badge, null); textViewBadge = tabHeader.findViewById(R.id.counterBadge); if(!tinyDb.getString("issuesCounter").isEmpty()) { getRepoInfo(instanceUrl, Authorization.returnAuthentication(getApplicationContext(), loginUid, instanceToken), repoOwner, repoName1); } Objects.requireNonNull(tabLayout.getTabAt(1)).setCustomView(tabHeader); + TabLayout.Tab tabOpenIssues = tabLayout.getTabAt(1); + ColorStateList textColor = tabLayout.getTabTextColors(); + assert tabOpenIssues != null; + TextView openIssueTabView = Objects.requireNonNull(tabOpenIssues.getCustomView()).findViewById(R.id.counterBadgeText); + openIssueTabView.setTextColor(textColor); + } } diff --git a/app/src/main/res/layout/badge.xml b/app/src/main/res/layout/badge.xml index 0d168e85..263e4596 100644 --- a/app/src/main/res/layout/badge.xml +++ b/app/src/main/res/layout/badge.xml @@ -13,7 +13,7 @@ android:textSize="16sp" app:textAllCaps="true" android:text="@string/tab_text_issues" - android:textColor="@color/white" /> + android:textColor="@color/lightGray" /> + android:textColor="@color/lightGray"/> + android:textColor="@color/lightGray"/> #009486 #e74c3c #3faef7 + #b6bbbf