Skip to content

Commit ffc762e

Browse files
committed
#15 Version 3.0 - Update libraries, convert to Kotlin, Maven -> Jitpack
1 parent f08140d commit ffc762e

File tree

15 files changed

+462
-456
lines changed

15 files changed

+462
-456
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,30 @@ _Disclaimer: Having too many pages in recycler means that user needs to swipe a
2525

2626
## Usage
2727

28+
### Migration to 3.0 from 2.x
29+
30+
Make sure you have Jitpack dependency in root gradle file.
31+
32+
Follow [this instructions](https://github.com/andkulikov/Transitions-Everywhere#migration-from-1x-guide) to update
33+
TransitionsEverywhere which migrated to Jetpack androidx.transition to prevent import crashes.
34+
2835
### Gradle dependency
2936

30-
In your gradle add dependency:
37+
In your root gradle add dependency to Jitpack:
38+
39+
```gradle
40+
buildscript {
41+
repositories {
42+
xxx
43+
maven { url 'https://jitpack.io' }
44+
}
45+
}
46+
```
47+
48+
In you module gradle add dependency to library:
3149

3250
```gradle
33-
compile "cz.intik:overflow-pager-indicator:$latestVersion"
51+
implementation "cz.intik:overflow-pager-indicator:$latestVersion"
3452
```
3553

3654
### Layout
@@ -103,6 +121,8 @@ You can easily change dot fill color and dot stroke color via xml attributes lik
103121

104122
### Changelog
105123

124+
3.0.0 Remove library from Bintray, use simply Jitpack. Convert library to Kotlin and update to TransitionsEverywhere 2.0 (which uses androidx.transition.X heavily)
125+
106126
2.0.0 Migrate to AndroidX, add color customization options (big thanks [Javi Chaqués](https://github.com/javichaques))
107127

108128
1.2.1 bugfix (thanks [Sajad Abasi](https://github.com/sajadabasi))

build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
buildscript {
2+
ext.kotlin_version = '1.3.50'
3+
24
repositories {
35
google()
46
jcenter()
57
}
68
dependencies {
7-
classpath 'com.android.tools.build:gradle:3.2.1'
9+
// Tools 3.4.1+ requires Gradle 5+ which is not supported by JitPack, yet
10+
classpath 'com.android.tools.build:gradle:3.2.0'
11+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
812
}
913
}
1014

@@ -17,4 +21,4 @@ allprojects {
1721

1822
task clean(type: Delete) {
1923
delete rootProject.buildDir
20-
}
24+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Jun 07 09:45:04 CEST 2017
1+
#Fri Aug 30 13:26:26 CEST 2019
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

library/build.gradle

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
apply plugin: 'com.android.library'
2+
apply plugin: 'kotlin-android-extensions'
3+
apply plugin: 'kotlin-android'
24

35
ext {
4-
PUBLISH_GROUP_ID = 'cz.intik'
6+
PUBLISH_GROUP_ID = 'cz.intik.overflowpagerindicator'
57
PUBLISH_ARTIFACT_ID = 'overflow-pager-indicator'
6-
PUBLISH_VERSION = '2.0.0'
7-
8-
// gradlew clean build generateRelease
8+
PUBLISH_VERSION = '3.0.0'
99
}
1010

1111
android {
1212
compileSdkVersion 28
1313

14+
compileOptions {
15+
kotlinOptions.freeCompilerArgs += ['-module-name', "$PUBLISH_GROUP_ID.$PUBLISH_ARTIFACT_ID"]
16+
}
17+
1418
defaultConfig {
1519
minSdkVersion 16
1620
targetSdkVersion 28
17-
versionCode 2
18-
versionName "2.0.0"
21+
versionCode 3
22+
versionName PUBLISH_VERSION
1923
}
2024
buildTypes {
2125
release {
@@ -25,11 +29,14 @@ android {
2529
}
2630
}
2731

32+
repositories {
33+
mavenCentral()
34+
}
35+
2836
dependencies {
2937
implementation "androidx.appcompat:appcompat:1.0.2"
3038
implementation "androidx.recyclerview:recyclerview:1.0.0"
3139

32-
implementation "com.andkulikov:transitionseverywhere:1.8.0"
33-
}
34-
35-
apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
40+
implementation "com.andkulikov:transitionseverywhere:2.0.0"
41+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
42+
}

library/src/main/java/cz/intik/overflowindicator/OverflowDataObserver.java

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package cz.intik.overflowindicator
2+
3+
import androidx.recyclerview.widget.RecyclerView
4+
5+
/**
6+
* Data observer which notifies [OverflowPagerIndicator] of changed data
7+
*
8+
* @author Petr Introvic <[email protected]>
9+
* created 03.10.2017.
10+
*/
11+
12+
internal class OverflowDataObserver(private val overflowPagerIndicator: OverflowPagerIndicator) :
13+
RecyclerView.AdapterDataObserver() {
14+
15+
override fun onChanged() = overflowPagerIndicator.updateIndicatorsCount()
16+
17+
override fun onItemRangeInserted(positionStart: Int, itemCount: Int) =
18+
overflowPagerIndicator.updateIndicatorsCount()
19+
20+
override fun onItemRangeChanged(positionStart: Int, itemCount: Int) =
21+
overflowPagerIndicator.updateIndicatorsCount()
22+
23+
override fun onItemRangeChanged(positionStart: Int, itemCount: Int, payload: Any?) =
24+
overflowPagerIndicator.updateIndicatorsCount()
25+
26+
override fun onItemRangeRemoved(positionStart: Int, itemCount: Int) =
27+
overflowPagerIndicator.updateIndicatorsCount()
28+
29+
override fun onItemRangeMoved(fromPosition: Int, toPosition: Int, itemCount: Int) =
30+
overflowPagerIndicator.updateIndicatorsCount()
31+
}

0 commit comments

Comments
 (0)