Trinea / android-auto-scroll-view-pager

Android auto scroll viewpager or viewpager in viewpager
http://p.codekk.com/
Apache License 2.0
1.67k stars 670 forks source link

"ViewPager" not found error when project migrated to AndroidX #46

Open sanketthecoder opened 5 years ago

sanketthecoder commented 5 years ago

When I migrated my project to AndroidX it seems that "ViewPager" is not correctly referenced. When I separately try to create a ViewPager it's being referenced from "androidx.viewpager.widget", whereas in your library it is still referred from the support library as it pertains to the normal libraries and not AndroidX. Please provide an update or atleast a fix for this ASAP.

Screenshot 2019-03-29 at 1 18 29 PM

vhontar commented 5 years ago

Did you find any solution for this error?

Kiaorra commented 5 years ago

This is a problem that can be solved simply by changing the "import android.support.v4.view.ViewPager" to "import androidx.viewpager.widget.ViewPager". And "import android.support.v4.view.PagerAdapter" to "import androidx.viewpager.widget.PagerAdapter".

Kunu003 commented 5 years ago

If you are still facing the same issue then instead of implementing the library just copy AutoScrollViewPager.java, CustomDurationScroller.java classes, and change the below imports of AutoScrollViewPager.java "import android.support.v4.view.ViewPager" to "import androidx.viewpager.widget.ViewPager" "import android.support.v4.view.PagerAdapter" to "import androidx.viewpager.widget.PagerAdapter"

pzienowicz commented 5 years ago

I've created kotlin version of this library and there AndroidX is supported. Feel free to use it: https://github.com/pzienowicz/androidx-auto-scroll-view-pager

Trinea commented 4 years ago

I've created kotlin version of this library and there AndroidX is supported. Feel free to use it: https://github.com/pzienowicz/androidx-auto-scroll-view-pager

@pzienowicz Thanks for giving it a new life. I have linked to your library url in ReadMe