├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ ├── mipmap-xhdpi │ │ │ ├── back_ns.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── drawable │ │ │ ├── calendar_check_bg.xml │ │ │ └── ic_launcher_background.xml │ │ └── layout │ │ │ ├── calendar_group_item.xml │ │ │ ├── calendar_child_item.xml │ │ │ ├── main_activity_layout.xml │ │ │ ├── calendar_activity_layout.xml │ │ │ └── loading_widget_show.xml │ │ ├── java │ │ └── com │ │ │ └── wugj │ │ │ └── calendar │ │ │ ├── CalendarListener.java │ │ │ ├── CalendarApp.java │ │ │ ├── CalendarBean.java │ │ │ ├── MainActivity.java │ │ │ ├── DateBean.java │ │ │ ├── SpecialDayUtil.java │ │ │ ├── LunarDayUtil.java │ │ │ └── CalendarActivity.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── device-2018-07-03-160102.png ├── device-2018-07-03-160123.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── inspectionProfiles │ └── Project_Default.xml └── misc.xml ├── gradle.properties ├── .gitignore ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /device-2018-07-03-160102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuguojin/CalendarPriceList/HEAD/device-2018-07-03-160102.png -------------------------------------------------------------------------------- /device-2018-07-03-160123.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuguojin/CalendarPriceList/HEAD/device-2018-07-03-160123.png -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | CalendarPriceList 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuguojin/CalendarPriceList/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/back_ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuguojin/CalendarPriceList/HEAD/app/src/main/res/mipmap-xhdpi/back_ns.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuguojin/CalendarPriceList/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuguojin/CalendarPriceList/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/calendar_check_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/wugj/calendar/CalendarListener.java: -------------------------------------------------------------------------------- 1 | package com.wugj.calendar; 2 | 3 | /** 4 | * 日历点击回调事件 5 | * 6 | * @author wuguojin 7 | * @date 2018/6/11 8 | */ 9 | public interface CalendarListener { 10 | void onDaySelect(DateBean bean); 11 | } 12 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Jun 11 15:03:37 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 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/wugj/calendar/CalendarApp.java: -------------------------------------------------------------------------------- 1 | package com.wugj.calendar; 2 | 3 | import android.app.Application; 4 | 5 | import com.huicent.library.utils.Utils; 6 | 7 | /** 8 | * 注意: 核心库初始化 9 | * 10 | * @author wuguojin 11 | * @date 2018/6/11 12 | */ 13 | public class CalendarApp extends Application { 14 | 15 | @Override 16 | public void onCreate() { 17 | super.onCreate(); 18 | Utils.init(this); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /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/res/layout/calendar_group_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /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=-Xmx4096m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 13 | org.gradle.parallel=true 14 | org.gradle.daemon=true 15 | 16 | ## init project compile params 17 | compile_sdk_version=26 18 | build_tool_version=26.0.2 19 | application_id=com.huicent.library 20 | min_sdk_version=15 21 | target_sdk_version=26 22 | android_support_library_version=25.3.1 23 | kotlin_version=1.1.51 24 | 25 | ## init app version param 26 | version_code=100 27 | version_name=1.0.0 -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | 5 | apply from: '../build-third.gradle' 6 | 7 | repositories { 8 | flatDir { 9 | dirs 'libs' 10 | } 11 | } 12 | 13 | android { 14 | compileSdkVersion Integer.parseInt("${compile_sdk_version}") 15 | buildToolsVersion "${build_tool_version}" 16 | 17 | defaultConfig { 18 | applicationId "${application_id}" 19 | minSdkVersion Integer.parseInt("${min_sdk_version}") 20 | targetSdkVersion Integer.parseInt("${target_sdk_version}") 21 | versionCode Integer.parseInt("${version_code}") 22 | versionName "${version_name}" 23 | multiDexEnabled true 24 | javaCompileOptions { 25 | annotationProcessorOptions { includeCompileClasspath = true } 26 | } 27 | } 28 | 29 | buildTypes { 30 | release { 31 | minifyEnabled false 32 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 33 | } 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 | # Uncomment the following line if you do not want to check your keystore files in. 45 | #*.jks 46 | 47 | # External native build folder generated in Android Studio 2.2 and later 48 | .externalNativeBuild 49 | 50 | # Google Services (e.g. APIs or Firebase) 51 | google-services.json 52 | 53 | # Freeline 54 | freeline.py 55 | freeline/ 56 | freeline_project_description.json 57 | -------------------------------------------------------------------------------- /app/src/main/java/com/wugj/calendar/CalendarBean.java: -------------------------------------------------------------------------------- 1 | package com.wugj.calendar; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | /** 7 | * 类描述 8 | * 9 | * @author wuguojin 10 | * @date 2018/6/8 11 | */ 12 | public class CalendarBean implements Serializable { 13 | private int year; 14 | private int month; 15 | private String shownTitle; 16 | private List dateBeans; 17 | 18 | public int getYear() { 19 | return year; 20 | } 21 | 22 | public void setYear(int year) { 23 | this.year = year; 24 | } 25 | 26 | public int getMonth() { 27 | return month; 28 | } 29 | 30 | public void setMonth(int month) { 31 | this.month = month; 32 | } 33 | 34 | public String getShownTitle() { 35 | return shownTitle; 36 | } 37 | 38 | public void setShownTitle(String shownTitle) { 39 | this.shownTitle = shownTitle; 40 | } 41 | 42 | public List getDateBeans() { 43 | return dateBeans; 44 | } 45 | 46 | public void setDateBeans(List dateBeans) { 47 | this.dateBeans = dateBeans; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CalendarPriceList 2 | 3 | > 使用RecyvlerView打造价格日历界面 4 | 5 | ### 使用说明: 6 | 7 | #### 日历跳转 8 | 9 | ##### 单选日期: 10 | 11 | CalendarActivity.startForResult(activity, 12 | CalendarActivity.MODE.SINGLE.toNumber(), null, 0x1024); 13 | 14 | ##### 往返日期: 15 | 16 | CalendarActivity.startForResult(activity, 17 | CalendarActivity.MODE.ROUND.toNumber(), null, 0x1024); 18 | 19 | #### 获得结果 20 | 21 | @Override 22 | public void onActivityResult(int requestCode, int resultCode, Intent data) { 23 | super.onActivityResult(requestCode, resultCode, data); 24 | if (requestCode == 0x1024) { 25 | if (data == null || resultCode != RESULT_OK) { 26 | return; 27 | } 28 | // 出发日期 29 | depDateBean = (DateBean) data.getSerializableExtra("resultDate"); 30 | // 回程日期 31 | backDateBean = (DateBean) data.getSerializableExtra("resultDate_back"); 32 | } 33 | } 34 | 35 | 效果图: 36 | 37 | ![效果图](https://github.com/wuguojin/CalendarPriceList/blob/master/device-2018-07-03-160102.png?raw=true) 38 | 39 | ![效果图](https://github.com/wuguojin/CalendarPriceList/blob/master/device-2018-07-03-160123.png?raw=true) -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 18 | 19 | 20 | 24 | 25 |