diff --git a/CHANGELOG.md b/CHANGELOG.md index c05279f..e7689f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ Change Log ========== -## Version 2.0.0 *(2021-05-22)* 🚀 +## Version 2.0.0, 2.0.1 *(2021-05-22)* 🚀 * 🆕 Previous boring custom layout system removed. And view-binding supported custom layout system added. See `CarouselListener` in the sample app for details. 🎉 * 🆕 The carousel is now supported Infinite ∞ looping (Infinite Carousel) 🥳! It's default now. You can disable it by setting `infiniteCarousel` to `false`. diff --git a/README.md b/README.md index b96bfde..5242332 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ dependencies { // Optional: Circle Indicator (To fix the xml preview "Missing classes" error) implementation 'me.relex:circleindicator:2.1.6' - implementation 'org.imaginativeworld.whynotimagecarousel:whynotimagecarousel:2.0.0' + implementation 'org.imaginativeworld.whynotimagecarousel:whynotimagecarousel:2.0.1' } ``` diff --git a/gradle.properties b/gradle.properties index 5c7e63c..63feb68 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,7 +24,7 @@ kotlin.code.style=official # ---------------- GROUP=org.imaginativeworld.whynotimagecarousel POM_ARTIFACT_ID=whynotimagecarousel -VERSION_NAME=2.0.0 +VERSION_NAME=2.0.1 # ---------------- POM_NAME=Why Not! Image Carousel! POM_DESCRIPTION=An easy, super simple and customizable image carousel view for Android. diff --git a/whynotimagecarousel/src/main/java/org/imaginativeworld/whynotimagecarousel/ImageCarousel.kt b/whynotimagecarousel/src/main/java/org/imaginativeworld/whynotimagecarousel/ImageCarousel.kt index b5e653a..4910a48 100644 --- a/whynotimagecarousel/src/main/java/org/imaginativeworld/whynotimagecarousel/ImageCarousel.kt +++ b/whynotimagecarousel/src/main/java/org/imaginativeworld/whynotimagecarousel/ImageCarousel.kt @@ -507,7 +507,10 @@ class ImageCarousel( if (autoPlay) { initAutoPlay() } + } + @OnLifecycleEvent(Lifecycle.Event.ON_RESUME) + private fun onResumeCheckForStartPositionForInfiniteCarousel() { if (infiniteCarousel && !isCarouselCentered && dataSize != 0) { initStartPositionForInfiniteCarousel() } @@ -1091,6 +1094,8 @@ class ImageCarousel( 0 ) } + + isCarouselCentered = true } } }