├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── 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 │ │ │ │ ├── dimen.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── fantasy │ │ │ └── doubledatepickerdemo │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── fantasy │ │ │ └── doubledatepickerdemo │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── fantasy │ │ └── doubledatepickerdemo │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── doubledatepicker ├── .gitignore ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── end_time_bg.png │ │ │ │ └── begin_time_bg.png │ │ │ ├── values │ │ │ │ ├── dimen.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── anim │ │ │ │ ├── popwindow_enter.xml │ │ │ │ └── popwindow_exit.xml │ │ │ ├── drawable │ │ │ │ ├── btn_selector.xml │ │ │ │ ├── wheel_val.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ └── layout │ │ │ │ ├── popwindow_bottom_layout.xml │ │ │ │ └── data_time_layout.xml │ │ └── java │ │ │ └── com │ │ │ └── fantasy │ │ │ └── doubledatepicker │ │ │ ├── OnWheelScrollListener.java │ │ │ ├── OnWheelChangedListener.java │ │ │ ├── WheelAdapter.java │ │ │ ├── NumericWheelAdapter.java │ │ │ ├── TimeUtil.java │ │ │ ├── DoubleDateSelectDialog.java │ │ │ └── WheelView.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── fantasy │ │ │ └── doubledatepicker │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── fantasy │ │ └── doubledatepicker │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── encodings.xml ├── vcs.xml ├── modules.xml ├── runConfigurations.xml └── misc.xml ├── gradle.properties ├── .gitignore ├── README.md ├── gradlew.bat ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /doubledatepicker/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':doubledatepicker' 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenfantasy/DoubleDatePicker/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenfantasy/DoubleDatePicker/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenfantasy/DoubleDatePicker/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenfantasy/DoubleDatePicker/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenfantasy/DoubleDatePicker/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenfantasy/DoubleDatePicker/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenfantasy/DoubleDatePicker/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenfantasy/DoubleDatePicker/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenfantasy/DoubleDatePicker/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /doubledatepicker/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenfantasy/DoubleDatePicker/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenfantasy/DoubleDatePicker/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /doubledatepicker/src/main/res/mipmap-xhdpi/end_time_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenfantasy/DoubleDatePicker/HEAD/doubledatepicker/src/main/res/mipmap-xhdpi/end_time_bg.png -------------------------------------------------------------------------------- /doubledatepicker/src/main/res/mipmap-xhdpi/begin_time_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenfantasy/DoubleDatePicker/HEAD/doubledatepicker/src/main/res/mipmap-xhdpi/begin_time_bg.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17sp 4 | 5 | 3dp 6 | 16sp 7 | -------------------------------------------------------------------------------- /doubledatepicker/src/main/res/values/dimen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17sp 4 | 5 | 3dp 6 | 16sp 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Jan 20 16:01:00 CST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 7 | -------------------------------------------------------------------------------- /doubledatepicker/src/main/res/anim/popwindow_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /doubledatepicker/src/main/res/anim/popwindow_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /doubledatepicker/src/main/res/drawable/btn_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | DoubleDatePicker 3 | 4 | 确 认 5 | 取 消 6 | 7 | 8 | 请选择日期 9 | 10 | 开始于\n 11 | 结束于\n 12 | 13 | 开始时间不能大于结束时间 14 | 15 | -------------------------------------------------------------------------------- /doubledatepicker/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | DoubleDatePicker 3 | 确 认 4 | 取 消 5 | 6 | 7 | 请选择日期 8 | 9 | 开始于\n 10 | 结束于\n 11 | 12 | 开始时间不能大于结束时间 13 | 14 | -------------------------------------------------------------------------------- /app/src/test/java/com/fantasy/doubledatepickerdemo/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.fantasy.doubledatepickerdemo; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /doubledatepicker/src/test/java/com/fantasy/doubledatepicker/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.fantasy.doubledatepicker; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | #efefef 8 | #333333 9 | #45a2ff 10 | #ffffff 11 | #999999 12 | #7eb3ff 13 | 14 | 15 | -------------------------------------------------------------------------------- /doubledatepicker/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | #efefef 8 | #333333 9 | #45a2ff 10 | #ffffff 11 | #999999 12 | #7eb3ff 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /app/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 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doubledatepicker/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 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/fantasy/doubledatepickerdemo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.fantasy.doubledatepickerdemo; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.fantasy.doubledatepicker", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /doubledatepicker/src/androidTest/java/com/fantasy/doubledatepicker/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.fantasy.doubledatepicker; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.fantasy.doubledatepicker.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /doubledatepicker/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 26 5 | 6 | 7 | 8 | defaultConfig { 9 | minSdkVersion 15 10 | targetSdkVersion 26 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 15 | 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | 25 | } 26 | 27 | dependencies { 28 | implementation fileTree(dir: 'libs', include: ['*.jar']) 29 | 30 | implementation 'com.android.support:appcompat-v7:26.1.0' 31 | testImplementation 'junit:junit:4.12' 32 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 33 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 34 | } 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/workspace.xml 38 | .idea/tasks.xml 39 | .idea/gradle.xml 40 | .idea/dictionaries 41 | .idea/libraries 42 | 43 | # Keystore files 44 | *.jks 45 | 46 | # External native build folder generated in Android Studio 2.2 and later 47 | .externalNativeBuild 48 | 49 | # Google Services (e.g. APIs or Firebase) 50 | google-services.json 51 | 52 | # Freeline 53 | freeline.py 54 | freeline/ 55 | freeline_project_description.json 56 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | defaultConfig { 6 | applicationId "com.fantasy.doubledatepicker" 7 | minSdkVersion 15 8 | targetSdkVersion 26 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | implementation fileTree(dir: 'libs', include: ['*.jar']) 23 | implementation 'com.android.support:appcompat-v7:26.1.0' 24 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 25 | testImplementation 'junit:junit:4.12' 26 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 27 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 28 | compile project(path: ':doubledatepicker') 29 | } 30 | -------------------------------------------------------------------------------- /doubledatepicker/src/main/java/com/fantasy/doubledatepicker/OnWheelScrollListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Yuri Kanivets 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.fantasy.doubledatepicker; 18 | 19 | /** 20 | * Wheel scrolled listener interface. 21 | */ 22 | public interface OnWheelScrollListener { 23 | /** 24 | * Callback method to be invoked when scrolling started. 25 | * @param wheel the wheel view whose state has changed. 26 | */ 27 | void onScrollingStarted(WheelView wheel); 28 | 29 | /** 30 | * Callback method to be invoked when scrolling ended. 31 | * @param wheel the wheel view whose state has changed. 32 | */ 33 | void onScrollingFinished(WheelView wheel); 34 | } 35 | -------------------------------------------------------------------------------- /doubledatepicker/src/main/res/drawable/wheel_val.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 27 | 28 | 31 | -------------------------------------------------------------------------------- /doubledatepicker/src/main/java/com/fantasy/doubledatepicker/OnWheelChangedListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Yuri Kanivets 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.fantasy.doubledatepicker; 18 | 19 | /** 20 | * Wheel changed listener interface. 21 | *

