Skip to content

Commit

Permalink
Merge pull request #1 from skydoves/migrate/maven
Browse files Browse the repository at this point in the history
Migrate to maven
  • Loading branch information
skydoves committed Feb 5, 2021
2 parents de8c23a + 68ed5a8 commit 8c14dbb
Show file tree
Hide file tree
Showing 10 changed files with 142 additions and 232 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
</p>

## Including in your project
[![Download](https://api.bintray.com/packages/devmagician/maven/indicatorscrollview/images/download.svg) ](https://bintray.com/devmagician/maven/indicatorscrollview/_latestVersion)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.skydoves/indicatorscrollview.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.skydoves%22%20AND%20a:%22indicatorscrollview%22)
[![JitPack](https://jitpack.io/v/skydoves/IndicatorScrollView.svg)](https://jitpack.io/#skydoves/IndicatorScrollView) <br>
Add below codes to your **root** `build.gradle` file (not your module build.gradle file).
```gradle
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
```
And add a dependency code to your **module**'s `build.gradle` file.
```gradle
dependencies {
implementation "com.github.skydoves:indicatorscrollview:1.0.3"
implementation "com.github.skydoves:indicatorscrollview:1.0.4"
}
```

Expand Down
14 changes: 10 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: '../dependencies.gradle'
apply from: "$rootDir/dependencies.gradle"

android {
compileSdkVersion versions.compileSdk
Expand All @@ -12,11 +11,18 @@ android {
versionCode versions.versionCode
versionName versions.versionName
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
}

dependencies {
implementation "com.google.android.material:material:$versions.googleMaterial"
implementation project(':indicatorscrollview')
implementation project(":indicatorscrollview")
}

apply from: '../spotless.gradle'
apply from: "$rootDir/spotless.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -21,60 +21,64 @@ import androidx.appcompat.app.AppCompatActivity
import com.skydoves.indicatorscrollview.IndicatorAnimation
import com.skydoves.indicatorscrollview.IndicatorItem
import com.skydoves.indicatorscrollview.indicatorItem
import kotlinx.android.synthetic.main.activity_custom.*
import com.skydoves.indicatorscrollviewdemo.databinding.ActivityCustomBinding

class CustomActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_custom)

indicatorScrollView.bindIndicatorView(indicatorView)
val binding = ActivityCustomBinding.inflate(layoutInflater)
setContentView(binding.root)

/** add an indicator item using [indicatorItem] kotlin dsl with plus operator. */
indicatorView + indicatorItem(section1) {
setItemColorResource(R.color.colorPrimary)
setItemIconResource(R.drawable.ic_heart)
setIndicatorAnimation(IndicatorAnimation.BOUNCE)
setItemCornerRadius(30f)
}
with(binding) {
indicatorScrollView.bindIndicatorView(indicatorView)

/** add an indicator item using [IndicatorItem.Builder] with plus operator. */
indicatorView + IndicatorItem.Builder(section2)
.setItemColorResource(R.color.md_orange_100)
.setItemIconResource(R.drawable.ic_home)
.setIndicatorAnimation(IndicatorAnimation.BOUNCE)
.setItemCornerRadius(30f)
.build()
/** add an indicator item using [indicatorItem] kotlin dsl with plus operator. */
indicatorView + indicatorItem(section1) {
setItemColorResource(R.color.colorPrimary)
setItemIconResource(R.drawable.ic_heart)
setIndicatorAnimation(IndicatorAnimation.BOUNCE)
setItemCornerRadius(30f)
}

/** add an indicator item using an addIndicatorItem method. */
indicatorView.addIndicatorItem(
IndicatorItem.Builder(section3)
.setItemColorResource(R.color.md_yellow_200)
.setItemIconResource(R.drawable.ic_assignment)
/** add an indicator item using [IndicatorItem.Builder] with plus operator. */
indicatorView + IndicatorItem.Builder(section2)
.setItemColorResource(R.color.md_orange_100)
.setItemIconResource(R.drawable.ic_home)
.setIndicatorAnimation(IndicatorAnimation.BOUNCE)
.setItemCornerRadius(30f)
.build()
)

indicatorView + IndicatorItem.Builder(section4)
.setItemColorResource(R.color.md_green_200)
.setItemIconResource(R.drawable.ic_bookmark)
.setIndicatorAnimation(IndicatorAnimation.BOUNCE)
.setItemCornerRadius(30f)
.build()
/** add an indicator item using an addIndicatorItem method. */
indicatorView.addIndicatorItem(
IndicatorItem.Builder(section3)
.setItemColorResource(R.color.md_yellow_200)
.setItemIconResource(R.drawable.ic_assignment)
.setIndicatorAnimation(IndicatorAnimation.BOUNCE)
.setItemCornerRadius(30f)
.build()
)

indicatorView + IndicatorItem.Builder(section4)
.setItemColorResource(R.color.md_green_200)
.setItemIconResource(R.drawable.ic_bookmark)
.setIndicatorAnimation(IndicatorAnimation.BOUNCE)
.setItemCornerRadius(30f)
.build()

indicatorView + IndicatorItem.Builder(section5)
.setItemColorResource(R.color.md_blue_200)
.setItemIconResource(R.drawable.ic_date)
.setIndicatorAnimation(IndicatorAnimation.BOUNCE)
.setItemCornerRadius(30f)
.build()
indicatorView + IndicatorItem.Builder(section5)
.setItemColorResource(R.color.md_blue_200)
.setItemIconResource(R.drawable.ic_date)
.setIndicatorAnimation(IndicatorAnimation.BOUNCE)
.setItemCornerRadius(30f)
.build()

indicatorView + IndicatorItem.Builder(section6)
.setItemColorResource(R.color.md_purple_100)
.setItemIconResource(R.drawable.ic_wifi)
.setIndicatorAnimation(IndicatorAnimation.BOUNCE)
.setItemCornerRadius(30f).build()
indicatorView + IndicatorItem.Builder(section6)
.setItemColorResource(R.color.md_purple_100)
.setItemIconResource(R.drawable.ic_wifi)
.setIndicatorAnimation(IndicatorAnimation.BOUNCE)
.setItemCornerRadius(30f).build()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,34 @@ package com.skydoves.indicatorscrollviewdemo
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.skydoves.indicatorscrollview.IndicatorItem
import kotlinx.android.synthetic.main.activity_main.*
import com.skydoves.indicatorscrollviewdemo.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

indicatorScrollView.bindIndicatorView(indicatorView)
val binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)

indicatorView + IndicatorItem.Builder(section1).setItemColorResource(
R.color.colorPrimary
).setItemIconResource(R.drawable.ic_heart).build()
with(binding) {
indicatorScrollView.bindIndicatorView(indicatorView)

indicatorView + IndicatorItem.Builder(section2).setItemColorResource(
R.color.md_yellow_200
).setItemIconResource(R.drawable.ic_assignment).build()
indicatorView + IndicatorItem.Builder(section1).setItemColorResource(
R.color.colorPrimary
).setItemIconResource(R.drawable.ic_heart).build()

indicatorView + IndicatorItem.Builder(section3).setItemColorResource(
R.color.md_green_200
).setItemIconResource(R.drawable.ic_bookmark).build()
indicatorView + IndicatorItem.Builder(section2).setItemColorResource(
R.color.md_yellow_200
).setItemIconResource(R.drawable.ic_assignment).build()

indicatorView + IndicatorItem.Builder(section4).setItemColorResource(
R.color.md_blue_200
).setItemIconResource(R.drawable.ic_date).build()
indicatorView + IndicatorItem.Builder(section3).setItemColorResource(
R.color.md_green_200
).setItemIconResource(R.drawable.ic_bookmark).build()

indicatorView + IndicatorItem.Builder(section4).setItemColorResource(
R.color.md_blue_200
).setItemIconResource(R.drawable.ic_date).build()
}
}
}
14 changes: 10 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
buildscript {
apply from: './dependencies.gradle'
apply from: "$rootDir/dependencies.gradle"
repositories {
google()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:$versions.gradleBuildTool"
classpath "com.android.tools.build:gradle:${versions.gradleBuildTool}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
classpath "com.diffplug.spotless:spotless-plugin-gradle:$versions.spotlessGradle"
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:$versions.dokkaGradle"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$versions.bintrayPlugin"
classpath "com.vanniktech:gradle-maven-publish-plugin:$versions.mavenPublish"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$versions.dokkaGradle"
}
}

apply plugin: 'org.jetbrains.dokka'

allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
jcenter()
}
}
Expand Down
14 changes: 7 additions & 7 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ ext.versions = [
versionCode : 4,
versionName : '1.0.3',

gradleBuildTool : '4.0.1',
spotlessGradle : '5.7.0',
ktlintGradle : '0.39.0',
dokkaGradle : '0.9.18',
bintrayPlugin : '1.8.5',
gradleBuildTool : '4.1.1',
spotlessGradle : '5.9.0',
ktlintGradle : '0.40.0',
dokkaGradle : '1.4.20',
mavenPublish : '0.13.0',

kotlin : '1.4.10',
kotlin : '1.4.20',
androidxAppcompat: '1.2.0',

// for demo
googleMaterial : '1.2.1',
googleMaterial : '1.3.0-alpha02',
]
61 changes: 43 additions & 18 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
#
# Copyright 2019 skydoves (Jaewoong Eum)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

