├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── drawable │ │ │ ├── add.png │ │ │ ├── bg.jpg │ │ │ └── above.png │ │ ├── mipmap-hdpi │ │ │ └── timetable_114px.png │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── menu │ │ │ └── toolbar.xml │ │ └── layout │ │ │ ├── activity_about.xml │ │ │ ├── course_card.xml │ │ │ ├── left_view.xml │ │ │ ├── activity_add_course.xml │ │ │ └── activity_main.xml │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── kcb │ │ │ ├── AboutActivity.java │ │ │ ├── DatabaseHelper.java │ │ │ ├── Course.java │ │ │ ├── AddCourseActivity.java │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml ├── build.gradle └── proguard-rules.pro ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── caches │ └── build_file_checksums.ser ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── codeStyles │ └── Project.xml └── misc.xml ├── release └── output.json ├── gradle.properties ├── .gitignore ├── gradlew.bat ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mainxml/CourseTable/HEAD/app/src/main/res/drawable/add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mainxml/CourseTable/HEAD/app/src/main/res/drawable/bg.jpg -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mainxml/CourseTable/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/above.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mainxml/CourseTable/HEAD/app/src/main/res/drawable/above.png -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mainxml/CourseTable/HEAD/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/timetable_114px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mainxml/CourseTable/HEAD/app/src/main/res/mipmap-hdpi/timetable_114px.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":3,"versionName":"1.2","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Kcb 3 | EXAMPLE 4 | Configure 5 | Add widget 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jan 09 11:27:23 CST 2019 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.6-all.zip 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/kcb/AboutActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.kcb; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | 6 | public class AboutActivity extends AppCompatActivity { 7 | @Override 8 | protected void onCreate(Bundle savedInstanceState) { 9 | super.onCreate(savedInstanceState); 10 | setContentView(R.layout.activity_about); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/menu/toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 10 | 15 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion '28.0.3' 6 | defaultConfig { 7 | applicationId "com.example.kcb" 8 | minSdkVersion 15 9 | targetSdkVersion 24 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | } 14 | 15 | dependencies { 16 | implementation fileTree(include: ['*.jar'], dir: 'libs') 17 | implementation 'com.android.support:appcompat-v7:26.1.0' 18 | implementation 'com.android.support:cardview-v7:26.1.0' 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/course_card.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 17 | 18 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/workspace.xml 38 | .idea/tasks.xml 39 | .idea/gradle.xml 40 | .idea/dictionaries 41 | .idea/libraries 42 | 43 | # Keystore files 44 | *.jks 45 | 46 | # External native build folder generated in Android Studio 2.2 and later 47 | .externalNativeBuild 48 | 49 | # Google Services (e.g. APIs or Firebase) 50 | google-services.json 51 | 52 | # Freeline 53 | freeline.py 54 | freeline/ 55 | freeline_project_description.json 56 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\do\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/kcb/DatabaseHelper.java: -------------------------------------------------------------------------------- 1 | package com.example.kcb; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | import android.database.sqlite.SQLiteOpenHelper; 6 | 7 | public class DatabaseHelper extends SQLiteOpenHelper { 8 | 9 | public DatabaseHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) { 10 | super(context, name, factory, version); 11 | } 12 | 13 | @Override 14 | public void onCreate(SQLiteDatabase db) { 15 | db.execSQL("create table courses(" + 16 | "id integer primary key autoincrement," + 17 | "course_name text," + 18 | "teacher text," + 19 | "class_room text," + 20 | "day integer," + 21 | "class_start integer," + 22 | "class_end integer)"); 23 | } 24 | 25 | @Override 26 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 23 | 24 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/left_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 22 | 23 | 29 | 30 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/kcb/Course.java: -------------------------------------------------------------------------------- 1 | package com.example.kcb; 2 | 3 | 4 | import java.io.Serializable; 5 | 6 | public class Course implements Serializable { 7 | 8 | private String courseName; 9 | private String teacher; 10 | private String classRoom; 11 | private int day; 12 | private int classStart; 13 | private int classEnd; 14 | 15 | public Course(String courseName, String teacher, String classRoom, int day, int classStart, int classEnd) { 16 | this.courseName = courseName; 17 | this.teacher = teacher; 18 | this.classRoom = classRoom; 19 | this.day = day; 20 | this.classStart = classStart; 21 | this.classEnd = classEnd; 22 | } 23 | 24 | public String getCourseName() { 25 | return courseName; 26 | } 27 | 28 | public void setCourseName(String courseName) { 29 | this.courseName = courseName; 30 | } 31 | 32 | public String getTeacher() { 33 | return teacher; 34 | } 35 | 36 | public void setTeacher(String teacher) { 37 | this.teacher = teacher; 38 | } 39 | 40 | public String getClassRoom() { 41 | return classRoom; 42 | } 43 | 44 | public void setClassRoom(String classRoom) { 45 | this.classRoom = classRoom; 46 | } 47 | 48 | public int getDay() { 49 | return day; 50 | } 51 | 52 | public void setDay(int day) { 53 | this.day = day; 54 | } 55 | 56 | public int getStart() { 57 | return classStart; 58 | } 59 | 60 | public void setStart(int classStart) { 61 | this.classEnd = classStart; 62 | } 63 | 64 | public int getEnd() { 65 | return classEnd; 66 | } 67 | 68 | public void setEnd(int classEnd) { 69 | this.classEnd = classEnd; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/kcb/AddCourseActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.kcb; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.view.View; 8 | import android.widget.Button; 9 | import android.widget.EditText; 10 | import android.widget.Toast; 11 | 12 | public class AddCourseActivity extends AppCompatActivity { 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_add_course); 18 | setFinishOnTouchOutside(false); 19 | 20 | final EditText inputCourseName = (EditText) findViewById(R.id.course_name); 21 | final EditText inputTeacher = (EditText) findViewById(R.id.teacher_name); 22 | final EditText inputClassRoom = (EditText) findViewById(R.id.class_room); 23 | final EditText inputDay = (EditText) findViewById(R.id.week); 24 | final EditText inputStart = (EditText) findViewById(R.id.classes_begin); 25 | final EditText inputEnd = (EditText) findViewById(R.id.classes_ends); 26 | 27 | Button okButton = (Button) findViewById(R.id.button); 28 | okButton.setOnClickListener(new View.OnClickListener() { 29 | @Override 30 | public void onClick(View v) { 31 | String courseName = inputCourseName.getText().toString(); 32 | String teacher = inputTeacher.getText().toString(); 33 | String classRoom = inputClassRoom.getText().toString(); 34 | String day = inputDay.getText().toString(); 35 | String start = inputStart.getText().toString(); 36 | String end = inputEnd.getText().toString(); 37 | 38 | if (courseName.equals("") || day.equals("") || start.equals("") || end.equals("")) { 39 | Toast.makeText(AddCourseActivity.this, "基本课程信息未填写", Toast.LENGTH_SHORT).show(); 40 | } else { 41 | Course course = new Course(courseName, teacher, classRoom, 42 | Integer.valueOf(day), Integer.valueOf(start), Integer.valueOf(end)); 43 | Intent intent = new Intent(AddCourseActivity.this, MainActivity.class); 44 | intent.putExtra("course", course); 45 | 46 | setResult(Activity.RESULT_OK, intent); 47 | finish(); 48 | } 49 | } 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_add_course.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 20 | 21 | 26 | 33 | 34 | 39 | 45 | 46 | 51 | 57 | 58 | 63 | 69 | 70 | 75 | 82 | 83 | 88 | 95 | 96 | 97 | 98 |