From adefb0e567380c6df700c0de2fc83d546d034a0d Mon Sep 17 00:00:00 2001 From: FineFindus <63370021+FineFindus@users.noreply.github.com> Date: Fri, 13 Jan 2023 23:46:58 +0100 Subject: [PATCH] feat(profile/note): add fade animation to confirm icon --- .../android/fragments/ProfileFragment.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index 75485a655..6ca5d2fc4 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -482,7 +482,19 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList } noteEdit.setOnFocusChangeListener((v, hasFocus) -> { - noteEditConfirm.setVisibility(hasFocus ? View.VISIBLE : View.INVISIBLE); + if (hasFocus) { + noteEditConfirm.setVisibility(View.VISIBLE); + noteEditConfirm.animate() + .alpha(1.0f) + .setDuration(400); + + } else { + noteEditConfirm.setVisibility(View.INVISIBLE); + noteEditConfirm.animate() + .alpha(0.0f) + .setDuration(400); + + } }); noteEditConfirm.setOnClickListener((v -> {