Skip to content

Commit

Permalink
Merge pull request #8615 from brave/fix_privacy_report_theme_colors
Browse files Browse the repository at this point in the history
Fix privacy report theme color
  • Loading branch information
deeppandya committed Apr 23, 2021
2 parents 18f3f06 + f7ee42b commit ec563f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewParent;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
import android.widget.ImageView;
Expand All @@ -30,10 +30,10 @@
import android.widget.RadioGroup;
import android.widget.TextView;

import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import androidx.fragment.app.FragmentTransaction;
import androidx.fragment.app.FragmentManager;

import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.bottomsheet.BottomSheetDialog;
Expand All @@ -49,6 +49,7 @@
import org.chromium.chrome.browser.local_database.BraveStatsTable;
import org.chromium.chrome.browser.local_database.DatabaseHelper;
import org.chromium.chrome.browser.local_database.SavedBandwidthTable;
import org.chromium.chrome.browser.night_mode.GlobalNightModeStateProviderHolder;
import org.chromium.chrome.browser.onboarding.OnboardingPrefManager;
import org.chromium.chrome.browser.util.ConfigurationUtils;
import org.chromium.ui.base.DeviceFormFactor;
Expand Down Expand Up @@ -330,11 +331,18 @@ protected void onPostExecute(Void result) {
TextView mSiteText = (TextView) layout.findViewById(R.id.site_text);

mTrackerCountText.setText(String.valueOf(statPair.second));
mTrackerCountText.setTextColor(
mContext.getResources().getColor(R.color.brave_stats_text_color));
mSiteText.setText(statPair.first);
mSiteText.setTextColor(
mContext.getResources().getColor(R.color.brave_stats_text_color));
if (GlobalNightModeStateProviderHolder.getInstance().isInNightMode()) {
mSiteText.setTextColor(mContext.getResources().getColor(
R.color.brave_stats_text_dark_color));
mTrackerCountText.setTextColor(mContext.getResources().getColor(
R.color.brave_stats_text_dark_color));
} else {
mSiteText.setTextColor(mContext.getResources().getColor(
R.color.brave_stats_text_light_color));
mTrackerCountText.setTextColor(mContext.getResources().getColor(
R.color.brave_stats_text_light_color));
}

rootView.addView(layout);
}
Expand Down
2 changes: 2 additions & 0 deletions android/java/res/values/brave_colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@

<color name="brave_stats_title_color">#868E96</color>
<color name="brave_stats_text_color">#212529</color>
<color name="brave_stats_text_light_color">#212529</color>
<color name="brave_stats_text_dark_color">#F0F2FF</color>
<color name="ntp_stats_bg_color">#212529</color>
<color name="ntp_stats_text_color">#C2C4CF</color>

Expand Down

0 comments on commit ec563f2

Please sign in to comment.