├── .gitignore ├── Jenkinsfile ├── LICENSE.md ├── README.md ├── build.gradle ├── demo ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── pyxis │ │ └── uzuki │ │ └── live │ │ └── sectioncalendarview │ │ └── demo │ │ ├── JavaActivity.java │ │ ├── KotlinActivity.kt │ │ └── MainActivity.kt │ └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── drawable │ └── ic_launcher_background.xml │ ├── layout │ ├── activity_main.xml │ └── activity_sample.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ └── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── docs ├── -section-calendar-view │ ├── alltypes │ │ └── index.html │ ├── index-outline.html │ ├── index.html │ ├── package-list │ ├── pyxis.uzuki.live.sectioncalendarview.adapter │ │ ├── -calendar-adapter │ │ │ ├── -init-.html │ │ │ ├── get-count.html │ │ │ ├── get-item-id.html │ │ │ ├── get-item.html │ │ │ ├── get-view.html │ │ │ ├── index.html │ │ │ ├── is-start.html │ │ │ ├── notify-data-set-changed.html │ │ │ ├── set-end-day.html │ │ │ ├── set-end.html │ │ │ ├── set-start-day.html │ │ │ └── set-start.html │ │ └── index.html │ ├── pyxis.uzuki.live.sectioncalendarview.impl │ │ ├── -on-day-selected-listener │ │ │ ├── index.html │ │ │ └── on-day-selected.html │ │ └── index.html │ ├── pyxis.uzuki.live.sectioncalendarview.model │ │ ├── -color-data │ │ │ ├── -builder │ │ │ │ ├── -init-.html │ │ │ │ ├── build.html │ │ │ │ ├── index.html │ │ │ │ ├── set-default-bg-color.html │ │ │ │ ├── set-default-text-color.html │ │ │ │ ├── set-end-day-bg-color.html │ │ │ │ ├── set-end-day-text-color.html │ │ │ │ ├── set-prev-day-text-color.html │ │ │ │ ├── set-selected-day-bg-color.html │ │ │ │ ├── set-start-day-bg-color.html │ │ │ │ ├── set-start-day-text-color.html │ │ │ │ └── set-today-text-color.html │ │ │ ├── -init-.html │ │ │ ├── default-bg-color.html │ │ │ ├── default-text-color.html │ │ │ ├── end-day-bg-color.html │ │ │ ├── end-day-text-color.html │ │ │ ├── index.html │ │ │ ├── prev-day-text-color.html │ │ │ ├── selected-day-bg-color.html │ │ │ ├── start-day-bg-color.html │ │ │ ├── start-day-text-color.html │ │ │ └── today-text-color.html │ │ ├── -day-data │ │ │ ├── -init-.html │ │ │ ├── day-str.html │ │ │ ├── day.html │ │ │ ├── full-day.html │ │ │ ├── index.html │ │ │ ├── month.html │ │ │ └── year.html │ │ └── index.html │ ├── pyxis.uzuki.live.sectioncalendarview.utils │ │ ├── assign-pad10.html │ │ ├── compare-day-equal.html │ │ ├── compare-day-great-equal.html │ │ ├── compare-day-great.html │ │ ├── compare-day-less-equal.html │ │ ├── compare-day-less.html │ │ ├── compare-equal.html │ │ ├── compare-greater-equal.html │ │ ├── compare-greater.html │ │ ├── compare-less-equal.html │ │ ├── compare-less.html │ │ ├── index.html │ │ ├── kotlin.-string │ │ │ ├── index.html │ │ │ └── to-int-or-zero.html │ │ └── not-empty-string.html │ └── pyxis.uzuki.live.sectioncalendarview │ │ ├── -section-calendar-view │ │ ├── -init-.html │ │ ├── build-calendar.html │ │ ├── clear-date.html │ │ ├── done.html │ │ ├── go-to-next-month.html │ │ ├── go-to-prev-month.html │ │ ├── index.html │ │ ├── on-item-click.html │ │ ├── set-color-data.html │ │ ├── set-date-format.html │ │ ├── set-err-toast-message.html │ │ └── set-on-day-selected-listener.html │ │ └── index.html ├── index.html └── style.css ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── library ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── pyxis │ │ └── uzuki │ │ └── live │ │ └── sectioncalendarview │ │ ├── SectionCalendarView.java │ │ ├── adapter │ │ └── CalendarAdapter.java │ │ ├── impl │ │ └── OnDaySelectedListener.java │ │ ├── model │ │ ├── ColorData.kt │ │ └── DayData.kt │ │ └── utils │ │ ├── CommonEx.kt │ │ └── InternalEx.kt │ └── res │ ├── drawable-hdpi │ ├── ic_arrow_left.png │ └── ic_arrow_right.png │ ├── drawable-mdpi │ ├── ic_arrow_left.png │ └── ic_arrow_right.png │ ├── drawable-xhdpi │ ├── ic_arrow_left.png │ └── ic_arrow_right.png │ ├── drawable-xxhdpi │ ├── ic_arrow_left.png │ └── ic_arrow_right.png │ ├── drawable-xxxhdpi │ ├── ic_arrow_left.png │ └── ic_arrow_right.png │ ├── layout │ ├── calendar_item.xml │ └── calendar_view.xml │ ├── values-ko │ └── strings.xml │ └── values │ └── strings.xml ├── sample.png └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | .idea/ 11 | .gradle/ -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | @Library('jenkins-shared-library')_ 2 | pipeline { 3 | agent any 4 | stages { 5 | stage ('Start') { 6 | steps { 7 | sendNotifications 'STARTED' 8 | } 9 | } 10 | stage('Make Environment') { 11 | parallel { 12 | stage('Touch local.properties') { 13 | steps { 14 | sh 'echo "sdk.dir=/opt/android-sdk-linux" >> local.properties' 15 | } 16 | } 17 | stage('Display directory') { 18 | steps { 19 | sh 'ls -la' 20 | } 21 | } 22 | } 23 | } 24 | stage('permission') { 25 | steps { 26 | sh 'chmod 777 gradlew' 27 | } 28 | } 29 | stage('assembleDebug') { 30 | steps { 31 | sh './gradlew assembleDebug --stacktrace' 32 | } 33 | } 34 | } 35 | post { 36 | always { 37 | sendNotifications currentBuild.result 38 | } 39 | } 40 | environment { 41 | GOOGLE_SERVICES_JSON = '' 42 | } 43 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SectionCalendarView [![](https://jitpack.io/v/WindSekirun/SectionCalendarView.svg)](https://jitpack.io/#WindSekirun/SectionCalendarView) 2 | 3 | [![Kotlin](https://img.shields.io/badge/kotlin-1.2.0-blue.svg)](http://kotlinlang.org) [![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-SectionCalendarView-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/6807) 4 | 5 | 6 | 7 | Custom CalendarView with selecting StartDay, EndDay for Android Application, written in Java and [Kotlin](http://kotlinlang.org) 8 | 9 | ### Usages 10 | 11 | *rootProject/build.gradle* 12 | ``` 13 | allprojects { 14 | repositories { 15 | maven { url 'https://jitpack.io' } 16 | } 17 | } 18 | ``` 19 | 20 | *app/build.gradle* 21 | ``` 22 | dependencies { 23 | implementation 'com.github.WindSekirun:SectionCalendarView:1.0.5.1' 24 | } 25 | ``` 26 | 27 | #### XML 28 | 29 | ```XML 30 | 35 | ``` 36 | 37 | #### Kotlin 38 | 39 | ```Kotlin 40 | calendarView.setDateFormat("yyyy MMM") 41 | calendarView.setPreventPreviousDate(true) 42 | calendarView.setErrToastMessage("You can not select the previous date.") 43 | calendarView.setOnDaySelectedListener { startDay, endDay -> 44 | txtStartDay.text = startDay 45 | txtEndDay.text = endDay 46 | } 47 | calendarView.buildCalendar() 48 | ``` 49 | 50 | #### Java 51 | 52 | ```Java 53 | calendarView.setDateFormat("yyyy MMM"); 54 | calendarView.setPreventPreviousDate(true); 55 | calendarView.setErrToastMessage("You can not select the previous date."); 56 | calendarView.setOnDaySelectedListener((startDay, endDay) -> { 57 | txtStartDay.setText(startDay); 58 | txtEndDay.setText(endDay); 59 | }); 60 | calendarView.buildCalendar(); 61 | ``` 62 | 63 | ### License 64 | 65 | ``` 66 | Copyright 2017 WindSekirun (DongGil, Seo) 67 | 68 | Licensed under the Apache License, Version 2.0 (the "License"); 69 | you may not use this file except in compliance with the License. 70 | You may obtain a copy of the License at 71 | 72 | http://www.apache.org/licenses/LICENSE-2.0 73 | 74 | Unless required by applicable law or agreed to in writing, software 75 | distributed under the License is distributed on an "AS IS" BASIS, 76 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 77 | See the License for the specific language governing permissions and 78 | limitations under the License. 79 | ``` 80 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.2.10' 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.0.1' 11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 12 | classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.15" 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | maven { url 'https://jitpack.io' } 23 | } 24 | } 25 | 26 | task clean(type: Delete) { 27 | delete rootProject.buildDir 28 | } 29 | -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /docs/ 3 | -------------------------------------------------------------------------------- /demo/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | 5 | android { 6 | compileSdkVersion 26 7 | 8 | 9 | 10 | defaultConfig { 11 | applicationId "pyxis.uzuki.live.sectioncalendarview.demo" 12 | minSdkVersion 16 13 | targetSdkVersion 26 14 | versionCode 1 15 | versionName "1.0" 16 | 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | 26 | compileOptions { 27 | sourceCompatibility JavaVersion.VERSION_1_8 28 | targetCompatibility JavaVersion.VERSION_1_8 29 | } 30 | } 31 | 32 | dependencies { 33 | implementation fileTree(include: ['*.jar'], dir: 'libs') 34 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 35 | implementation 'com.android.support:appcompat-v7:26.1.0' 36 | implementation project(':library') 37 | implementation 'com.github.WindSekirun:RichUtilsKt:2.0.4' 38 | implementation 'com.github.WindSekirun:PyxInjector:1.1.5' 39 | } -------------------------------------------------------------------------------- /demo/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /demo/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /demo/src/main/java/pyxis/uzuki/live/sectioncalendarview/demo/JavaActivity.java: -------------------------------------------------------------------------------- 1 | package pyxis.uzuki.live.sectioncalendarview.demo; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.widget.TextView; 6 | 7 | import pyxis.uzuki.live.pyxinjector.annotation.BindView; 8 | import pyxis.uzuki.live.pyxinjector.annotation.OnClick; 9 | import pyxis.uzuki.live.pyxinjector.base.InjectActivity; 10 | import pyxis.uzuki.live.sectioncalendarview.SectionCalendarView; 11 | 12 | /** 13 | * SectionCalendarView 14 | * Class: JavaActivity 15 | * Created by Pyxis on 2017-12-20. 16 | */ 17 | 18 | public class JavaActivity extends InjectActivity { 19 | private @BindView TextView txtStartDay; 20 | private @BindView TextView txtEndDay; 21 | private @BindView SectionCalendarView calendarView; 22 | 23 | @Override 24 | protected void onCreate(@Nullable Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.activity_sample); 27 | 28 | init(); 29 | } 30 | 31 | private void init() { 32 | calendarView.setDateFormat("yyyy MMM"); 33 | calendarView.setErrToastMessage("You can not select the previous date."); 34 | calendarView.setOnDaySelectedListener((startDay, endDay) -> { 35 | txtStartDay.setText(startDay); 36 | txtEndDay.setText(endDay); 37 | }); 38 | calendarView.buildCalendar(); 39 | } 40 | 41 | @OnClick(R.id.btnClear) 42 | private void clickClear() { 43 | calendarView.clearDate(); 44 | } 45 | 46 | @OnClick(R.id.btnDone) 47 | private void clickDone() { 48 | calendarView.sendNowValue(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /demo/src/main/java/pyxis/uzuki/live/sectioncalendarview/demo/KotlinActivity.kt: -------------------------------------------------------------------------------- 1 | package pyxis.uzuki.live.sectioncalendarview.demo 2 | 3 | import android.annotation.SuppressLint 4 | import android.os.Bundle 5 | import android.support.v7.app.AppCompatActivity 6 | import kotlinx.android.synthetic.main.activity_sample.* 7 | 8 | /** 9 | * SectionCalendarView 10 | * Class: KotlinActivity 11 | * Created by Pyxis on 2017-12-20. 12 | */ 13 | 14 | class KotlinActivity : AppCompatActivity() { 15 | 16 | override fun onCreate(savedInstanceState: Bundle?) { 17 | super.onCreate(savedInstanceState) 18 | setContentView(R.layout.activity_sample) 19 | 20 | init() 21 | } 22 | 23 | @SuppressLint("SetTextI18n") 24 | private fun init() { 25 | calendarView.setDateFormat("yyyy MMM") 26 | calendarView.setPreventPreviousDate(false) 27 | calendarView.setErrToastMessage("You can not select the previous date.") 28 | calendarView.setOnDaySelectedListener { startDay, endDay -> 29 | txtStartDay.text = startDay 30 | txtEndDay.text = endDay 31 | } 32 | calendarView.buildCalendar() 33 | 34 | btnClear.setOnClickListener { v -> calendarView.clearDate() } 35 | btnDone.setOnClickListener { v -> calendarView.sendNowValue() } 36 | } 37 | } -------------------------------------------------------------------------------- /demo/src/main/java/pyxis/uzuki/live/sectioncalendarview/demo/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package pyxis.uzuki.live.sectioncalendarview.demo 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import android.support.v7.app.AppCompatActivity 6 | import kotlinx.android.synthetic.main.activity_main.* 7 | 8 | class MainActivity : AppCompatActivity() { 9 | 10 | override fun onCreate(savedInstanceState: Bundle?) { 11 | super.onCreate(savedInstanceState) 12 | setContentView(R.layout.activity_main) 13 | 14 | btnKotlin.setOnClickListener { 15 | startActivity(Intent(this@MainActivity, KotlinActivity::class.java)) 16 | } 17 | 18 | btnJava.setOnClickListener { 19 | startActivity(Intent(this@MainActivity, JavaActivity::class.java)) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 |