├── .gitignore ├── LICENSE ├── README.md ├── TimetableView ├── .idea │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations.xml │ └── workspace.xml ├── AndroidManifest.xml ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── ic_launcher-web.png ├── proguard-project.txt ├── project.properties ├── res │ ├── drawable-hdpi │ │ ├── ic_add.png │ │ └── ic_launcher.png │ ├── drawable-ldpi │ │ └── layer_gridview.xml │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── drawable-xxhdpi │ │ └── ic_launcher.png │ ├── drawable │ │ ├── course_redpoint_style.xml │ │ ├── item_corner_style.xml │ │ ├── layout_press_style.xml │ │ ├── week_oval_normal_style.xml │ │ ├── week_oval_press_style.xml │ │ ├── week_oval_style.xml │ │ ├── weekview_thisweek.xml │ │ └── weekview_white.xml │ ├── layout │ │ ├── chooseweek_item_layout.xml │ │ ├── item_dateview.xml │ │ ├── item_dateview_first.xml │ │ ├── item_slide_default.xml │ │ ├── item_slide_time.xml │ │ ├── item_timetable.xml │ │ ├── item_weekview.xml │ │ ├── timetable_layout.xml │ │ ├── view_content.xml │ │ ├── view_simplescrollview.xml │ │ └── view_weekview.xml │ ├── menu │ │ └── main.xml │ ├── values-v11 │ │ └── styles.xml │ ├── values-v14 │ │ └── styles.xml │ ├── values-w820dp │ │ └── dimens.xml │ └── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml └── src │ └── com │ └── zhuangfei │ └── timetable │ ├── TimetableView.java │ ├── listener │ ├── ISchedule.java │ ├── IWeekView.java │ ├── OnConfigHandleAdapter.java │ ├── OnDateBuildAapter.java │ ├── OnFlaglayoutClickAdapter.java │ ├── OnItemBuildAdapter.java │ ├── OnItemClickAdapter.java │ ├── OnItemLongClickAdapter.java │ ├── OnScrollViewBuildAdapter.java │ ├── OnSlideBuildAdapter.java │ ├── OnSpaceItemClickAdapter.java │ ├── OnWeekChangedAdapter.java │ ├── OnWeekItemClickedAdapter.java │ ├── OnWeekLeftClickedAdapter.java │ └── package-info.java │ ├── model │ ├── Schedule.java │ ├── ScheduleColorPool.java │ ├── ScheduleConfig.java │ ├── ScheduleEnable.java │ ├── ScheduleSupport.java │ ├── WeekViewEnable.java │ └── package-info.java │ ├── operater │ ├── AbsOperater.java │ ├── SimpleOperater.java │ └── package-info.java │ ├── package-info.java │ ├── utils │ ├── ColorUtils.java │ ├── ScreenUtils.java │ └── package-info.java │ └── view │ ├── PerWeekView.java │ ├── WeekView.java │ └── package-info.java ├── app ├── .gitignore ├── build.gradle ├── debug │ ├── app-debug.apk │ └── output-metadata.json ├── proguard-rules.pro ├── release │ ├── app-release.apk │ └── output-metadata.json └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── example │ │ └── hhuclassschedule │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ └── parseHtml.js │ ├── ic_launcher-playstore.png │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── hhuclassschedule │ │ │ ├── AboutActivity.java │ │ │ ├── AddCourseActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── MyConfig.java │ │ │ ├── MySubject.java │ │ │ ├── NotificationConfigActivity.java │ │ │ ├── ParseHtmlActivity.java │ │ │ ├── SplashActivity.java │ │ │ ├── SubjectRepertory.java │ │ │ ├── adapter │ │ │ ├── OnDateDelayAdapter.java │ │ │ └── OnMyConfigHandleAdapter.java │ │ │ ├── receiver │ │ │ └── AlarmReceiver.java │ │ │ └── util │ │ │ ├── ContextApplication.java │ │ │ ├── SharedPreferencesUtil.java │ │ │ └── TimeCalUtil.java │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── dialog_radius_bg.xml │ │ ├── ic_kechengbiao.xml │ │ ├── ic_launcher_background.xml │ │ ├── ic_launcher_foreground.xml │ │ ├── ic_menu.png │ │ ├── switch_ios_thumb.xml │ │ ├── switch_ios_track_off.xml │ │ ├── switch_ios_track_on.xml │ │ ├── switch_ios_track_selector.xml │ │ └── widgets_button_small_blue_bg.xml │ │ ├── font │ │ └── iconfont.ttf │ │ ├── layout │ │ ├── activity_about.xml │ │ ├── activity_add_course.xml │ │ ├── activity_main.xml │ │ ├── activity_notification_config.xml │ │ ├── activity_parse_html.xml │ │ ├── activity_splash.xml │ │ ├── fragment_confirm.xml │ │ ├── fragment_course_detail.xml │ │ ├── fragment_select_date.xml │ │ ├── fragment_select_time.xml │ │ ├── fragment_select_week.xml │ │ ├── header_base_func.xml │ │ ├── item_add_course_base.xml │ │ ├── item_add_course_detail.xml │ │ └── toolbar.xml │ │ ├── menu │ │ ├── popmenu_base_func.xml │ │ └── savemenu.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── ic_launcher_trans.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-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── example │ └── hhuclassschedule │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── img ├── 1623573908305.jpg ├── 1623573908311.jpg ├── 1623573908317.jpg ├── 1623573908321.jpg ├── 1623573908326.jpg ├── 1623573908331.jpg ├── 1623573908335.jpg ├── 1623573908340.jpg ├── 1623573908350.jpg ├── 1623573908354.jpg └── 1623574151732.jpg └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | .cxx 10 | /TimetableView/build/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 yuchen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HHUClassSchedule 2 | 3 | > HHU课程表是一个简洁高效无广告的课程表软件,正在开发中 4 | 5 | # 特点 6 | 7 | - 简洁,无广告 8 | - 支持教务系统课表的导入 9 | - 纯java开发,适合新手学习,二次开发 10 | 11 | # 已实现的功能 12 | 13 | - 添加、删除、修改课程 14 | - 教务系统导入课程 15 | - 设置开学时间 16 | - 设置当前周 17 | - 课程通知提醒 18 | - 隐藏/显示周末 19 | - 隐藏/显示非本周课程 20 | - 隐藏/显示节次时间 21 | 22 |

23 | 24 | 25 | 26 |

27 |

28 | 29 | 30 | 31 |

