Remove remained references of ViewPager

This commit is contained in:
Ebrahim Byagowi 2020-04-08 22:39:39 +04:30
parent 79e85363fb
commit 3a11f2842b
2 changed files with 4 additions and 6 deletions

View File

@ -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<V extends View> 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);

View File

@ -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;