From 394699c07267ae95648d12359270186537a7cf8b Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Sun, 22 Jan 2023 18:26:53 -0300 Subject: [PATCH] Fixing fab behavior on profile page when notes are selected --- .../android/fragments/ProfileFragment.java | 20 ++++++++++++++++++- 1 file changed, 19 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 32050ac73..e77314e75 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -225,13 +225,31 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList noteEdit.setOnFocusChangeListener((v, hasFocus) -> { if (hasFocus) { - fab.setVisibility(View.GONE); + fab.setVisibility(View.INVISIBLE); + TranslateAnimation animate = new TranslateAnimation( + 0, + 0, + 0, + fab.getHeight() * 2); + animate.setDuration(300); + animate.setFillAfter(true); + fab.startAnimation(animate); + noteEditConfirm.setVisibility(View.VISIBLE); noteEditConfirm.animate() .alpha(1.0f) .setDuration(700); } else { fab.setVisibility(View.VISIBLE); + TranslateAnimation animate = new TranslateAnimation( + 0, + 0, + fab.getHeight() * 2, + 0); + animate.setDuration(300); + animate.setFillAfter(true); + fab.startAnimation(animate); + noteEditConfirm.animate() .alpha(0.0f) .setDuration(700);