All Projects → jerryOkafor → Timelineview

jerryOkafor / Timelineview

Licence: mit
A simple Timeline View that demonstrates the power of ConstraintLayout and RecyclerView. No drawing, just plug in and play.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Timelineview

edsc-timeline
No description or website provided.
Stars: ✭ 16 (-95.49%)
Mutual labels:  timeline
Stream Js
JS / Browser Client - Build Activity Feeds & Streams with GetStream.io
Stars: ✭ 286 (-19.44%)
Mutual labels:  timeline
Tockler
Application that tracks your time by monitoring your active windows (only titles) and idle time.
Stars: ✭ 301 (-15.21%)
Mutual labels:  timeline
React Horizontal Timeline
[Not maintained] A Timeline component
Stars: ✭ 257 (-27.61%)
Mutual labels:  timeline
Timeline list
Timeline widget for flutter
Stars: ✭ 281 (-20.85%)
Mutual labels:  timeline
Leaflet.timeline
Display arbitrary GeoJSON on a map with a timeline slider and play button
Stars: ✭ 291 (-18.03%)
Mutual labels:  timeline
notifyme
react-notification-timeline is a react based component helps in managing the notification in time-based manner.
Stars: ✭ 94 (-73.52%)
Mutual labels:  timeline
React Timeline Gantt
A react Timeline component with virtual rendering
Stars: ✭ 347 (-2.25%)
Mutual labels:  timeline
Mojs
The motion graphics toolbelt for the web
Stars: ✭ 17,189 (+4741.97%)
Mutual labels:  timeline
Zmjganttchart
Full configurable spreadsheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, gantt chart or timetable as if you are using Excel.
Stars: ✭ 301 (-15.21%)
Mutual labels:  timeline
Scena
🎬 Scena is a component that represents the timeline of Scene.js. You can control time, properties, and items.
Stars: ✭ 259 (-27.04%)
Mutual labels:  timeline
Stepperview
SwiftUI iOS component for Step Indications.
Stars: ✭ 281 (-20.85%)
Mutual labels:  timeline
Stream Laravel
Laravel Client - Build Activity Feeds & Streams with GetStream.io
Stars: ✭ 299 (-15.77%)
Mutual labels:  timeline
timeline heatmap
A kibana visualization that uses swim lanes to visualize multiple sources over time. Each swim lane represents a source and the intervals of the date histogram are colored based on the metric defined at the given time.
Stars: ✭ 18 (-94.93%)
Mutual labels:  timeline
Devportfolio
A lightweight, customizable single-page personal portfolio website template built with JavaScript and Sass
Stars: ✭ 3,582 (+909.01%)
Mutual labels:  timeline
react-native-beautiful-timeline
Fully customizable, beautifully designed Timeline for React Native.
Stars: ✭ 111 (-68.73%)
Mutual labels:  timeline
Vue Cute Timeline
A cute timeline component for Vue.js.
Stars: ✭ 289 (-18.59%)
Mutual labels:  timeline
Timelineparticlecontrol
An example of controlling particle system from timeline.
Stars: ✭ 348 (-1.97%)
Mutual labels:  timeline
Timeline View
Android Timeline View is used to display views like Tracking of shipment/order, steppers etc.
Stars: ✭ 3,553 (+900.85%)
Mutual labels:  timeline
Proceduralmotiontrack
Simple procedural motion with Unity Timeline.
Stars: ✭ 300 (-15.49%)
Mutual labels:  timeline

TimeLineView

Android Timeline View Library demonstrate the the power of ConstraintnLayout and RecyclerView.

Build Status codecov Codacy Badge Android Arsenal License

Showcase

ExampleMain      ExampleMain      ExampleMain

Quick Setup

1. Include library

Using Gradle

TimelineView is currently available in on Jitpack so add the following line before every other thing if you have not done that already.

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

Then add the following line

dependencies {
  compile 'com.github.po10cio:TimeLineView:1.0.2'
}

Using Maven

Also add the following lines before adding the maven dependency

<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>

Then add the dependency

<dependency>
  <groupId>com.github.po10cio</groupId>
  <artifactId>TimeLineView</artifactId>
  <version>1.0.2</version>
</dependency>

2. Usage

In your XML layout include the TimelineView as follows:

<me.jerryhanks.stepview.TimeLineView
  android:id="@+id/timelineView"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_marginBottom="8dp"
  android:layout_marginLeft="8dp"
  android:layout_marginRight="8dp"
  android:layout_marginTop="16dp">
      

Then in your Kotlin code, do the following:

Create a class that extends TimeLine

class MyTimeLine(status: Status, var title: String?, var content: String?) : TimeLine(status) {
  override fun equals(other: Any?): Boolean {
    if (this === other) return true
    if (javaClass != other?.javaClass) return false
        other as MyTimeLine
    
    if (title != other.title) return false
    if (content != other.content) return false

    return true
  }
  
  override fun hashCode(): Int {
    var result = if (title != null) title!!.hashCode() else 0
    result = 31 * result + if (content != null) content!!.hashCode() else 0
    
    return result
  }

  override fun toString(): String {
    return "MyTimeLine{" +
      "title='" + title + '\'' +
      ", content='" + content + '\'' +
      '}'
  }
}

TimeLine has three Statuses:

  • Status.COMPLETED
  • Status.UN_COMPLETED
  • Status.ATTENTION

You can choose from any of the statuses depending on the status of the item you want to represent.

Create an Array of your TimeLine

val timeLines = mutableListOf<MyTimeLine>()
  .apply {
    add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_1), getString(R.string.s_content_1)))
    add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_2), getString(R.string.s_content_2)))
    add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_3), getString(R.string.s_content_3)))
    add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_4), getString(R.string.s_content_4)))
    add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_5), getString(R.string.s_content_5)))
    add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_6), getString(R.string.s_content_6)))
    add(MyTimeLine(Status.COMPLETED, getString(R.string.s_title_7), getString(R.string.s_content_7)))
  }

Create the IndicatorAdapter and add it to the TimeLineView

val adapter = IndicatorAdapter(mutableListOf(), this, object : TimeLineViewCallback<MyTimeLine> {
  override fun onBindView(model: MyTimeLine, container: FrameLayout, position: Int): View {
    val view = layoutInflater
      .inflate(R.layout.sample_time_line,
      container, false)
      
    (view.findViewById<TextView>(R.id.tv_title)).text = model.title
    (view.findViewById<TextView>(R.id.tv_content)).text = model.content
   
    return view
  }
})

timelineView.setIndicatorAdapter(adapter)
adapter.swapItems(timeLines)

IndicatorAdapter This extends RecyclerView.Adapter and exposes the following functions:

  • Swaps the old items with the new items
fun swapItems(timeLines: List<T>)
  • Update a single item given the index
fun updateItem(timeline: T, position: Int) 
  • Adds a list of items to the list starting from the given index
fun addItems(vararg items: T, index: Int = itemCount)

Changelog

See the changelog file.

License

TimeLineView is distributed under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].