GithubHelp home page GithubHelp logo

morristech / timeline-view-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vrgsoftua/timeline-view

0.0 1.0 0.0 3.41 MB

Open source android library

Home Page: http://vrgsoft.net

Java 100.00%

timeline-view-1's Introduction

Timeline View

alt text

Usage

For a working implementation, Have a look at the Sample Project - app

  1. Include the library as local library project.
allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

dependencies {

compile 'com.github.VRGsoftUA:Timeline-View:1.0.0'

}
  1. Include the YearLayout widget in your layout.

      <com.vrgsoft.yearview.YearLayout
        android:id="@+id/year_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent"
        android:scrollbarStyle="insideOverlay"
        android:scrollbars="horizontal"
        app:description_text_size="8sp"
        app:row_text_size="14sp"
        app:year_text_size="9sp"
        />

3 You need to implement YearModel interface in your model

  class SomeModel:YearModel
  1. In your onCreate method refer to the View and setup YearLayout.Builder.Also you can implement OnRowClickListener for handling clicks
        YearLayout.Builder builder = new YearLayout.Builder();
        builder.setYears(mModels)
                .setMaxYear(2017)
                .setMinYear(1860)
                .attachToActivity(this)
                .setOnRowClick(this)
                .setYearBackgroundColor(R.color.line_color)
                .setYearTitleColor(R.color.colorPrimary)
                .setYearRowTextColor(R.color.colorPrimaryDark)
                .create();
        mYearLayout.setBuilder(builder);
    }
    
    @Override
    public void onClick(int year, ClickView.ItemHolder view) {
        Toast.makeText(this, "Clicked on year " + year, Toast.LENGTH_SHORT).show();
    }

    Customisation

    You can add fields via xml or via Builder. Supported fields:
       <attr name="year_text_size" format="dimension"/>
       <attr name="row_text_size" format="dimension"/>
       <attr name="description_text_size" format="dimension"/>
       <attr name="year_background_color" format="color"/>
       <attr name="year_title_color" format="color"/>
       <attr name="year_row_text_color" format="color"/>
       <attr name="min_year" format="integer"/>
       <attr name="max_year" format="integer"/>

    Contributing

  • Contributions are always welcome
  • If you want a feature and can code, feel free to fork and add the change yourself and make a pull request

timeline-view-1's People

Contributors

pawlo2102 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.