The currentItemChanged() method is called whenever current wheel positions is changed: 22 | *

  • New Wheel position is set 23 | *
  • Wheel view is scrolled 24 | */ 25 | public interface OnWheelChangedListener { 26 | /** 27 | * Callback method to be invoked when current item changed 28 | * @param wheel the wheel view whose state has changed 29 | * @param oldValue the old value of current item 30 | * @param newValue the new value of current item 31 | */ 32 | void onChanged(WheelView wheel, int oldValue, int newValue); 33 | } 34 | -------------------------------------------------------------------------------- /doubledatepicker/src/main/java/com/fantasy/doubledatepicker/WheelAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Yuri Kanivets 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.fantasy.doubledatepicker; 18 | 19 | public interface WheelAdapter { 20 | /** 21 | * Gets items count 22 | * @return the count of wheel items 23 | */ 24 | public int getItemsCount(); 25 | 26 | /** 27 | * Gets a wheel item by index. 28 | * 29 | * @param index the item index 30 | * @return the wheel item text or null 31 | */ 32 | public String getItem(int index); 33 | 34 | /** 35 | * Gets maximum item length. It is used to determine the wheel width. 36 | * If -1 is returned there will be used the default wheel width. 37 | * 38 | * @return the maximum item length or -1 39 | */ 40 | public int getMaximumLength(); 41 | } 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DoubleDatePicker 2 | ### 安卓双日期选择器,可以选择开始日期和结束日期。 3 | 4 | ![](http://oic2oders.bkt.clouddn.com/double_picker_1.gif) 5 | 6 | 7 | 8 | ![](http://oic2oders.bkt.clouddn.com/double_picker_2.gif) 9 | 10 | ### How to 11 | 12 | **Step 1.** Add the JitPack repository to your build file 13 | 14 | Add it in your root build.gradle at the end of repositories: 15 | 16 | ``` 17 | allprojects { 18 | repositories { 19 | ... 20 | maven { url 'https://jitpack.io' } 21 | } 22 | } 23 | ``` 24 | 25 | **Step 2.** Add the dependency 26 | 27 | ``` 28 | dependencies { 29 | compile 'com.github.darrenfantasy:DoubleDatePicker:1.0' 30 | } 31 | ``` 32 | 33 | **Step 3.** API 34 | 35 | ``` 36 | /** 37 | * @param context 38 | * @param allowedSmallestDate 日期选择器的起始日期 39 | * @param allowedBiggestDate 日期选择器的终止日期 40 | */ 41 | public DoubleDateSelectDialog(Context context, String allowedSmallestDate, String allowedBiggestDate) 42 | ``` 43 | 44 | ``` 45 | /** 46 | * 47 | * @param context 48 | * @param allowedSmallestDate 日期选择器的起始日期 49 | * @param allowedBiggestDate 日期选择器的终止日期 50 | * @param defaultChooseDate 日期选择器默认选择日期 51 | */ 52 | public DoubleDateSelectDialog(Context context, String allowedSmallestDate, String allowedBiggestDate, String defaultChooseDate) 53 | ``` 54 | 55 | ``` 56 | /** 57 | * set监听 58 | * 59 | * @param onDateSelectFinished 完成监听 60 | */ 61 | public void setOnDateSelectFinished(OnDateSelectFinished onDateSelectFinished) 62 | ``` -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 20 | 21 | 26 | 27 | 32 | 33 |