Skip to content

Commit

Permalink
Merge pull request ImaginativeShohag#80 from ImaginativeShohag/dev
Browse files Browse the repository at this point in the history
Version 2.1.0
  • Loading branch information
ImaginativeShohag authored Mar 1, 2022
2 parents 45427d7 + be9f3ce commit 2e238b4
Show file tree
Hide file tree
Showing 14 changed files with 969 additions and 307 deletions.
81 changes: 61 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
Change Log
==========

## Version 2.0.6 *(2022-01-11)* 🚀
## Version 2.1.0 *(2022-03-01)* 🚀

* 🐞 Fixed [#74](https://github.com/ImaginativeShohag/Why-Not-Image-Carousel/issues/74):
Changing `infiniteCarousel` attribute now will call `initAdapter()`.

*Note:* Before changing the `infiniteCarousel`, it is better to clear the data-set, then change the
`infiniteCarousel` attribute and finally set the data. Changing the `infiniteCarousel` with existing
data can create undesirable issues.

Example code:

```kotlin
// Step 1: Clear existing data
carousel.setData(emptyList())

// Step 2: Change infiniteCarousel
carousel.infiniteCarousel = true // or false

// Step 3: Finally, set data
carousel.setData(itemList) // itemList is List<CarouselItem>
```

* ⬆ Dependencies upgraded to the latest version.
* 🆕 Some instrumented tests were added.

## Version 2.0.6 *(2022-01-11)*

* 🐞 Fixed [#72](https://github.com/ImaginativeShohag/Why-Not-Image-Carousel/issues/72): Indicator
will now indicate first item after data replace.
Expand Down Expand Up @@ -35,17 +60,32 @@ Change Log

## 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`.
* 🆕 Carousel now supports touch-to-pause auto-play. It is default now. You can disable it by setting `touchToPause` to `false`. 🎊
* 🆕 `carouselGravity` attribute added. So you can set carousel item view gravity `START` if you want.
* 🆕 Carousel padding attributes added. You can use `carouselPadding`, `carouselPaddingStart`, `carouselPaddingTop`, `carouselPaddingEnd`, and `carouselPaddingBottom` to set carousel padding.
* 🆕 The `ImageCarousel` is now a lifecycle component. You can register any lifecycle with `registerLifecycle()` method. It is recommended if you enable `autoPlay` and `infiniteCarousel`. So that when the application is in the pause state, the carousel will be paused and resumed on the app resume. It is also used to correctly initialize the infinite carousel when the app is in the background.
* 🆕 You can now use `setData()` to set `CarouselItem` list. And `addData()` to add single or multiple items to the carousel. If you set/add data only once, then you can continue using `addData()` method.
* 🆕 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`.
* 🆕 Carousel now supports touch-to-pause auto-play. It is default now. You can disable it by
setting `touchToPause` to `false`. 🎊
* 🆕 `carouselGravity` attribute added. So you can set carousel item view gravity `START` if you
want.
* 🆕 Carousel padding attributes added. You can use `carouselPadding`, `carouselPaddingStart`
, `carouselPaddingTop`, `carouselPaddingEnd`, and `carouselPaddingBottom` to set carousel padding.
* 🆕 The `ImageCarousel` is now a lifecycle component. You can register any lifecycle
with `registerLifecycle()` method. It is recommended if you enable `autoPlay`
and `infiniteCarousel`. So that when the application is in the pause state, the carousel will be
paused and resumed on the app resume. It is also used to correctly initialize the infinite
carousel when the app is in the background.
* 🆕 You can now use `setData()` to set `CarouselItem` list. And `addData()` to add single or
multiple items to the carousel. If you set/add data only once, then you can continue
using `addData()` method.
* 🆕 You can now get the carousel items using `getData()` method.
* 🆕 Sample app re-designed. Various use cases and inspiring 💡 examples are added. 😎
* ⚠️ `OnItemClickListener` renamed to `CarouselListener` and two new method (`onCreateViewHolder()` and `onBindViewHolder()`) added for the latest custom view feature. `setOnItemClickListener()` also renamed to `setCarouselListener()`.
* ⚠️ `CarouselListener` (previously `OnItemClickListener`) package changed from `org.imaginativeworld.whynotimagecarousel` to `org.imaginativeworld.whynotimagecarousel.listener`.
* ⚠️ `OnItemClickListener` renamed to `CarouselListener` and two new method (`onCreateViewHolder()`
and `onBindViewHolder()`) added for the latest custom view feature. `setOnItemClickListener()`
also renamed to `setCarouselListener()`.
* ⚠️ `CarouselListener` (previously `OnItemClickListener`) package changed
from `org.imaginativeworld.whynotimagecarousel`
to `org.imaginativeworld.whynotimagecarousel.listener`.
* ⚠️ `CarouselItem` package changed from `org.imaginativeworld.whynotimagecarousel`
to `org.imaginativeworld.whynotimagecarousel.model`.
* ️🛠 New parameters `position` and `carouselItem` add to `onScrolled` method
Expand All @@ -68,34 +108,35 @@ headers["header_key"] = "header_value"
val carouselItem1 = CarouselItem(
imageUrl = "https://images.unsplash.com/photo-1549577434-d7615fd4ceac?w=1080",
caption = "Photo by Jeremy Bishop on Unsplash",
headers = headers
headers = headers
)
val carouselItem2 = CarouselItem(
imageUrl = "https://images.unsplash.com/photo-1549577434-d7615fd4ceac?w=1080",
headers = headers
imageUrl = "https://images.unsplash.com/photo-1549577434-d7615fd4ceac?w=1080",
headers = headers
)
```

```java
// Java
Map<String, String> headers = new HashMap<>();
headers.put("header_key", "header_value");
Map<String, String> headers=new HashMap<>();
headers.put("header_key","header_value");

CarouselItem carouselItem1 = new CarouselItem(
CarouselItem carouselItem1=new CarouselItem(
"https://images.unsplash.com/photo-1549577434-d7615fd4ceac?w=1080",
"Photo by Jeremy Bishop on Unsplash",
headers
);
);

CarouselItem carouselItem2 = new CarouselItem(
CarouselItem carouselItem2=new CarouselItem(
"https://images.unsplash.com/photo-1549577434-d7615fd4ceac?w=1080",
headers
);
);
```

## Version 1.2.1 *(2021-02-04)*

We move our library from **jitpack.io** to **maven** repository. So no need to add any repositories for using the library.
We move our library from **jitpack.io** to **maven** repository. So no need to add any repositories
for using the library.

View binding added to the sample. Dependent libraries updated.

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
An easy, super simple and customizable image carousel view for Android.

[![Developer](https://img.shields.io/badge/Maintainer-ImaginativeShohag-green)](https://github.com/ImaginativeShohag)
[![GitHub release](https://img.shields.io/github/release/ImaginativeShohag/Why-Not-Image-Carousel.svg)](https://github.com/ImaginativeShohag/Oops-No-Internet/releases)
[![GitHub release](https://img.shields.io/github/release/ImaginativeShohag/Why-Not-Image-Carousel.svg)](https://github.com/ImaginativeShohag/Why-Not-Image-Carousel/releases)
[![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-Why%20Not!%20Image%20Carousel!-green.svg?style=flat )]( https://android-arsenal.com/details/1/8053)
[![API](https://img.shields.io/badge/API-21%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=21)

Expand All @@ -24,12 +24,12 @@ An easy, super simple and customizable image carousel view for Android.
```groovy
dependencies {
// Material Components for Android. Replace the version with the latest version of Material Components library.
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.android.material:material:1.5.0'
// Circle Indicator (To fix the xml preview "Missing classes" error)
implementation 'me.relex:circleindicator:2.1.6'
implementation 'org.imaginativeworld.whynotimagecarousel:whynotimagecarousel:2.0.6'
implementation 'org.imaginativeworld.whynotimagecarousel:whynotimagecarousel:2.1.0'
}
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ kotlin.code.style=official
# ----------------
GROUP=org.imaginativeworld.whynotimagecarousel
POM_ARTIFACT_ID=whynotimagecarousel
VERSION_NAME=2.0.6
VERSION_NAME=2.1.0
# ----------------
POM_NAME=Why Not! Image Carousel!
POM_DESCRIPTION=An easy, super simple and customizable image carousel view for Android.
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
18 changes: 11 additions & 7 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,36 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:core-ktx:1.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation "androidx.test:runner:1.4.0"
androidTestImplementation "androidx.test:rules:1.4.0"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0'

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'

// Why Not! Image Carousel! Library
implementation project(':whynotimagecarousel')
// You will use the library like this:
// implementation "org.imaginativeworld.whynotimagecarousel:whynotimagecarousel:x.x.x"

// Material Components
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.android.material:material:1.5.0'

// Circle Indicator
implementation 'me.relex:circleindicator:2.1.6'

// Glide
implementation 'com.github.bumptech.glide:glide:4.12.0'
kapt 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'com.github.bumptech.glide:glide:4.13.1'
kapt 'com.github.bumptech.glide:compiler:4.13.1'

// Fragment
implementation "androidx.fragment:fragment-ktx:1.4.0"
implementation "androidx.fragment:fragment-ktx:1.4.1"

// debugImplementation because LeakCanary should only run in debug builds.
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
}

This file was deleted.

Loading

0 comments on commit 2e238b4

Please sign in to comment.