mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-12 19:59:35 +01:00
Clean up getLicenseStylesheet().
This commit is contained in:
parent
a9095ca2ad
commit
4b7de86a92
@ -36,21 +36,17 @@ private fun getFormattedLicense(context: Context, license: License): String {
|
|||||||
*/
|
*/
|
||||||
private fun getLicenseStylesheet(context: Context): String {
|
private fun getLicenseStylesheet(context: Context): String {
|
||||||
val isLightTheme = ThemeHelper.isLightThemeSelected(context)
|
val isLightTheme = ThemeHelper.isLightThemeSelected(context)
|
||||||
return (
|
val licenseBackgroundColor = getHexRGBColor(
|
||||||
"body{padding:12px 15px;margin:0;" + "background:#" + getHexRGBColor(
|
context, if (isLightTheme) R.color.light_license_background_color else R.color.dark_license_background_color
|
||||||
context,
|
)
|
||||||
if (isLightTheme) R.color.light_license_background_color
|
val licenseTextColor = getHexRGBColor(
|
||||||
else R.color.dark_license_background_color
|
context, if (isLightTheme) R.color.light_license_text_color else R.color.dark_license_text_color
|
||||||
) + ";" + "color:#" + getHexRGBColor(
|
)
|
||||||
context,
|
val youtubePrimaryColor = getHexRGBColor(
|
||||||
if (isLightTheme) R.color.light_license_text_color
|
context, if (isLightTheme) R.color.light_youtube_primary_color else R.color.dark_youtube_primary_color
|
||||||
else R.color.dark_license_text_color
|
)
|
||||||
) + "}" + "a[href]{color:#" + getHexRGBColor(
|
return "body{padding:12px 15px;margin:0;background:#$licenseBackgroundColor;color:#$licenseTextColor}" +
|
||||||
context,
|
"a[href]{color:#$youtubePrimaryColor}pre{white-space:pre-wrap}"
|
||||||
if (isLightTheme) R.color.light_youtube_primary_color
|
|
||||||
else R.color.dark_youtube_primary_color
|
|
||||||
) + "}" + "pre{white-space:pre-wrap}"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user