Fix issue #629 - Remove animations after refresh

maths
Thomas 2 years ago
parent a7563d2859
commit 269b83607c

@ -28,6 +28,7 @@ import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.SimpleItemAnimator;
import java.util.ArrayList;
import java.util.List;
@ -262,6 +263,11 @@ public class FragmentMastodonConversation extends Fragment implements Conversati
if (binding == null || !isAdded() || getActivity() == null) {
return;
}
RecyclerView.ItemAnimator animator = binding.recyclerView.getItemAnimator();
if (animator instanceof SimpleItemAnimator) {
((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
}
binding.loader.setVisibility(View.GONE);
binding.noAction.setVisibility(View.GONE);
binding.swipeContainer.setRefreshing(false);

@ -32,6 +32,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.SimpleItemAnimator;
import com.google.gson.annotations.SerializedName;
@ -253,6 +254,10 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
if (binding == null || !isAdded() || getActivity() == null) {
return;
}
RecyclerView.ItemAnimator animator = binding.recyclerView.getItemAnimator();
if (animator instanceof SimpleItemAnimator) {
((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
}
binding.loader.setVisibility(View.GONE);
binding.noAction.setVisibility(View.GONE);
binding.swipeContainer.setRefreshing(false);

@ -39,6 +39,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.SimpleItemAnimator;
import java.util.ArrayList;
import java.util.List;
@ -538,6 +539,10 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
if (statusReport != null) {
scrollToTop();
}
RecyclerView.ItemAnimator animator = binding.recyclerView.getItemAnimator();
if (animator instanceof SimpleItemAnimator) {
((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
}
mLayoutManager = new LinearLayoutManager(requireActivity());
mLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
binding.recyclerView.setLayoutManager(mLayoutManager);

Loading…
Cancel
Save