Skip to content

Commit

Permalink
Merge branch 'release/0.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
sangcomz committed Nov 23, 2020
2 parents fa1a0e8 + 3bf4fff commit 95c77f5
Show file tree
Hide file tree
Showing 20 changed files with 389 additions and 301 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
/captures
.externalNativeBuild
/release
.idea/*
.idea/*
/.vs
45 changes: 23 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@

StickyTimeLine is timeline view for android.

## What's New in 0.1.0? :tada:
- Add Horizontal Mode
- Fix DEMO app
- change attribute name
- `timeLineCircleColor` -> `timeLineDotColor`
- `timeLineCircleStrokeColor` -> `timeLineDotStrokeColor`

## What's New in 0.1.1? :tada:
- Remove the way of using xml view of VerticalSectionItemDecoration
- Add dot size attribute
- `timeLineDotRadius`, `timeLineDotStrokeSize`
- Support RTL (#26)

## Result Screen

Feel free to send me a pull request with your app and I'll link you here:

| Sample <p style="float:left;"> <a href="https://play.google.com/store/apps/details?id=xyz.sangcomz.stickytimeline"> <img HEIGHT="40" WIDTH="135" alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/apps/en-play-badge.png" /></a></p> | AlleysMap <p style="float:left;"> <a href="https://play.google.com/store/apps/details?id=co.alleys.android"> <img HEIGHT="40" WIDTH="135" alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/apps/en-play-badge.png" /></a></p> |
|:---------------------------------:|:--------------------------------:|
| <img src="/pic/sample_result.gif">|<img src="/pic/alleys_result.gif">|
| Sample <p style="float:left;"> <a href="https://play.google.com/store/apps/details?id=xyz.sangcomz.stickytimeline"> <img HEIGHT="40" WIDTH="135" alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/apps/en-play-badge.png" /></a></p> | AlleysMap <p style="float:left;"> <a href="https://play.google.com/store/apps/details?id=co.alleys.android"> <img HEIGHT="40" WIDTH="135" alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/apps/en-play-badge.png" /> </a></p> | StockRoom <p style="float:left;"> <a href="https://play.google.com/store/apps/details?id=com.thecloudsite.stockroom"> <img HEIGHT="40" WIDTH="135" alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/apps/en-play-badge.png" /></a></p> |
|:---------------------------------:|:--------------------------------:|:--------------------------------:|
| <img src="/pic/sample_result.gif">|<img src="/pic/alleys_result.gif">|<img width="auto" height="500px" src="/pic/stockroom_result.gif">|

## How to Use

Expand All @@ -29,7 +28,7 @@ StickyTimeLine is timeline view for android.
dependencies {
//StickyTimeLine v0.0.20 and above only supports projects that have been migrated to androidx.
compile 'com.github.sangcomz:StickyTimeLine:v0.1.0'
compile 'com.github.sangcomz:StickyTimeLine:v0.1.1'
}
```
### Usage
Expand Down Expand Up @@ -201,18 +200,20 @@ public class JavaExampleActivity extends AppCompatActivity {

| Method Name | Description | Default Value |
|:------------------------:|-------------------------------------------------------|:-------------:|
| sectionBackgroundColor | To change section section background color | #f9f9f9 |
| sectionTitleTextColor | To change section title color | #414fca |
| sectionSubTitleTextColor | To change section sub title color | #d16767 |
| timeLineColor | To change line color in timeline | #51ae45 |
| timeLineDotColor | To change dot color in timeline | #51ae45 |
| timeLineCircleStrokeColor| To change dot stroke color in timeline | #f9f9f9 |
| sectionTitleTextSize | To change section title text size | 14sp |
| sectionSubTitleTextSize | To change section sub title text size | 12sp |
| timeLineWidth | To change line width in timeline | 4dp |
| isSticky | To change Sticky functionality in the Timeline | true |
| customDotDrawable | To change the circle to custom drawable | null |
|sectionBackgroundColor | To change section section background color | #f9f9f9 |
|sectionTitleTextColor | To change section title color | #414fca |
|sectionSubTitleTextColor | To change section sub title color | #d16767 |
|timeLineColor | To change line color in timeline | #51ae45 |
|timeLineDotColor | To change dot color in timeline | #51ae45 |
|timeLineCircleStrokeColor | To change dot stroke color in timeline | #f9f9f9 |
|sectionTitleTextSize | To change section title text size | 14sp |
|sectionSubTitleTextSize | To change section sub title text size | 12sp |
|timeLineWidth | To change line width in timeline | 4dp |
|isSticky | To change Sticky functionality in the Timeline | true |
|customDotDrawable | To change the circle to custom drawable | null |
|sectionBackgroundColorMode| To change section background area(for horizontal mode)| MODE_FULL |
|timeLineDotRadius | To change dot radius | 8dp |
|timeLineDotStrokeSize | To change dot stroke size | 4dp |

# Contribute
We welcome any contributions.
Expand Down
4 changes: 3 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ dependencies {
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation 'androidx.cardview:cardview:1.0.0'
implementation project(':stickytimelineview')
// implementation 'com.github.sangcomz:StickyTimeLine:v0.1.1'


implementation "androidx.appcompat:appcompat:1.2.0"
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
}
17 changes: 16 additions & 1 deletion app/src/main/java/xyz/sangcomz/stickytimeline/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class MainActivity : AppCompatActivity() {
)

horizontal_recycler_view.addItemDecoration(getSectionCallback(singerList))
horizontal_recycler_view2.addItemDecoration(getSectionCallback(singerList))
horizontal_recycler_view2.addItemDecoration(getSectionCallbackWithDrawable(singerList))
}

//Get data method
Expand All @@ -93,6 +93,21 @@ class MainActivity : AppCompatActivity() {

//Get SectionCallback method
private fun getSectionCallback(singerList: List<Singer>): SectionCallback {
return object : SectionCallback {
//In your data, implement a method to determine if this is a section.
override fun isSection(position: Int): Boolean =
singerList[position].debuted != singerList[position - 1].debuted

//Implement a method that returns a SectionHeader.
override fun getSectionHeader(position: Int): SectionInfo? {
val singer = singerList[position]
return SectionInfo(singer.debuted, singer.group)
}

}
}

private fun getSectionCallbackWithDrawable(singerList: List<Singer>): SectionCallback {
return object : SectionCallback {
//In your data, implement a method to determine if this is a section.
override fun isSection(position: Int): Boolean =
Expand Down
24 changes: 20 additions & 4 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
android:paddingBottom="16dp"
android:text="VERTICAL"
android:textColor="#ffffff"
android:textDirection="locale"
android:textSize="24dp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -33,8 +34,12 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vertical_text_view"
app:timeLineColor="#2196F3"
app:timeLineDotColor="#2196F3"
app:timeLineDotRadius="4dp"
app:timeLineDotStrokeColor="#ffffff"
app:timeLineDotStrokeSize="2dp"
app:timeLineMode="vertical"
app:timeLineWidth="2dp" />
app:timeLineWidth="4dp" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
Expand All @@ -61,6 +66,7 @@
android:paddingBottom="16dp"
android:text="HORIZONTAL"
android:textColor="#ffffff"
android:textDirection="locale"
android:textSize="24dp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -81,17 +87,27 @@
app:sectionSubTitleTextColor="#CDFFFFFF"
app:sectionTitleTextColor="#ffffff"
app:timeLineColor="#3F51B5"
app:timeLineMode="horizontal" />
app:timeLineDotColor="@color/colorPrimary"
app:timeLineDotRadius="4dp"
app:timeLineDotStrokeColor="#ffffff"
app:timeLineDotStrokeSize="2dp"
app:timeLineMode="horizontal"
app:timeLineWidth="0dp" />

<xyz.sangcomz.stickytimelineview.TimeLineRecyclerView
android:id="@+id/horizontal_recycler_view2"
android:layout_width="0dp"
android:layout_height="0dp"
app:isSticky="true"
app:timeLineMode="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/guideline2" />
app:layout_constraintTop_toBottomOf="@+id/guideline2"
app:timeLineDotColor="@color/colorPrimary"
app:timeLineDotRadius="6dp"
app:timeLineDotStrokeColor="#ffffff"
app:timeLineDotStrokeSize="4dp"
app:timeLineMode="horizontal"
app:timeLineWidth="4dp" />

</androidx.constraintlayout.widget.ConstraintLayout>
1 change: 1 addition & 0 deletions app/src/main/res/layout/recycler_horizontal_row.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:textDirection="locale"
tools:text="name" />

</androidx.cardview.widget.CardView>
1 change: 1 addition & 0 deletions app/src/main/res/layout/recycler_vertical_row.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:textDirection="locale"
tools:text="name" />

</androidx.cardview.widget.CardView>
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ buildscript {
}

repositories {
mavenLocal()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -22,6 +23,7 @@ buildscript {

allprojects {
repositories {
mavenLocal()
google()
jcenter()
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Aug 10 23:14:19 KST 2020
#Fri Oct 16 21:54:52 KST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
Binary file added pic/stockroom_result.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include ':app', ':stickytimelineview'

gradle.ext.set('versionCode', 8)
gradle.ext.set('versionName', '0.1.0')
gradle.ext.set('versionCode', 9)
gradle.ext.set('versionName', '0.1.1')

gradle.ext.set('minSdk', 16)
gradle.ext.set('targetSdk', 28)
Expand Down
14 changes: 13 additions & 1 deletion stickytimelineview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'maven-publish'

group = 'com.github.sangcomz'
version = 'v' + gradle.versionName

repositories {
mavenCentral()
}


android {
compileSdkVersion gradle.compileSdk
defaultConfig {
Expand Down Expand Up @@ -40,3 +41,14 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

}

install {
repositories.mavenInstaller {
// only necessary if artifact ID diverges from project name
// the latter defaults to project directory name and can be
// configured in settings.gradle
pom.artifactId = 'StickyTimeLine'
// shouldn't be needed as this is the default anyway
pom.packaging = 'aar'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.recyclerview.widget.RecyclerView
import xyz.sangcomz.stickytimelineview.callback.SectionCallback
import xyz.sangcomz.stickytimelineview.decoration.HorizontalSectionItemDecoration
import xyz.sangcomz.stickytimelineview.decoration.VerticalSectionItemDecoration
import xyz.sangcomz.stickytimelineview.ext.shouldUseLayoutRtl
import xyz.sangcomz.stickytimelineview.model.RecyclerViewAttr


Expand Down Expand Up @@ -92,7 +93,15 @@ class TimeLineRecyclerView(context: Context, attrs: AttributeSet?) : RecyclerVie
it.getInt(
R.styleable.TimeLineRecyclerView_sectionBackgroundColorMode,
MODE_FULL
), it.getDimension(
R.styleable.TimeLineRecyclerView_timeLineDotRadius,
context.resources.getDimension(R.dimen.dot_radius)
),
it.getDimension(
R.styleable.TimeLineRecyclerView_timeLineDotStrokeSize,
context.resources.getDimension(R.dimen.dot_stroke_width)
)

)
}

Expand Down
Loading

0 comments on commit 95c77f5

Please sign in to comment.