From 531b8ead0484b76910562891c809bcc7a339240d Mon Sep 17 00:00:00 2001 From: Grishka Date: Sun, 27 Nov 2022 13:14:31 +0300 Subject: [PATCH] Make verified fields more like on iOS --- .../android/fragments/ProfileAboutFragment.java | 16 +++++++++++++--- .../drawable/ic_fluent_checkmark_24_regular.xml | 3 +++ 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 mastodon/src/main/res/drawable/ic_fluent_checkmark_24_regular.xml diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileAboutFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileAboutFragment.java index 7b8c1f25..15b11215 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileAboutFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileAboutFragment.java @@ -220,9 +220,19 @@ public class ProfileAboutFragment extends Fragment implements WindowInsetsAwareF super.onBind(item); title.setText(item.parsedName); value.setText(item.parsedValue); - if(item.verifiedAt != null){ - background.getPaint().setARGB(255,213,228, 217); - itemView.setBackground(background); + if(item.verifiedAt!=null){ + background.getPaint().setColor(UiUtils.isDarkTheme() ? 0xFF49595a : 0xFFd7e3da); + int textColor=UiUtils.isDarkTheme() ? 0xFF89bb9c : 0xFF5b8e63; + value.setTextColor(textColor); + value.setLinkTextColor(textColor); + Drawable check=getResources().getDrawable(R.drawable.ic_fluent_checkmark_24_regular, getActivity().getTheme()).mutate(); + check.setTint(textColor); + value.setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, check, null); + }else{ + background.getPaint().setColor(UiUtils.getThemeColor(getActivity(), R.attr.colorBackgroundLight)); + value.setTextColor(UiUtils.getThemeColor(getActivity(), android.R.attr.textColorPrimary)); + value.setLinkTextColor(UiUtils.getThemeColor(getActivity(), android.R.attr.colorAccent)); + value.setCompoundDrawables(null, null, null, null); } } diff --git a/mastodon/src/main/res/drawable/ic_fluent_checkmark_24_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_checkmark_24_regular.xml new file mode 100644 index 00000000..94ede83b --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_checkmark_24_regular.xml @@ -0,0 +1,3 @@ + + +