move community activity hyperlink theming to m3

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-09-26 19:31:09 +02:00 committed by Álvaro Brey
parent 3c5268201a
commit bdcfbbb377
No known key found for this signature in database
GPG key ID: 2585783189A62105
3 changed files with 11 additions and 7 deletions

View file

@ -64,7 +64,9 @@ public class CommunityActivity extends DrawerActivity {
contributeForumView.setMovementMethod(LinkMovementMethod.getInstance());
contributeForumView.setText(Html.fromHtml(getString(R.string.community_contribute_forum_text) + " " +
getString(R.string.community_contribute_forum_text_link,
themeColorUtils.primaryColorToHexString(this),
viewThemeUtils
.files
.primaryColorToHexString(this),
getString(R.string.help_link),
getString(R.string.community_contribute_forum_forum))));
@ -72,7 +74,7 @@ public class CommunityActivity extends DrawerActivity {
contributeTranslationView.setMovementMethod(LinkMovementMethod.getInstance());
contributeTranslationView.setText(Html.fromHtml(
getString(R.string.community_contribute_translate_link,
themeColorUtils.primaryColorToHexString(this),
viewThemeUtils.files.primaryColorToHexString(this),
getString(R.string.translation_link),
getString(R.string.community_contribute_translate_translate)) + " " +
getString(R.string.community_contribute_translate_text)));
@ -82,7 +84,7 @@ public class CommunityActivity extends DrawerActivity {
contributeGithubView.setText(Html.fromHtml(
getString(R.string.community_contribute_github_text,
getString(R.string.community_contribute_github_text_link,
themeColorUtils.primaryColorToHexString(this),
viewThemeUtils.files.primaryColorToHexString(this),
getString(R.string.contributing_link)))));
MaterialButton reportButton = binding.communityTestingReport;

View file

@ -294,10 +294,6 @@ public class ThemeColorUtils {
return Configuration.UI_MODE_NIGHT_YES == nightModeFlag;
}
public String primaryColorToHexString(Context context) {
return String.format("#%06X", 0xFFFFFF & primaryColor(context, true));
}
public int unchangedPrimaryColor(Account account, Context context) {
try {
return Color.parseColor(getCapability(account, context).getServerColor());

View file

@ -199,6 +199,12 @@ class FilesSpecificViewThemeUtils @Inject constructor(
}
}
fun primaryColorToHexString(context: Context): String {
return withScheme(context) { scheme ->
String.format("#%06X", 0xFFFFFF and scheme.primary)
}
}
companion object {
private val TAG = FilesSpecificViewThemeUtils::class.simpleName