mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
move community activity hyperlink theming to m3
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
3c5268201a
commit
bdcfbbb377
3 changed files with 11 additions and 7 deletions
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue