diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2015-12-28 20:01:52 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-01-07 23:16:01 +0100 |
commit | 620afa3f7687785d16d598452bdc27eea0d86834 (patch) | |
tree | 8267f6b9d0fb7fdbb08089c0577d11ea051f2d6a | |
parent | 1995e70bd5faeac3bfb458b9090a9f2c2226ead5 (diff) | |
download | AntennaPod-620afa3f7687785d16d598452bdc27eea0d86834.zip |
Replacement for deprecated support library method
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java | 6 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java index 091f4c843..9ccb0fbe3 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java @@ -10,6 +10,7 @@ import android.support.v4.view.MenuItemCompat; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SearchView; +import android.support.v7.widget.SimpleItemAnimator; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; @@ -303,7 +304,10 @@ public class AllEpisodesFragment extends Fragment { View root = inflater.inflate(fragmentResource, container, false); recyclerView = (RecyclerView) root.findViewById(android.R.id.list); - recyclerView.getItemAnimator().setSupportsChangeAnimations(false); + RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator(); + if (animator instanceof SimpleItemAnimator) { + ((SimpleItemAnimator) animator).setSupportsChangeAnimations(false); + } layoutManager = new LinearLayoutManager(getActivity()); recyclerView.setLayoutManager(layoutManager); recyclerView.setHasFixedSize(true); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index 1271887b1..cc6b44f6a 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -10,6 +10,7 @@ import android.support.v4.view.MenuItemCompat; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SearchView; +import android.support.v7.widget.SimpleItemAnimator; import android.support.v7.widget.helper.ItemTouchHelper; import android.util.Log; import android.view.LayoutInflater; @@ -365,7 +366,10 @@ public class QueueFragment extends Fragment { View root = inflater.inflate(R.layout.queue_fragment, container, false); infoBar = (TextView) root.findViewById(R.id.info_bar); recyclerView = (RecyclerView) root.findViewById(R.id.recyclerView); - recyclerView.getItemAnimator().setSupportsChangeAnimations(false); + RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator(); + if (animator instanceof SimpleItemAnimator) { + ((SimpleItemAnimator) animator).setSupportsChangeAnimations(false); + } layoutManager = new LinearLayoutManager(getActivity()); recyclerView.setLayoutManager(layoutManager); recyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getActivity()).build()); |