Code Monkey home page Code Monkey logo

persian-horizontal-date-picker's Introduction

Persian Horizontal Date Picker

This Library is a date picker for Android to pick a date and only supports a year from the day you open the app.

Demo

persian_horizontal-date-picker

Usage

First add jitpack to your projects build.gradle file

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

Then add the dependency in your android app module's build.gradle file.

dependencies {
    implementation 'com.github.Behkha:Persian-Horizontal-Date-Picker:1.1.0'
}

Then use the view in your layouts:

<com.ratintech.behkha.persiandatepicker.PersianDatePicker
        android:id="@+id/persian_date_picker"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        >

Setup

PersianDatePicker persianDatePicker = findViewById(R.id.persian_date_picker);
        persianDatePicker.setYearMonths( new Calendar( new PersianCalendar().getPersianLongDate()).getYearMonths() )
                .setDefaultItemBackgroundColor(R.color.defaultBackgroundColor)  // background color of non-selected item
                .setDefaultItemTextColor(R.color.defaultTextColor)  // text color of non-selected item
                .setSelectedItemBackgroundColor(R.color.colorPrimary) // background color of selected item
                .setSelectedItemTextColor(R.color.selectText)   // text color of selected item
                .setListener(new PersianDatePicker.OnDaySelectListener() {
                    @Override
                    public void onDaySelect(YearMonth yearMonth, Day day) {
                        // right your code here when item is selected 
                    }
                })
                .setItemElevation( 4f )  // default is 0
                .setItemRadius( 2f )  // default is 0
                .hasAnimation(true) // Animation for item selection . default is false 
                .load();

persian-horizontal-date-picker's People

Contributors

behkha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

bhmn shm1994

persian-horizontal-date-picker's Issues

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.