From 70c40d8956b11c10169e86cceed9390fac04b4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?He=CC=81ctor=20Abraham?= Date: Mon, 12 Feb 2024 17:39:08 +0100 Subject: [PATCH] Added Gravatar Sync Info When the user updates any of the fields, we need some time until the change is propagated to Gravatar. We want to inform the user about that. Also, the user can dismiss that notification with a done button. --- .../android/ui/prefs/MyProfileFragment.java | 8 ++++ .../main/res/layout/my_profile_fragment.xml | 48 ++++++++++++++++++- WordPress/src/main/res/values/strings.xml | 2 + 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/MyProfileFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/MyProfileFragment.java index be7827f7b552..c0c03bdb1e22 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/MyProfileFragment.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/MyProfileFragment.java @@ -40,6 +40,8 @@ public class MyProfileFragment extends Fragment implements TextInputDialogFragme private WPTextView mDisplayName; private WPTextView mAboutMe; private Button mLearMoreAtGravatar; + private Button mGravatarSyncButton; + private View mGravatarSyncContainer; @Inject Dispatcher mDispatcher; @Inject AccountStore mAccountStore; @@ -90,6 +92,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa mDisplayName = rootView.findViewById(R.id.display_name); mAboutMe = rootView.findViewById(R.id.about_me); mLearMoreAtGravatar = rootView.findViewById(R.id.learn_more_at_gravatar); + mGravatarSyncButton = rootView.findViewById(R.id.gravatar_sync_button); + mGravatarSyncContainer = rootView.findViewById(R.id.gravatar_sync_container); rootView.findViewById(R.id.first_name_row).setOnClickListener( createOnClickListener( @@ -118,6 +122,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa mLearMoreAtGravatar.setOnClickListener(v -> { ActivityLauncher.openUrlExternal(getActivity(), GRAVATAR_URL); }); + mGravatarSyncButton.setOnClickListener(v -> { + mGravatarSyncContainer.setVisibility(View.GONE); + }); return rootView; } @@ -182,6 +189,7 @@ private void updateMyProfileForLabel(TextView textView) { payload.params.put(restParamForTextView(textView), textView.getText().toString()); mDispatcher.dispatch(AccountActionBuilder.newPushSettingsAction(payload)); trackSettingsDidChange(restParamForTextView(textView)); + mGravatarSyncContainer.setVisibility(View.VISIBLE); } private void trackSettingsDidChange(String fieldName) { diff --git a/WordPress/src/main/res/layout/my_profile_fragment.xml b/WordPress/src/main/res/layout/my_profile_fragment.xml index 6bb3b9be7b62..4377bcf70d37 100644 --- a/WordPress/src/main/res/layout/my_profile_fragment.xml +++ b/WordPress/src/main/res/layout/my_profile_fragment.xml @@ -1,8 +1,10 @@ + android:layout_height="match_parent" + android:animateLayoutChanges="true"> @@ -121,4 +124,45 @@ app:icon="@drawable/ic_external_white_24dp" /> + + + + + + + + diff --git a/WordPress/src/main/res/values/strings.xml b/WordPress/src/main/res/values/strings.xml index f3887828dd20..94489959c095 100644 --- a/WordPress/src/main/res/values/strings.xml +++ b/WordPress/src/main/res/values/strings.xml @@ -2871,6 +2871,8 @@ Checking purchases "Gravatar keeps your profile information safe and up to date, automatically syncing any updates made here with your Gravatar profile." Learn more on Gravatar.com + Updates might take some time to sync with your Gravatar profile. + Done Account Settings