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