GithubHelp home page GithubHelp logo

trendingtechnology / datepickertimeline Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 101loop/datepickertimeline

0.0 2.0 0.0 147 KB

Android Date Picker Library that provides a calendar as a horizontal timeline

License: Apache License 2.0

Java 100.00%

datepickertimeline's Introduction

DatePickerTimeline

An android package that provides a horizontal date picker

Download

DatePicker Logo

Gradle

In your module (app-level) Gradle file (usually app/build.gradle), Add this line inside the dependencies block.

dependencies {
    ...
    implementation 'com.vivekkaushik.datepicker:datePickerTimeline:0.0.1'
}

Usage

Add DatePickerTimeline View to your layout file

<com.vivekkaushik.datepicker.DatePickerTimeline
android:id="@+id/datePickerTimeline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Properties:

You can use the following properties in your XML to change your DatePickerTimeline colors.

  • app:dateTextColor (color) -> default -> Black
  • app:dayTextColor (color) -> default -> Black
  • app:monthTextColor (color) -> default -> Black

JAVA

DatePickerTimeline datePickerTimeline = findViewById(R.id.dateTimeline);
// Set a Start date (Default, 1 Jan 1970)
datePickerTimeline.setInitialDate(2019, 3, 21);
// Set a date Selected Listener
datePickerTimeline.setOnDateSelectedListener(new OnDateSelectedListener() {
    @Override
    public void onDateSelected(int year, int month, int day, int dayOfWeek) {
        //Do Something
    }
});

You can also use the built in methods to change the text color

datePickerTimeline.setDateTextColor(Color.RED);
datePickerTimeline.setDayTextColor(Color.RED);
datePickerTimeline.setMonthTextColor(Color.RED);

LIMITATIONS

  • Text Size currently can't be changed

FIXES

  • This project is using androidX artifacts make sure you have migrated your project to androidX.
  • If Preview dosen't show up in android Studio then make sure you have added android recycler view.

Creator

datepickertimeline's People

Contributors

iamvivekkaushik avatar

Watchers

 avatar  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.