diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..2b75303
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,13 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..30aa626
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..2996d53
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..703e5d4
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..761e69a
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,41 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 28
+ defaultConfig {
+ applicationId "com.dujiajun.courseblock"
+ minSdkVersion 21
+ targetSdkVersion 28
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 'androidx.appcompat:appcompat:1.0.0-rc02'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ implementation 'com.google.android.material:material:1.0.0-rc02'
+ implementation 'org.jsoup:jsoup:1.11.3'
+ implementation 'com.squareup.okhttp3:okhttp:3.14.0'
+ //implementation 'com.google.code.gson:gson:2.8.5'
+ //implementation 'com.eclipsesource.j2v8:j2v8:4.5.0@aar'
+ implementation 'com.github.bumptech.glide:glide:4.9.0'
+ annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
+ implementation 'com.github.zfman:TimetableView:v2.0.7'
+ //implementation 'org.apache.httpcomponents:httpclient:4.5.7'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/app/src/androidTest/java/com/dujiajun/courseblock/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/dujiajun/courseblock/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..f45102f
--- /dev/null
+++ b/app/src/androidTest/java/com/dujiajun/courseblock/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.dujiajun.courseblock;
+
+import android.content.Context;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.dujiajun.courseblock", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..614c448
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/dujiajun/courseblock/CourseDBHelper.java b/app/src/main/java/com/dujiajun/courseblock/CourseDBHelper.java
new file mode 100644
index 0000000..7526f6f
--- /dev/null
+++ b/app/src/main/java/com/dujiajun/courseblock/CourseDBHelper.java
@@ -0,0 +1,39 @@
+package com.dujiajun.courseblock;
+
+import android.content.Context;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.widget.Toast;
+
+import androidx.annotation.Nullable;
+
+public class CourseDBHelper extends SQLiteOpenHelper {
+
+ public static final String CREATE_COURSE_TABLE = "CREATE TABLE course(" +
+ "id integer primary key autoincrement," +
+ "cno integer not null," +
+ "cname text not null," +
+ "start_week integer," +
+ "end_week integer," +
+ "teacher text," +
+ "location text," +
+ "day_in_week integer," +
+ "class_in_day integer)";
+
+ private Context mContext;
+ public CourseDBHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
+ super(context, name, factory, version);
+ mContext = context;
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(CREATE_COURSE_TABLE);
+ Toast.makeText(mContext, "CREATED DATABASE", Toast.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+
+ }
+}
diff --git a/app/src/main/java/com/dujiajun/courseblock/CourseManager.java b/app/src/main/java/com/dujiajun/courseblock/CourseManager.java
new file mode 100644
index 0000000..7ac5bf8
--- /dev/null
+++ b/app/src/main/java/com/dujiajun/courseblock/CourseManager.java
@@ -0,0 +1,224 @@
+package com.dujiajun.courseblock;
+
+import android.content.Context;
+import android.os.AsyncTask;
+import android.util.Log;
+import android.webkit.CookieManager;
+import android.widget.Toast;
+
+import com.zhuangfei.timetable.model.Schedule;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import okhttp3.Callback;
+import okhttp3.Cookie;
+import okhttp3.CookieJar;
+import okhttp3.FormBody;
+import okhttp3.HttpUrl;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+
+public class CourseManager {
+
+ private Context mContext;
+ private static CourseManager singleton;
+ private List scheduleList;
+
+ private CourseManager(Context context) {
+ mContext = context;
+ scheduleList = new ArrayList<>();
+ }
+
+ public static CourseManager getInstance(Context context) {
+ if (singleton == null) {
+ singleton = new CourseManager(context);
+ }
+ return singleton;
+ }
+
+ public List getScheduleList() {
+ return scheduleList;
+ }
+
+ public void writeToDatabase() {
+
+ }
+
+ public void readFromDatabase() {
+
+ }
+
+ public void downloadFromNetwork() {
+
+ }
+
+ private OkHttpClient client = new OkHttpClient.Builder()
+ .cookieJar(new WebViewCookieHandler())
+ .build();
+
+ public enum SEMESTER {
+ FIRST("3"), SECOND("12"), SUMMER("16");
+ private String name;
+
+ SEMESTER(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+ }
+
+ private void getCourseTable(String year, SEMESTER semester, Callback callback) {
+ RequestBody requestBody = new FormBody.Builder()
+ .add("xnm", year)
+ .add("xqm", semester.getName())
+ .build();
+ String courseJsonUrl = "http://i.sjtu.edu.cn/kbcx/xskbcx_cxXsKb.html";
+ Request request = new Request.Builder()
+ .url(courseJsonUrl)
+ .post(requestBody)
+ .build();
+ Log.i("CourseBlock", request.headers().toString());
+ client.newCall(request).enqueue(callback);
+ }
+
+ public void updateCourseDatabase(String year, SEMESTER semester, ShowInUICallback callback) {
+
+ new AsyncTask() {
+
+ @Override
+ protected Void doInBackground(Void... voids) {
+ RequestBody requestBody = new FormBody.Builder()
+ .add("xnm", year)
+ .add("xqm", semester.getName())
+ .build();
+ String courseJsonUrl = "http://i.sjtu.edu.cn/kbcx/xskbcx_cxXsKb.html";
+ Request request = new Request.Builder()
+ .url(courseJsonUrl)
+ .post(requestBody)
+ .build();
+ Log.i("CourseBlock", request.headers().toString());
+ Response response = null;
+ try {
+ response = client.newCall(request).execute();
+
+ if (!"application/json;charset=UTF-8".equals(response.header("Content-Type"))) {
+ Toast.makeText(mContext, "请先登录!", Toast.LENGTH_SHORT).show();
+ return null;
+ }
+ if (response.body() != null) {
+ String resp = null;
+ resp = response.body().string();
+ parseCourseJson(resp);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ @Override
+ protected void onPostExecute(Void aVoid) {
+ super.onPostExecute(aVoid);
+ callback.onShow(scheduleList);
+ }
+ }.execute();
+
+ }
+
+ public interface ShowInUICallback {
+ void onShow(List schedules);
+ }
+
+ private void parseCourseJson(String json) {
+ try {
+ scheduleList.clear();
+ JSONObject jsonObject = new JSONObject(json);
+ JSONObject jsonObjectJmcMap = jsonObject.getJSONObject("xqjmcMap");
+ JSONArray jsonArrayKb = jsonObject.getJSONArray("kbList");
+ for (int i = 0; i < jsonArrayKb.length(); i++) {
+ JSONObject jsonCourse = jsonArrayKb.getJSONObject(i);
+ JSubject subject = new JSubject();
+ subject.setName(jsonCourse.getString("kcmc"));
+ subject.setRoom(jsonCourse.getString("cdmc"));
+ subject.setDay(jsonCourse.getInt("xqj"));
+ List startAndStep = getStartAndStep(jsonCourse.getString("jcor"));
+ subject.setStart(startAndStep.get(0));
+ subject.setStep(startAndStep.get(1));
+ subject.setTeacher(jsonCourse.getString("xm"));
+ subject.setWeekList(getWeekList(jsonCourse.getString("zcd")));
+ scheduleList.add(subject.getSchedule());
+ }
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ private List getWeekList(String weekString) {
+ int isEven = 0;
+ if (weekString.contains("(单)")) {
+ isEven = 1;
+ weekString = weekString.replace("(单)", "");
+ }
+ if (weekString.contains("(双)")) {
+ isEven = 1;
+ weekString = weekString.replace("(双)", "");
+ }
+ String[] weeks = weekString.replace("周", "").split("-");
+ List weekList = new ArrayList<>();
+ for (Integer i = Integer.valueOf(weeks[0]); i <= Integer.valueOf(weeks[1]); i = i + 1 + isEven) {
+ weekList.add(i);
+ }
+ return weekList;
+ }
+
+ private List getStartAndStep(String jcor) {
+ List startAndStep = new ArrayList<>();
+ String[] jc = jcor.split("-");
+ startAndStep.add(Integer.valueOf(jc[0]));
+ startAndStep.add(Integer.valueOf(jc[1]) - Integer.valueOf(jc[0]) + 1);
+ return startAndStep;
+ }
+
+ public static class WebViewCookieHandler implements CookieJar {
+ private CookieManager mCookieManager = CookieManager.getInstance();
+
+ @Override
+ public void saveFromResponse(HttpUrl url, List cookies) {
+ String urlString = url.toString();
+
+ for (Cookie cookie : cookies) {
+ mCookieManager.setCookie(urlString, cookie.toString());
+ }
+ }
+
+ @Override
+ public List loadForRequest(HttpUrl url) {
+ String urlString = url.toString();
+ String cookiesString = mCookieManager.getCookie(urlString);
+
+ if (cookiesString != null && !cookiesString.isEmpty()) {
+ String[] cookieHeaders = cookiesString.split(";");
+ List cookies = new ArrayList<>(cookieHeaders.length);
+
+ for (String header : cookieHeaders) {
+ cookies.add(Cookie.parse(url, header));
+ }
+ return cookies;
+ }
+
+ return Collections.emptyList();
+ }
+ }
+}
diff --git a/app/src/main/java/com/dujiajun/courseblock/CourseTableView.java b/app/src/main/java/com/dujiajun/courseblock/CourseTableView.java
new file mode 100644
index 0000000..1f07775
--- /dev/null
+++ b/app/src/main/java/com/dujiajun/courseblock/CourseTableView.java
@@ -0,0 +1,53 @@
+package com.dujiajun.courseblock;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.annotation.Nullable;
+
+public class CourseTableView extends LinearLayout {
+
+ private LinearLayout layoutTitle;
+ private LinearLayout layoutLeft;
+ public CourseTableView(Context context, @Nullable AttributeSet attrs) {
+ super(context, attrs);
+ LayoutInflater.from(context).inflate(R.layout.view_coursetable,this);
+
+ layoutTitle = findViewById(R.id.layout_title_day);
+ layoutLeft = findViewById(R.id.layout_left_class);
+
+ //ArrayList listTitleDay = new ArrayList<>();
+ //ArrayList listLeftClass = new ArrayList<>();
+ String[] strTitleDay = getResources().getStringArray(R.array.days_in_week);
+
+ LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT
+ , ViewGroup.LayoutParams.WRAP_CONTENT
+ ,1);
+ params.gravity = Gravity.CENTER;
+
+ for (String s:strTitleDay) {
+ TextView textView = new TextView(context);
+ textView.setText(s);
+ //textView.setTextSize(18);
+ textView.setGravity(Gravity.CENTER);
+ textView.setLayoutParams(params);
+ layoutTitle.addView(textView);
+ }
+
+ for (int i = 1; i <= 13; i++) {
+ TextView textView = new TextView(context);
+ textView.setText(String.valueOf(i));
+ //textView.setTextSize(18);
+ textView.setGravity(Gravity.CENTER);
+ textView.setLayoutParams(params);
+ layoutLeft.addView(textView);
+ }
+ }
+
+
+}
diff --git a/app/src/main/java/com/dujiajun/courseblock/JSubject.java b/app/src/main/java/com/dujiajun/courseblock/JSubject.java
new file mode 100644
index 0000000..4014626
--- /dev/null
+++ b/app/src/main/java/com/dujiajun/courseblock/JSubject.java
@@ -0,0 +1,142 @@
+package com.dujiajun.courseblock;
+
+import com.zhuangfei.timetable.model.Schedule;
+import com.zhuangfei.timetable.model.ScheduleEnable;
+
+import java.util.List;
+
+public class JSubject implements ScheduleEnable {
+
+ private int id = 0;
+ //private String courseId;
+ private String time;
+ private String name;
+ private String room;
+ private String teacher;
+ private int start;
+ private int step;
+ private int day;
+ private List weekList;
+ private String term;
+ private int colorRandom = 0;
+
+ public JSubject() {
+ }
+
+ public JSubject(String time, String name, String room, String teacher, int start, int step, int day, List weekList, String term, int colorRandom) {
+ this.time = time;
+ this.name = name;
+ this.room = room;
+ this.teacher = teacher;
+ this.start = start;
+ this.step = step;
+ this.day = day;
+ this.weekList = weekList;
+ this.term = term;
+ this.colorRandom = colorRandom;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getTime() {
+ return time;
+ }
+
+ public void setTime(String time) {
+ this.time = time;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getRoom() {
+ return room;
+ }
+
+ public void setRoom(String room) {
+ this.room = room;
+ }
+
+ public String getTeacher() {
+ return teacher;
+ }
+
+ public void setTeacher(String teacher) {
+ this.teacher = teacher;
+ }
+
+ public int getStart() {
+ return start;
+ }
+
+ public void setStart(int start) {
+ this.start = start;
+ }
+
+ public int getStep() {
+ return step;
+ }
+
+ public void setStep(int step) {
+ this.step = step;
+ }
+
+ public int getDay() {
+ return day;
+ }
+
+ public void setDay(int day) {
+ this.day = day;
+ }
+
+ public List getWeekList() {
+ return weekList;
+ }
+
+ public void setWeekList(List weekList) {
+ this.weekList = weekList;
+ }
+
+ public String getTerm() {
+ return term;
+ }
+
+ public void setTerm(String term) {
+ this.term = term;
+ }
+
+ public int getColorRandom() {
+ return colorRandom;
+ }
+
+ public void setColorRandom(int colorRandom) {
+ this.colorRandom = colorRandom;
+ }
+
+ @Override
+ public Schedule getSchedule() {
+ Schedule schedule = new Schedule();
+ schedule.setDay(getDay());
+ schedule.setName(getName());
+ schedule.setRoom(getRoom());
+ schedule.setStart(getStart());
+ schedule.setStep(getStep());
+ schedule.setTeacher(getTeacher());
+ schedule.setWeekList(getWeekList());
+ schedule.setColorRandom(2);
+ //schedule.putExtras(EXTRAS_ID,getId());
+ //schedule.putExtras(EXTRAS_AD_URL,getUrl());
+ return schedule;
+ }
+}
diff --git a/app/src/main/java/com/dujiajun/courseblock/LoginActivity.java b/app/src/main/java/com/dujiajun/courseblock/LoginActivity.java
new file mode 100644
index 0000000..00363c0
--- /dev/null
+++ b/app/src/main/java/com/dujiajun/courseblock/LoginActivity.java
@@ -0,0 +1,39 @@
+package com.dujiajun.courseblock;
+
+import android.os.Bundle;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+
+public class LoginActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_login);
+ Toolbar toolbar = findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+ toolbar.setNavigationOnClickListener(v -> finish());
+ WebView webView = findViewById(R.id.webview);
+ webView.getSettings().setJavaScriptEnabled(true);
+ webView.setWebViewClient(new WebViewClient(){
+ @Override
+ public boolean shouldOverrideUrlLoading(WebView view, String url) {
+ view.loadUrl(url);
+ return true;
+ }
+
+ /*@Override
+ public void onLoadResource(WebView view, String url) {
+ super.onLoadResource(view, url);
+ if (url.contains("i.sjtu.edu.cn")){
+ finish();
+ }
+ }*/
+ });
+ String loginUrl = "http://i.sjtu.edu.cn/jaccountlogin";
+ webView.loadUrl(loginUrl);
+ }
+}
diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..1f6bb29
--- /dev/null
+++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..0d025f9
--- /dev/null
+++ b/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..9410f3f
--- /dev/null
+++ b/app/src/main/res/layout/activity_login.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..f76ba85
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml
new file mode 100644
index 0000000..565938c
--- /dev/null
+++ b/app/src/main/res/layout/content_main.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/view_coursetable.xml b/app/src/main/res/layout/view_coursetable.xml
new file mode 100644
index 0000000..d191a3e
--- /dev/null
+++ b/app/src/main/res/layout/view_coursetable.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml
new file mode 100644
index 0000000..648c447
--- /dev/null
+++ b/app/src/main/res/menu/menu_main.xml
@@ -0,0 +1,10 @@
+
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..898f3ed
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..dffca36
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..64ba76f
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..dae5e08
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..e5ed465
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..14ed0af
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b0907ca
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..d8ae031
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..2c18de9
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..beed3cd
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..025a2d4
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,9 @@
+
+
+ #008577
+ #00574B
+ #D81B60
+ #B3E5FC
+ #BDBDBD
+ #FFF9C4
+
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..8e95d46
--- /dev/null
+++ b/app/src/main/res/values/dimens.xml
@@ -0,0 +1,5 @@
+
+ 16dp
+ 48dp
+ 48dp
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..06559ae
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,16 @@
+
+ CourseBlock
+ Settings
+ TODO
+ Login
+
+
+ - 周一
+ - 周二
+ - 周三
+ - 周四
+ - 周五
+ - 周六
+ - 周日
+
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..5e399fa
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/xml/network_security_config.xml b/app/src/main/res/xml/network_security_config.xml
new file mode 100644
index 0000000..dca93c0
--- /dev/null
+++ b/app/src/main/res/xml/network_security_config.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/test/java/com/dujiajun/courseblock/ExampleUnitTest.java b/app/src/test/java/com/dujiajun/courseblock/ExampleUnitTest.java
new file mode 100644
index 0000000..3fa4652
--- /dev/null
+++ b/app/src/test/java/com/dujiajun/courseblock/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.dujiajun.courseblock;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..87845ed
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ google()
+ jcenter()
+
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.3.2'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ maven { url 'https://jitpack.io' }
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..199d16e
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,20 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app's APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Automatically convert third-party libraries to use AndroidX
+android.enableJetifier=true
+
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..f6b961f
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..b6b06ac
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sat Mar 16 17:22:49 CST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..cccdd3d
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+include ':app'