Skip to content

Commit 95c77f5

Browse files
committed
Merge branch 'release/0.1.1'
2 parents fa1a0e8 + 3bf4fff commit 95c77f5

File tree

20 files changed

+389
-301
lines changed

20 files changed

+389
-301
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
/captures
99
.externalNativeBuild
1010
/release
11-
.idea/*
11+
.idea/*
12+
/.vs

README.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44

55
StickyTimeLine is timeline view for android.
66

7-
## What's New in 0.1.0? :tada:
8-
- Add Horizontal Mode
9-
- Fix DEMO app
10-
- change attribute name
11-
- `timeLineCircleColor` -> `timeLineDotColor`
12-
- `timeLineCircleStrokeColor` -> `timeLineDotStrokeColor`
13-
7+
## What's New in 0.1.1? :tada:
8+
- Remove the way of using xml view of VerticalSectionItemDecoration
9+
- Add dot size attribute
10+
- `timeLineDotRadius`, `timeLineDotStrokeSize`
11+
- Support RTL (#26)
12+
1413
## Result Screen
1514

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

18-
| 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> |
19-
|:---------------------------------:|:--------------------------------:|
20-
| <img src="/pic/sample_result.gif">|<img src="/pic/alleys_result.gif">|
17+
| 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> |
18+
|:---------------------------------:|:--------------------------------:|:--------------------------------:|
19+
| <img src="/pic/sample_result.gif">|<img src="/pic/alleys_result.gif">|<img width="auto" height="500px" src="/pic/stockroom_result.gif">|
2120

2221
## How to Use
2322

@@ -29,7 +28,7 @@ StickyTimeLine is timeline view for android.
2928
3029
dependencies {
3130
//StickyTimeLine v0.0.20 and above only supports projects that have been migrated to androidx.
32-
compile 'com.github.sangcomz:StickyTimeLine:v0.1.0'
31+
compile 'com.github.sangcomz:StickyTimeLine:v0.1.1'
3332
}
3433
```
3534
### Usage
@@ -201,18 +200,20 @@ public class JavaExampleActivity extends AppCompatActivity {
201200

202201
| Method Name | Description | Default Value |
203202
|:------------------------:|-------------------------------------------------------|:-------------:|
204-
| sectionBackgroundColor | To change section section background color | #f9f9f9 |
205-
| sectionTitleTextColor | To change section title color | #414fca |
206-
| sectionSubTitleTextColor | To change section sub title color | #d16767 |
207-
| timeLineColor | To change line color in timeline | #51ae45 |
208-
| timeLineDotColor | To change dot color in timeline | #51ae45 |
209-
| timeLineCircleStrokeColor| To change dot stroke color in timeline | #f9f9f9 |
210-
| sectionTitleTextSize | To change section title text size | 14sp |
211-
| sectionSubTitleTextSize | To change section sub title text size | 12sp |
212-
| timeLineWidth | To change line width in timeline | 4dp |
213-
| isSticky | To change Sticky functionality in the Timeline | true |
214-
| customDotDrawable | To change the circle to custom drawable | null |
203+
|sectionBackgroundColor | To change section section background color | #f9f9f9 |
204+
|sectionTitleTextColor | To change section title color | #414fca |
205+
|sectionSubTitleTextColor | To change section sub title color | #d16767 |
206+
|timeLineColor | To change line color in timeline | #51ae45 |
207+
|timeLineDotColor | To change dot color in timeline | #51ae45 |
208+
|timeLineCircleStrokeColor | To change dot stroke color in timeline | #f9f9f9 |
209+
|sectionTitleTextSize | To change section title text size | 14sp |
210+
|sectionSubTitleTextSize | To change section sub title text size | 12sp |
211+
|timeLineWidth | To change line width in timeline | 4dp |
212+
|isSticky | To change Sticky functionality in the Timeline | true |
213+
|customDotDrawable | To change the circle to custom drawable | null |
215214
|sectionBackgroundColorMode| To change section background area(for horizontal mode)| MODE_FULL |
215+
|timeLineDotRadius | To change dot radius | 8dp |
216+
|timeLineDotStrokeSize | To change dot stroke size | 4dp |
216217

217218
# Contribute
218219
We welcome any contributions.

app/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ dependencies {
4949
implementation "androidx.recyclerview:recyclerview:1.1.0"
5050
implementation 'androidx.cardview:cardview:1.0.0'
5151
implementation project(':stickytimelineview')
52+
// implementation 'com.github.sangcomz:StickyTimeLine:v0.1.1'
53+
5254

5355
implementation "androidx.appcompat:appcompat:1.2.0"
5456
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
5557
testImplementation 'junit:junit:4.13'
5658
androidTestImplementation 'androidx.test:runner:1.3.0'
5759
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
58-
}
60+
}

app/src/main/java/xyz/sangcomz/stickytimeline/MainActivity.kt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class MainActivity : AppCompatActivity() {
8484
)
8585

8686
horizontal_recycler_view.addItemDecoration(getSectionCallback(singerList))
87-
horizontal_recycler_view2.addItemDecoration(getSectionCallback(singerList))
87+
horizontal_recycler_view2.addItemDecoration(getSectionCallbackWithDrawable(singerList))
8888
}
8989

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

9494
//Get SectionCallback method
9595
private fun getSectionCallback(singerList: List<Singer>): SectionCallback {
96+
return object : SectionCallback {
97+
//In your data, implement a method to determine if this is a section.
98+
override fun isSection(position: Int): Boolean =
99+
singerList[position].debuted != singerList[position - 1].debuted
100+
101+
//Implement a method that returns a SectionHeader.
102+
override fun getSectionHeader(position: Int): SectionInfo? {
103+
val singer = singerList[position]
104+
return SectionInfo(singer.debuted, singer.group)
105+
}
106+
107+
}
108+
}
109+
110+
private fun getSectionCallbackWithDrawable(singerList: List<Singer>): SectionCallback {
96111
return object : SectionCallback {
97112
//In your data, implement a method to determine if this is a section.
98113
override fun isSection(position: Int): Boolean =

app/src/main/res/layout/activity_main.xml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
android:paddingBottom="16dp"
1818
android:text="VERTICAL"
1919
android:textColor="#ffffff"
20+
android:textDirection="locale"
2021
android:textSize="24dp"
2122
android:textStyle="bold"
2223
app:layout_constraintEnd_toEndOf="parent"
@@ -33,8 +34,12 @@
3334
app:layout_constraintStart_toStartOf="parent"
3435
app:layout_constraintTop_toBottomOf="@id/vertical_text_view"
3536
app:timeLineColor="#2196F3"
37+
app:timeLineDotColor="#2196F3"
38+
app:timeLineDotRadius="4dp"
39+
app:timeLineDotStrokeColor="#ffffff"
40+
app:timeLineDotStrokeSize="2dp"
3641
app:timeLineMode="vertical"
37-
app:timeLineWidth="2dp" />
42+
app:timeLineWidth="4dp" />
3843

3944
<androidx.constraintlayout.widget.Guideline
4045
android:id="@+id/guideline"
@@ -61,6 +66,7 @@
6166
android:paddingBottom="16dp"
6267
android:text="HORIZONTAL"
6368
android:textColor="#ffffff"
69+
android:textDirection="locale"
6470
android:textSize="24dp"
6571
android:textStyle="bold"
6672
app:layout_constraintEnd_toEndOf="parent"
@@ -81,17 +87,27 @@
8187
app:sectionSubTitleTextColor="#CDFFFFFF"
8288
app:sectionTitleTextColor="#ffffff"
8389
app:timeLineColor="#3F51B5"
84-
app:timeLineMode="horizontal" />
90+
app:timeLineDotColor="@color/colorPrimary"
91+
app:timeLineDotRadius="4dp"
92+
app:timeLineDotStrokeColor="#ffffff"
93+
app:timeLineDotStrokeSize="2dp"
94+
app:timeLineMode="horizontal"
95+
app:timeLineWidth="0dp" />
8596

8697
<xyz.sangcomz.stickytimelineview.TimeLineRecyclerView
8798
android:id="@+id/horizontal_recycler_view2"
8899
android:layout_width="0dp"
89100
android:layout_height="0dp"
90101
app:isSticky="true"
91-
app:timeLineMode="horizontal"
92102
app:layout_constraintBottom_toBottomOf="parent"
93103
app:layout_constraintEnd_toEndOf="parent"
94104
app:layout_constraintStart_toStartOf="parent"
95-
app:layout_constraintTop_toBottomOf="@+id/guideline2" />
105+
app:layout_constraintTop_toBottomOf="@+id/guideline2"
106+
app:timeLineDotColor="@color/colorPrimary"
107+
app:timeLineDotRadius="6dp"
108+
app:timeLineDotStrokeColor="#ffffff"
109+
app:timeLineDotStrokeSize="4dp"
110+
app:timeLineMode="horizontal"
111+
app:timeLineWidth="4dp" />
96112

97113
</androidx.constraintlayout.widget.ConstraintLayout>

app/src/main/res/layout/recycler_horizontal_row.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
android:layout_width="wrap_content"
1010
android:layout_height="wrap_content"
1111
android:padding="10dp"
12+
android:textDirection="locale"
1213
tools:text="name" />
1314

1415
</androidx.cardview.widget.CardView>

app/src/main/res/layout/recycler_vertical_row.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
android:layout_width="match_parent"
1010
android:layout_height="wrap_content"
1111
android:padding="10dp"
12+
android:textDirection="locale"
1213
tools:text="name" />
1314

1415
</androidx.cardview.widget.CardView>

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ buildscript {
88
}
99

1010
repositories {
11+
mavenLocal()
1112
google()
1213
jcenter()
1314
}
1415
dependencies {
15-
classpath 'com.android.tools.build:gradle:4.0.1'
16+
classpath 'com.android.tools.build:gradle:4.1.0'
1617
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1718
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
1819
// NOTE: Do not place your application dependencies here; they belong
@@ -22,6 +23,7 @@ buildscript {
2223

2324
allprojects {
2425
repositories {
26+
mavenLocal()
2527
google()
2628
jcenter()
2729
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon Aug 10 23:14:19 KST 2020
1+
#Fri Oct 16 21:54:52 KST 2020
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-6.1.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip

pic/stockroom_result.gif

6.52 MB
Loading

0 commit comments

Comments
 (0)