diff --git a/app/src/main/java/com/google/android/material/bottomsheet/ViewPagerBottomSheetBehavior.java b/app/src/main/java/com/google/android/material/bottomsheet/ViewPagerBottomSheetBehavior.java index 1667006a5..5e74a5834 100644 --- a/app/src/main/java/com/google/android/material/bottomsheet/ViewPagerBottomSheetBehavior.java +++ b/app/src/main/java/com/google/android/material/bottomsheet/ViewPagerBottomSheetBehavior.java @@ -4,8 +4,9 @@ import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; + import androidx.core.view.ViewCompat; -import androidx.viewpager.widget.ViewPager; +import androidx.viewpager2.widget.ViewPager2; import java.lang.ref.WeakReference; @@ -31,8 +32,8 @@ public class ViewPagerBottomSheetBehavior extends BottomSheetBeh return view; } - if (view instanceof ViewPager) { - ViewPager viewPager = (ViewPager) view; + if (view instanceof ViewPager2) { + ViewPager2 viewPager = (ViewPager2) view; View currentViewPagerChild = viewPager.getChildAt(viewPager.getCurrentItem()); if (currentViewPagerChild != null) { return findScrollingChild(currentViewPagerChild); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java index ee63fbcf4..4ccc53118 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java @@ -9,9 +9,6 @@ import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentManager; -import androidx.fragment.app.FragmentPagerAdapter; -import androidx.viewpager.widget.ViewPager; import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.widget.ViewPager2;