Timeline-View


Source link: https://github.com/vipulasri/Timeline-View

Timeline-View

Android Timeline View Library (Using RecyclerView) is simple implementation used to display view like Tracking of shipment/order, steppers etc.

Specs

Badges/Featured In

Sample Project

You can download the latest sample APK from this repo here: https://github.com/vipulasri/Timeline-View/tree/master/apk

For information : checkout Sample App Code in repository.

Download

Quick Setup

1. Include library

Using Gradle

dependencies {

  compile 'com.github.vipulasri:timelineview:1.0.5' 
}

Using Maven

<dependency>
  <groupId>com.github.vipulasri</groupId>
  <artifactId>timelineview</artifactId>
  <version>1.0.5</version>
  <type>pom</type> </dependency> 

Manual:

Manual - Using Android Studio:

  • Download the library folder and import to your root application folder. You can manually achieve this step with 3 steps:
    1. Paste the folder library into your application at the same level of your app, build and gradle folder
    2. Add to your settings.gradle file the following code line: "include ':app', ':timelineview'"
    3. Rebuild the project
  • File → Project Structure → in Modules section click on "app" → Click on tab "Dependecies" → Click on the green plus → Module Dependecy → Select ":library"
  • Done

What's New

See the project's Releases page for a list of versions with their changelogs.

View Releases

If you Watch this repository, GitHub will send you an email every time I publish an update.

2. Usage

  • In XML Layout :
<com.github.vipulasri.timelineview.TimelineView
  android:id="@+id/time_marker"
  android:layout_width="wrap_content"
  android:layout_height="match_parent"
  app:markerSize="20dp"
  app:lineSize="2dp"
  app:line="@color/colorPrimary"/>
Line Padding around marker
<com.github.vipulasri.timelineview.TimelineView
  android:id="@+id/time_marker"
  android:layout_width="wrap_content"
  android:layout_height="match_parent"
  app:markerSize="20dp"
  app:lineSize="2dp"
  app:line="@color/colorPrimary"
  app:linePadding="5dp"/>
  • Configure using xml attributes or setters in code:

    Attribute Name Default Value Description
    app:marker="@drawable/marker" Green Colored Oval Drawable sets marker drawable
    app:markerSize="25dp" 25dp sets marker size
    app:markerInCenter="false" true sets the marker in center of line if `true`
    app:line="@color/primarColor" Dark Grey Line sets line color
    app:lineSize="2dp" 2dp sets line width
    app:lineOrientation="horizontal" vertical sets orientation of line ie `horizontal` or `vertical`
    app:linePadding="5dp" 0dp sets line padding around marker
  • RecyclerView Holder : Your RecyclerViewHolder should have an extra paramenter in constructor i.e viewType from onCreateViewHolder. You would also have to call the method initLine(viewType) in constructor definition.

 public class TimeLineViewHolder extends RecyclerView.ViewHolder {

public  TimelineView mTimelineView;

 public TimeLineViewHolder(View itemView, int viewType) {

 super(itemView);

 mTimelineView = (TimelineView) itemView.findViewById(R.id.time_marker);

 mTimelineView.initLine(viewType);

}

  
}
 
  • RecyclerView Adapter : override getItemViewType method in Adapter
 @Override
  public int getItemViewType(int position) {

return TimelineView.getTimeLineViewType(position,getItemCount());

  
}
 

And pass the viewType from onCreateViewHolder to its Holder.

 @Override
  public TimeLineViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

View view = View.inflate(parent.getContext(), R.layout.item_timeline, null);

return new TimeLineViewHolder(view, viewType);

  
}
 

Apps that use this library

If you're using this library in your app and you'd like to list it here, Please let me know via email, pull requests or issues.

License

Copyright 2017 Vipul Asri  Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

Resources

An example application for the Android Data Binding library, implementing retrofit to fetch a list of repositories and update a RecyclerView using the binding methods to display each repository as a view component.

Wrapper around the android Camera class that simplifies its usage.

Enjarify is a tool for translating Dalvik bytecode to equivalent Java bytecode. This allows Java analysis tools to analyze Android applications.

Monitoring, crash reports & statistics.

Asks the user if (s)he wants to open the Play Store to rate your application when certain requirements are met. This can and should be configured to be very cautious. Don't annoy your users!

Infer is a static analysis tool for Java, Objective-C and C, written in OCaml.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes