Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sangcomz committed Feb 27, 2024
2 parents 57f505d + 980b9d7 commit 27eb84f
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 81 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
StickyTimeLine is timeline view for android.

## What's New? :tada:
- [Improvement] Move to MavenCentral
- [Improvement] lib version update

## Result Screen
Expand Down
29 changes: 18 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {

compileSdkVersion gradle.compileSdk
compileSdk gradle.compileSdk
defaultConfig {
minSdkVersion gradle.minSdk
targetSdkVersion gradle.targetSdk
minSdk gradle.minSdk
targetSdk gradle.targetSdk
versionName gradle.versionName
versionCode gradle.versionCode
applicationId "xyz.sangcomz.stickytimeline"
Expand Down Expand Up @@ -39,21 +38,29 @@ android {

}
}

namespace 'xyz.sangcomz.stickytimeline'

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation "androidx.constraintlayout:constraintlayout:$constraint_version"
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation 'androidx.cardview:cardview:1.0.0'
implementation project(':stickytimelineview')


implementation "androidx.appcompat:appcompat:1.4.1"
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xyz.sangcomz.stickytimeline">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand Down
85 changes: 41 additions & 44 deletions app/src/main/java/xyz/sangcomz/stickytimeline/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.content.res.AppCompatResources
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.activity_main.*
import xyz.sangcomz.stickytimelineview.TimeLineRecyclerView
import xyz.sangcomz.stickytimelineview.callback.SectionCallback
import xyz.sangcomz.stickytimelineview.decoration.VerticalSectionItemDecoration
import xyz.sangcomz.stickytimelineview.model.SectionInfo

class MainActivity : AppCompatActivity() {
Expand Down Expand Up @@ -39,52 +38,50 @@ class MainActivity : AppCompatActivity() {

private fun initVerticalRecyclerView() {
val singerList = getSingerList()
vertical_recycler_view.adapter = SingerAdapter(
layoutInflater,
singerList,
R.layout.recycler_vertical_row
)

//Currently only LinearLayoutManager is supported.
vertical_recycler_view.layoutManager = LinearLayoutManager(
this,
RecyclerView.VERTICAL,
false
)

vertical_recycler_view.addItemDecoration(getSectionCallback(singerList))
findViewById<TimeLineRecyclerView>(R.id.vertical_recycler_view).apply {
adapter = SingerAdapter(
layoutInflater,
singerList,
R.layout.recycler_vertical_row
)
layoutManager = LinearLayoutManager(
this@MainActivity,
RecyclerView.VERTICAL,
false
)
addItemDecoration(getSectionCallback(singerList))
}
}

private fun initHorizontalRecyclerView() {
val singerList = getSingerList()
horizontal_recycler_view.adapter = SingerAdapter(
layoutInflater,
singerList,
R.layout.recycler_horizontal_row
)

horizontal_recycler_view2.adapter = SingerAdapter(
layoutInflater,
singerList,
R.layout.recycler_horizontal_row
)


//Currently only LinearLayoutManager is supported.
horizontal_recycler_view.layoutManager = LinearLayoutManager(
this,
RecyclerView.HORIZONTAL,
false
)

horizontal_recycler_view2.layoutManager = LinearLayoutManager(
this,
RecyclerView.HORIZONTAL,
false
)

horizontal_recycler_view.addItemDecoration(getSectionCallback(singerList))
horizontal_recycler_view2.addItemDecoration(getSectionCallbackWithDrawable(singerList))
findViewById<TimeLineRecyclerView>(R.id.horizontal_recycler_view).apply {
adapter = SingerAdapter(
layoutInflater,
singerList,
R.layout.recycler_horizontal_row
)
layoutManager = LinearLayoutManager(
this@MainActivity,
RecyclerView.HORIZONTAL,
false
)
addItemDecoration(getSectionCallback(singerList))
}

findViewById<TimeLineRecyclerView>(R.id.horizontal_recycler_view2).apply {
adapter = SingerAdapter(
layoutInflater,
singerList,
R.layout.recycler_horizontal_row
)
layoutManager = LinearLayoutManager(
this@MainActivity,
RecyclerView.HORIZONTAL,
false
)
addItemDecoration(getSectionCallbackWithDrawable(singerList))
}
}

//Get data method
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
buildscript {

ext {
kotlin_version = '1.6.10'
constraint_version = '2.1.3'
kotlin_version = '1.9.21'
constraint_version = '2.1.4'
}

repositories {
Expand All @@ -15,7 +15,7 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.0'
classpath 'com.android.tools.build:gradle:8.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.github.sabujak-sabujak:gradle-github-release-plugin:0.0.2"
// NOTE: Do not place your application dependencies here; they belong
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m

Expand Down
6 changes: 2 additions & 4 deletions gradle/release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def siteUrl = 'https://github.com/sangcomz/StickyTimeLine' // Homepage URL
def gitUrl = 'https://github.com/sangcomz/StickyTimeLine.git' // Git repository URL

afterEvaluate {

task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier.set("sources")
Expand All @@ -53,6 +52,7 @@ afterEvaluate {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
tasks.named("generateMetadataFileForReleasePublication").configure { dependsOn("sourceJar") }
groupId group
artifactId archivesBaseName
version version
Expand All @@ -62,7 +62,6 @@ afterEvaluate {
} else {
from components.java
}
artifact sourceJar
artifact javadocJar

pom {
Expand All @@ -78,7 +77,7 @@ afterEvaluate {
developers {
developer {
id = 'sangcomz'
name = 'Swokwon Jeong'
name = 'Seokwon Jeong'
email = '[email protected]'
}
}
Expand Down Expand Up @@ -123,7 +122,6 @@ githubRelease {
tagName = version
targetCommitish = 'master'
body = """## Release Note
* [Improvement] Move to MavenCentral
* [Improvement] lib version update
"""
name = version
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.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
10 changes: 5 additions & 5 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include ':app', ':stickytimelineview'

gradle.ext.set('versionCode', 10)
gradle.ext.set('versionName', '1.0.0')
gradle.ext.set('versionCode', 11)
gradle.ext.set('versionName', '1.1.0')

gradle.ext.set('minSdk', 16)
gradle.ext.set('targetSdk', 31)
gradle.ext.set('compileSdk', 31)
gradle.ext.set('minSdk', 21)
gradle.ext.set('targetSdk', 34)
gradle.ext.set('compileSdk', 34)
23 changes: 16 additions & 7 deletions stickytimelineview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ repositories {
}

android {
compileSdkVersion gradle.compileSdk
compileSdk gradle.compileSdk
defaultConfig {
minSdkVersion gradle.minSdk
targetSdkVersion gradle.targetSdk
minSdk gradle.minSdk
targetSdk gradle.targetSdk
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand All @@ -19,21 +19,30 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
namespace 'xyz.sangcomz.stickytimelineview'

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}
}

apply from: '../gradle/release.gradle'

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation "androidx.constraintlayout:constraintlayout:$constraint_version"

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

tasks.withType(Javadoc).all {
Expand Down
3 changes: 1 addition & 2 deletions stickytimelineview/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xyz.sangcomz.stickytimelineview" />
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />

0 comments on commit 27eb84f

Please sign in to comment.