Skip to content

Commit

Permalink
add notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cris-GY committed Jul 4, 2021
1 parent 3ed613d commit 07cea24
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 14 deletions.
12 changes: 11 additions & 1 deletion src/main/java/ml/crisgy/cgyapp/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package ml.crisgy.cgyapp;
/**
* 使用模板进行修改
*/

import android.app.Notification;
import android.app.NotificationChannel;
Expand Down Expand Up @@ -49,9 +52,13 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
setSupportActionBar(toolbar);//菜单栏
FloatingActionButton fab = findViewById(R.id.fab);//进入添加课程考试界面
fab.setOnClickListener(new View.OnClickListener() {
/**
* 添加考试课程选择界面
* @param view
*/
@Override
public void onClick(View view) {//选择考试or课程
AlertDialog.Builder courseexamdialog = new AlertDialog.Builder(MainActivity.this).setTitle("请选择需要添加的对象").setPositiveButton("课程", new DialogInterface.OnClickListener() {
Expand Down Expand Up @@ -109,6 +116,9 @@ public boolean onSupportNavigateUp() {
|| super.onSupportNavigateUp();
}

/**
*结束前发出提醒
*/
@RequiresApi(api = Build.VERSION_CODES.O)
@Override
public void onDestroy() {
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/ml/crisgy/cgyapp/SplashActivity.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package ml.crisgy.cgyapp;
/**
* 开屏展示
* @version 1.1.3
*/

import android.content.Intent;
import android.os.Bundle;
Expand All @@ -10,7 +14,7 @@ public class SplashActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
Thread.sleep(1000);
Thread.sleep(1000);//等待1秒
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/ml/crisgy/cgyapp/addcourse.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package ml.crisgy.cgyapp;
/**
* 添加课程
*@version 1.1.3
*/

import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;
Expand All @@ -17,11 +21,11 @@

public class addcourse extends MainActivity{

private List<String> weeklist = new ArrayList<String>();
private List<String> weeklist = new ArrayList<String>();//第几周
private ArrayAdapter<String> courseweekspinneradapter;
private List<String> ofweeklist = new ArrayList<String>();
private List<String> ofweeklist = new ArrayList<String>();//周几
private ArrayAdapter<String> courseofweekspinneradapter;
private List<String> timelist = new ArrayList<String>();
private List<String> timelist = new ArrayList<String>();//时间
private ArrayAdapter<String> coursetimespinneradapter;
private databasehelper coursedbhelper;
int ofweek = 1, timestart = 1, timeend = 1, weekstart = 1, weekend = 1;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/ml/crisgy/cgyapp/addexam.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
package ml.crisgy.cgyapp;
/**
* 添加考试
* 考试日期选择为简单列表下拉选择,未判定是否合法
* @version 1.1.2
*/

import android.content.ContentValues;
import android.content.SharedPreferences;
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/ml/crisgy/cgyapp/coursecardadapter.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package ml.crisgy.cgyapp;
/**
*主页课程卡片adapter
* @version 1.1.1
*/

import android.content.Context;
import android.util.Log;
Expand All @@ -25,9 +29,9 @@ public View getView(int position, View convertView, ViewGroup parent){
View view;
view = LayoutInflater.from(getContext()).inflate(resourceId, parent, false);
TextView coursecardname = view.findViewById(R.id.coursecardname_textview);
TextView coursecardweek = view.findViewById(R.id.coursecardweek_textview);
TextView coursecardtime = view.findViewById(R.id.coursecardtime_textview);
TextView coursecardcontent = view.findViewById(R.id.coursecardcontent_textview);
TextView coursecardweek = view.findViewById(R.id.coursecardweek_textview);//周数和周几
TextView coursecardtime = view.findViewById(R.id.coursecardtime_textview);//第几节
TextView coursecardcontent = view.findViewById(R.id.coursecardcontent_textview);//其他内容包括老师和教室
String coursename = coursecarditem.getCoursename();
coursecardname.setText(coursename);
int weekstart = coursecarditem.getWeekstart();
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/ml/crisgy/cgyapp/coursecarditem.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package ml.crisgy.cgyapp;
/**
* 课程卡片item
* version 1.1.1
*/

import android.util.Log;

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/ml/crisgy/cgyapp/databasehelper.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package ml.crisgy.cgyapp;
/**
* 数据库管理
* version 1.1.1
*/

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/ml/crisgy/cgyapp/examcalendarremind.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package ml.crisgy.cgyapp;
/**
* 添加考试至日历提醒
* @version 1.1.2
*/

import android.content.ContentUris;
import android.content.ContentValues;
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/ml/crisgy/cgyapp/examcardadapter.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package ml.crisgy.cgyapp;
/**
* 考试卡片adapter
* @version 1.1.3
*/

import android.content.Context;
import android.view.LayoutInflater;
Expand All @@ -24,7 +28,7 @@ public View getView(int position, View convertView, ViewGroup parent){
View view;
view = LayoutInflater.from(getContext()).inflate(resourceId, parent, false);
TextView examcardname = view.findViewById(R.id.examcardname_textview);
TextView examcardcontent = view.findViewById(R.id.examcardcontent_textview);
TextView examcardcontent = view.findViewById(R.id.examcardcontent_textview);//包括考试时间加地点
examcardname.setText(examcarditem.getExamname());
int month = examcarditem.getMonth();
String months = "" + month;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/ml/crisgy/cgyapp/examcarditem.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package ml.crisgy.cgyapp;

/**
* 考试卡片item
* @version 1.1.2
*/

public class examcarditem {
private String examname , examroom;
private int month , day;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/ml/crisgy/cgyapp/noticeactivity.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package ml.crisgy.cgyapp;
/**
* 通知提醒
* @version 1.1.1
*/

import android.os.Bundle;
import android.os.PersistableBundle;
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/ml/crisgy/cgyapp/settings.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package ml.crisgy.cgyapp;

/**
* 设置
* #version 1.1.3
*/

import android.content.ComponentName;
import android.content.Intent;
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/ml/crisgy/cgyapp/timemanager.java
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
package ml.crisgy.cgyapp;
/**
* 统一获取时间
* @version 1.1.3
*/

import android.content.SharedPreferences;

import java.util.Calendar;

public class timemanager extends MainActivity{

public static int getWeekOfYear() {
public static int getWeekOfYear() {//获取周数
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
int weekOfYear = calendar.get(Calendar.WEEK_OF_YEAR);//获取当前周数
return weekOfYear;
}

public static int getMonth() {
public static int getMonth() {//月份
Calendar calendar = Calendar.getInstance();
int month = calendar.get(Calendar.MONTH) + 1;
return month;
}

public static int getDay() {
public static int getDay() {//日期
Calendar calendar = Calendar.getInstance();
int day = calendar.get(Calendar.DAY_OF_MONTH);
return day;
}

public static int getWeekDay(){
public static int getWeekDay(){//周几
Calendar calendar = Calendar.getInstance();
int weekday = calendar.get(Calendar.DAY_OF_WEEK) - 1;
if (weekday == 0){
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/ml/crisgy/cgyapp/zhlgd.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package ml.crisgy.cgyapp;
/**
* 智慧理工大webview
* @version 1.1.1
*/

import android.content.Intent;
import android.os.Bundle;
Expand Down

0 comments on commit 07cea24

Please sign in to comment.