Skip to content

Commit 9e34317

Browse files
committed
fix : update readme
1 parent 8cb027a commit 9e34317

10 files changed

Lines changed: 88 additions & 63 deletions

File tree

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ Version 1.0.0 *(2017-11-23)*
99
Version 1.0.1 *(2017-12-06)*
1010
----------------------------
1111

12-
- imeLineViewCallback callback now returns a view
12+
- TimeLineViewCallback callback now returns a view

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ Android Timeline View Library demonstrate the the power of ConstraintnLayout and
55

66
[![](https://jitpack.io/v/po10cio/TimeLineView.svg)](https://jitpack.io/#po10cio/TimeLineView)
77
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/po10cio/TimeLineView/blob/master/LICENSE.md)
8-
8+
99

1010
##Showcase
1111

1212

1313
<img src="sc/sc1.png" alt="ExampleMain" width="240">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
14-
<img src="sc/sc2.png" alt="ExampleMain" width="240">
14+
<img src="sc/sc2.png" alt="ExampleMain" width="240">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
15+
<img src="sc/sc3.png" alt="ExampleMain" width="240">
1516

1617

1718
##Quick Setup
@@ -48,16 +49,16 @@ Also add the following lines before adding the maven dependency
4849
<id>jitpack.io</id>
4950
<url>https://jitpack.io</url>
5051
</repository>
51-
</repositories>
52+
</repositories>
5253
```
5354
Then add the dependency
5455

5556
``` maven
5657
<dependency>
57-
<groupId>com.github.po10cio</groupId>
58-
<artifactId>TimeLineView</artifactId>
59-
<version>1.0.0</version>
60-
</dependency>
58+
<groupId>com.github.po10cio</groupId>
59+
<artifactId>TimeLineView</artifactId>
60+
<version>1.0.0</version>
61+
</dependency>
6162
```
6263

6364
###2. Usage

app/src/main/java/me/jerryhanks/stepviewapp/MainActivity.kt

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,27 @@ import kotlinx.android.synthetic.main.activity_main.*
99
import me.jerryhanks.stepview.IndicatorAdapter
1010
import me.jerryhanks.stepview.interfaces.TimeLineViewCallback
1111
import me.jerryhanks.stepview.model.Status
12-
import java.util.*
1312

1413
class MainActivity : AppCompatActivity() {
1514

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

20-
val timeLines = ArrayList<MyTimeLine>()
21-
timeLines.add(MyTimeLine(Status.COMPLETED, getString(R.string.title_1), getString(R.string.content_1)))
22-
timeLines.add(MyTimeLine(Status.UN_COMPLETED, getString(R.string.title_2), getString(R.string.content_2)))
23-
timeLines.add(MyTimeLine(Status.COMPLETED, getString(R.string.title_3), getString(R.string.content_3)))
24-
timeLines.add(MyTimeLine(Status.COMPLETED, getString(R.string.title_4), getString(R.string.content_4)))
25-
timeLines.add(MyTimeLine(Status.ATTENTION, getString(R.string.title_5), getString(R.string.content_5)))
26-
timeLines.add(MyTimeLine(Status.COMPLETED, getString(R.string.title_6), getString(R.string.content_6)))
19+
val timeLines = mutableListOf<MyTimeLine>()
20+
.apply {
21+
add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_1), getString(R.string.s_content_1)))
22+
add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_2), getString(R.string.s_content_2)))
23+
add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_3), getString(R.string.s_content_3)))
24+
add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_4), getString(R.string.s_content_4)))
25+
add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_5), getString(R.string.s_content_5)))
26+
add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_6), getString(R.string.s_content_6)))
27+
add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_7), getString(R.string.s_content_7)))
2728

28-
//
29-
// timeLines.add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_1), getString(R.string.s_content_1)))
30-
// timeLines.add(MyTimeLine(Status.UN_COMPLETED, getString(R.string.s_title_2), getString(R.string.s_content_2)))
31-
// timeLines.add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_3), getString(R.string.s_content_3)))
32-
// timeLines.add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_4), getString(R.string.s_content_4)))
33-
// timeLines.add(MyTimeLine(Status.ATTENTION, getString(R.string.s_title_5), getString(R.string.s_content_5)))
34-
// timeLines.add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_6), getString(R.string.s_content_6)))
29+
}
3530

3631

37-
val adapter = IndicatorAdapter(timeLines, this, object : TimeLineViewCallback<MyTimeLine> {
32+
val adapter = IndicatorAdapter(mutableListOf(), this, object : TimeLineViewCallback<MyTimeLine> {
3833
override fun onBindView(model: MyTimeLine, container: FrameLayout, position: Int): View {
3934
val view = layoutInflater
4035
.inflate(R.layout.sample_time_line,
@@ -50,8 +45,8 @@ class MainActivity : AppCompatActivity() {
5045
adapter.swapItems(timeLines)
5146

5247
//set the title
53-
caption.text = getString(R.string.timeline_of_world_war_i)
54-
// caption.text = getString(R.string.delivery_status)
48+
// caption.text = getString(R.string.timeline_of_world_war_i)
49+
caption.text = getString(R.string.delivery_status)
5550

5651
}
5752
}

app/src/main/java/me/jerryhanks/stepviewapp/MyTimeLine.kt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,22 @@ import me.jerryhanks.stepview.model.TimeLine
77
* @author <@Po10cio> on 10/18/17 for StepViewApp
88
*/
99

10-
class MyTimeLine(status: Status, var title: String?, var content: String?) : TimeLine(status) {
10+
class MyTimeLine(status: Status, var title: String?, var content: String?) : TimeLine(status) {
1111

1212

13-
override fun equals(o: Any?): Boolean {
14-
if (this === o) return true
15-
if (o !is MyTimeLine) return false
13+
override fun equals(other: Any?): Boolean {
14+
if (this === other) return true
15+
if (javaClass != other?.javaClass) return false
1616

17-
val that = o as MyTimeLine?
17+
other as MyTimeLine
1818

19-
if (if (title != null) title != that!!.title else that!!.title != null) return false
20-
return if (content != null) content == that.content else that.content == null
19+
if (title != other.title) return false
20+
if (content != other.content) return false
21+
22+
return true
2123
}
2224

25+
2326
override fun hashCode(): Int {
2427
var result = if (title != null) title!!.hashCode() else 0
2528
result = 31 * result + if (content != null) content!!.hashCode() else 0
@@ -32,4 +35,6 @@ class MyTimeLine(status: Status, var title: String?, var content: String?) : Tim
3235
", content='" + content + '\'' +
3336
'}'
3437
}
38+
39+
3540
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
app:layout_constraintLeft_toLeftOf="parent"
3535
app:layout_constraintRight_toRightOf="parent"
3636
app:layout_constraintTop_toBottomOf="@+id/caption"
37-
app:layout_constraintVertical_bias="0.0">
38-
39-
40-
</me.jerryhanks.stepview.TimeLineView>
37+
app:layout_constraintVertical_bias="0.0" />
4138

4239
</android.support.constraint.ConstraintLayout>

app/src/main/res/values/strings.xml

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,56 @@
3030
Fakhri Pasha surrenders at Medina. Treaty of Versailles between the Allies and Germany: the Peace Conference opens in Paris\n\nThe United Kingdom ratifies the Treaty of Versailles
3131
</string>
3232

33-
<string name="s_title_1">UnAssigned</string>
34-
<string name="s_title_2">Assigned</string>
35-
<string name="s_title_3">Acknowledged</string>
36-
<string name="s_title_4">Arrived Pickup</string>
37-
<string name="s_title_5">Pickup</string>
38-
<string name="s_title_6">Arrived Delivery</string>
39-
<string name="s_title_7">Delivered</string>
40-
<string name="s_content_1">Oct 30, 2017 @ 3:30 PM</string>
41-
<string name="s_content_2">Oct 30, 2017 @ 3:33 PM</string>
42-
<string name="s_content_3">Oct 30, 2017 @ 3:35 PM</string>
43-
<string name="s_content_4">Oct 30, 2017 @ 3:40 PM</string>
44-
<string name="s_content_5">Oct 30, 2017 @ 3:50 PM</string>
45-
<string name="s_content_6">Oct 30, 2017 @ 4:30 PM</string>
33+
<!--<string name="s_title_1">UnAssigned</string>-->
34+
<!--<string name="s_title_2">Assigned</string>-->
35+
<!--<string name="s_title_3">Acknowledged</string>-->
36+
<!--<string name="s_title_4">Arrived Pickup</string>-->
37+
<!--<string name="s_title_5">Pickup</string>-->
38+
<!--<string name="s_title_6">Arrived Delivery</string>-->
39+
<!--<string name="s_title_7">Delivered</string>-->
40+
<!--<string name="s_content_1">Oct 30, 2017 @ 3:30 PM</string>-->
41+
<!--<string name="s_content_2">Oct 30, 2017 @ 3:33 PM</string>-->
42+
<!--<string name="s_content_3">Oct 30, 2017 @ 3:35 PM</string>-->
43+
<!--<string name="s_content_4">Oct 30, 2017 @ 3:40 PM</string>-->
44+
<!--<string name="s_content_5">Oct 30, 2017 @ 3:50 PM</string>-->
45+
<!--<string name="s_content_6">Oct 30, 2017 @ 4:30 PM</string>-->
46+
<!--<string name="timeline_of_world_war_i">Timeline of World War I</string>-->
47+
<!--<string name="delivery_status">Delivery Statuses</string>-->
48+
49+
50+
<string name="s_title_1">STEP 1</string>
51+
<string name="s_title_2">STEP 2</string>
52+
<string name="s_title_3">STEP 3</string>
53+
<string name="s_title_4">Step 4</string>
54+
<string name="s_title_5">STEP 5</string>
55+
<string name="s_title_6">STEP 6</string>
56+
<string name="s_title_7">STEP 7</string>
57+
58+
<string name="s_content_1">Orientation\nPrio to the beginning of the year.</string>
59+
<string name="s_content_2">Self-Assessment Goal setting\nPrio to the Goal Setting Conference</string>
60+
<string name="s_content_3">Beginning of the year Conference\nBy The end of september</string>
61+
<string name="s_content_4">School Site Visits/Informal Assessment\nOngoing</string>
62+
<string name="s_content_5">Mid-Year conference\nPrio to the end of the school year.</string>
63+
<string name="s_content_6">Identify and collect Artifacts and Evidence\nAt or new the end of the school year</string>
64+
<string name="s_content_7">End of the Year conference and Settings\nEnd of the School Year once all performance has been received and analysed</string>
4665
<string name="timeline_of_world_war_i">Timeline of World War I</string>
47-
<string name="delivery_status">Delivery Statuses</string>
66+
<string name="delivery_status">Steps!!</string>
67+
68+
69+
<!--<string name="s_title_1">1958</string>-->
70+
<!--<string name="s_title_2">1971</string>-->
71+
<!--<string name="s_title_3">1980</string>-->
72+
<!--<string name="s_title_4">1982</string>-->
73+
<!--<string name="s_title_5">1990</string>-->
74+
<!--<string name="s_title_6">1991</string>-->
75+
<!--<string name="s_title_7">1993</string>-->
76+
77+
<!--<string name="s_content_1">American Century founded</string>-->
78+
<!--<string name="s_content_2">U.S Growth Equity Inception</string>-->
79+
<!--<string name="s_content_3">U.S Fixed Income inception</string>-->
80+
<!--<string name="s_content_4">First Institution client</string>-->
81+
<!--<string name="s_content_5">U.S Core Equity inception</string>-->
82+
<!--<string name="s_content_6">International Equity Inception</string>-->
83+
<!--<string name="s_content_7">U.S Value Equity Inception</string>-->
84+
<!--<string name="delivery_status">US Equity</string>-->
4885
</resources>

sc/sc2.png

560 KB
Loading

sc/sc3.png

751 KB
Loading

timelineview/src/main/java/me/jerryhanks/stepview/model/TimeLine.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,4 @@ package me.jerryhanks.stepview.model
44
* @author <@Po10cio> on 10/18/17 for StepViewApp
55
*/
66

7-
open class TimeLine {
8-
var status: Status? = null
9-
10-
constructor(status: Status) {
11-
this.status = status
12-
}
13-
14-
constructor() {
15-
this.status = Status.COMPLETED
16-
}
17-
}
7+
open class TimeLine @JvmOverloads constructor(open var status: Status = Status.COMPLETED)

0 commit comments

Comments
 (0)