From e8631e432aa9b1460e532afd044c82c210d74698 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Fri, 29 Sep 2023 19:15:53 -0300 Subject: [PATCH] fix: fix toolbar oopsie --- .../android/fragments/MastodonRecyclerFragment.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/MastodonRecyclerFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/MastodonRecyclerFragment.java index 24521f759d..fc805457a4 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/MastodonRecyclerFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/MastodonRecyclerFragment.java @@ -40,11 +40,13 @@ protected List getViewsForElevationEffect(){ @CallSuper public void onViewCreated(View view, Bundle savedInstanceState){ super.onViewCreated(view, savedInstanceState); - if(wantsElevationOnScrollEffect()) + if (getParentFragment() instanceof HasElevationOnScrollListener elevator) + list.addOnScrollListener(elevator.getElevationOnScrollListener()); + else if(wantsElevationOnScrollEffect()) list.addOnScrollListener(elevationOnScrollListener=new ElevationOnScrollListener((FragmentRootLinearLayout) view, getViewsForElevationEffect())); - if(refreshLayout!=null){ + if(refreshLayout!=null) setRefreshLayoutColors(refreshLayout); - } + } @Override