org.gradle.jvmargs=-Xmx4g

# AndroidX
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

# Maven
GROUP=com.github.skydoves
POM_ARTIFACT_ID=indicatorscrollview
VERSION_NAME=1.0.5-SNAPSHOT

POM_NAME=indicatorscrollview
POM_DESCRIPTION=A dynamic way of animating indicators according to positions of a scroll view.

POM_URL=https://github.com/skydoves/IndicatorScrollView/
POM_SCM_URL=https://github.com/skydoves/IndicatorScrollView/
POM_SCM_CONNECTION=scm:git:git://github.com/skydoves/IndicatorScrollView.git
POM_SCM_DEV_CONNECTION=scm:git:git://github.com/skydoves/IndicatorScrollView.git

POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=skydoves
POM_DEVELOPER_NAME=Jaewoong Eum
POM_DEVELOPER_URL=https://github.com/skydoves/

RELEASE_REPOSITORY_URL=https://oss.sonatype.org/service/local/staging/deploy/maven2/
SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots/
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-6.6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
14 changes: 5 additions & 9 deletions indicatorscrollview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka-android'
apply plugin: 'org.jetbrains.dokka'
apply from: '../dependencies.gradle'
apply from: '../publish.gradle'

android {
compileSdkVersion versions.compileSdk
Expand All @@ -12,22 +11,19 @@ android {
versionCode versions.versionCode
versionName versions.versionName
}
buildFeatures {
buildConfig false
}
}

dependencies {
implementation "androidx.appcompat:appcompat:$versions.androidxAppcompat"
}

dokka {
moduleName = 'indicatorscrollview'
outputFormat = 'html'
//noinspection GroovyAccessibility
outputDirectory = "$buildDir/javadoc"
}

tasks.withType(Javadoc) {
excludes = ['**/*.kt']
options.addBooleanOption('Xdoclint:none', true)
}

apply plugin: "com.vanniktech.maven.publish"
apply from: '../spotless.gradle'
Loading

0 comments on commit 8c14dbb

Please sign in to comment.