Skip to content

Commit

Permalink
Clean up getLicenseStylesheet().
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Seneviratne committed Jul 25, 2022
1 parent 11b9d75 commit 5e193c1
Showing 1 changed file with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,14 @@ private fun getFormattedLicense(context: Context, license: License): String {
*/
private fun getLicenseStylesheet(context: Context): String {
val isLightTheme = ThemeHelper.isLightThemeSelected(context)
return (
"body{padding:12px 15px;margin:0;" + "background:#" + getHexRGBColor(
context,
if (isLightTheme) R.color.light_license_background_color
else R.color.dark_license_background_color
) + ";" + "color:#" + getHexRGBColor(
context,
if (isLightTheme) R.color.light_license_text_color
else R.color.dark_license_text_color
) + "}" + "a[href]{color:#" + getHexRGBColor(
context,
if (isLightTheme) R.color.light_youtube_primary_color
else R.color.dark_youtube_primary_color
) + "}" + "pre{white-space:pre-wrap}"
)
val licenseBackgroundColor = getHexRGBColor(context,
if (isLightTheme) R.color.light_license_background_color else R.color.dark_license_background_color)
val licenseTextColor = getHexRGBColor(context,
if (isLightTheme) R.color.light_license_text_color else R.color.dark_license_text_color)
val youtubePrimaryColor = getHexRGBColor(context,
if (isLightTheme) R.color.light_youtube_primary_color else R.color.dark_youtube_primary_color)
return "body{padding:12px 15px;margin:0;background:#$licenseBackgroundColor;color:#$licenseTextColor}" +
"a[href]{color:#$youtubePrimaryColor}pre{white-space:pre-wrap}"
}

/**
Expand Down

0 comments on commit 5e193c1

Please sign in to comment.