- // Create the `ForegroundColorSpan`. We have to use the deprecated `getColor` until API >= 23.
- ForegroundColorSpan blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));
- ForegroundColorSpan redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_a700));
+ // Create a red `ForegroundColorSpan`. We have to use the deprecated `getColor` until API >= 23.
+ @SuppressWarnings("deprecation") ForegroundColorSpan redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_a700));
+
+ // Create a blue `ForegroundColorSpan`.
+ ForegroundColorSpan blueColorSpan;
+
+ // Set `blueColorSpan` according to the theme. We have to use the deprecated `getColor()` until API >= 23.
+ if (MainWebViewActivity.darkTheme) {
+ //noinspection deprecation
+ blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_400));
+ } else {
+ //noinspection deprecation
+ blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));
+ }