32 | 33 | 34 | # 开发流程 35 | 36 | > [阮一峰的git教程](https://www.liaoxuefeng.com/wiki/896043488029600) 37 | 38 | 1. fork本项目到自己的仓库 39 | 2. 获取自己仓库的git链接,clone到本地开发 40 | 3. push到自己的远程仓库 41 | 4. pr提交到dev分支 42 | 43 | # 注意事项 44 | 45 | - pr提交到dev分支,不是main分支! 46 | 47 | 48 | # 感谢 49 | 50 | - [com.zhuangfei.timetable](https://github.com/zfman/TimetableView) 51 | - [cn.carbswang.android:NumberPickerView](https://github.com/Carbs0126/NumberPickerView) 52 | - [com.github.GrenderG:Toasty](https://github.com/GrenderG/Toasty) 53 | - [WakeupSchedule_Kotlin](https://github.com/YZune/WakeupSchedule_Kotlin) 54 | - [AIschedule-HHU-URP](https://github.com/yuchenii/AIschedule-HHU-URP) 55 | -------------------------------------------------------------------------------- /TimetableView/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /TimetableView/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /TimetableView/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TimetableView/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /TimetableView/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /TimetableView/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | api fileTree(include: '*.jar', dir: 'libs') 5 | implementation 'androidx.appcompat:appcompat:1.3.0' 6 | } 7 | 8 | android { 9 | compileSdkVersion 30 10 | buildToolsVersion "30.0.3" 11 | 12 | compileOptions { 13 | sourceCompatibility JavaVersion.VERSION_1_8 14 | targetCompatibility JavaVersion.VERSION_1_8 15 | } 16 | 17 | sourceSets { 18 | main { 19 | manifest.srcFile 'AndroidManifest.xml' 20 | java.srcDirs = ['src'] 21 | resources.srcDirs = ['src'] 22 | aidl.srcDirs = ['src'] 23 | renderscript.srcDirs = ['src'] 24 | res.srcDirs = ['res'] 25 | assets.srcDirs = ['assets'] 26 | } 27 | 28 | // Move the tests to tests/java, tests/res, etc... 29 | androidTest.setRoot('tests') 30 | 31 | // Move the build types to build-types/ 32 | // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ... 33 | // This moves them out of them default location under src//... which would 34 | // conflict with src/ being used by the main source set. 35 | // Adding new build types or product flavors should be accompanied 36 | // by a similar customization. 37 | debug.setRoot('build-types/debug') 38 | release.setRoot('build-types/release') 39 | } 40 | 41 | buildTypes { 42 | release { 43 | //混淆 44 | minifyEnabled false 45 | 46 | //加载默认混淆配置文件 47 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 48 | } 49 | } 50 | defaultConfig { 51 | minSdkVersion 21 52 | targetSdkVersion 30 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /TimetableView/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/TimetableView/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /TimetableView/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jan 28 17:35:13 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 | -------------------------------------------------------------------------------- /TimetableView/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /TimetableView/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /TimetableView/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/TimetableView/ic_launcher-web.png -------------------------------------------------------------------------------- /TimetableView/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /TimetableView/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-19 15 | android.library.reference.1=..\\pulltorefreshlibrary 16 | android.library=true 17 | -------------------------------------------------------------------------------- /TimetableView/res/drawable-hdpi/ic_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/TimetableView/res/drawable-hdpi/ic_add.png -------------------------------------------------------------------------------- /TimetableView/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/TimetableView/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /TimetableView/res/drawable-ldpi/layer_gridview.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /TimetableView/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/TimetableView/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /TimetableView/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/TimetableView/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /TimetableView/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/TimetableView/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /TimetableView/res/drawable/course_redpoint_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TimetableView/res/drawable/item_corner_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /TimetableView/res/drawable/layout_press_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TimetableView/res/drawable/week_oval_normal_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /TimetableView/res/drawable/week_oval_press_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /TimetableView/res/drawable/week_oval_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /TimetableView/res/drawable/weekview_thisweek.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /TimetableView/res/drawable/weekview_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /TimetableView/res/layout/chooseweek_item_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 20 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /TimetableView/res/layout/item_dateview.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 18 | 19 | 24 | -------------------------------------------------------------------------------- /TimetableView/res/layout/item_dateview_first.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /TimetableView/res/layout/item_slide_default.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 13 | 14 | -------------------------------------------------------------------------------- /TimetableView/res/layout/item_slide_time.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /TimetableView/res/layout/item_timetable.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 17 | 27 | 28 | -------------------------------------------------------------------------------- /TimetableView/res/layout/item_weekview.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 21 | 26 | 27 | 33 | 34 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /TimetableView/res/layout/timetable_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /TimetableView/res/layout/view_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 20 | 21 | 22 | 23 | 30 | 31 | 38 | 39 | 46 | 47 | 54 | 55 | 62 | 63 | 70 | 71 | 78 | 79 | 80 | 86 | 87 | 91 | 92 | -------------------------------------------------------------------------------- /TimetableView/res/layout/view_simplescrollview.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /TimetableView/res/layout/view_weekview.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 22 | 23 | 24 | 29 | 30 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /TimetableView/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /TimetableView/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /TimetableView/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /TimetableView/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 64dp 9 | 16dp 10 | 56dp 11 | 57dp 12 | 55dp 13 | 3dp 14 | 3dp 15 | 50dp 16 | 17 | 2dp 18 | 80dp 19 | 20 | -------------------------------------------------------------------------------- /TimetableView/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /TimetableView/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #000000 5 | 6 | 7 | #FB6A8F 8 | 9 | 10 | 11 | 12 | 13 | #31C453 14 | 15 | 16 | #FB5137 17 | 18 | 19 | #F52A64 20 | 21 | #84fab0 22 | #8fd3f4 23 | 24 | 25 | #F2F2F2 26 | #EEEEEE 27 | #d81e06 28 | #E8E8E8 29 | #999999 30 | #E6E6E6 31 | #f0f0f0 32 | #636363 33 | 34 | 35 | #FFFFCC 36 | #2196F3 37 | #3FCAB8 38 | 39 | #2ABFFD 40 | #4F8CFE 41 | #FB6A8F 42 | 43 | #faf6f0 44 | #ffac37 45 | #24b9fe 46 | 47 | #BFF6F4 48 | #F4F8F8 49 | #0E0E0E 50 | #D3D3D3 51 | #5ACE45 52 | #ffffff 53 | #FF6633 54 | #EDF0F2 55 | #F7F7F7 56 | 57 | #5D89B6 58 | #C4F1FD 59 | #3D3B46 60 | #8D8B99 61 | #5A5865 62 | 63 | 64 | #FFFF99 65 | #AAA3DB 66 | #86ACE9 67 | #92D261 68 | #80D8A3 69 | #F1C672 70 | #FDAD8B 71 | #ADBEFF 72 | #94D6FA 73 | #C3B5F6 74 | #99CCFF 75 | #FBA6ED 76 | 77 | #EE8262 78 | #EE6363 79 | #EEB4B4 80 | #D2B48C 81 | #CD9B9B 82 | #5F9EA0 83 | 84 | #E6E6E6 85 | 86 | #000000 87 | 88 | 89 | #CCCCCC 90 | 91 | #e7e7e7 92 | #d9d9d9 93 | 94 | #effafe 95 | #f0ffec 96 | #f3fffc 97 | 98 | 99 | #00abcf 100 | #d5ddde 101 | #d3d3d3 102 | #bfbfbf 103 | #FF9966 104 | #66FF66 105 | 106 | #F3F4F7 107 | #E0E0E0 108 | #D7D7DA 109 | 110 | #FDCD00 111 | #EBEBEB 112 | #393939 113 | #8E8E93 114 | #DADBE2 115 | #474747 116 | 117 | #0effc2 118 | #63AEFF 119 | #D6D6D6 120 | 121 | #E9E9E9 122 | #13B0F1 123 | #F4F8F8 124 | #E4EBEE 125 | 126 | #333333 127 | #E2F7F6 128 | #F1FFFE 129 | #B7F5F2 130 | 131 | -------------------------------------------------------------------------------- /TimetableView/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 55dp 7 | 3dp 8 | 3dp 9 | 50dp 10 | 2dp 11 | 12 | -------------------------------------------------------------------------------- /TimetableView/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | subject-timetable 5 | Hello world! 6 | Settings 7 | 8 | 9 | -------------------------------------------------------------------------------- /TimetableView/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/listener/ISchedule.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.listener; 2 | 3 | import android.content.Context; 4 | import android.graphics.drawable.GradientDrawable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.widget.FrameLayout; 8 | import android.widget.LinearLayout; 9 | import android.widget.TextView; 10 | 11 | import com.zhuangfei.timetable.TimetableView; 12 | import com.zhuangfei.timetable.model.Schedule; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * 与Schedule有关的接口. 18 | */ 19 | 20 | public interface ISchedule { 21 | 22 | /** 23 | * 课程项点击监听器 24 | */ 25 | interface OnItemClickListener { 26 | /** 27 | * 当课程项被点击时回调 28 | * 29 | * @param v 30 | * @param scheduleList 该位置的所有课程 31 | */ 32 | void onItemClick(View v, List scheduleList); 33 | } 34 | 35 | /** 36 | * 课程项长按事件监听器 37 | */ 38 | interface OnItemLongClickListener { 39 | /** 40 | * 当课程项被点击时回调 41 | * 42 | * @param v 43 | * @param day 星期,1:周一,7:周日 44 | * @param start 节次,从1开始 45 | */ 46 | void onLongClick(View v, int day,int start,int id); 47 | } 48 | 49 | /** 50 | * 空白格子点击监听器 51 | */ 52 | interface OnSpaceItemClickListener { 53 | /** 54 | * 当课程项被点击时回调 55 | * 56 | * @param day 表示周几,0:周一,6:周日 57 | * @param start 表示点击空白格子的节次,1:第一节 58 | */ 59 | void onSpaceItemClick(int day,int start); 60 | 61 | /** 62 | * 初始化方法 63 | * @param flagLayout 一个指示器的布局 64 | * @param monthWidth 月份列宽度 65 | * @param itemWidth 课程项宽度,itemWidth:是包含了边距的,设置宽度时所以需要减去边距 66 | * @param itemHeight 课程项高度 67 | * @param marTop 外边距 68 | */ 69 | void onInit(LinearLayout flagLayout,int monthWidth,int itemWidth, 70 | int itemHeight,int marTop,int marLeft); 71 | } 72 | 73 | /** 74 | * 旗标布局点击监听器 75 | */ 76 | interface OnFlaglayoutClickListener { 77 | /** 78 | * 当旗标布局被点击时回调 79 | * 80 | * @param day 表示周几,0:周一,6:周日 81 | * @param start 表示点击空白格子的节次,1:第一节 82 | */ 83 | void onFlaglayoutClick(int day,int start); 84 | } 85 | 86 | /** 87 | * 周次改变监听器 88 | */ 89 | interface OnWeekChangedListener { 90 | /** 91 | * 当周次被改变时回调 92 | * 93 | * @param curWeek 改变的周次,不一定是当前周,因为切换周次的时候有两种模式: 94 | * 仅仅切换周次、强制切换,前者不会更改当前周 95 | */ 96 | void onWeekChanged(int curWeek); 97 | } 98 | 99 | /** 100 | * 课程项构建时回调 101 | */ 102 | interface OnItemBuildListener { 103 | 104 | /** 105 | * 构建课程项的文本时回调. 106 | * 107 | * @param schedule 该位置对应的课程实体 108 | * @param isThisWeek 该课程是否是本周上 109 | * @return 110 | */ 111 | String getItemText(Schedule schedule, boolean isThisWeek); 112 | 113 | //当changeWeek()调用结束后回调该接口 114 | //你可以在这里对属性进行二次设置,从而使其符合需求 115 | 116 | /** 117 | * 课程项构建完成后回调. 118 | * 119 | * @param layout 课程项的帧布局 120 | * @param textView 课程项的内容区域 121 | * @param countTextView 课程项的角标 122 | * @param schedule 课程实体 123 | * @param gd 内容区域的背景是使用GradientDrawable来设置的,你可以二次设置 124 | */ 125 | void onItemUpdate(FrameLayout layout, TextView textView, TextView countTextView, 126 | Schedule schedule, GradientDrawable gd); 127 | } 128 | 129 | /** 130 | * 侧边栏构建监听器 131 | */ 132 | interface OnSlideBuildListener { 133 | 134 | /** 135 | * 构建每项 136 | * 137 | * @param pos 位置 138 | * @param inflater 转换器 139 | * @param itemHeight 课程项的高度 140 | * @param marTop 课程项的marTop值 141 | * @return 构建好的一个侧边项 142 | */ 143 | View getView(int pos, LayoutInflater inflater, int itemHeight, int marTop); 144 | 145 | /** 146 | * 初始化方法 147 | * @param layout 日期栏容器 148 | * @param alpha 透明度 149 | */ 150 | void onInit(LinearLayout layout,float alpha); 151 | } 152 | 153 | /** 154 | * 滚动布局构建监听器 155 | */ 156 | interface OnScrollViewBuildListener { 157 | /** 158 | * 构建滚动布局时回调 159 | * 160 | * @param mInflate 161 | * @return 162 | */ 163 | View getScrollView(LayoutInflater mInflate); 164 | } 165 | 166 | /** 167 | * 日期构造监听器 168 | */ 169 | interface OnDateBuildListener { 170 | 171 | /** 172 | * 初始化方法 173 | * @param layout 日期栏容器 174 | * @param alpha 透明度 175 | */ 176 | void onInit(LinearLayout layout,float alpha); 177 | 178 | /** 179 | * 获取View数组 180 | * 被废弃,自v2.0.3起该方法无效 181 | * 182 | * @param mInflate 转换器 183 | * @param monthWidth 月份宽度px 184 | * @param perWidth 日期每项宽度px 185 | * @param height 默认的日期栏高度 186 | * @return 187 | */ 188 | View[] getDateViews(LayoutInflater mInflate, float monthWidth,float perWidth, int height); 189 | 190 | /** 191 | * 为日期栏设置高亮时回调 192 | */ 193 | void onHighLight(); 194 | 195 | /** 196 | * 更新日期时回调 197 | */ 198 | void onUpdateDate(int curWeek,int targetWeek); 199 | } 200 | 201 | interface OnConfigHandleListener{ 202 | void onParseConfig(String key, String value, TimetableView mView); 203 | } 204 | } 205 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/listener/IWeekView.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.listener; 2 | 3 | /** 4 | * WeekView的相关接口. 5 | */ 6 | 7 | public interface IWeekView { 8 | 9 | /** 10 | * WeekView的Item点击监听器 11 | */ 12 | interface OnWeekItemClickedListener{ 13 | /** 14 | * 当Item被点击时回调 15 | * @param week 选择的周次 16 | */ 17 | void onWeekClicked(int week); 18 | } 19 | 20 | /** 21 | * WeekView的左侧(设置当前周)的点击监听器 22 | */ 23 | interface OnWeekLeftClickedListener{ 24 | /** 25 | * 当"设置当前周"按钮被点击时回调 26 | */ 27 | void onWeekLeftClicked(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/listener/OnConfigHandleAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.listener; 2 | 3 | import com.zhuangfei.timetable.TimetableView; 4 | 5 | /** 6 | * Created by Liu ZhuangFei on 2018/12/21. 7 | */ 8 | public class OnConfigHandleAdapter implements ISchedule.OnConfigHandleListener { 9 | 10 | @Override 11 | public void onParseConfig(String key, String value, TimetableView mView) { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/listener/OnDateBuildAapter.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.listener; 2 | 3 | 4 | import android.content.Context; 5 | import android.graphics.Color; 6 | import android.util.Log; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.widget.LinearLayout; 10 | import android.widget.TextView; 11 | 12 | import com.zhuangfei.android_timetableview.sample.R; 13 | import com.zhuangfei.timetable.model.ScheduleSupport; 14 | import com.zhuangfei.timetable.utils.ColorUtils; 15 | 16 | import java.text.SimpleDateFormat; 17 | import java.util.Calendar; 18 | import java.util.Date; 19 | import java.util.List; 20 | 21 | /** 22 | * 日期栏的构建过程. 23 | */ 24 | 25 | public class OnDateBuildAapter implements ISchedule.OnDateBuildListener { 26 | 27 | private static final String TAG = "OnDateBuildAapter"; 28 | 29 | //第一个:月份,之后7个表示周一至周日 30 | protected TextView[] textViews = new TextView[8]; 31 | protected LinearLayout[] layouts = new LinearLayout[8]; 32 | 33 | protected int background = Color.parseColor("#F4F8F8"); 34 | protected float alpha = 1; 35 | 36 | protected String[] dateArray; 37 | protected List weekDates; 38 | protected LinearLayout layout; 39 | 40 | public OnDateBuildAapter setBackground(int background) { 41 | this.background = background; 42 | return this; 43 | } 44 | 45 | @Override 46 | public void onInit(LinearLayout layout, float alpha) { 47 | this.alpha = alpha; 48 | this.layout = layout; 49 | //星期设置 50 | dateArray = getStringArray(); 51 | weekDates = ScheduleSupport.getWeekDate(); 52 | int alphaColor = ColorUtils.alphaColor(background, alpha); 53 | if (layout != null) layout.setBackgroundColor(alphaColor); 54 | } 55 | 56 | @Override 57 | public View[] getDateViews(LayoutInflater mInflate, float monthWidth, float perWidth, int height) { 58 | View[] views = new View[8]; 59 | views[0] = onBuildMonthLayout(mInflate, (int) monthWidth, height); 60 | for (int i = 1; i < 8; i++) { 61 | views[i] = onBuildDayLayout(mInflate, i, (int) perWidth, height); 62 | } 63 | return views; 64 | } 65 | 66 | @Override 67 | public void onHighLight() { 68 | initDateBackground(); 69 | 70 | //获取周几,1->7 71 | Calendar now = Calendar.getInstance(); 72 | //一周第一天是否为星期天 73 | boolean isFirstSunday = (now.getFirstDayOfWeek() == Calendar.SUNDAY); 74 | int weekDay = now.get(Calendar.DAY_OF_WEEK); 75 | //若一周第一天为星期天,则-1 76 | if (isFirstSunday) { 77 | weekDay = weekDay - 1; 78 | if (weekDay == 0) { 79 | weekDay = 7; 80 | } 81 | } 82 | 83 | activeDateBackground(weekDay); 84 | } 85 | 86 | 87 | @Override 88 | public void onUpdateDate(int curWeek, int targetWeek) { 89 | if (textViews == null || textViews.length < 8) return; 90 | 91 | weekDates = ScheduleSupport.getDateStringFromWeek(curWeek, targetWeek); 92 | int month = Integer.parseInt(weekDates.get(0)); 93 | textViews[0].setText(month + "\n月"); 94 | for (int i = 1; i < 8; i++) { 95 | if (textViews[i] != null) { 96 | textViews[i].setText(weekDates.get(i) + "日"); 97 | } 98 | } 99 | } 100 | 101 | /** 102 | * 构建月份,也就是日期栏的第一格.
103 | * 宽度、高度均为px 104 | * 105 | * @param mInflate 106 | * @param width 宽度 107 | * @param height 默认高度 108 | * @return 109 | */ 110 | protected View onBuildMonthLayout(LayoutInflater mInflate, int width, int height) { 111 | View first = mInflate.inflate(R.layout.item_dateview_first, null, false); 112 | //月份设置 113 | textViews[0] = first.findViewById(R.id.id_week_month); 114 | layouts[0] = null; 115 | 116 | LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(width, height); 117 | 118 | int month = Integer.parseInt(weekDates.get(0)); 119 | first.setLayoutParams(lp); 120 | textViews[0].setText(month + "\n月"); 121 | return first; 122 | } 123 | 124 | protected View onBuildDayLayout(LayoutInflater mInflate, int pos, int width, int height) { 125 | View v = mInflate.inflate(R.layout.item_dateview, null, false); 126 | TextView dayTextView = v.findViewById(R.id.id_week_day); 127 | dayTextView.setText(dateArray[pos]); 128 | 129 | textViews[pos] = v.findViewById(R.id.id_week_date); 130 | layouts[pos] = v.findViewById(R.id.id_week_layout); 131 | 132 | LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(width, height); 133 | layouts[pos].setLayoutParams(lp); 134 | textViews[pos].setText(weekDates.get(pos) + "日"); 135 | 136 | return v; 137 | } 138 | 139 | /** 140 | * 返回一个长度为8的数组,第0个位置为null 141 | * 142 | * @return 143 | */ 144 | public String[] getStringArray() { 145 | return new String[]{null, "周一", "周二", "周三", "周四", "周五", "周六", "周日"}; 146 | } 147 | 148 | protected void initDateBackground() { 149 | for (int i = 1; i < 8; i++) { 150 | if (layouts[i] != null) layouts[i].setBackgroundColor(Color.TRANSPARENT); 151 | } 152 | } 153 | 154 | protected void activeDateBackground(int weekDay) { 155 | if (layouts.length > weekDay && layouts[weekDay] != null) { 156 | layouts[weekDay].setBackgroundColor( 157 | ColorUtils.alphaColor(Color.parseColor("#BFF6F4"), alpha)); 158 | } 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/listener/OnFlaglayoutClickAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.listener; 2 | 3 | /** 4 | * Created by Liu ZhuangFei on 2018/8/3. 5 | */ 6 | 7 | public class OnFlaglayoutClickAdapter implements ISchedule.OnFlaglayoutClickListener { 8 | @Override 9 | public void onFlaglayoutClick(int day, int start) { 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/listener/OnItemBuildAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.listener; 2 | 3 | import android.graphics.drawable.GradientDrawable; 4 | import android.text.TextUtils; 5 | import android.widget.FrameLayout; 6 | import android.widget.TextView; 7 | 8 | import com.zhuangfei.timetable.model.Schedule; 9 | 10 | /** 11 | * Item构建监听器的默认实现. 12 | */ 13 | 14 | public class OnItemBuildAdapter implements ISchedule.OnItemBuildListener { 15 | @Override 16 | public String getItemText(Schedule schedule, boolean isThisWeek) { 17 | if (schedule == null || TextUtils.isEmpty(schedule.getName())) return "未命名"; 18 | if (schedule.getRoom() == null) { 19 | if (!isThisWeek) 20 | return "[非本周]" + schedule.getName(); 21 | return schedule.getName(); 22 | } 23 | 24 | String r = schedule.getName() + "@" + schedule.getRoom(); 25 | if (!isThisWeek) { 26 | r = "[非本周]" + r; 27 | } 28 | return r; 29 | } 30 | 31 | @Override 32 | public void onItemUpdate(FrameLayout layout, TextView textView, TextView countTextView, Schedule schedule, GradientDrawable gd) { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/listener/OnItemClickAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.listener; 2 | 3 | import android.util.Log; 4 | import android.view.View; 5 | 6 | import com.zhuangfei.timetable.model.Schedule; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Item点击的默认实现. 12 | */ 13 | 14 | public class OnItemClickAdapter implements ISchedule.OnItemClickListener { 15 | private static final String TAG = "OnItemClickAdapter"; 16 | @Override 17 | public void onItemClick(View v, List scheduleList) { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/listener/OnItemLongClickAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.listener; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | * Created by Liu ZhuangFei on 2018/8/3. 7 | */ 8 | 9 | public class OnItemLongClickAdapter implements ISchedule.OnItemLongClickListener { 10 | @Override 11 | public void onLongClick(View v, int day, int start,int id) { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/listener/OnScrollViewBuildAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.listener; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.View; 5 | 6 | import com.zhuangfei.android_timetableview.sample.R; 7 | 8 | /** 9 | * 滚动布局构建监听的默认实现 10 | */ 11 | 12 | public class OnScrollViewBuildAdapter implements ISchedule.OnScrollViewBuildListener { 13 | @Override 14 | public View getScrollView(LayoutInflater mInflate) { 15 | return mInflate.inflate(R.layout.view_simplescrollview,null,false); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/listener/OnSlideBuildAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.listener; 2 | 3 | import android.graphics.Color; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.LinearLayout; 8 | import android.widget.TextView; 9 | 10 | import com.zhuangfei.android_timetableview.sample.R; 11 | import com.zhuangfei.timetable.utils.ColorUtils; 12 | 13 | /** 14 | * 控件实现的一个可以显示时间的侧边栏适配器 15 | * Created by Liu ZhuangFei on 2018/6/18. 16 | */ 17 | 18 | public class OnSlideBuildAdapter implements ISchedule.OnSlideBuildListener { 19 | 20 | //时刻,每个元素保存每节课的开始时间 21 | protected String[] times; 22 | 23 | //节次文本的颜色、字号 24 | protected int textColor= Color.BLACK; 25 | protected float textSize=14; 26 | 27 | //时刻文本的颜色、字号 28 | protected float timeTextSize=12; 29 | protected int timeTextColor=Color.GRAY; 30 | 31 | //侧边栏背景色 32 | protected int background=Color.WHITE; 33 | protected float alpha=1; 34 | 35 | /** 36 | * 设置时刻数组 37 | * @param times 38 | * @return 39 | */ 40 | public OnSlideBuildAdapter setTimes(String[] times) { 41 | this.times = times; 42 | return this; 43 | } 44 | 45 | public OnSlideBuildAdapter setBackground(int backgroundColor) { 46 | this.background=backgroundColor; 47 | return this; 48 | } 49 | 50 | /** 51 | * 获取时刻数组 52 | * @return 53 | */ 54 | public String[] getTimes() { 55 | return times; 56 | } 57 | 58 | 59 | /** 60 | * 设置节次文本颜色 61 | * @param textColor 指定颜色 62 | * @return 63 | */ 64 | public OnSlideBuildAdapter setTextColor(int textColor) { 65 | this.textColor = textColor; 66 | return this; 67 | } 68 | 69 | /** 70 | * 设置节次文本的大小 71 | * @param textSize 指定字号 72 | * @return 73 | */ 74 | public OnSlideBuildAdapter setTextSize(float textSize) { 75 | this.textSize = textSize; 76 | return this; 77 | } 78 | 79 | /** 80 | * 设置节次时间的文本颜色 81 | * @param timeTextColor 颜色 82 | * @return 83 | */ 84 | public OnSlideBuildAdapter setTimeTextColor(int timeTextColor) { 85 | this.timeTextColor = timeTextColor; 86 | return this; 87 | } 88 | 89 | /** 90 | * 设置节次时间的文本大小 91 | * @param timeTextSize 字号 92 | * @return 93 | */ 94 | public OnSlideBuildAdapter setTimeTextSize(float timeTextSize) { 95 | this.timeTextSize = timeTextSize; 96 | return this; 97 | } 98 | 99 | @Override 100 | public View getView(int pos, LayoutInflater inflater, int itemHeight, int marTop) { 101 | View view=inflater.inflate(R.layout.item_slide_time,null,false); 102 | TextView numberTextView=view.findViewById(R.id.item_slide_number); 103 | TextView timeTextView=view.findViewById(R.id.item_slide_time); 104 | LinearLayout.LayoutParams lp=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 105 | itemHeight); 106 | lp.setMargins(0,marTop,0,0); 107 | view.setLayoutParams(lp); 108 | 109 | numberTextView.setText((pos+1)+""); 110 | numberTextView.setTextSize(textSize); 111 | numberTextView.setTextColor(textColor); 112 | 113 | if(times==null) timeTextView.setText(""); 114 | if(times!=null&&pos>=0&&pos 11 | * 1.增加了extras,可以保存一些自己需要的东西
12 | * @author Administrator 刘壮飞 13 | * 14 | */ 15 | public class Schedule implements Serializable,Comparable{ 16 | 17 | /** 18 | * 课程名 19 | */ 20 | private String name=""; 21 | 22 | /** 23 | * 教室 24 | */ 25 | private String room=""; 26 | 27 | /** 28 | * 教师 29 | */ 30 | private String teacher=""; 31 | 32 | /** 33 | * 第几周至第几周上 34 | */ 35 | private List weekList=new ArrayList<>(); 36 | 37 | /** 38 | * 开始上课的节次 39 | */ 40 | private int start=0; 41 | 42 | /** 43 | * 上课节数 44 | */ 45 | private int step=0; 46 | 47 | /** 48 | * 周几上 49 | */ 50 | private int day=0; 51 | 52 | /** 53 | * 一个随机数,用于对应课程的颜色 54 | */ 55 | private int colorRandom = 0; 56 | 57 | /** 58 | * 额外信息 59 | */ 60 | private Map extras=new HashMap<>(); 61 | 62 | public Schedule(String name, String room, String teacher, 63 | List weekList, int start, int step, int day, 64 | int colorRandom) { 65 | super(); 66 | this.name = name; 67 | this.room = room; 68 | this.teacher = teacher; 69 | this.weekList = weekList; 70 | this.start = start; 71 | this.step = step; 72 | this.day = day; 73 | this.colorRandom = colorRandom; 74 | } 75 | 76 | public Map getExtras(){ 77 | return extras; 78 | } 79 | 80 | public void setExtras(Map map){ 81 | this.extras=map; 82 | } 83 | 84 | public void putExtras(String key,Object val){ 85 | getExtras().put(key,val); 86 | } 87 | 88 | 89 | public String getName() { 90 | return name; 91 | } 92 | 93 | public void setName(String name) { 94 | this.name = name; 95 | } 96 | 97 | public String getRoom() { 98 | return room; 99 | } 100 | 101 | public void setRoom(String room) { 102 | this.room = room; 103 | } 104 | 105 | public String getTeacher() { 106 | return teacher; 107 | } 108 | 109 | public void setTeacher(String teacher) { 110 | this.teacher = teacher; 111 | } 112 | 113 | public void setWeekList(List weekList) { 114 | this.weekList = weekList; 115 | } 116 | 117 | public List getWeekList() { 118 | return weekList; 119 | } 120 | 121 | public int getStart() { 122 | return start; 123 | } 124 | 125 | public void setStart(int start) { 126 | this.start = start; 127 | } 128 | 129 | public int getStep() { 130 | return step; 131 | } 132 | 133 | public void setStep(int step) { 134 | this.step = step; 135 | } 136 | 137 | public int getDay() { 138 | return day; 139 | } 140 | 141 | public void setDay(int day) { 142 | this.day = day; 143 | } 144 | 145 | public int getColorRandom() { 146 | return colorRandom; 147 | } 148 | 149 | public void setColorRandom(int colorRandom) { 150 | this.colorRandom = colorRandom; 151 | } 152 | 153 | public Schedule() { 154 | super(); 155 | } 156 | 157 | @Override 158 | public int compareTo(Schedule o) { 159 | if(getStart() colorMap; 29 | 30 | //false:非本周课程使用uselessColor渲染 31 | //true:非本周课程使用colorMap渲染 32 | private boolean ignoreUserlessColor=false; 33 | 34 | public ScheduleColorPool(Context context){ 35 | this.context=context; 36 | // setUselessColor(context.getResources().getColor(R.color.useless)); 37 | setUselessColor(ContextCompat.getColor(context,R.color.useless)); 38 | colorMap=new HashMap<>(); 39 | reset(); 40 | } 41 | 42 | /** 43 | * 获取颜色的映射Map 44 | * @return Map 45 | */ 46 | public Map getColorMap() { 47 | if(colorMap==null) return new HashMap<>(); 48 | return colorMap; 49 | } 50 | 51 | /** 52 | * 设置colorMap 53 | * @param colorMap Map 54 | * @return ScheduleColorPool 55 | */ 56 | public ScheduleColorPool setColorMap(Map colorMap) { 57 | this.colorMap = colorMap; 58 | return this; 59 | } 60 | 61 | /** 62 | * 获取渲染时是否忽略非本周颜色 63 | * @return boolean 64 | */ 65 | public boolean isIgnoreUserlessColor() { 66 | return ignoreUserlessColor; 67 | } 68 | 69 | /** 70 | * 设置渲染时是否忽略非本周颜色 71 | * false:非本周课程使用uselessColor渲染 72 | * true:非本周课程使用colorMap渲染 73 | * @return ScheduleColorPool 74 | */ 75 | public ScheduleColorPool setIgnoreUserlessColor(boolean ignoreUserlessColor) { 76 | this.ignoreUserlessColor = ignoreUserlessColor; 77 | return this; 78 | } 79 | 80 | //使用集合维护颜色池 81 | private List colorPool; 82 | 83 | /** 84 | * 获取非本周课程颜色 85 | * @return 86 | */ 87 | public int getUselessColor() { 88 | return uselessColor; 89 | } 90 | 91 | /** 92 | * 获取非本周课程颜色 93 | * @return int 94 | */ 95 | public int getUselessColorWithAlpha(float alpha) { 96 | return ColorUtils.alphaColor(uselessColor,alpha); 97 | } 98 | 99 | /** 100 | * 设置非本周课程颜色 101 | * @param uselessColor 非本周课程的颜色 102 | * @return ScheduleColorPool 103 | */ 104 | public ScheduleColorPool setUselessColor(int uselessColor) { 105 | this.uselessColor = uselessColor; 106 | return this; 107 | } 108 | 109 | /** 110 | * 得到颜色池的实例,即List集合 111 | * @return List 112 | */ 113 | public List getPoolInstance() { 114 | if(colorPool==null) colorPool=new ArrayList<>(); 115 | return colorPool; 116 | } 117 | 118 | /** 119 | * 从颜色池中取指定透明度的颜色 120 | * @param random 121 | * @param alpha 122 | * @return int 123 | */ 124 | public int getColorAutoWithAlpha(int random,float alpha){ 125 | if(random<0) return getColorAuto(-random); 126 | return ColorUtils.alphaColor(getColor(random%size()),alpha); 127 | } 128 | 129 | /** 130 | * 根据索引获取颜色,索引越界默认返回 Color.GRAY 131 | * @param i 索引 132 | * @return int 133 | */ 134 | public int getColor(int i){ 135 | if(i<0||i>=size()) return Color.GRAY; 136 | return colorPool.get(i); 137 | } 138 | 139 | /** 140 | * 使用模运算根据索引从颜色池中获取颜色, 141 | * 如果i<0,转换为正数, 142 | * 否则:重新计算索引j=i mod size 143 | * @param i 索引 144 | * @return int颜色 145 | */ 146 | public int getColorAuto(int i){ 147 | if(i<0) return getColorAuto(-i); 148 | return getColor(i%size()); 149 | } 150 | 151 | /** 152 | * 将指定集合中的颜色加入到颜色池中 153 | * @param ownColorPool 集合 154 | * @return ScheduleColorPool 155 | */ 156 | public ScheduleColorPool addAll(Collection ownColorPool){ 157 | getPoolInstance().addAll(ownColorPool); 158 | return this; 159 | } 160 | 161 | /** 162 | * 颜色池的大小 163 | * @return int 164 | */ 165 | public int size(){ 166 | if(getPoolInstance()==null) return 0; 167 | return getPoolInstance().size(); 168 | } 169 | 170 | /** 171 | * 清空颜色池,清空默认颜色 172 | * @return ScheduleColorPool 173 | */ 174 | public ScheduleColorPool clear(){ 175 | getPoolInstance().clear(); 176 | return this; 177 | } 178 | 179 | /** 180 | * 在颜色池中添加一些自定义的颜色 181 | * @param colorIds 多个颜色 182 | * @return ScheduleColorPool 183 | */ 184 | public ScheduleColorPool add(int... colorIds){ 185 | if(colorIds!=null){ 186 | for(int i=0;i mConfigMap; 24 | private Context context; 25 | private String configName="default_schedule_config"; 26 | 27 | public ScheduleConfig(Context context){ 28 | this.context=context; 29 | mConfigMap=new HashMap<>(); 30 | } 31 | 32 | /** 33 | * 设置本地配置的名称 34 | * @param name 配置名称 35 | * @return ScheduleConfig 36 | */ 37 | public ScheduleConfig setConfigName(String name){ 38 | if(configName==null||name==null) return this; 39 | if(mConfigPreferences==null||!configName.equals(name)){ 40 | configName=name; 41 | mConfigPreferences=context.getSharedPreferences(configName,Context.MODE_PRIVATE); 42 | mEditor=mConfigPreferences.edit(); 43 | } 44 | return this; 45 | } 46 | 47 | /** 48 | * 设置配置处理器 49 | * @param mOnConfigHandleListener 配置处理器 50 | * @return ScheduleConfig 51 | */ 52 | public ScheduleConfig setOnConfigHandleListener(ISchedule.OnConfigHandleListener mOnConfigHandleListener) { 53 | this.mOnConfigHandleListener = mOnConfigHandleListener; 54 | return this; 55 | } 56 | 57 | /** 58 | * 获取配置处理器 59 | * @return ISchedule.OnConfigHandleListener 60 | */ 61 | public ISchedule.OnConfigHandleListener getOnConfigHandleListener() { 62 | return mOnConfigHandleListener; 63 | } 64 | 65 | /** 66 | * 将配置提交到缓存,需要使用commit()将其保存到本地 67 | * @param key 属性名 68 | * @param value 属性值 69 | * @return ScheduleConfig 70 | */ 71 | public ScheduleConfig put(String key, String value){ 72 | if(mConfigMap==null||value==null) return this; 73 | mConfigMap.put(key,value); 74 | return this; 75 | } 76 | 77 | /** 78 | * 从缓存中取出属性key的值 79 | * @param key 属性名 80 | * @return String 81 | */ 82 | public String get(String key){ 83 | if(mConfigMap==null) return null; 84 | return mConfigMap.get(key); 85 | } 86 | 87 | /** 88 | * 将指定的Map作为缓存 89 | * @param mConfigMap Map 90 | * @return ScheduleConfig 91 | */ 92 | public ScheduleConfig setConfigMap(Map mConfigMap) { 93 | this.mConfigMap = mConfigMap; 94 | return this; 95 | } 96 | 97 | /** 98 | * 获取缓存的属性Map 99 | * @return 100 | */ 101 | public Map getConfigMap() { 102 | return mConfigMap; 103 | } 104 | 105 | /** 106 | * 将缓存中的修改提交到本地 107 | */ 108 | public void commit(){ 109 | Set set=new HashSet<>(); 110 | for(Map.Entry entry:mConfigMap.entrySet()){ 111 | if(entry.getKey()==null||entry.getValue()==null) continue; 112 | set.add(entry.getKey().trim()+"="+entry.getValue().trim()); 113 | } 114 | Set finalSet=mConfigPreferences.getStringSet("scheduleconfig_set",new HashSet()); 115 | finalSet.addAll(set); 116 | mConfigMap.clear(); 117 | mEditor.putStringSet("scheduleconfig_set",finalSet); 118 | mEditor.commit(); 119 | } 120 | 121 | /** 122 | * 清除缓存和本地属性配置 123 | */ 124 | public void clear(){ 125 | mConfigMap.clear(); 126 | mEditor.clear(); 127 | mEditor.commit(); 128 | } 129 | 130 | /** 131 | * 导出本地配置文件中的数据 132 | * @return set集合,每个元素都是一个配置,格式:key=value 133 | */ 134 | public Set export(){ 135 | Set finalSet=mConfigPreferences.getStringSet("scheduleconfig_set",new HashSet()); 136 | return finalSet; 137 | } 138 | 139 | /** 140 | * 将集合配置导入到本地 141 | * @param data 142 | */ 143 | public void load(Set data){ 144 | Set finalSet=mConfigPreferences.getStringSet("scheduleconfig_set",new HashSet()); 145 | finalSet.addAll(data); 146 | mConfigMap.clear(); 147 | mEditor.putStringSet("scheduleconfig_set",finalSet); 148 | mEditor.commit(); 149 | } 150 | 151 | /** 152 | * 设置TimetableView的属性,使配置生效 153 | * @param view TimetableView 154 | */ 155 | public void use(TimetableView view){ 156 | if(getConfigMap()==null||getOnConfigHandleListener()==null) return; 157 | Set keySet=mConfigPreferences.getStringSet("scheduleconfig_set",new HashSet()); 158 | String[] configArray=null; 159 | for(String str:keySet){ 160 | if(!TextUtils.isEmpty(str)&&str.indexOf("=")!=-1){ 161 | str=str.trim(); 162 | configArray=str.split("="); 163 | if(configArray.length==2){ 164 | getOnConfigHandleListener().onParseConfig(configArray[0],configArray[1],view); 165 | } 166 | } 167 | } 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/model/ScheduleEnable.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.model; 2 | 3 | /** 4 | * 该接口定义数据转换的规范, 5 | * 用户自定义课程实体类需要实现该接口以及实现其中的转换方法, 6 | * 在设置数据源时可以使用自定义的课程实体,但是必须实现该接口 7 | */ 8 | 9 | public interface ScheduleEnable { 10 | 11 | /** 12 | * 获取Schedule 13 | * @return 14 | */ 15 | Schedule getSchedule(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/model/WeekViewEnable.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.model; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * 如果需要自定义周次选择栏,请实现该接口, 7 | * 它仅仅提供一个规范,可用可不用 8 | * Created by Liu ZhuangFei on 2018/7/28. 9 | */ 10 | 11 | public interface WeekViewEnable { 12 | /** 13 | * 设置当前周 14 | * @param curWeek 15 | * @return 16 | */ 17 | T curWeek(int curWeek); 18 | 19 | /** 20 | * 设置项数 21 | * @param count 22 | * @return 23 | */ 24 | T itemCount(int count); 25 | 26 | /** 27 | * 获取项数 28 | * @return 29 | */ 30 | int itemCount(); 31 | 32 | /** 33 | * 设置数据源 34 | * @param list 35 | * @return 36 | */ 37 | T source(List list); 38 | 39 | /** 40 | * 设置数据源 41 | * @param scheduleList 42 | * @return 43 | */ 44 | public T data(List scheduleList); 45 | 46 | /** 47 | * 获取数据源 48 | * @return 49 | */ 50 | List dataSource(); 51 | 52 | /** 53 | * 初次构建时调用,显示周次选择布局 54 | */ 55 | T showView(); 56 | 57 | /** 58 | * 当前周被改变后可以调用该方式修正一下底部的文本 59 | * @return 60 | */ 61 | T updateView(); 62 | 63 | /** 64 | * 设置控件的可见性 65 | * @param isShow true:显示,false:隐藏 66 | */ 67 | T isShow(boolean isShow); 68 | 69 | /** 70 | * 判断该控件是否显示 71 | * @return 72 | */ 73 | boolean isShowing(); 74 | } 75 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/model/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 该包存放与Schedule有关的模型类 3 | */ 4 | package com.zhuangfei.timetable.model; -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/operater/AbsOperater.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.operater; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.LinearLayout; 6 | 7 | import com.zhuangfei.timetable.TimetableView; 8 | 9 | /** 10 | * 抽象的业务逻辑 11 | * Created by Liu ZhuangFei on 2018/9/2. 12 | */ 13 | public abstract class AbsOperater { 14 | public void init(Context context, AttributeSet attrs, TimetableView view){}; 15 | 16 | public void showView(){}; 17 | 18 | public void updateDateView(){}; 19 | 20 | public void updateSlideView(){}; 21 | 22 | public void changeWeek(int week, boolean isCurWeek){}; 23 | 24 | public LinearLayout getFlagLayout(){return null;}; 25 | 26 | public LinearLayout getDateLayout(){return null;}; 27 | 28 | public void setWeekendsVisiable(boolean isShow){}; 29 | } 30 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/operater/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 该包存放与ScheduleOperater有关的类 3 | */ 4 | package com.zhuangfei.timetable.operater; -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * TimetableView是课表控件,主要是操作该对象进而完成对属性设置以及对视图的创建、更新 3 | */ 4 | package com.zhuangfei.timetable; -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/utils/ColorUtils.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.utils; 2 | 3 | import android.graphics.Color; 4 | 5 | /** 6 | * Created by Liu ZhuangFei on 2018/7/25. 7 | */ 8 | 9 | public class ColorUtils { 10 | 11 | /** 12 | * 合成指定颜色、指定不透明度的颜色, 13 | * 0:完全透明,1:不透明 14 | * @param color 15 | * @param alpha 0:完全透明,1:不透明 16 | * @return 17 | */ 18 | public static int alphaColor(int color,float alpha){ 19 | int a = Math.min(255, Math.max(0, (int) (alpha * 255))) << 24; 20 | int rgb = 0x00ffffff & color; 21 | return a + rgb; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/utils/ScreenUtils.java: -------------------------------------------------------------------------------- 1 | package com.zhuangfei.timetable.utils; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * 尺寸工具类 7 | */ 8 | public class ScreenUtils { 9 | 10 | /** 11 | * 获取屏幕的高度Px 12 | * @param context 13 | * @return 14 | */ 15 | public static final int getHeightInPx(Context context) { 16 | final int height = context.getResources().getDisplayMetrics().heightPixels; 17 | return height; 18 | } 19 | 20 | /** 21 | * 获取屏幕的宽度Px 22 | * @param context 23 | * @return 24 | */ 25 | public static final int getWidthInPx(Context context) { 26 | final int width = context.getResources().getDisplayMetrics().widthPixels; 27 | return width; 28 | } 29 | 30 | /** 31 | * 获取屏幕的高度Dp 32 | * @param context 33 | * @return 34 | */ 35 | public static final int getHeightInDp(Context context) { 36 | final float height = context.getResources().getDisplayMetrics().heightPixels; 37 | int heightInDp = px2dip(context, height); 38 | return heightInDp; 39 | } 40 | 41 | /** 42 | * 获取屏幕的宽度Dp 43 | * @param context 44 | * @return 45 | */ 46 | public static final int getWidthInDp(Context context) { 47 | final float width = context.getResources().getDisplayMetrics().widthPixels; 48 | int widthInDp = px2dip(context, width); 49 | return widthInDp; 50 | } 51 | 52 | /** 53 | * dp转换为px 54 | * @param context 上下文 55 | * @param dpValue dp 56 | * @return px 57 | */ 58 | public static int dip2px(Context context, float dpValue) { 59 | final float scale = context.getResources().getDisplayMetrics().density; 60 | return (int) (dpValue * scale + 0.5f); 61 | } 62 | 63 | /** 64 | * px转换为dp 65 | * @param context 上下文 66 | * @param pxValue px 67 | * @return dp 68 | */ 69 | public static int px2dip(Context context, float pxValue) { 70 | final float scale = context.getResources().getDisplayMetrics().density; 71 | return (int) (pxValue / scale + 0.5f); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/utils/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 该包存放一些全局的工具方法 3 | */ 4 | package com.zhuangfei.timetable.utils; -------------------------------------------------------------------------------- /TimetableView/src/com/zhuangfei/timetable/view/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 该包存放控件实现的自定义View 3 | */ 4 | package com.zhuangfei.timetable.view; -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | } 4 | 5 | android { 6 | compileSdkVersion 30 7 | buildToolsVersion "30.0.3" 8 | 9 | defaultConfig { 10 | applicationId "com.example.hhuclassschedule" 11 | minSdkVersion 21 12 | targetSdkVersion 30 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | compileOptions { 26 | sourceCompatibility JavaVersion.VERSION_1_8 27 | targetCompatibility JavaVersion.VERSION_1_8 28 | } 29 | } 30 | 31 | dependencies { 32 | 33 | implementation fileTree(include: ['*.jar'], dir: 'libs') 34 | implementation project(':TimetableView') 35 | implementation 'androidx.appcompat:appcompat:1.3.0' 36 | implementation 'com.google.android.material:material:1.3.0' 37 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 38 | testImplementation 'junit:junit:4.13.2' 39 | androidTestImplementation 'androidx.test.ext:junit:1.1.2' 40 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' 41 | implementation 'com.google.code.gson:gson:2.8.6' 42 | implementation 'cn.carbswang.android:NumberPickerView:1.2.0' 43 | implementation 'androidx.multidex:multidex:2.0.1' 44 | implementation 'com.android.support:multidex:2.0.1' 45 | implementation 'com.github.GrenderG:Toasty:1.5.0' 46 | } -------------------------------------------------------------------------------- /app/debug/app-debug.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/debug/app-debug.apk -------------------------------------------------------------------------------- /app/debug/output-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "artifactType": { 4 | "type": "APK", 5 | "kind": "Directory" 6 | }, 7 | "applicationId": "com.example.hhuclassschedule", 8 | "variantName": "processDebugResources", 9 | "elements": [ 10 | { 11 | "type": "SINGLE", 12 | "filters": [], 13 | "versionCode": 1, 14 | "versionName": "1.0", 15 | "outputFile": "app-debug.apk" 16 | } 17 | ] 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 -------------------------------------------------------------------------------- /app/release/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/release/app-release.apk -------------------------------------------------------------------------------- /app/release/output-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "artifactType": { 4 | "type": "APK", 5 | "kind": "Directory" 6 | }, 7 | "applicationId": "com.example.hhuclassschedule", 8 | "variantName": "processReleaseResources", 9 | "elements": [ 10 | { 11 | "type": "SINGLE", 12 | "filters": [], 13 | "versionCode": 1, 14 | "versionName": "1.0", 15 | "outputFile": "app-release.apk" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/com/example/hhuclassschedule/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.example.hhuclassschedule; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | assertEquals("com.example.hhuclassschedule", appContext.getPackageName()); 25 | } 26 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/assets/parseHtml.js: -------------------------------------------------------------------------------- 1 | function getSectionTimes(str_sectionTimes, index) { 2 | let sectionTimes = {}; 3 | str_sectionTimes = (str_sectionTimes.replace("第", "")).replace("节(", " "); 4 | str_sectionTimes = (str_sectionTimes.replace("-", " ")).replace(")", ""); 5 | let sec = str_sectionTimes.split(" "); 6 | sectionTimes.section = index + 1; 7 | sectionTimes.startTime = sec[1]; 8 | sectionTimes.endTime = sec[2]; 9 | return sectionTimes; 10 | } 11 | 12 | function getWeeks(str_weeks) { 13 | let weeks = []; 14 | let flag = 0; 15 | if (str_weeks.search("单") != -1) { 16 | flag = 1; 17 | str_weeks = str_weeks.replace("单", ""); 18 | } else if (str_weeks.search("双") != -1) { 19 | flag = 2; 20 | str_weeks = str_weeks.replace("双", ""); 21 | } 22 | str_weeks = str_weeks.replace("周", ""); 23 | let startWeek = Number(str_weeks.split('-')[0]); 24 | let endWeek = Number(str_weeks.split('-')[1]); 25 | for (let i = startWeek; i <= endWeek; i++) { 26 | if (flag == 0) { 27 | weeks.push(i); 28 | } else if (flag == 1 && i % 2 == 1) { 29 | weeks.push[i]; 30 | } else if (flag == 2 && i % 2 == 0) { 31 | weeks.push(i); 32 | } 33 | } 34 | return weeks; 35 | } 36 | 37 | function getSections(str_sections) { 38 | let sections = []; 39 | str_sections = str_sections.replace("节", ""); 40 | let startSection = Number(str_sections.split("-")[0]); 41 | let endSection = Number(str_sections.split("-")[1]); 42 | for (let i = startSection; i <= endSection; i++) { 43 | sections.push({ 44 | section: i 45 | }); 46 | } 47 | return sections; 48 | } 49 | 50 | 51 | function parseHtml() { 52 | 53 | let courseTable = document.querySelector("#courseTableBody"); 54 | let trs = courseTable.querySelectorAll("tr"); 55 | let sectionTimes = []; 56 | let courseInfos = []; 57 | 58 | for (let i = 0; i < trs.length; i++) { 59 | let str_sectionTimes = (trs[i].querySelectorAll("th:last-of-type"))[0].innerText; 60 | sectionTimes.push(getSectionTimes(str_sectionTimes, i)); 61 | let tds = trs[i].querySelectorAll("td"); 62 | 63 | for (let j = 0; j < tds.length; j++) { 64 | let result = {}; 65 | let td_context = tds[j].querySelectorAll("p"); 66 | if (td_context.length != 0) { 67 | result.name = td_context[0].innerText; 68 | result.teacher = td_context[1].innerText; 69 | let str_weeks = td_context[2].innerText; 70 | result.weeks = getWeeks(str_weeks); 71 | let str_sections = td_context[3].innerText; 72 | result.sections = getSections(str_sections); 73 | result.position = td_context[4].innerText; 74 | result.day = j + 1; 75 | courseInfos.push(result); 76 | } 77 | } 78 | } 79 | return { 80 | sectionTimes: sectionTimes, 81 | courseInfos: courseInfos 82 | } 83 | } -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/main/java/com/example/hhuclassschedule/AboutActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.hhuclassschedule; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | import androidx.appcompat.widget.Toolbar; 5 | 6 | import android.content.Intent; 7 | import android.net.Uri; 8 | import android.os.Bundle; 9 | import android.view.View; 10 | import android.widget.TextView; 11 | 12 | 13 | /** 14 | * 关于界面 15 | */ 16 | public class AboutActivity extends AppCompatActivity { 17 | 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_about); 22 | 23 | initToolbar("关于"); 24 | initLinkTextView(); 25 | } 26 | 27 | /** 28 | * 初始化 toolbar 29 | * 30 | * @param title toolbar标题 31 | */ 32 | protected void initToolbar(String title) { 33 | 34 | Toolbar toolbar = findViewById(R.id.toolbar); 35 | setSupportActionBar(toolbar); 36 | // 设置title 37 | // getSupportActionBar().setTitle(title); 38 | TextView textView = findViewById(R.id.toolbar_title); 39 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);// 添加默认的返回图标 40 | getSupportActionBar().setHomeButtonEnabled(true); // 设置返回键可用 41 | textView.setText(title); 42 | toolbar.setNavigationOnClickListener(new View.OnClickListener() { 43 | @Override 44 | public void onClick(View v) { 45 | finish(); 46 | } 47 | }); 48 | } 49 | 50 | /** 51 | * 超链接添加点击事件 52 | */ 53 | private void initLinkTextView() { 54 | TextView tv_github = findViewById(R.id.tv_github); 55 | tv_github.setOnClickListener(new View.OnClickListener() { 56 | @Override 57 | public void onClick(View v) { 58 | Uri uri = Uri.parse(getString(R.string.github)); 59 | Intent intent = new Intent(Intent.ACTION_VIEW, uri); 60 | startActivity(intent); 61 | 62 | } 63 | }); 64 | 65 | TextView tv_yuchenii = findViewById(R.id.tv_yuchenii); 66 | tv_yuchenii.setOnClickListener(new View.OnClickListener() { 67 | @Override 68 | public void onClick(View v) { 69 | Uri uri = Uri.parse(getString(R.string.yuchenii)); 70 | Intent intent = new Intent(Intent.ACTION_VIEW, uri); 71 | startActivity(intent); 72 | } 73 | }); 74 | 75 | TextView tv_fudi2000 = findViewById(R.id.tv_fudi2000); 76 | tv_fudi2000.setOnClickListener(new View.OnClickListener() { 77 | @Override 78 | public void onClick(View v) { 79 | Uri uri = Uri.parse(getString(R.string.fudi2000)); 80 | Intent intent = new Intent(Intent.ACTION_VIEW, uri); 81 | startActivity(intent); 82 | } 83 | }); 84 | 85 | TextView tv_scandy316 = findViewById(R.id.tv_scandy316); 86 | tv_scandy316.setOnClickListener(new View.OnClickListener() { 87 | @Override 88 | public void onClick(View v) { 89 | Uri uri = Uri.parse(getString(R.string.scandy316)); 90 | Intent intent = new Intent(Intent.ACTION_VIEW, uri); 91 | startActivity(intent); 92 | } 93 | }); 94 | 95 | TextView tv_chlcoder = findViewById(R.id.tv_chlcoder); 96 | tv_chlcoder.setOnClickListener(new View.OnClickListener() { 97 | @Override 98 | public void onClick(View v) { 99 | Uri uri = Uri.parse(getString(R.string.chlcoder)); 100 | Intent intent = new Intent(Intent.ACTION_VIEW, uri); 101 | startActivity(intent); 102 | } 103 | }); 104 | 105 | TextView tv_hhuzyp = findViewById(R.id.tv_hhuzyp); 106 | tv_hhuzyp.setOnClickListener(new View.OnClickListener() { 107 | @Override 108 | public void onClick(View v) { 109 | Uri uri = Uri.parse(getString(R.string.hhuzyp)); 110 | Intent intent = new Intent(Intent.ACTION_VIEW, uri); 111 | startActivity(intent); 112 | } 113 | }); 114 | 115 | TextView tv_xuanipvp = findViewById(R.id.tv_xuanipvp); 116 | tv_xuanipvp.setOnClickListener(new View.OnClickListener() { 117 | @Override 118 | public void onClick(View v) { 119 | Uri uri = Uri.parse(getString(R.string.xuanipvp)); 120 | Intent intent = new Intent(Intent.ACTION_VIEW, uri); 121 | startActivity(intent); 122 | } 123 | }); 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/hhuclassschedule/MyConfig.java: -------------------------------------------------------------------------------- 1 | package com.example.hhuclassschedule; 2 | 3 | 4 | import android.content.Context; 5 | import android.content.SharedPreferences; 6 | 7 | import com.example.hhuclassschedule.adapter.OnMyConfigHandleAdapter; 8 | 9 | import com.example.hhuclassschedule.util.ContextApplication; 10 | import com.example.hhuclassschedule.util.SharedPreferencesUtil; 11 | 12 | import java.util.HashMap; 13 | import java.util.Map; 14 | 15 | /** 16 | * 保存加载配置信息 17 | */ 18 | public class MyConfig { 19 | public static final String TAG = "MyConfig"; 20 | // private Context myContext; 21 | // public MyConfig(Context myContext) { 22 | // this.myContext = myContext; 23 | // } 24 | 25 | /** 26 | * 保存当前配置信息(缓冲map)至本地文件 27 | * 28 | * @param configMap 配置缓冲map 29 | */ 30 | public static void saveConfig(Map configMap) { 31 | SharedPreferencesUtil sharedPreferencesUtil = 32 | SharedPreferencesUtil.init(ContextApplication.getAppContext(), MainActivity.CONFIG_FILENAME); 33 | for (String key : configMap.keySet()) { 34 | String value = configMap.get(key); 35 | sharedPreferencesUtil.putString(key, value); 36 | } 37 | } 38 | 39 | 40 | // public void saveConfig(Map configMap){ 41 | // SharedPreferences.Editor editor = 42 | // myContext.getSharedPreferences(MainActivity.CONFIG_FILENAME,Context.MODE_PRIVATE).edit(); 43 | // for(String key : configMap.keySet()){ 44 | // String value = configMap.get(key); 45 | // editor.putString(key, value); 46 | // editor.commit(); 47 | // } 48 | // } 49 | 50 | /** 51 | * 从本地配置文件中读取信息至缓冲map 52 | */ 53 | public static Map loadConfig() { 54 | Map configMap; 55 | SharedPreferencesUtil sharedPreferencesUtil = 56 | SharedPreferencesUtil.init(ContextApplication.getAppContext(), MainActivity.CONFIG_FILENAME); 57 | configMap = (Map) sharedPreferencesUtil.getAll(); 58 | return configMap; 59 | } 60 | 61 | // public Map loadConfig(){ 62 | // Map configMap; 63 | // SharedPreferences sharedPreferences = 64 | // myContext.getSharedPreferences(MainActivity.CONFIG_FILENAME,Context.MODE_PRIVATE); 65 | // configMap = (Map) sharedPreferences.getAll(); 66 | // return configMap; 67 | // } 68 | 69 | /** 70 | * 从本地配置文件里获取notConfigMap; 71 | * 默认value都是false 72 | * 73 | * @return 74 | */ 75 | public static Map getNotConfigMap() { 76 | Map originMap = MyConfig.loadConfig(); 77 | Map notConfigMap = new HashMap<>(); 78 | //初始化 79 | notConfigMap.put(OnMyConfigHandleAdapter.CONFIG_NOT_OPEN, false); 80 | notConfigMap.put(OnMyConfigHandleAdapter.CONFIG_NOT_SHOW_WHEN, false); 81 | notConfigMap.put(OnMyConfigHandleAdapter.CONFIG_NOT_SHOW_WHERE, false); 82 | notConfigMap.put(OnMyConfigHandleAdapter.CONFIG_NOT_SHOW_STEP, false); 83 | //从配置文件里读取 84 | for (String key : originMap.keySet()) { 85 | String value = originMap.get(key); 86 | if (value == null) 87 | continue; 88 | switch (key) { 89 | case OnMyConfigHandleAdapter.CONFIG_NOT_OPEN: 90 | case OnMyConfigHandleAdapter.CONFIG_NOT_SHOW_WHEN: 91 | case OnMyConfigHandleAdapter.CONFIG_NOT_SHOW_WHERE: 92 | case OnMyConfigHandleAdapter.CONFIG_NOT_SHOW_STEP: 93 | if (value.equals(OnMyConfigHandleAdapter.VALUE_TRUE)) 94 | notConfigMap.put(key, true); 95 | else 96 | notConfigMap.put(key, false); 97 | break; 98 | default: 99 | break; 100 | } 101 | } 102 | return notConfigMap; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/hhuclassschedule/MySubject.java: -------------------------------------------------------------------------------- 1 | package com.example.hhuclassschedule; 2 | 3 | import com.zhuangfei.timetable.model.Schedule; 4 | import com.zhuangfei.timetable.model.ScheduleEnable; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 自定义实体类需要实现ScheduleEnable接口并实现getSchedule() 10 | * 11 | * @see ScheduleEnable#getSchedule() 12 | */ 13 | public class MySubject implements ScheduleEnable { 14 | 15 | public static final String EXTRAS_ID = "extras_id"; 16 | public static final String EXTRAS_AD_URL = "extras_ad_url"; 17 | 18 | private int id = 0; 19 | 20 | /** 21 | * 课程名 22 | */ 23 | private String name; 24 | 25 | /** 26 | * 时间 27 | */ 28 | private String time; 29 | 30 | /** 31 | * 教室 32 | */ 33 | private String room; 34 | 35 | /** 36 | * 教师 37 | */ 38 | private String teacher; 39 | 40 | /** 41 | * 第几周至第几周上 42 | */ 43 | private List weekList; 44 | 45 | /** 46 | * 开始上课的节次 47 | */ 48 | private int start; 49 | 50 | /** 51 | * 上课节数 52 | */ 53 | private int step; 54 | 55 | /** 56 | * 周几上 57 | */ 58 | private int day; 59 | 60 | private String term; 61 | 62 | /** 63 | * 一个随机数,用于对应课程的颜色 64 | */ 65 | private int colorRandom; 66 | 67 | private String url; 68 | 69 | public void setUrl(String url) { 70 | this.url = url; 71 | } 72 | 73 | public String getUrl() { 74 | return url; 75 | } 76 | 77 | public void setTime(String time) { 78 | this.time = time; 79 | } 80 | 81 | public String getTime() { 82 | return time; 83 | } 84 | 85 | public void setTerm(String term) { 86 | this.term = term; 87 | } 88 | 89 | public String getTerm() { 90 | return term; 91 | } 92 | 93 | public String getName() { 94 | return name; 95 | } 96 | 97 | public void setName(String name) { 98 | this.name = name; 99 | } 100 | 101 | public String getRoom() { 102 | return room; 103 | } 104 | 105 | public void setRoom(String room) { 106 | this.room = room; 107 | } 108 | 109 | public String getTeacher() { 110 | return teacher; 111 | } 112 | 113 | public void setTeacher(String teacher) { 114 | this.teacher = teacher; 115 | } 116 | 117 | public void setWeekList(List weekList) { 118 | this.weekList = weekList; 119 | } 120 | 121 | public List getWeekList() { 122 | return weekList; 123 | } 124 | 125 | public int getStart() { 126 | return start; 127 | } 128 | 129 | public void setStart(int start) { 130 | this.start = start; 131 | } 132 | 133 | public int getStep() { 134 | return step; 135 | } 136 | 137 | public void setStep(int step) { 138 | this.step = step; 139 | } 140 | 141 | public int getDay() { 142 | return day; 143 | } 144 | 145 | public void setDay(int day) { 146 | this.day = day; 147 | } 148 | 149 | public int getColorRandom() { 150 | return colorRandom; 151 | } 152 | 153 | public void setColorRandom(int colorRandom) { 154 | this.colorRandom = colorRandom; 155 | } 156 | 157 | public void setId(int id) { 158 | this.id = id; 159 | } 160 | 161 | public int getId() { 162 | String str = "" + getWeekList().get(0) + getWeekList().get(getWeekList().size() - 1) + getDay() + getStart() + getStep(); 163 | id = Integer.parseInt(str); 164 | return id; 165 | } 166 | 167 | public MySubject(String term, String name, String room, String teacher, List weekList, int start, int step, int day, int colorRandom, String time) { 168 | super(); 169 | this.term = term; 170 | this.name = name; 171 | this.room = room; 172 | this.teacher = teacher; 173 | this.weekList = weekList; 174 | this.start = start; 175 | this.step = step; 176 | this.day = day; 177 | this.colorRandom = colorRandom; 178 | this.time = time; 179 | } 180 | 181 | /** 182 | * 实现 getSchedule() 183 | * 184 | * @return Schedule列表 185 | */ 186 | @Override 187 | public Schedule getSchedule() { 188 | Schedule schedule = new Schedule(); 189 | schedule.setDay(getDay()); 190 | schedule.setName(getName()); 191 | schedule.setRoom(getRoom()); 192 | schedule.setStart(getStart()); 193 | schedule.setStep(getStep()); 194 | schedule.setTeacher(getTeacher()); 195 | schedule.setWeekList(getWeekList()); 196 | schedule.setColorRandom(2); 197 | schedule.putExtras(EXTRAS_ID, getId()); 198 | schedule.putExtras(EXTRAS_AD_URL, getUrl()); 199 | return schedule; 200 | } 201 | 202 | } 203 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/hhuclassschedule/ParseHtmlActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.hhuclassschedule; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.content.Intent; 6 | import android.graphics.Bitmap; 7 | import android.os.Bundle; 8 | import android.text.TextUtils; 9 | import android.util.Log; 10 | import android.view.View; 11 | import android.webkit.ValueCallback; 12 | import android.webkit.WebSettings; 13 | import android.webkit.WebView; 14 | import android.webkit.WebViewClient; 15 | import android.widget.TextView; 16 | 17 | import com.example.hhuclassschedule.util.ContextApplication; 18 | import com.example.hhuclassschedule.util.SharedPreferencesUtil; 19 | 20 | import java.io.BufferedReader; 21 | import java.io.IOException; 22 | import java.io.InputStreamReader; 23 | 24 | /** 25 | * 抓取课程信息并保存为json字符串 26 | */ 27 | public class ParseHtmlActivity extends AppCompatActivity { 28 | 29 | private static final String TAG = "ParseHtmlActivity"; 30 | 31 | WebView webView; 32 | TextView tv_import; 33 | String parseHtmlJS; 34 | String URL = "http://jwxs.hhu.edu.cn"; 35 | 36 | @Override 37 | protected void onCreate(Bundle savedInstanceState) { 38 | super.onCreate(savedInstanceState); 39 | setContentView(R.layout.activity_parse_html); 40 | try { 41 | // 打开网页 42 | openWeb(); 43 | } catch (IOException e) { 44 | e.printStackTrace(); 45 | } 46 | // 导入课程 47 | importSubject(); 48 | 49 | } 50 | 51 | /** 52 | * 打开网页 53 | * 54 | * @throws IOException 55 | */ 56 | public void openWeb() throws IOException { 57 | // toolbar 58 | androidx.appcompat.widget.Toolbar toolbar = findViewById(R.id.toolbar); 59 | setSupportActionBar(toolbar); 60 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);// 添加默认的返回图标 61 | getSupportActionBar().setHomeButtonEnabled(true); // 设置返回键可用 62 | toolbar.setNavigationOnClickListener(new View.OnClickListener() { 63 | @Override 64 | public void onClick(View v) { 65 | finish(); 66 | } 67 | }); 68 | 69 | // webView 设置 70 | webView = findViewById(R.id.classWeb); 71 | WebSettings ws = webView.getSettings(); 72 | // 支持js 73 | ws.setJavaScriptEnabled(true); // 允许js 74 | ws.setJavaScriptCanOpenWindowsAutomatically(true); // 允许js打开新窗口 75 | 76 | // 缩放操作 77 | ws.setSupportZoom(true); 78 | ws.setBuiltInZoomControls(true); // 开启缩放 79 | ws.setDisplayZoomControls(false); // 隐藏原生的缩放控件 80 | 81 | // 自适应屏幕 82 | ws.setUseWideViewPort(true); // 自适应屏幕 83 | ws.setLoadWithOverviewMode(true); // 缩放至屏幕的大小 84 | 85 | // 设置浏览器标识,以pc模式打开网页 86 | ws.setUserAgentString("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36"); 87 | 88 | ws.setAllowFileAccess(true); // 可以访问文件 89 | 90 | // 读取 assets 里的js文件 91 | InputStreamReader inputReader = new InputStreamReader(getResources().getAssets().open("parseHtml.js")); 92 | BufferedReader bufReader = new BufferedReader(inputReader); 93 | String line; 94 | parseHtmlJS = ""; 95 | while ((line = bufReader.readLine()) != null) 96 | parseHtmlJS += line; 97 | Log.e(TAG, "parseHtmlJS: " + parseHtmlJS); 98 | 99 | // 加载网页 100 | webView.loadUrl(parseHtmlJS); 101 | webView.loadUrl(URL); 102 | webView.setWebViewClient(new WebViewClient() { 103 | 104 | // // android 6.0 以下使用 105 | // public boolean shouldOverrideUrlLoading(WebView view, String Url) { 106 | // view.loadUrl(Url); 107 | // return true; 108 | // } 109 | // @Override 110 | // public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { 111 | // view.loadUrl(String.valueOf(request.getUrl())); 112 | // return true; 113 | // } 114 | 115 | // js 注入 116 | @Override 117 | public void onPageStarted(WebView view, String url, Bitmap favicon) { 118 | webView.evaluateJavascript(parseHtmlJS, null); 119 | } 120 | 121 | public void onPageFinished(WebView view, String url) { 122 | super.onPageFinished(view, url); 123 | String title = view.getTitle(); 124 | if (!TextUtils.isEmpty(title)) { 125 | // 设置标题 126 | // getSupportActionBar().setTitle(title); 127 | TextView textView = findViewById(R.id.toolbar_title); 128 | textView.setText(title); 129 | Log.e(TAG, "title" + title); 130 | } 131 | } 132 | }); 133 | } 134 | 135 | /** 136 | * 导入课程保存为json字符串 137 | */ 138 | public void importSubject() { 139 | // 导入课程 140 | tv_import = findViewById(R.id.tv_button); 141 | tv_import.setOnClickListener(new View.OnClickListener() { 142 | @Override 143 | public void onClick(View v) { 144 | // 通过Handler发送消息 145 | webView.post(new Runnable() { 146 | @Override 147 | public void run() { 148 | // 注意调用的JS方法名要对应上 149 | // 调用javascript的parseHtml()方法 150 | // webView.loadUrl("javascript:parseHtml()"); 151 | webView.evaluateJavascript("javascript:parseHtml()", new ValueCallback() { 152 | @Override 153 | public void onReceiveValue(String value) { 154 | // 此处为 js 返回的结果 155 | // SharedPreferences sp = getSharedPreferences("COURSE_DATA", Context.MODE_PRIVATE);//创建sp对象 156 | // SharedPreferences.Editor editor = sp.edit(); 157 | // editor.clear(); 158 | // editor.putString("HTML_TO_SUBJECT", value); //存入json串 159 | // editor.commit();//提交 160 | SharedPreferencesUtil.init(ContextApplication.getAppContext(), "COURSE_DATA").putString("HTML_TO_SUBJECT", value); 161 | SharedPreferencesUtil.init(ContextApplication.getAppContext(), "COURSE_DATA").remove("SUBJECT_LIST"); 162 | Log.e(TAG, "HTML_TO_SUBJECT: " + value); 163 | 164 | Intent intent = new Intent(ParseHtmlActivity.this, MainActivity.class); 165 | if (MainActivity.mainActivity != null) { 166 | MainActivity.mainActivity.finish(); // 销毁MainActivity 167 | } 168 | startActivity(intent); 169 | finish(); 170 | } 171 | }); 172 | } 173 | }); 174 | } 175 | }); 176 | } 177 | 178 | 179 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/hhuclassschedule/SplashActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.hhuclassschedule; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | import android.content.Intent; 7 | import android.content.pm.ActivityInfo; 8 | import android.widget.TextView; 9 | 10 | import java.util.Timer; 11 | import java.util.TimerTask; 12 | 13 | /** 14 | * 启动界面 15 | */ 16 | public class SplashActivity extends AppCompatActivity { 17 | 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_splash); 22 | //设置此界面为 23 | // 竖屏 24 | setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 25 | init(); 26 | } 27 | 28 | private void init() { 29 | TextView tv_version = findViewById(R.id.tv_version); 30 | tv_version.setText("HHU课程表"); 31 | //利用timer让此界面延迟1秒后跳转,timer有一个线程,该线程不断执行task 32 | Timer timer = new Timer(); 33 | TimerTask timerTask = new TimerTask() { 34 | @Override 35 | public void run() { 36 | //发送intent实现页面跳转,第一个参数为当前页面的context,第二个参数为要跳转的主页 37 | Intent intent = new Intent(SplashActivity.this, MainActivity.class); 38 | startActivity(intent); 39 | //跳转后关闭当前欢迎页面 40 | SplashActivity.this.finish(); 41 | } 42 | }; 43 | //调度执行timerTask,第二个参数传入延迟时间(毫秒) 44 | timer.schedule(timerTask, 1000); 45 | } 46 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/hhuclassschedule/adapter/OnDateDelayAdapter.java: -------------------------------------------------------------------------------- 1 | package com.example.hhuclassschedule.adapter; 2 | 3 | import android.text.TextUtils; 4 | import android.widget.LinearLayout; 5 | 6 | import com.zhuangfei.timetable.listener.OnDateBuildAapter; 7 | import com.zhuangfei.timetable.model.ScheduleSupport; 8 | 9 | import java.text.SimpleDateFormat; 10 | import java.util.List; 11 | 12 | /** 13 | * 自定义日期栏 14 | */ 15 | public class OnDateDelayAdapter extends OnDateBuildAapter { 16 | 17 | /** 18 | * 阈值,即超过这个时间戳后开始更新日期 19 | * 否则将一直显示initDates中的日期 20 | */ 21 | protected long startTime; 22 | protected String startTimeStr; 23 | 24 | protected SimpleDateFormat sdf; 25 | 26 | /** 27 | * 日期集合,8个元素,当前时间小于等于阈值时使用 28 | */ 29 | List initDates = null; 30 | 31 | public OnDateDelayAdapter() { 32 | sdf = new SimpleDateFormat("yyyy-MM-dd"); 33 | } 34 | 35 | /** 36 | * 设置日期集合 37 | * 38 | * @param dates 元素个数必须大于等于8,第一个为月份数值,第2-8为周一至周日的日期数值(不带中文) 39 | */ 40 | public void setDateList(List dates) { 41 | if (dates.size() >= 8) { 42 | this.initDates = dates; 43 | } 44 | } 45 | 46 | public void setStartTime(long startTime) { 47 | this.startTime = startTime; 48 | this.startTimeStr = sdf.format(startTime); 49 | } 50 | 51 | @Override 52 | public void onInit(LinearLayout layout, float alpha) { 53 | super.onInit(layout, alpha); 54 | 55 | //增加的 56 | long curTime = System.currentTimeMillis(); 57 | if (curTime <= startTime) { 58 | weekDates = initDates; 59 | } 60 | } 61 | 62 | @Override 63 | public void onUpdateDate(int curWeek, int targetWeek) { 64 | if (textViews == null || textViews.length < 8) return; 65 | 66 | if (whenBeginSchool() <= 0) { 67 | weekDates = ScheduleSupport.getDateStringFromWeek(curWeek, targetWeek); 68 | } 69 | 70 | // weekDates = ScheduleSupport.getDateStringFromWeek(curWeek,targetWeek); 71 | int month = Integer.parseInt(weekDates.get(0)); 72 | textViews[0].setText(month + "\n月"); 73 | for (int i = 1; i < 8; i++) { 74 | if (textViews[i] != null) { 75 | textViews[i].setText(weekDates.get(i) + "日"); 76 | } 77 | } 78 | } 79 | 80 | //这段代码可以禁止在开学前自动更新日期栏上的星期高亮 81 | //它会使用开学那天的星期作为高亮 82 | //你可以根据自己的需求使用 83 | // @Override 84 | // public void onHighLight() { 85 | // if(whenBeginSchool()<=0){ 86 | // super.onHighLight(); 87 | // return; 88 | // } 89 | // 90 | // initDateBackground(); 91 | // //获取周几,1->7 92 | // Calendar calendar = Calendar.getInstance(); 93 | // calendar.setTime(new Date(startTime)); 94 | // //一周第一天是否为星期天 95 | // boolean isFirstSunday = (calendar.getFirstDayOfWeek() == Calendar.SUNDAY); 96 | // int weekDay = calendar.get(Calendar.DAY_OF_WEEK); 97 | // //若一周第一天为星期天,则-1 98 | // if (isFirstSunday) { 99 | // weekDay = weekDay - 1; 100 | // if (weekDay == 0) { 101 | // weekDay = 7; 102 | // } 103 | // } 104 | // activeDateBackground(weekDay); 105 | // } 106 | // 107 | // private void activeDateBackground(int weekDay) { 108 | // layouts[weekDay].setBackgroundColor( 109 | // ColorUtils.alphaColor(Color.parseColor("#BFF6F4"), alpha)); 110 | // } 111 | 112 | /** 113 | * 计算距离开学的天数 114 | * 115 | * @return 返回值2种类型,-1:没有开学时间,无法计算;0:已经开学;>0:天数 116 | */ 117 | public long whenBeginSchool() { 118 | if (!TextUtils.isEmpty(startTimeStr)) { 119 | int calWeek = ScheduleSupport.timeTransfrom(startTimeStr); 120 | if (calWeek > 0) {//开学 121 | return 0; 122 | } else { 123 | long seconds = (startTime - System.currentTimeMillis()) / 1000; 124 | long day = seconds / (24 * 3600); 125 | return day; 126 | } 127 | } 128 | return -1; 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/hhuclassschedule/adapter/OnMyConfigHandleAdapter.java: -------------------------------------------------------------------------------- 1 | package com.example.hhuclassschedule.adapter; 2 | 3 | import com.zhuangfei.timetable.TimetableView; 4 | 5 | /** 6 | * 处理配置信息 7 | */ 8 | public class OnMyConfigHandleAdapter { 9 | 10 | public OnMyConfigHandleAdapter() { 11 | } 12 | 13 | private static final String TAG = "OnMyConfigHandleAdapter"; 14 | 15 | public static final String CONFIG_SHOW_WEEKENDS = "config_show_weekends"; 16 | public static final String CONFIG_SHOW_NOT_CUR_WEEK = "config_show_not_cur_week"; 17 | /** 18 | * 存储的是开学日期,需利用其他工具动态计算当前周; 19 | * 存储格式"yy-MM-dd HH:mm:ss" 20 | */ 21 | public static final String CONFIG_CUR_WEEK = "config_current_week"; 22 | public static final String CONFIG_SHOW_TIME = "config_show_time"; 23 | 24 | public static final String CONFIG_NOT_OPEN = "config_not_open"; 25 | public static final String CONFIG_NOT_SHOW_WHERE = "config_not_where"; 26 | public static final String CONFIG_NOT_SHOW_WHEN = "config_not_when"; 27 | public static final String CONFIG_NOT_SHOW_STEP = "config_not_step"; 28 | 29 | 30 | public static final String CONFIG_START_DATE = "config_start_date"; 31 | 32 | 33 | public static final String VALUE_TRUE = "config_value_true"; 34 | public static final String VALUE_FALSE = "config_value_false"; 35 | 36 | /** 37 | * 应用配置信息 38 | * 39 | * @param key 信息的键 40 | * @param value 信息的值 41 | * @param mView 待设置的view 42 | */ 43 | public void onParseConfig(String key, String value, TimetableView mView) { 44 | if (mView == null || key == null || value == null) return; 45 | switch (key) { 46 | case CONFIG_SHOW_WEEKENDS: 47 | mView.isShowWeekends(value.equals(VALUE_TRUE)); 48 | break; 49 | case CONFIG_SHOW_NOT_CUR_WEEK: 50 | mView.isShowNotCurWeek(value.equals(VALUE_TRUE)); 51 | break; 52 | case CONFIG_CUR_WEEK: 53 | mView.curWeek(value);//value为开学周的时间 54 | break; 55 | default: 56 | break; 57 | } 58 | mView.updateView(); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/hhuclassschedule/util/ContextApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.hhuclassschedule.util; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | /** 7 | * 获取 Context 8 | */ 9 | public class ContextApplication extends Application { 10 | private static Context context; 11 | 12 | @Override 13 | public void onCreate() { 14 | super.onCreate(); 15 | ContextApplication.context = getApplicationContext(); 16 | } 17 | 18 | public static Context getAppContext() { 19 | return ContextApplication.context; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/hhuclassschedule/util/TimeCalUtil.java: -------------------------------------------------------------------------------- 1 | package com.example.hhuclassschedule.util; 2 | 3 | import java.text.ParseException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | import java.util.Locale; 7 | 8 | /** 9 | * 时间相关的计算工具 10 | */ 11 | public class TimeCalUtil { 12 | 13 | /** 14 | * 将"yyyy-MM-dd HH:mm:ss"格式的时间字符串 转换成 Date型 15 | */ 16 | public static Date str2Date(String dateStr) { 17 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA); 18 | Date date = null; 19 | try { 20 | date = format.parse(dateStr); 21 | } catch (ParseException e) { 22 | e.printStackTrace(); 23 | } 24 | return date; 25 | } 26 | 27 | /** 28 | * 将Date型 转换成 "yyyy-MM-dd HH:mm:ss"格式的时间字符串 29 | */ 30 | public static String date2Str(Date date) { 31 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA); 32 | return format.format(date); 33 | } 34 | 35 | /** 36 | * 计算某一时间 某几周前的Date: 37 | * 计算date时间在weeksNum周前的Date 38 | */ 39 | public static Date calWeeksAgo(Date date, int weeksNum) { 40 | return new Date(date.getTime() - weeksNum * 7 * 24 * 60 * 60 * 1000); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_radius_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_kechengbiao.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 8 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/res/drawable/ic_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/switch_ios_thumb.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/switch_ios_track_off.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/switch_ios_track_on.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/switch_ios_track_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/widgets_button_small_blue_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/res/font/iconfont.ttf -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_add_course.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 14 | 15 | 20 | 21 | 24 | 25 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 14 | 15 | 19 | 20 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_notification_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 17 | 18 | 27 | 28 | 38 | 39 | 40 | 49 | 50 | 55 | 56 | 60 | 61 | 70 | 71 | 81 | 82 | 83 | 87 | 88 | 97 | 98 | 108 | 109 | 110 | 114 | 115 | 124 | 125 | 135 | 136 | 137 | 138 | 139 | 148 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_parse_html.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 16 | 17 | 25 | 26 | 44 | 45 | 60 | 61 | 78 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | 21 | 22 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_confirm.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 18 | 19 | 23 | 24 | 29 | 30 | 39 | 40 | 44 | 45 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_course_detail.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 21 | 22 | 34 | 35 | 40 | 41 | 55 | 56 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_select_date.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 17 | 18 | 21 | 22 | 33 | 34 | 45 | 46 | 57 | 58 | 59 | 60 | 67 | 68 | 73 | 74 | 86 | 87 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_select_time.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 17 | 18 | 21 | 22 | 33 | 34 | 45 | 46 | 57 | 58 | 59 | 60 | 67 | 68 | 73 | 74 | 86 | 87 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_select_week.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 17 | 18 | 21 | 22 | 33 | 34 | 45 | 46 | 47 | 48 | 49 | 56 | 57 | 62 | 63 | 75 | 76 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /app/src/main/res/layout/header_base_func.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | 22 | 23 | 29 | 30 | 31 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_add_course_base.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 17 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 76 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_add_course_detail.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 31 | 32 | 38 | 39 | 48 | 49 | 59 | 60 | 61 | 67 | 68 | 77 | 78 | 92 | 93 | 94 | 100 | 101 | 110 | 111 | 122 | 123 | 124 | 125 | 131 | 132 | 141 | 142 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /app/src/main/res/layout/toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/menu/popmenu_base_func.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 10 | 13 | 16 | 19 | 22 | 25 | 28 | 31 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/menu/savemenu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 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 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_trans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/res/mipmap-hdpi/ic_launcher_trans.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | #9a000000 11 | #FF7A59 12 | #FBFBFB 13 | 14 | #dc7e2c 15 | #dc7e2c 16 | #dc7e2c 17 | #9aa3a3a3 18 | #2A3033 19 | #787C7E 20 | #ffffff 21 | #CFCFCF 22 | #3a9be7 23 | 24 | #000000 25 | 26 | #FB6A8F 27 | 28 | 29 | #31C453 30 | 31 | 32 | #FB5137 33 | 34 | 35 | #F52A64 36 | 37 | #84fab0 38 | #8fd3f4 39 | 40 | 41 | #F2F2F2 42 | #EEEEEE 43 | #d81e06 44 | #E8E8E8 45 | #999999 46 | #E6E6E6 47 | #f0f0f0 48 | #636363 49 | #757575 50 | 51 | 52 | #FFFFCC 53 | #2196F3 54 | #3FCAB8 55 | 56 | #2ABFFD 57 | #4F8CFE 58 | #FB6A8F 59 | 60 | #faf6f0 61 | #ffac37 62 | #24b9fe 63 | 64 | #BFF6F4 65 | #F4F8F8 66 | #0E0E0E 67 | #D3D3D3 68 | #5ACE45 69 | 70 | #FF6633 71 | #EDF0F2 72 | #F7F7F7 73 | 74 | #5D89B6 75 | #C4F1FD 76 | #3D3B46 77 | #8D8B99 78 | #5A5865 79 | 80 | 81 | #FFFF99 82 | #AAA3DB 83 | #86ACE9 84 | #92D261 85 | #80D8A3 86 | #F1C672 87 | #FDAD8B 88 | #ADBEFF 89 | #94D6FA 90 | #C3B5F6 91 | #99CCFF 92 | #FBA6ED 93 | 94 | #EE8262 95 | #EE6363 96 | #EEB4B4 97 | #D2B48C 98 | #CD9B9B 99 | #5F9EA0 100 | 101 | #E6E6E6 102 | 103 | #000000 104 | 105 | 106 | #CCCCCC 107 | 108 | #e7e7e7 109 | #d9d9d9 110 | 111 | #effafe 112 | #f0ffec 113 | #f3fffc 114 | 115 | 116 | #00abcf 117 | #d5ddde 118 | #d3d3d3 119 | #bfbfbf 120 | #FF9966 121 | #66FF66 122 | 123 | #F3F4F7 124 | #E0E0E0 125 | #D7D7DA 126 | 127 | #FDCD00 128 | #EBEBEB 129 | #393939 130 | #8E8E93 131 | #DADBE2 132 | #474747 133 | 134 | #0effc2 135 | #63AEFF 136 | #D6D6D6 137 | 138 | #E9E9E9 139 | #13B0F1 140 | #F4F8F8 141 | #E4EBEE 142 | 143 | #333333 144 | #E2F7F6 145 | #F1FFFE 146 | #B7F5F2 147 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | HHU课程表 3 | 1.0.0 4 | 5 | 6 | com.zhuangfei.timetable 7 | \ncn.carbswang.android:NumberPickerView 8 | \ncom.github.GrenderG:Toasty 9 | \nAIschedule-HHU-URP 10 | \ncom.google.code.gson:gson 11 | 12 | 13 | https://github.com/yuchenii/HHUClassSchedule 14 | https://github.com/yuchenii 15 | https://github.com/Chl-coder 16 | https://github.com/xuanipvp 17 | https://github.com/yuchenii 18 | https://github.com/Fudi2000 19 | https://github.com/Scandy316 20 | https://github.com/HHU-ZYP 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /app/src/test/java/com/example/hhuclassschedule/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.example.hhuclassschedule; 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() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | google() 5 | mavenCentral() 6 | maven { url "https://jitpack.io" } 7 | maven { url "https://maven.aliyun.com/repository/jcenter/" } 8 | } 9 | dependencies { 10 | classpath "com.android.tools.build:gradle:4.1.3" 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | google() 19 | mavenCentral() 20 | maven { url "https://jitpack.io" } 21 | maven { url "https://maven.aliyun.com/repository/jcenter/" } 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Apr 19 20:09:12 CST 2021 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-6.5-bin.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /img/1623573908305.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/img/1623573908305.jpg -------------------------------------------------------------------------------- /img/1623573908311.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/img/1623573908311.jpg -------------------------------------------------------------------------------- /img/1623573908317.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/img/1623573908317.jpg -------------------------------------------------------------------------------- /img/1623573908321.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/img/1623573908321.jpg -------------------------------------------------------------------------------- /img/1623573908326.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/img/1623573908326.jpg -------------------------------------------------------------------------------- /img/1623573908331.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/img/1623573908331.jpg -------------------------------------------------------------------------------- /img/1623573908335.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/img/1623573908335.jpg -------------------------------------------------------------------------------- /img/1623573908340.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/img/1623573908340.jpg -------------------------------------------------------------------------------- /img/1623573908350.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/img/1623573908350.jpg -------------------------------------------------------------------------------- /img/1623573908354.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/img/1623573908354.jpg -------------------------------------------------------------------------------- /img/1623574151732.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuchenii/HHUClassSchedule/eaeaf6032d908cd463bb46cde7737774783fc054/img/1623574151732.jpg -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':TimetableView' 2 | include ':app' 3 | rootProject.name = "HHU课程表" --------------------------------------------------------------------------------