Skip to content

Commit 0a873ac

Browse files
committed
Merge branch 'release/v0.0.19'
2 parents 04c7bb1 + 1b7304d commit 0a873ac

File tree

8 files changed

+25
-9
lines changed

8 files changed

+25
-9
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
StickyTimeLine is timeline view for android.
66

7-
## What's New in 0.0.18? :tada:
8-
- Update library
7+
## What's New in 0.0.19? :tada:
8+
- Customize drawable for dots in timeline view (#10) by [carohauta](https://github.com/carohauta) :clap::clap::clap:
99

1010
## How to Use
1111

@@ -16,7 +16,7 @@ StickyTimeLine is timeline view for android.
1616
}
1717
1818
dependencies {
19-
compile 'com.github.sangcomz:StickyTimeLine:v0.0.18'
19+
compile 'com.github.sangcomz:StickyTimeLine:v0.0.19'
2020
}
2121
```
2222
### Usage
@@ -119,7 +119,8 @@ class MainActivity : AppCompatActivity() {
119119
| sectionTitleTextSize | To change section title text size | 14sp |
120120
| sectionSubTitleTextSize | To change section sub title text size | 12sp |
121121
| sectionLineWidth | To change line width in timeline | 4dp |
122-
| :new: isSticky | To change Sticky functionality in the Timeline | true |
122+
| isSticky | To change Sticky functionality in the Timeline | true |
123+
| :new: customDotDrawable | To change the circle to custom drawable | null |
123124

124125
## Result Screen
125126

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24.0"
5+
android:viewportHeight="24.0">
6+
<path
7+
android:fillColor="#ff0000"
8+
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
9+
</vector>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
android:id="@+id/recycler_view"
1111
android:layout_width="match_parent"
1212
android:layout_height="wrap_content"
13+
app:customDotDrawable="@drawable/ic_star"
1314
app:isSticky="true" />
1415
</android.support.constraint.ConstraintLayout>

settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include ':app', ':stickytimelineview'
22

3-
gradle.ext.set('versionCode', 4)
4-
gradle.ext.set('versionName', '0.0.18')
3+
gradle.ext.set('versionCode', 5)
4+
gradle.ext.set('versionName', '0.0.19')
55

66
gradle.ext.set('minSdk', 16)
77
gradle.ext.set('targetSdk', 28)

stickytimelineview/src/main/java/xyz/sangcomz/stickytimelineview/RecyclerSectionItemDecoration.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class RecyclerSectionItemDecoration(
144144
headerTitle = headerView.findViewById(R.id.list_item_section_title)
145145
headerSubTitle = headerView.findViewById(R.id.list_item_section_sub_title)
146146
val dot: ImageView = headerView.findViewById(R.id.dot)
147-
dot.background = getOvalDrawable()
147+
dot.background = recyclerViewAttr.customDotDrawable ?: getOvalDrawable()
148148
recyclerViewAttr.let { attrs ->
149149
headerBackground?.apply {
150150
setBackgroundColor(attrs.sectionBackgroundColor)

stickytimelineview/src/main/java/xyz/sangcomz/stickytimelineview/TimeLineRecyclerView.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ class TimeLineRecyclerView(context: Context, attrs: AttributeSet?) : RecyclerVie
5454
context.resources.getDimension(R.dimen.sub_title_text_size)),
5555
it.getDimension(R.styleable.TimeLineRecyclerView_timeLineWidth,
5656
context.resources.getDimension(R.dimen.line_width)),
57-
it.getBoolean(R.styleable.TimeLineRecyclerView_isSticky, true))
57+
it.getBoolean(R.styleable.TimeLineRecyclerView_isSticky, true),
58+
it.getDrawable(R.styleable.TimeLineRecyclerView_customDotDrawable))
5859
}
5960

6061
}

stickytimelineview/src/main/java/xyz/sangcomz/stickytimelineview/model/RecyclerViewAttr.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package xyz.sangcomz.stickytimelineview.model
22

3+
import android.graphics.drawable.Drawable
4+
35
/**
46
* Created by seokwon.jeong on 17/11/2017.
57
*/
@@ -12,5 +14,6 @@ data class RecyclerViewAttr(val sectionBackgroundColor: Int,
1214
val sectionTitleTextSize: Float,
1315
val sectionSubTitleTextSize: Float,
1416
val sectionLineWidth: Float,
15-
val isSticky: Boolean
17+
val isSticky: Boolean,
18+
val customDotDrawable: Drawable?
1619
)

stickytimelineview/src/main/res/values/attrs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<attr name="sectionTitleTextSize" format="dimension" />
1414
<attr name="sectionSubTitleTextSize" format="dimension" />
1515
<attr name="isSticky" format="boolean" />
16+
<attr name="customDotDrawable" format="reference" />
1617
</declare-styleable>
1718
</resources>

0 commit comments

Comments
 (0)