salario07 / ViewPagerBottomSheet

a library based on laenger view pager bottom sheet, compatible with viewpager2
Apache License 2.0
3 stars 2 forks source link

Does this support viewpager2? #1

Open Priyanthi44 opened 2 years ago

Priyanthi44 commented 2 years ago

Brilliant work... Thank you... I am reluctant to roll back to viewpager as the number of tabs cannot be known beforehand. I can see BottomSheetUtils.setupWithViewPager() for view pager 2 but it cannot be applied to the project. Please guide me on how to get this working. Thanks

james602152002 commented 1 year ago

use his jitpack implementation his READ.me content is branch of aenger/ViewPagerBottomSheet

https://jitpack.io/#salario07/ViewPagerBottomSheet/1.0.4 dependencies { implementation 'com.github.salario07.ViewPagerBottomSheet:vpbs:1.0.4' }

james602152002 commented 1 year ago

If use use android x youe need to change design_view_pager_bottom_sheet_dialog.xml to this `<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true">

<androidx.coordinatorlayout.widget.CoordinatorLayout
    android:id="@+id/coordinator"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <View
        android:id="@+id/touch_outside"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:importantForAccessibility="no"
        android:soundEffectsEnabled="false"
        tools:ignore="UnusedAttribute"/>

    <FrameLayout
        android:id="@+id/design_bottom_sheet"
        style="?attr/bottomSheetStyle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|top"
        app:layout_behavior="@string/view_pager_bottom_sheet_behavior"/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>

`