├── .gitignore
├── .idea
├── checkstyle-idea.xml
├── codeStyles
│ └── Project.xml
├── code_generator_settings.xml
├── encodings.xml
├── gradle.xml
├── markdown-doclet.xml
├── misc.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── app.plantuml
├── build.gradle
├── proguard-rules.pro
├── release
│ └── output.json
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── homeworkreminder
│ │ ├── ExampleInstrumentedTest.java
│ │ └── homeworkreminder.plantuml
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── homeworkreminder
│ │ │ ├── activity
│ │ │ ├── AboutActivity.java
│ │ │ ├── BaseActivity.java
│ │ │ ├── CountActivity.java
│ │ │ ├── EditHomeworkActivity.java
│ │ │ ├── EditUserInfoActivity.java
│ │ │ ├── HomeworkDetailActivity.java
│ │ │ ├── IndexActivity.java
│ │ │ ├── LoginActivity.java
│ │ │ ├── MainActivity.java
│ │ │ ├── ModifyPasswordActivity.java
│ │ │ ├── MyHomeworkDetailActivity.java
│ │ │ ├── NewHomeworkActivity.java
│ │ │ ├── RegisterActivity.java
│ │ │ ├── ReminderActivity.java
│ │ │ ├── TestBmobActivity.java
│ │ │ ├── TestQMUIActivity.java
│ │ │ ├── TomatoClockActivity.java
│ │ │ └── UserActivity.java
│ │ │ ├── adapter
│ │ │ ├── DoneDataRecyclerViewAdapter.java
│ │ │ ├── HomeDataRecyclerViewAdapter.java
│ │ │ ├── MyFragmentPagerAdapter.java
│ │ │ ├── MyViewPagerAdapter.java
│ │ │ ├── TabViewPagerAdapter.java
│ │ │ └── UndoDataRecyclerViewAdapter.java
│ │ │ ├── entity
│ │ │ ├── Count.java
│ │ │ ├── HomeData.java
│ │ │ ├── HomeworkData.java
│ │ │ ├── HomeworkID.java
│ │ │ ├── UserInfo.java
│ │ │ ├── Weather.java
│ │ │ ├── Weather2.java
│ │ │ └── bean
│ │ │ │ └── Person.java
│ │ │ ├── fragment
│ │ │ ├── DoneHomeworkFragment.java
│ │ │ ├── HomeFragment.java
│ │ │ ├── HomeworkFragment.java
│ │ │ ├── IndexFragment.java
│ │ │ ├── PageViewModel.java
│ │ │ ├── SettingFragment.java
│ │ │ ├── UndoHomeworkFragment.java
│ │ │ └── UserFragment.java
│ │ │ ├── interfaces
│ │ │ ├── CallbackValueToActivity.java
│ │ │ ├── MyRecyclerViewOnItemClickListener.java
│ │ │ └── MyRecyclerViewOnItemLongPressListener.java
│ │ │ ├── receiver
│ │ │ └── ClockReceiver.java
│ │ │ ├── service
│ │ │ └── MusicService.java
│ │ │ ├── utils
│ │ │ ├── ClockUtil.java
│ │ │ ├── GlideImageLoader.java
│ │ │ ├── MyApplication.java
│ │ │ ├── TimeUtil.java
│ │ │ ├── networkUtil
│ │ │ │ ├── MyGson.java
│ │ │ │ ├── VolleyInterface.java
│ │ │ │ ├── VolleyListener.java
│ │ │ │ └── VolleyUtil.java
│ │ │ └── userUtil
│ │ │ │ └── CheckUserInfoUtil.java
│ │ │ └── view
│ │ │ └── TomatoView.java
│ └── res
│ │ ├── anim
│ │ ├── slide_in_left.xml
│ │ ├── slide_in_right.xml
│ │ ├── slide_out_left.xml
│ │ └── slide_out_right.xml
│ │ ├── drawable-v24
│ │ ├── about_bg.jpg
│ │ ├── app_logo.png
│ │ ├── app_logo2.png
│ │ ├── app_logo_background.png
│ │ ├── app_logo_foreground.png
│ │ ├── head.jpg
│ │ ├── ic_launcher_foreground.xml
│ │ ├── icon_about.png
│ │ ├── icon_add_to_my.png
│ │ ├── icon_edit.png
│ │ ├── icon_selected_all_hw.png
│ │ ├── icon_selected_home.png
│ │ ├── icon_selected_my.png
│ │ ├── icon_selected_my_hw.png
│ │ ├── icon_tomato.png
│ │ ├── icon_unselected_all_hw.png
│ │ ├── icon_unselected_home.png
│ │ ├── icon_unselected_my.png
│ │ ├── icon_unselected_my_hw.png
│ │ ├── img_clock_bg2.jpg
│ │ ├── img_count_bg.jpg
│ │ ├── img_count_bg2.jpg
│ │ ├── img_count_bg3.png
│ │ ├── img_edit_user_top.png
│ │ ├── img_modify_pw_top.png
│ │ ├── img_new_hw_top.png
│ │ ├── img_user_top.jpeg
│ │ ├── img_user_top2.jpeg
│ │ ├── index_bg1.jpg
│ │ ├── index_bg2.jpg
│ │ ├── index_btn_bg1.png
│ │ ├── index_btn_bg2.png
│ │ ├── index_btn_bg3.png
│ │ ├── index_btn_bg4.png
│ │ ├── index_btn_bg5.png
│ │ ├── info_header_bg.jpg
│ │ ├── login_bg.jpg
│ │ ├── logo.png
│ │ ├── menu_register.png
│ │ ├── new_homework_ok.png
│ │ └── reg_bg.jpg
│ │ ├── drawable
│ │ ├── add2.png
│ │ ├── card_corner.xml
│ │ ├── color_shape.xml
│ │ ├── color_shape_radius.xml
│ │ ├── ic_launcher_background.xml
│ │ ├── ic_menu_camera.xml
│ │ ├── ic_menu_gallery.xml
│ │ ├── ic_menu_manage.xml
│ │ ├── ic_menu_send.xml
│ │ ├── ic_menu_share.xml
│ │ ├── ic_menu_slideshow.xml
│ │ ├── menu_home.png
│ │ ├── menu_homework.png
│ │ ├── menu_setting.png
│ │ ├── nav_bar_bg.jpg
│ │ ├── new_bg.jpg
│ │ ├── no_image.png
│ │ ├── ok.png
│ │ ├── point_deep.xml
│ │ ├── point_smiple.xml
│ │ ├── side_nav_bar.xml
│ │ ├── welcome_img1.jpg
│ │ ├── welcome_img2.jpg
│ │ └── welcome_img3.jpg
│ │ ├── layout
│ │ ├── activity_about.xml
│ │ ├── activity_count.xml
│ │ ├── activity_edit_homework.xml
│ │ ├── activity_edit_user_info.xml
│ │ ├── activity_homework.xml
│ │ ├── activity_homework_detail.xml
│ │ ├── activity_index.xml
│ │ ├── activity_login.xml
│ │ ├── activity_main.xml
│ │ ├── activity_modify_password.xml
│ │ ├── activity_my_homework_detail.xml
│ │ ├── activity_new_homework.xml
│ │ ├── activity_register.xml
│ │ ├── activity_reminder.xml
│ │ ├── activity_set_smc.xml
│ │ ├── activity_splash.xml
│ │ ├── activity_test_bmob.xml
│ │ ├── activity_test_qmui.xml
│ │ ├── activity_tomato_clock.xml
│ │ ├── activity_user.xml
│ │ ├── app_bar_main.xml
│ │ ├── content_about.xml
│ │ ├── content_edit_homework.xml
│ │ ├── content_homework_detail.xml
│ │ ├── content_main.xml
│ │ ├── content_my_homework_detail.xml
│ │ ├── content_new_homework.xml
│ │ ├── content_user.xml
│ │ ├── foot_load_tips.xml
│ │ ├── fragment_done_homework.xml
│ │ ├── fragment_index.xml
│ │ ├── fragment_undo_homework.xml
│ │ ├── fragment_user.xml
│ │ ├── home_fragment_layout.xml
│ │ ├── home_homework_list_item.xml
│ │ ├── homework_done_list_item.xml
│ │ ├── homework_fragment_layout.xml
│ │ ├── homework_recycler_view.xml
│ │ ├── homework_undo_list_item.xml
│ │ ├── nav_header_main.xml
│ │ └── setting_fragment_layout.xml
│ │ ├── menu
│ │ ├── activity_main_drawer.xml
│ │ ├── main.xml
│ │ ├── menu_about.xml
│ │ ├── menu_edit_homework.xml
│ │ ├── menu_homework_detail.xml
│ │ ├── menu_my_homework_detail.xml
│ │ ├── menu_new_homework.xml
│ │ └── menu_user.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.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
│ │ ├── raw
│ │ └── bgm.mp3
│ │ ├── values-v21
│ │ └── styles.xml
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ ├── values
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ │ └── xml
│ │ └── network_security_config.xml
│ └── test
│ └── java
│ └── com
│ └── homeworkreminder
│ ├── ExampleUnitTest.java
│ └── homeworkreminder.plantuml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 |
--------------------------------------------------------------------------------
/.idea/checkstyle-idea.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/.idea/code_generator_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
--------------------------------------------------------------------------------
/.idea/markdown-doclet.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # HomeworkReminder 共享作业题提醒APP
2 |
3 | ## 作业共享提醒APP
4 |
5 | ## 1 简介
6 | 为了解决不让同学经常来问我每次课堂的作业是什么,我觉得开发一个APP来记录课堂作业,并共享,我自己记录下来的作业或者其他同学记录下来的作业,可共享给其他同学看。可以在作业中设置提醒什么时候交作业,通过APP的闹钟通知提前一天时间通知自己该完成作业了。
7 |
8 | 
9 |
10 | 
11 |
12 |
13 |
14 | APP名称:作业共享提醒
15 |
16 | 开发者:李步官
17 |
18 | 学校:中山大学新华学院
19 |
20 | **github项目地址**
21 |
22 | Android APP:https://github.com/AlanLee97/HomeworkReminder
23 |
24 | PHP服务端:https://github.com/AlanLee97/ThinkPHP5_HomeworkReminder
25 |
26 | ## 2 APP端界面
27 |
28 | 
29 |
30 | 
31 |
32 | 
33 |
34 | ## 3 后台管理界面
35 |
36 | 
37 |
38 | 
39 |
40 | 
41 |
42 | 
43 |
44 | 
45 |
46 | 
47 |
48 | 
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 28
5 | defaultConfig {
6 | applicationId "com.homeworkremider"
7 | minSdkVersion 24
8 | targetSdkVersion 28
9 | versionCode 1
10 | versionName "1.0"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 |
20 | useLibrary 'org.apache.http.legacy'
21 | }
22 |
23 | buildscript {
24 | repositories {
25 | jcenter()
26 | }
27 | dependencies {
28 | classpath 'com.android.tools.build:gradle:1.2.3'
29 | }
30 | }
31 |
32 | allprojects {
33 | repositories {
34 | jcenter()
35 | //Bmob的maven仓库地址--必填
36 | maven { url "https://raw.github.com/bmob/bmob-android-sdk/master" }
37 | }
38 | }
39 |
40 | dependencies {
41 | implementation fileTree(dir: 'libs', include: ['*.jar'])
42 |
43 | implementation 'cn.bmob.android:bmob-sdk:3.7.3-rc1'
44 | implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
45 | implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
46 |
47 | implementation 'com.qmuiteam:qmui:1.4.0'
48 |
49 |
50 | // https://mvnrepository.com/artifact/com.android.volley/volley
51 | implementation group: 'com.android.volley', name: 'volley', version: '1.1.1'
52 |
53 | // https://mvnrepository.com/artifact/com.nostra13.universalimageloader/universal-image-loader
54 | implementation group: 'com.nostra13.universalimageloader', name: 'universal-image-loader', version: '1.9.5'
55 |
56 | // https://mvnrepository.com/artifact/com.google.code.gson/gson
57 | implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
58 |
59 | // https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
60 | implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.10.0'
61 |
62 | // https://mvnrepository.com/artifact/com.squareup.okio/okio
63 | implementation group: 'com.squareup.okio', name: 'okio', version: '1.14.0'
64 |
65 | implementation 'com.youth.banner:banner:1.4.10' //最新版本
66 |
67 | // https://mvnrepository.com/artifact/com.github.bumptech.glide/glide
68 | compile group: 'com.github.bumptech.glide', name: 'glide', version: '4.8.0'
69 |
70 |
71 | implementation 'com.android.support:recyclerview-v7:28.0.0'
72 | implementation 'com.android.support:appcompat-v7:28.0.0'
73 | implementation 'com.android.support:support-v4:28.0.0'
74 | implementation 'com.android.support:design:28.0.0'
75 | implementation 'com.android.support.constraint:constraint-layout:1.1.3'
76 | testImplementation 'junit:junit:4.12'
77 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
78 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
79 | implementation 'android.arch.lifecycle:extensions:1.1.1'
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/release/output.json:
--------------------------------------------------------------------------------
1 | [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/homeworkreminder/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.homeworkremider;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.homeworkremider", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/homeworkreminder/homeworkreminder.plantuml:
--------------------------------------------------------------------------------
1 | @startuml
2 |
3 | title __HOMEWORKREMINDER's Class Diagram__\n
4 |
5 |
6 |
7 | right footer
8 |
9 |
10 | PlantUML diagram generated by SketchIt! (https://bitbucket.org/pmesmeur/sketch.it)
11 | For more information about this tool, please contact philippe.mesmeur@gmail.com
12 | endfooter
13 |
14 | @enduml
15 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
17 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
35 |
38 |
42 |
46 |
47 |
50 |
51 |
55 |
59 |
62 |
65 |
68 |
72 |
76 |
77 |
78 |
81 |
82 |
83 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/activity/AboutActivity.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.activity;
2 |
3 | import android.os.Bundle;
4 | import android.support.design.widget.FloatingActionButton;
5 | import android.support.design.widget.Snackbar;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.support.v7.widget.Toolbar;
8 | import android.view.View;
9 |
10 | import com.homeworkreminder.R;
11 |
12 | public class AboutActivity extends AppCompatActivity {
13 |
14 | @Override
15 | protected void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | setContentView(R.layout.activity_about);
18 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
19 | setSupportActionBar(toolbar);
20 |
21 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
22 | // fab.setOnClickListener(new View.OnClickListener() {
23 | // @Override
24 | // public void onClick(View view) {
25 | // Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
26 | // .setAction("Action", null).show();
27 | // }
28 | // });
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/activity/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.activity;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.annotation.Nullable;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.util.Log;
8 |
9 | import com.homeworkreminder.utils.userUtil.CheckUserInfoUtil;
10 |
11 | import cn.bmob.v3.Bmob;
12 |
13 | public class BaseActivity extends AppCompatActivity {
14 | //APPID
15 | private static final String BMOB_APPID = "c25d039da1fe8e259a7a49dac8435a6d";
16 |
17 | @Override
18 | protected void onCreate(@Nullable Bundle savedInstanceState) {
19 | super.onCreate(savedInstanceState);
20 |
21 | //初始化Bmob
22 | Bmob.initialize(getApplicationContext(),BMOB_APPID);
23 |
24 | }
25 |
26 | @Override
27 | protected void onDestroy() {
28 | super.onDestroy();
29 | }
30 |
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/activity/EditHomeworkActivity.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.activity;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.design.widget.FloatingActionButton;
6 | import android.support.design.widget.Snackbar;
7 | import android.support.v7.app.AppCompatActivity;
8 | import android.support.v7.widget.Toolbar;
9 | import android.view.View;
10 | import android.widget.EditText;
11 | import android.widget.TextView;
12 | import android.widget.Toast;
13 |
14 | import com.android.volley.VolleyError;
15 | import com.homeworkreminder.R;
16 | import com.homeworkreminder.receiver.ClockReceiver;
17 | import com.homeworkreminder.utils.ClockUtil;
18 | import com.homeworkreminder.utils.MyApplication;
19 | import com.homeworkreminder.utils.networkUtil.VolleyInterface;
20 | import com.homeworkreminder.utils.networkUtil.VolleyUtil;
21 |
22 | import java.util.Calendar;
23 |
24 | /**
25 | * 编辑作业的Activity
26 | */
27 | public class EditHomeworkActivity extends AppCompatActivity {
28 | private EditText etEditHomeworkTitle;
29 | private EditText etEditHomeworkContent;
30 | private EditText etEditHomeworkDeadtime;
31 | private EditText etEditHomeworkTag;
32 | private TextView tvEditChooseDate;
33 | private TextView tvEditChooseTime;
34 | private EditText etEditHomeworkCourse;
35 | private String hid;
36 | private MyApplication app;
37 | private String url = "http://www.nibuguai.cn/index.php/index/homework/api_editHomeworkDoWith?id=";
38 | private String title;
39 | private String content;
40 | private String course;
41 | private String deadtime;
42 | private String remind_date;
43 | private String remind_time;
44 |
45 |
46 | @Override
47 | protected void onCreate(Bundle savedInstanceState) {
48 | super.onCreate(savedInstanceState);
49 | setContentView(R.layout.activity_edit_homework);
50 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
51 | setSupportActionBar(toolbar);
52 |
53 | initView();
54 |
55 | setData();
56 |
57 | final Calendar calendar = Calendar.getInstance();
58 | ClockUtil.chooseDate(tvEditChooseDate, calendar, EditHomeworkActivity.this);
59 | ClockUtil.chooseTime(tvEditChooseTime, calendar, EditHomeworkActivity.this);
60 |
61 | app = (MyApplication) getApplication();
62 |
63 |
64 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
65 | fab.setOnClickListener(new View.OnClickListener() {
66 | @Override
67 | public void onClick(View view) {
68 |
69 | getData();
70 | url = url + hid
71 | + "&title=" + title
72 | + "&course=" + course
73 | + "&content=" + content
74 | + "&deadtime=" + deadtime
75 | + "&remind_date=" + remind_date
76 | + "&remind_time=" + remind_time;
77 |
78 | VolleyUtil.volleyGET(EditHomeworkActivity.this, url, "106",
79 | new VolleyInterface(
80 | EditHomeworkActivity.this, VolleyInterface.mListener, VolleyInterface.mErrorListener
81 | ) {
82 | @Override
83 | public void onMySuccess(String result) {
84 | Toast.makeText(EditHomeworkActivity.this, "修改作业成功", Toast.LENGTH_SHORT).show();
85 | }
86 |
87 | @Override
88 | public void onMyError(VolleyError error) {
89 | Toast.makeText(EditHomeworkActivity.this, "修改作业失败", Toast.LENGTH_SHORT).show();
90 |
91 | }
92 | });
93 |
94 | ClockUtil.startAlarm(EditHomeworkActivity.this, ClockReceiver.class, calendar);
95 | }
96 | });
97 | }
98 |
99 | private void getData() {
100 | title = etEditHomeworkTitle.getText().toString();
101 | content = etEditHomeworkContent.getText().toString();
102 | course = etEditHomeworkCourse.getText().toString();
103 | deadtime = etEditHomeworkDeadtime.getText().toString();
104 | remind_date = tvEditChooseDate.getText().toString();
105 | remind_time = tvEditChooseTime.getText().toString();
106 | }
107 |
108 | /**
109 | * 接收其他Activity传过来的数据,并显示当当前Activity
110 | */
111 | private void setData() {
112 | Intent intent = getIntent();
113 | Bundle bundle = intent.getExtras();
114 | //ivDetailHead.setImageResource(headImg);
115 |
116 | etEditHomeworkTitle.setText(bundle.getCharSequence("title"));
117 | etEditHomeworkContent.setText(bundle.getCharSequence("content"));
118 | etEditHomeworkDeadtime.setText(bundle.getCharSequence("deadtime"));
119 | etEditHomeworkCourse.setText(bundle.getCharSequence("course"));
120 | etEditHomeworkTag.setText(bundle.getCharSequence("tag"));
121 |
122 | hid = bundle.getCharSequence("hid").toString();
123 | }
124 |
125 | private void initView() {
126 | etEditHomeworkTitle = (EditText) findViewById(R.id.et_edit_homework_title);
127 | etEditHomeworkContent = (EditText) findViewById(R.id.et_edit_homework_content);
128 | etEditHomeworkDeadtime = (EditText) findViewById(R.id.et_edit_homework_deadtime);
129 | etEditHomeworkTag = (EditText) findViewById(R.id.et_edit_homework_tag);
130 | tvEditChooseDate = (TextView) findViewById(R.id.tv_edit_chooseDate);
131 | tvEditChooseTime = (TextView) findViewById(R.id.tv_edit_chooseTime);
132 | etEditHomeworkCourse = (EditText) findViewById(R.id.et_edit_homework_course);
133 |
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/activity/EditUserInfoActivity.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.activity;
2 |
3 | import android.content.Intent;
4 | import android.graphics.Color;
5 | import android.os.Build;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.os.Bundle;
8 | import android.view.View;
9 | import android.view.Window;
10 | import android.widget.Button;
11 | import android.widget.EditText;
12 | import android.widget.TextView;
13 | import android.widget.Toast;
14 |
15 | import com.android.volley.VolleyError;
16 | import com.homeworkreminder.R;
17 | import com.homeworkreminder.utils.MyApplication;
18 | import com.homeworkreminder.utils.networkUtil.VolleyInterface;
19 | import com.homeworkreminder.utils.networkUtil.VolleyUtil;
20 |
21 |
22 | /**
23 | * 编辑用户信息界面
24 | */
25 | public class EditUserInfoActivity extends AppCompatActivity {
26 |
27 | private EditText etEditNickname;
28 | private EditText etEditSchool;
29 | private TextView etEditMajor;
30 | private EditText etEditClass;
31 | private Button btnEditUserinfo;
32 | //private TextView tvEditJump;
33 | private String nickname;
34 | private String school;
35 | private String major;
36 | private String clazz;
37 | private String url = "http://www.nibuguai.cn/index.php/index/user/api_editUserInfoDoWith?";
38 |
39 | private MyApplication app;
40 |
41 |
42 | @Override
43 | protected void onCreate(Bundle savedInstanceState) {
44 | super.onCreate(savedInstanceState);
45 | setContentView(R.layout.activity_edit_user_info);
46 | app = (MyApplication) getApplication();
47 |
48 | if(Build.VERSION.SDK_INT >= 24) {
49 | Window window = getWindow();
50 | window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
51 | | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
52 | window.setStatusBarColor(Color.TRANSPARENT);
53 | }
54 |
55 |
56 | initView();
57 |
58 | Intent intent = getIntent();
59 | Bundle bundle = intent.getExtras();
60 | receiveDataFormBundle(bundle);
61 |
62 | btnEditUserinfo.setOnClickListener(new View.OnClickListener() {
63 | @Override
64 | public void onClick(View v) {
65 | sendRequest();
66 | }
67 | });
68 |
69 | }
70 |
71 | /**
72 | * 发送请求
73 | */
74 | private void sendRequest() {
75 | getData();
76 | int uid = app.getUserInfo().getData().get(0).getId();
77 | url = url + "nickname=" + nickname
78 | + "&school=" + school
79 | + "&class=" + clazz
80 | + "&major=" + major
81 | + "&id=" + uid;
82 | VolleyUtil.volleyGET(getApplicationContext(), url, "100",
83 | new VolleyInterface(getApplicationContext(),VolleyInterface.mListener, VolleyInterface.mErrorListener) {
84 | @Override
85 | public void onMySuccess(String result) {
86 | Toast.makeText(getApplication(), "请求成功", Toast.LENGTH_SHORT).show();
87 | startActivity(new Intent(EditUserInfoActivity.this, IndexActivity.class));
88 | }
89 |
90 | @Override
91 | public void onMyError(VolleyError error) {
92 | Toast.makeText(getApplication(), "请求失败", Toast.LENGTH_SHORT).show();
93 | }
94 | });
95 | }
96 |
97 | public void getData(){
98 | nickname = etEditNickname.getText().toString();
99 | school = etEditSchool.getText().toString();
100 | major = etEditMajor.getText().toString();
101 | clazz = etEditClass.getText().toString();
102 |
103 | }
104 |
105 | private void initView() {
106 | etEditNickname = (EditText) findViewById(R.id.et_edit_nickname);
107 | etEditSchool = (EditText) findViewById(R.id.et_edit_school);
108 | etEditMajor = (TextView) findViewById(R.id.et_edit_major);
109 | etEditClass = (EditText) findViewById(R.id.et_edit_class);
110 | btnEditUserinfo = (Button) findViewById(R.id.btn_edit_userinfo);
111 | }
112 |
113 |
114 | public void receiveDataFormBundle(Bundle bundle){
115 | etEditNickname.setText(bundle.getCharSequence("nickname"));
116 | etEditSchool.setText(bundle.getCharSequence("school"));
117 | etEditMajor.setText(bundle.getCharSequence("major"));
118 | etEditClass.setText(bundle.getCharSequence("class"));
119 |
120 | System.out.println("nickname:" + bundle.getCharSequence("nickname"));
121 | System.out.println("school:" + bundle.getCharSequence("school"));
122 | System.out.println("major:" + bundle.getCharSequence("major"));
123 | System.out.println("class:" + bundle.getCharSequence("class"));
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/activity/MyHomeworkDetailActivity.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.activity;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.design.widget.FloatingActionButton;
6 | import android.support.design.widget.Snackbar;
7 | import android.support.v7.app.AppCompatActivity;
8 | import android.support.v7.widget.Toolbar;
9 | import android.view.View;
10 | import android.widget.TextView;
11 |
12 | import com.homeworkreminder.R;
13 | import com.homeworkreminder.utils.MyApplication;
14 | import com.qmuiteam.qmui.widget.QMUIRadiusImageView;
15 |
16 | /**
17 | * 作业详情页
18 | */
19 | public class MyHomeworkDetailActivity extends AppCompatActivity {
20 |
21 | private QMUIRadiusImageView ivMyDetailHead;
22 | private TextView tvMyDetailNickname;
23 | private TextView tvMyDetailDate;
24 | private TextView tvMyDetailTitle;
25 | private TextView tvMyDetailContent;
26 | private TextView tvMyDetailDeadtime;
27 | private TextView tvMyDetailTag;
28 | private TextView tvMyDetailAlarmtime;
29 | private TextView tvDetailCourse;
30 |
31 | //private int headImg;
32 | private String nickname;
33 | private String date;
34 | private String title;
35 | private String content;
36 | private String course;
37 | private String deadtime;
38 | private String tag;
39 | private String hid;
40 |
41 | private MyApplication app;
42 |
43 | @Override
44 | protected void onCreate(Bundle savedInstanceState) {
45 | super.onCreate(savedInstanceState);
46 | setContentView(R.layout.activity_my_homework_detail);
47 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
48 | setSupportActionBar(toolbar);
49 |
50 | initView();
51 |
52 | Intent intent = getIntent();
53 | Bundle bundle = intent.getExtras();
54 | //ivDetailHead.setImageResource(headImg);
55 | tvMyDetailNickname.setText(bundle.getCharSequence("nickname"));
56 | tvMyDetailDate.setText(bundle.getCharSequence("date"));
57 | tvMyDetailTitle.setText(bundle.getCharSequence("title"));
58 | tvMyDetailContent.setText(bundle.getCharSequence("content"));
59 | tvMyDetailTag.setText(bundle.getCharSequence("tag"));
60 | tvDetailCourse.setText(bundle.getCharSequence("course"));
61 | tvMyDetailDeadtime.setText(bundle.getCharSequence("deadtime"));
62 | hid = bundle.getCharSequence("hid").toString();
63 |
64 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
65 | fab.setOnClickListener(new View.OnClickListener() {
66 | @Override
67 | public void onClick(View view) {
68 | Intent intent2 = new Intent(MyHomeworkDetailActivity.this, EditHomeworkActivity.class);
69 |
70 | Bundle bundle = new Bundle();
71 |
72 | convertDataToActivity(bundle);
73 |
74 | intent2.putExtras(bundle);
75 |
76 | startActivity(intent2);
77 |
78 | }
79 | });
80 |
81 |
82 | }
83 |
84 | private void initView() {
85 | ivMyDetailHead = (QMUIRadiusImageView) findViewById(R.id.iv_my_detail_head);
86 | tvMyDetailNickname = (TextView) findViewById(R.id.tv_my_detail_nickname);
87 | tvMyDetailDate = (TextView) findViewById(R.id.tv_my_detail_date);
88 | tvMyDetailTitle = (TextView) findViewById(R.id.tv_my_detail_title);
89 | tvMyDetailContent = (TextView) findViewById(R.id.tv_my_detail_content);
90 | tvMyDetailDeadtime = (TextView) findViewById(R.id.tv_my_detail_deadtime);
91 | tvMyDetailTag = (TextView) findViewById(R.id.tv_my_detail_tag);
92 | tvMyDetailAlarmtime = (TextView) findViewById(R.id.tv_my_detail_alarmtime);
93 | tvDetailCourse = (TextView) findViewById(R.id.tv_detail_course);
94 | }
95 |
96 |
97 | /**
98 | * 通过Bundle向Activity中传值
99 | */
100 | public void convertDataToActivity(Bundle bundle){
101 |
102 | getData();
103 |
104 | //bundle.putInt("headImg",headImg);
105 | bundle.putCharSequence("nickname", nickname);
106 | bundle.putCharSequence("title", title);
107 | bundle.putCharSequence("content", content);
108 | bundle.putCharSequence("tag", tag);
109 | bundle.putCharSequence("date", date);
110 | bundle.putCharSequence("course", course);
111 | bundle.putCharSequence("deadtime", deadtime);
112 | bundle.putCharSequence("hid", hid);
113 |
114 | }
115 |
116 |
117 | public void getData(){
118 | nickname = tvMyDetailNickname.getText().toString();
119 | date = tvMyDetailDate.getText().toString();
120 | title = tvMyDetailTitle.getText().toString();
121 | content = tvMyDetailContent.getText().toString();
122 | course = tvDetailCourse.getText().toString();
123 | deadtime = tvMyDetailDeadtime.getText().toString();
124 | tag = tvMyDetailTag.getText().toString();
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/activity/ReminderActivity.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.activity;
2 |
3 | import android.content.DialogInterface;
4 | import android.support.v7.app.AlertDialog;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.os.Bundle;
7 |
8 | import com.homeworkreminder.R;
9 |
10 | /**
11 | * 提醒界面
12 | */
13 | public class ReminderActivity extends AppCompatActivity {
14 |
15 | @Override
16 | protected void onCreate(Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 | setContentView(R.layout.activity_reminder);
19 |
20 | reminder();
21 |
22 | }
23 |
24 | /**
25 | * 闹钟提醒
26 | */
27 | public void reminder(){
28 | AlertDialog alertDialog = new AlertDialog.Builder(this).create();
29 |
30 | alertDialog.setTitle("闹钟");
31 | alertDialog.setMessage("闹钟时间到");
32 | alertDialog.setButton(DialogInterface.BUTTON_POSITIVE,
33 | "确定",
34 | new DialogInterface.OnClickListener() {
35 | @Override
36 | public void onClick(DialogInterface dialog, int which) {
37 |
38 | }
39 | }
40 | );
41 | alertDialog.show();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/activity/TestQMUIActivity.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.activity;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | import com.homeworkreminder.R;
7 |
8 | public class TestQMUIActivity extends AppCompatActivity {
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_test_qmui);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/activity/TomatoClockActivity.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.activity;
2 |
3 | import android.graphics.Color;
4 | import android.os.Build;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.view.Window;
9 | import android.widget.TextView;
10 |
11 | import com.homeworkreminder.R;
12 | import com.homeworkreminder.view.TomatoView;
13 | import com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton;
14 |
15 | public class TomatoClockActivity extends AppCompatActivity {
16 | TomatoView clockView;
17 | private QMUIRoundButton btnStart;
18 | private QMUIRoundButton btnStop;
19 |
20 |
21 |
22 |
23 | @Override
24 | protected void onCreate(Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | setContentView(R.layout.activity_tomato_clock);
27 |
28 | if(Build.VERSION.SDK_INT >= 24) {
29 | Window window = getWindow();
30 | window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
31 | | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
32 | window.setStatusBarColor(Color.TRANSPARENT);
33 | }
34 |
35 |
36 | initView();
37 |
38 | btnStart.setOnClickListener(new View.OnClickListener() {
39 | @Override
40 | public void onClick(View view) {
41 | clockView.start();
42 | }
43 | });
44 |
45 | btnStop.setOnClickListener(new View.OnClickListener() {
46 | @Override
47 | public void onClick(View view) {
48 | clockView.stop();
49 | }
50 | });
51 | }
52 |
53 | private void initView() {
54 | clockView = findViewById(R.id.clockView);
55 | btnStart = (QMUIRoundButton) findViewById(R.id.btn_start);
56 | btnStop = (QMUIRoundButton) findViewById(R.id.btn_stop);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/activity/UserActivity.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.activity;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.design.widget.FloatingActionButton;
6 | import android.support.design.widget.Snackbar;
7 | import android.support.v7.app.AppCompatActivity;
8 | import android.support.v7.widget.Toolbar;
9 | import android.util.Log;
10 | import android.view.View;
11 | import android.widget.Button;
12 | import android.widget.TextView;
13 | import android.widget.Toast;
14 |
15 | import com.android.volley.VolleyError;
16 | import com.homeworkreminder.R;
17 | import com.homeworkreminder.entity.UserInfo;
18 | import com.homeworkreminder.utils.MyApplication;
19 | import com.homeworkreminder.utils.networkUtil.MyGson;
20 | import com.homeworkreminder.utils.networkUtil.VolleyInterface;
21 | import com.homeworkreminder.utils.networkUtil.VolleyUtil;
22 | import com.homeworkreminder.utils.userUtil.CheckUserInfoUtil;
23 |
24 | import java.util.List;
25 |
26 | import cn.bmob.v3.util.V;
27 |
28 | /**
29 | * 用户界面(已废弃,换成UserFragment)
30 | */
31 | public class UserActivity extends AppCompatActivity {
32 | private TextView tvUserinfoUsername;
33 | private TextView tvUserinfoNickname;
34 | private TextView tvUserinfoSchool;
35 | private TextView tvUserinfoMajor;
36 | private TextView tvUserinfoClass;
37 | private Button btnLogout;
38 | private Button btnModifyPassword;
39 |
40 | private String nickname;
41 | private String school;
42 | private String major;
43 | private String clazz;
44 |
45 | MyApplication app = new MyApplication();
46 |
47 | String url = "http://www.nibuguai.cn/index.php/index/user/api_getUserInfoById?id=";
48 | int uid;
49 |
50 | String registerState = "";
51 | String loginState = "";
52 |
53 | @Override
54 | protected void onCreate(Bundle savedInstanceState) {
55 | super.onCreate(savedInstanceState);
56 | setContentView(R.layout.activity_user);
57 |
58 | initView();
59 |
60 | //checkUserState();
61 |
62 | //showData();
63 |
64 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
65 | setSupportActionBar(toolbar);
66 |
67 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
68 | fab.setOnClickListener(new View.OnClickListener() {
69 | @Override
70 | public void onClick(View view) {
71 | // Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
72 | // .setAction("Action", null).show();
73 |
74 | getData();
75 | Intent intent = new Intent(UserActivity.this, EditUserInfoActivity.class);
76 | Bundle bundle = new Bundle();
77 |
78 | convertDataToActivity(bundle);
79 | intent.putExtras(bundle);
80 |
81 | startActivity(intent);
82 | }
83 | });
84 |
85 | modifyPassword();
86 |
87 | logout();
88 | }
89 |
90 | private void modifyPassword() {
91 | btnModifyPassword.setOnClickListener(new View.OnClickListener() {
92 | @Override
93 | public void onClick(View v) {
94 | startActivity(new Intent(UserActivity.this, ModifyPasswordActivity.class));
95 |
96 | }
97 | });
98 | }
99 |
100 |
101 | private String TAG = "user_state";
102 |
103 | private void logout() {
104 | btnLogout.setOnClickListener(new View.OnClickListener() {
105 | @Override
106 | public void onClick(View v) {
107 |
108 | CheckUserInfoUtil userInfoUtil = new CheckUserInfoUtil(getApplicationContext());
109 | userInfoUtil.writeUserInfo("false", "register");
110 | userInfoUtil.writeUserInfo("false", "login");
111 | userInfoUtil.writeUserInfo("", "uid");
112 | //app.setSTATE_LOGIN(false);
113 | startActivity(new Intent(UserActivity.this, IndexActivity.class));
114 |
115 | finish();
116 | }
117 | });
118 | }
119 |
120 | private void initView() {
121 |
122 |
123 | tvUserinfoUsername = (TextView) findViewById(R.id.tv_userinfo_username);
124 | tvUserinfoNickname = (TextView) findViewById(R.id.tv_userinfo_nickname);
125 | tvUserinfoSchool = (TextView) findViewById(R.id.tv_userinfo_school);
126 | tvUserinfoMajor = (TextView) findViewById(R.id.tv_userinfo_major);
127 | tvUserinfoClass = (TextView) findViewById(R.id.tv_userinfo_class);
128 | btnLogout = (Button) findViewById(R.id.btn_logout);
129 | btnModifyPassword = (Button) findViewById(R.id.btn_modifyPassword);
130 |
131 | }
132 |
133 |
134 |
135 | /**
136 | * 通过Bundle向Activity中传值
137 | */
138 | public void convertDataToActivity(Bundle bundle){
139 | //bundle.putInt("headImg",headImg);
140 | bundle.putCharSequence("nickname", nickname);
141 | bundle.putCharSequence("school", school);
142 | bundle.putCharSequence("major", major);
143 | bundle.putCharSequence("class", clazz);
144 |
145 |
146 | }
147 |
148 | public void getData(){
149 | nickname = tvUserinfoNickname.getText().toString();
150 | school = tvUserinfoSchool.getText().toString();
151 | major = tvUserinfoMajor.getText().toString();
152 | clazz = tvUserinfoClass.getText().toString();
153 |
154 | }
155 |
156 |
157 | }
158 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/adapter/HomeDataRecyclerViewAdapter.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.adapter;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.NonNull;
5 | import android.support.v7.widget.CardView;
6 | import android.support.v7.widget.RecyclerView;
7 | import android.util.Log;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.ImageView;
12 | import android.widget.LinearLayout;
13 | import android.widget.TextView;
14 |
15 |
16 | import com.homeworkreminder.R;
17 | import com.homeworkreminder.entity.HomeData;
18 | import com.homeworkreminder.entity.HomeworkData;
19 | import com.homeworkreminder.interfaces.MyRecyclerViewOnItemClickListener;
20 |
21 | import java.util.ArrayList;
22 | import java.util.List;
23 |
24 | public class HomeDataRecyclerViewAdapter extends RecyclerView.Adapter {
25 | //上下文
26 | private Context context;
27 | //数据列表
28 | private List homeDataList = new ArrayList<>();
29 | private List homeworkDataList = new ArrayList<>();
30 | private List homeworkDataBeanList = new ArrayList<>();
31 | private LayoutInflater layoutInflater;
32 | //定义监听器
33 | private MyRecyclerViewOnItemClickListener myRecyclerViewOnItemClickListener;
34 |
35 | //*/
36 |
37 | //*
38 | public HomeDataRecyclerViewAdapter(Context context, List homeworkDataBeanList) {
39 | this.context = context;
40 | this.homeworkDataBeanList = homeworkDataBeanList;
41 | }
42 |
43 | public void setMyRecyclerViewOnItemClickListener(MyRecyclerViewOnItemClickListener myRecyclerViewOnItemClickListener) {
44 | this.myRecyclerViewOnItemClickListener = myRecyclerViewOnItemClickListener;
45 | }
46 |
47 | @NonNull
48 | @Override
49 | public MyViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
50 | //填充布局列表项
51 | View itemView = LayoutInflater.from(context).inflate(R.layout.home_homework_list_item, viewGroup, false);
52 | MyViewHolder myViewHolder = new MyViewHolder(itemView);
53 | return myViewHolder;
54 | }
55 |
56 | @Override
57 | public void onBindViewHolder(@NonNull final MyViewHolder myViewHolder, final int position) {
58 | //填充onCreateViewHolder返回的控件
59 |
60 | //更新数据到RecyclerView
61 | myViewHolder.updateData();
62 |
63 |
64 | //设置监听器的点击事件
65 | if (myRecyclerViewOnItemClickListener != null){
66 | myViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
67 | @Override
68 | public void onClick(View v) {
69 | myRecyclerViewOnItemClickListener.onItemClickListener(myViewHolder.itemView, position);
70 | }
71 | });
72 | }
73 | }
74 |
75 | @Override
76 | public int getItemCount() {
77 | return homeworkDataBeanList.size();
78 | }
79 |
80 |
81 | /**
82 | * 自定义内部类
83 | * 我的理解是,在MyViewHolder中将填充布局文件recycler_view_item.xml的内容加载进来,
84 | * 类似于在Activity中初始化组件
85 | */
86 | class MyViewHolder extends RecyclerView.ViewHolder{
87 | //定义对应的列表项
88 |
89 | private LinearLayout homeworkListLinearLayout;
90 | private CardView cardView;
91 | private ImageView cardTouxiang;
92 | private TextView cardNickname;
93 | private TextView cardDate;
94 | private TextView cardTitle;
95 | private TextView cardContent;
96 | private TextView cardTag;
97 | private TextView cardCourse;
98 | private TextView cardDeadtime;
99 |
100 | public MyViewHolder(@NonNull View itemView) {
101 | super(itemView);
102 | //获取对应的列表项
103 | homeworkListLinearLayout = (LinearLayout) itemView.findViewById(R.id.homework_list_linearLayout);
104 | cardView = (CardView) itemView.findViewById(R.id.cardView);
105 | cardTouxiang = (ImageView) itemView.findViewById(R.id.card_touxiang);
106 | cardNickname = (TextView) itemView.findViewById(R.id.card_nickname);
107 | cardDate = (TextView) itemView.findViewById(R.id.card_date);
108 | cardTitle = (TextView) itemView.findViewById(R.id.card_title);
109 | cardContent = (TextView) itemView.findViewById(R.id.card_content);
110 | cardTag = (TextView) itemView.findViewById(R.id.card_tag);
111 | cardCourse = (TextView) itemView.findViewById(R.id.card_course);
112 | cardDeadtime = (TextView) itemView.findViewById(R.id.card_deadtime);
113 | }
114 |
115 | public void updateData(){
116 | int position = this.getLayoutPosition();
117 | HomeworkData.DataBean dataBean = homeworkDataBeanList.get(position);
118 | cardNickname.setText(dataBean.getUsername());
119 | cardTitle.setText(dataBean.getTitle());
120 | cardDate.setText(dataBean.getDate());
121 | cardContent.setText(dataBean.getContent());
122 | cardTag.setText(dataBean.getTag());
123 | cardCourse.setText(dataBean.getCourse());
124 | cardDeadtime.setText(dataBean.getDeadtime());
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/adapter/MyFragmentPagerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.adapter;
2 |
3 | import android.support.v4.app.Fragment;
4 | import android.support.v4.app.FragmentManager;
5 | import android.support.v4.app.FragmentPagerAdapter;
6 |
7 | import java.util.List;
8 |
9 | public class MyFragmentPagerAdapter extends FragmentPagerAdapter {
10 | private List fragmentList;
11 | private FragmentManager fragmentManager;
12 |
13 | /**
14 | * 初始化FragmentPagerAdapter
15 | * @param fm FragmentManager
16 | * @param fragmentList List
17 | */
18 | public MyFragmentPagerAdapter(FragmentManager fm, List fragmentList) {
19 | super(fm);
20 | this.fragmentList = fragmentList;
21 | }
22 |
23 | /**
24 | * 获取Fragment的位置
25 | * @param i 位置
26 | * @return Fragment的位置
27 | */
28 | @Override
29 | public Fragment getItem(int i) {
30 | return fragmentList.get(i);
31 | }
32 |
33 | /**
34 | * 获取Fragment的数量
35 | * @return Fragment的数量
36 | */
37 | @Override
38 | public int getCount() {
39 | return fragmentList.size();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/adapter/MyViewPagerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.adapter;
2 |
3 | import android.support.annotation.NonNull;
4 | import android.support.v4.view.PagerAdapter;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 |
8 | import java.util.List;
9 |
10 | public class MyViewPagerAdapter extends PagerAdapter {
11 | private List viewList;
12 |
13 | public MyViewPagerAdapter(List viewList) {
14 | this.viewList = viewList;
15 | }
16 |
17 | MyViewPagerAdapter(){
18 |
19 | }
20 |
21 | @Override
22 | public int getCount() {
23 | return viewList.size();
24 | }
25 |
26 | @Override
27 | public boolean isViewFromObject(@NonNull View view, @NonNull Object o) {
28 | return view == o;
29 | }
30 |
31 | @NonNull
32 | @Override
33 | public Object instantiateItem(@NonNull ViewGroup container, int position) {
34 | container.addView(viewList.get(position));
35 | return viewList.get(position);
36 | }
37 |
38 | @Override
39 | public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
40 | //super.destroyItem(container, position, object);
41 | container.removeView(viewList.get(position));
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/adapter/TabViewPagerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.adapter;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.NonNull;
5 | import android.support.annotation.Nullable;
6 | import android.support.v4.app.Fragment;
7 | import android.support.v4.app.FragmentManager;
8 | import android.support.v4.view.PagerAdapter;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 |
12 | import com.homeworkreminder.R;
13 | import com.homeworkreminder.fragment.HomeworkFragment;
14 |
15 | import java.util.List;
16 |
17 | /**
18 | * 选项卡适配器
19 | */
20 | public class TabViewPagerAdapter extends PagerAdapter {
21 | private List viewList;
22 | public static final int[] TAB_TITLES = new int[]{R.string.tab_text_1, R.string.tab_text_2};
23 | private Context mContext;
24 |
25 |
26 | public TabViewPagerAdapter(List viewList, Context mContext) {
27 | this.viewList = viewList;
28 | this.mContext = mContext;
29 | }
30 |
31 | TabViewPagerAdapter(){
32 |
33 | }
34 |
35 |
36 |
37 | @Override
38 | public int getCount() {
39 | return viewList.size();
40 | }
41 |
42 | @Override
43 | public boolean isViewFromObject(@NonNull View view, @NonNull Object o) {
44 | return view == o;
45 | }
46 |
47 | @NonNull
48 | @Override
49 | public Object instantiateItem(@NonNull ViewGroup container, int position) {
50 | container.addView(viewList.get(position));
51 | return viewList.get(position);
52 | }
53 |
54 | @Override
55 | public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
56 | //super.destroyItem(container, position, object);
57 | container.removeView(viewList.get(position));
58 | }
59 |
60 |
61 |
62 | @Nullable
63 | @Override
64 | public CharSequence getPageTitle(int position) {
65 | return mContext.getResources().getString(TAB_TITLES[position]);
66 | }
67 |
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/entity/Count.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.entity;
2 |
3 | public class Count {
4 | /**
5 | * code : 200
6 | * message : ok
7 | * data : {"done":3,"undo":1}
8 | */
9 |
10 | private String code;
11 | private String message;
12 | private DataBean data;
13 |
14 | public String getCode() {
15 | return code;
16 | }
17 |
18 | public void setCode(String code) {
19 | this.code = code;
20 | }
21 |
22 | public String getMessage() {
23 | return message;
24 | }
25 |
26 | public void setMessage(String message) {
27 | this.message = message;
28 | }
29 |
30 | public DataBean getData() {
31 | return data;
32 | }
33 |
34 | public void setData(DataBean data) {
35 | this.data = data;
36 | }
37 |
38 | public static class DataBean {
39 | /**
40 | * done : 3
41 | * undo : 1
42 | */
43 |
44 | private int done;
45 | private int undo;
46 |
47 | public int getDone() {
48 | return done;
49 | }
50 |
51 | public void setDone(int done) {
52 | this.done = done;
53 | }
54 |
55 | public int getUndo() {
56 | return undo;
57 | }
58 |
59 | public void setUndo(int undo) {
60 | this.undo = undo;
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/entity/HomeData.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.entity;
2 |
3 |
4 | public class HomeData {
5 |
6 | //属性
7 | private String nickname;
8 | private int img;
9 | private String date;
10 | private String title;
11 | private String content;
12 | private String tag;
13 |
14 | public HomeData(String nickname, int img, String date, String title, String content, String tag) {
15 | this.nickname = nickname;
16 | this.img = img;
17 | this.date = date;
18 | this.title = title;
19 | this.content = content;
20 | this.tag = tag;
21 | }
22 |
23 | public String getNickname() {
24 | return nickname;
25 | }
26 |
27 | public void setNickname(String nickname) {
28 | this.nickname = nickname;
29 | }
30 |
31 | public int getImg() {
32 | return img;
33 | }
34 |
35 | public void setImg(int img) {
36 | this.img = img;
37 | }
38 |
39 | public String getDate() {
40 | return date;
41 | }
42 |
43 | public void setDate(String date) {
44 | this.date = date;
45 | }
46 |
47 | public String getTitle() {
48 | return title;
49 | }
50 |
51 | public void setTitle(String title) {
52 | this.title = title;
53 | }
54 |
55 | public String getContent() {
56 | return content;
57 | }
58 |
59 | public void setContent(String content) {
60 | this.content = content;
61 | }
62 |
63 | public String getTag() {
64 | return tag;
65 | }
66 |
67 | public void setTag(String tag) {
68 | this.tag = tag;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/entity/HomeworkID.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.entity;
2 |
3 | import java.util.List;
4 |
5 | public class HomeworkID {
6 |
7 | /**
8 | * code : 200
9 | * message : ok
10 | * data : [{"t_hid":15}]
11 | */
12 |
13 | private String code;
14 | private String message;
15 | private List data;
16 |
17 | public String getCode() {
18 | return code;
19 | }
20 |
21 | public void setCode(String code) {
22 | this.code = code;
23 | }
24 |
25 | public String getMessage() {
26 | return message;
27 | }
28 |
29 | public void setMessage(String message) {
30 | this.message = message;
31 | }
32 |
33 | public List getData() {
34 | return data;
35 | }
36 |
37 | public void setData(List data) {
38 | this.data = data;
39 | }
40 |
41 | public static class DataBean {
42 | /**
43 | * t_hid : 15
44 | */
45 |
46 | private int t_hid;
47 |
48 | public int getT_hid() {
49 | return t_hid;
50 | }
51 |
52 | public void setT_hid(int t_hid) {
53 | this.t_hid = t_hid;
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/entity/UserInfo.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.entity;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | import java.util.List;
6 |
7 | public class UserInfo {
8 | /**
9 | * code : 200
10 | * message : ok
11 | * data : [{"id":5,"username":"li","password":"123456","nickname":"AlanLee","school":"zdxh","major":"软件工程","class":"A班","create_time":"2019-09-15 12:03:16"}]
12 | */
13 |
14 | private String code;
15 | private String message;
16 | private List data;
17 |
18 | public String getCode() {
19 | return code;
20 | }
21 |
22 | public void setCode(String code) {
23 | this.code = code;
24 | }
25 |
26 | public String getMessage() {
27 | return message;
28 | }
29 |
30 | public void setMessage(String message) {
31 | this.message = message;
32 | }
33 |
34 | public List getData() {
35 | return data;
36 | }
37 |
38 | public void setData(List data) {
39 | this.data = data;
40 | }
41 |
42 | public static class DataBean {
43 | /**
44 | * id : 5
45 | * username : li
46 | * password : 123456
47 | * nickname : AlanLee
48 | * school : zdxh
49 | * major : 软件工程
50 | * class : A班
51 | * create_time : 2019-09-15 12:03:16
52 | */
53 |
54 | private int id;
55 | private String username;
56 | private String password;
57 | private String nickname;
58 | private String school;
59 | private String major;
60 | @SerializedName("class")
61 | private String classX;
62 | private String create_time;
63 |
64 | public int getId() {
65 | return id;
66 | }
67 |
68 | public void setId(int id) {
69 | this.id = id;
70 | }
71 |
72 | public String getUsername() {
73 | return username;
74 | }
75 |
76 | public void setUsername(String username) {
77 | this.username = username;
78 | }
79 |
80 | public String getPassword() {
81 | return password;
82 | }
83 |
84 | public void setPassword(String password) {
85 | this.password = password;
86 | }
87 |
88 | public String getNickname() {
89 | return nickname;
90 | }
91 |
92 | public void setNickname(String nickname) {
93 | this.nickname = nickname;
94 | }
95 |
96 | public String getSchool() {
97 | return school;
98 | }
99 |
100 | public void setSchool(String school) {
101 | this.school = school;
102 | }
103 |
104 | public String getMajor() {
105 | return major;
106 | }
107 |
108 | public void setMajor(String major) {
109 | this.major = major;
110 | }
111 |
112 | public String getClassX() {
113 | return classX;
114 | }
115 |
116 | public void setClassX(String classX) {
117 | this.classX = classX;
118 | }
119 |
120 | public String getCreate_time() {
121 | return create_time;
122 | }
123 |
124 | public void setCreate_time(String create_time) {
125 | this.create_time = create_time;
126 | }
127 |
128 | @Override
129 | public String toString() {
130 | return "DataBean{" +
131 | "id=" + id +
132 | ", username='" + username + '\'' +
133 | ", password='" + password + '\'' +
134 | ", nickname='" + nickname + '\'' +
135 | ", school='" + school + '\'' +
136 | ", major='" + major + '\'' +
137 | ", classX='" + classX + '\'' +
138 | ", create_time='" + create_time + '\'' +
139 | '}';
140 | }
141 | }
142 |
143 | @Override
144 | public String toString() {
145 | return "UserInfo{" +
146 | "code='" + code + '\'' +
147 | ", message='" + message + '\'' +
148 | ", data=" + data +
149 | '}';
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/entity/bean/Person.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.entity.bean;
2 |
3 | import cn.bmob.v3.BmobObject;
4 |
5 | public class Person extends BmobObject {
6 | private String name;
7 | private int age;
8 |
9 | public String getName() {
10 | return name;
11 | }
12 |
13 | public void setName(String name) {
14 | this.name = name;
15 | }
16 |
17 | public int getAge() {
18 | return age;
19 | }
20 |
21 | public void setAge(int age) {
22 | this.age = age;
23 | }
24 |
25 | @Override
26 | public String toString() {
27 | return "Person{" +
28 | "name='" + name + '\'' +
29 | ", age=" + age +
30 | '}';
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/fragment/PageViewModel.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.fragment;
2 |
3 | import android.arch.core.util.Function;
4 | import android.arch.lifecycle.LiveData;
5 | import android.arch.lifecycle.MutableLiveData;
6 | import android.arch.lifecycle.Transformations;
7 | import android.arch.lifecycle.ViewModel;
8 |
9 | public class PageViewModel extends ViewModel {
10 |
11 | private MutableLiveData mIndex = new MutableLiveData<>();
12 | private LiveData mText = Transformations.map(mIndex, new Function() {
13 | @Override
14 | public String apply(Integer input) {
15 | return "Hello world from section: " + input;
16 | }
17 | });
18 |
19 | public void setIndex(int index) {
20 | mIndex.setValue(index);
21 | }
22 |
23 | public LiveData getText() {
24 | return mText;
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/fragment/SettingFragment.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.homeworkreminder.R;
10 |
11 | /**
12 | * 设置界面的Fragment
13 | */
14 | public class SettingFragment extends Fragment {
15 |
16 |
17 | @Override
18 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
19 | Bundle savedInstanceState) {
20 | return inflater.inflate(R.layout.setting_fragment_layout, null);
21 | }
22 |
23 | @Override
24 | public void onViewCreated(View view, Bundle savedInstanceState) {
25 | super.onViewCreated(view, savedInstanceState);
26 |
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/interfaces/CallbackValueToActivity.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.interfaces;
2 |
3 | public interface CallbackValueToActivity {
4 | public void sendValue(String string);
5 | }
6 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/interfaces/MyRecyclerViewOnItemClickListener.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.interfaces;
2 |
3 | import android.view.View;
4 |
5 | /**
6 | * RecyclerView的监听事件
7 | */
8 | public interface MyRecyclerViewOnItemClickListener {
9 | public void onItemClickListener(View view, int position);
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/interfaces/MyRecyclerViewOnItemLongPressListener.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.interfaces;
2 |
3 | import android.view.View;
4 |
5 | /**
6 | * RecyclerView的监听事件
7 | */
8 | public interface MyRecyclerViewOnItemLongPressListener {
9 | public void onItemLongPressListener(View view, int position);
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/receiver/ClockReceiver.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.receiver;
2 |
3 | import android.app.AlertDialog;
4 | import android.content.BroadcastReceiver;
5 | import android.content.Context;
6 | import android.content.DialogInterface;
7 | import android.content.Intent;
8 | import android.os.Build;
9 | import android.os.Vibrator;
10 | import android.view.WindowManager;
11 |
12 | import com.homeworkreminder.activity.NewHomeworkActivity;
13 | import com.homeworkreminder.service.MusicService;
14 |
15 | /**
16 | * 闹钟接收器
17 | * 收到广播后处理:显示弹窗,播放闹铃
18 | */
19 | public class ClockReceiver extends BroadcastReceiver {
20 | private Vibrator vibrator; //振动器
21 |
22 | /**
23 | * 接收广播
24 | * @param context 上下文
25 | * @param intent 意图
26 | */
27 | @Override
28 | public void onReceive(final Context context, Intent intent) {
29 | vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
30 | vibrator.vibrate(new long[]{500, 1000, 500, 2000}, 0);
31 |
32 | //接收广播
33 | Intent homeworkIntent = new Intent(context, NewHomeworkActivity.class);
34 | //String content = homeworkIntent.getStringExtra("newReminder");
35 |
36 | //开启闹铃
37 | final Intent musicIntent = new Intent(context, MusicService.class);
38 | if (!MusicService.isPlay){
39 | //开启音乐服务
40 | context.startService(musicIntent);
41 | }else {
42 | //停止音乐服务
43 | context.stopService(musicIntent);
44 | }
45 |
46 | //闹铃弹窗提醒
47 | AlertDialog alertDialog = new AlertDialog.Builder(context).create();
48 | alertDialog.setTitle("闹钟");
49 | alertDialog.setMessage("时间到啦");
50 | alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "确定", new DialogInterface.OnClickListener() {
51 | @Override
52 | public void onClick(DialogInterface dialog, int which) {
53 | //关闭闹钟
54 | vibrator.cancel();
55 | //停止音乐服务
56 | context.stopService(musicIntent);
57 | }
58 | });
59 |
60 | //设置弹窗
61 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { //Android 8.0 以上的弹窗类型
62 | alertDialog.getWindow().setType((WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY));
63 | }else {
64 | alertDialog.getWindow().setType((WindowManager.LayoutParams.TYPE_SYSTEM_ALERT));
65 | }
66 |
67 | //显示弹窗
68 | alertDialog.show();
69 |
70 | //开启服务
71 | context.startService(homeworkIntent);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/service/MusicService.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.service;
2 |
3 | import android.app.Service;
4 | import android.content.Intent;
5 | import android.media.MediaPlayer;
6 | import android.os.IBinder;
7 | import android.util.Log;
8 |
9 | import com.homeworkreminder.R;
10 |
11 | /**
12 | * 音乐服务类
13 | * 功能:添加闹钟音乐
14 | */
15 | public class MusicService extends Service {
16 | String TAG = "MusicService";
17 |
18 | public MusicService() {
19 | }
20 |
21 | public static boolean isPlay = false;
22 | MediaPlayer player;
23 |
24 | @Override
25 | public IBinder onBind(Intent intent) {
26 | Log.d(TAG, "onBind: ");
27 | // TODO: Return the communication channel to the service.
28 | throw new UnsupportedOperationException("Not yet implemented");
29 | }
30 |
31 | @Override
32 | public void onCreate() {
33 | player = MediaPlayer.create(this, R.raw.bgm);
34 | Log.d(TAG, "onCreate: 创建MediaPlayer");
35 | }
36 |
37 | @Override
38 | public int onStartCommand(Intent intent, int flags, int startId) {
39 | Log.d(TAG, "onStartCommand: 判断是否正在播放音乐");
40 | //判断是否正在播放音乐
41 | if (!player.isPlaying()){
42 | player.start();
43 | isPlay = player.isPlaying();
44 | }
45 | return super.onStartCommand(intent, flags, startId);
46 | }
47 |
48 | @Override
49 | public void onDestroy() {
50 | player.stop();
51 | isPlay = player.isPlaying();
52 | player.release();
53 | super.onDestroy();
54 |
55 | Log.d(TAG, "onDestroy: ");
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/utils/ClockUtil.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.utils;
2 |
3 | import android.app.AlarmManager;
4 | import android.app.DatePickerDialog;
5 | import android.app.PendingIntent;
6 | import android.app.TimePickerDialog;
7 | import android.content.Context;
8 | import android.content.Intent;
9 | import android.util.Log;
10 | import android.view.View;
11 | import android.widget.DatePicker;
12 | import android.widget.TextView;
13 | import android.widget.TimePicker;
14 | import android.widget.Toast;
15 |
16 | import com.homeworkreminder.activity.NewHomeworkActivity;
17 | import com.homeworkreminder.receiver.ClockReceiver;
18 |
19 | import java.util.Calendar;
20 |
21 | public class ClockUtil {
22 | // private static Calendar calendar;
23 | private Context context;
24 | private static int mYear;
25 | private static int mMonth;
26 | private static int mDay;
27 | private static int mHour;
28 | private static int mMin;
29 | private static long triggerTimeMillis;
30 |
31 |
32 | /**
33 | * 选择日期
34 | */
35 | public static void chooseDate(final TextView textView, final Calendar calendar, final Context context){
36 |
37 | textView.setOnClickListener(new View.OnClickListener() {
38 | @Override
39 | public void onClick(View v) {
40 | //calendar = Calendar.getInstance();
41 |
42 | //使用DatePickerDialog的构造方法创建DatePickerDialog日期选择器
43 | DatePickerDialog datePickerDialog = new DatePickerDialog(
44 | context,
45 | new DatePickerDialog.OnDateSetListener(){
46 |
47 | @Override
48 | public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
49 |
50 |
51 | mYear = year;
52 | mMonth = month;
53 | mDay = dayOfMonth;
54 |
55 | String pickedDate = year + "-" + (month + 1) + "-" + dayOfMonth;
56 | textView.setText(pickedDate);
57 | }
58 | },
59 | calendar.get(Calendar.YEAR),
60 | calendar.get(Calendar.MONTH),
61 | calendar.get(Calendar.DAY_OF_MONTH)
62 | );
63 |
64 | //设置最小的日期为 当前日期
65 | datePickerDialog.getDatePicker().setMinDate(calendar.getTimeInMillis());
66 |
67 | //显示选择日期的读对话框
68 | datePickerDialog.show();
69 |
70 | }
71 | });
72 |
73 | }
74 |
75 |
76 | /**
77 | * 选择时间
78 | */
79 | public static void chooseTime(final TextView textView, final Calendar calendar, final Context context){
80 | textView.setOnClickListener(new View.OnClickListener() {
81 | @Override
82 | public void onClick(View v) {
83 | //calendar = Calendar.getInstance();
84 |
85 | TimePickerDialog timePickerDialog = new TimePickerDialog(
86 | context,
87 | new TimePickerDialog.OnTimeSetListener() {
88 | @Override
89 | public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
90 | String pickedTime = hourOfDay + ":" + minute;
91 | textView.setText(pickedTime);
92 |
93 | mHour = hourOfDay;
94 | mMin = minute;
95 | }
96 | },
97 | calendar.get(Calendar.HOUR_OF_DAY),
98 | calendar.get(Calendar.MINUTE),
99 | false
100 | );
101 |
102 | timePickerDialog.show();
103 | }
104 | });
105 | }
106 |
107 |
108 | /**
109 | * 开启闹钟
110 | */
111 | public static void startAlarm(Context context, Class receiverClass, Calendar calendar) {
112 | long tmpTime = TimeUtil.transformateFromDateToMilis(mYear, mMonth, mDay, mHour, mMin);
113 | triggerTimeMillis = tmpTime - calendar.getTimeInMillis();
114 |
115 | Intent intent = new Intent(context, receiverClass);
116 | //intent.putExtra("newReminder", "newReminder的值");
117 |
118 | //获取广播
119 | PendingIntent pendingIntent = PendingIntent.getBroadcast(
120 | context,
121 | 1,
122 | intent,
123 | PendingIntent.FLAG_UPDATE_CURRENT
124 | );
125 |
126 | //设定闹钟
127 | AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
128 | alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis() + triggerTimeMillis, pendingIntent);
129 |
130 | Log.d("setTime", "triggerAtMillis: " + (calendar.getTimeInMillis() + triggerTimeMillis));
131 | }
132 | }
133 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/utils/GlideImageLoader.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.utils;
2 |
3 | import android.content.Context;
4 | import android.net.Uri;
5 | import android.widget.ImageView;
6 |
7 | import com.bumptech.glide.Glide;
8 | import com.youth.banner.loader.ImageLoader;
9 |
10 | public class GlideImageLoader extends ImageLoader {
11 | @Override
12 | public void displayImage(Context context, Object path, ImageView imageView) {
13 | /**
14 | 注意:
15 | 1.图片加载器由自己选择,这里不限制,只是提供几种使用方法
16 | 2.返回的图片路径为Object类型,由于不能确定你到底使用的那种图片加载器,
17 | 传输的到的是什么格式,那么这种就使用Object接收和返回,你只需要强转成你传输的类型就行,
18 | 切记不要胡乱强转!
19 | */
20 |
21 |
22 | //Glide 加载图片简单用法
23 | Glide.with(context).load(path).into(imageView);
24 |
25 | //Picasso 加载图片简单用法
26 | //Picasso.with(context).load(path).into(imageView);
27 |
28 | //用fresco加载图片简单用法,记得要写下面的createImageView方法
29 | Uri uri = Uri.parse((String) path);
30 | imageView.setImageURI(uri);
31 | }
32 |
33 | //提供createImageView 方法,如果不用可以不重写这个方法,主要是方便自定义ImageView的创建
34 | @Override
35 | public ImageView createImageView(Context context) {
36 | //使用fresco,需要创建它提供的ImageView,当然你也可以用自己自定义的具有图片加载功能的ImageView
37 | // SimpleDraweeView simpleDraweeView=new SimpleDraweeView(context);
38 | // return simpleDraweeView;
39 | return null;
40 | }
41 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/utils/MyApplication.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.utils;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import android.util.Log;
6 | import android.widget.Toast;
7 |
8 | import com.android.volley.DefaultRetryPolicy;
9 | import com.android.volley.Request;
10 | import com.android.volley.RequestQueue;
11 | import com.android.volley.toolbox.Volley;
12 | import com.homeworkreminder.entity.UserInfo;
13 | import com.homeworkreminder.utils.networkUtil.MyGson;
14 | import com.homeworkreminder.utils.networkUtil.VolleyUtil;
15 | import com.homeworkreminder.utils.userUtil.CheckUserInfoUtil;
16 | import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;
17 | import com.nostra13.universalimageloader.core.DisplayImageOptions;
18 | import com.nostra13.universalimageloader.core.ImageLoader;
19 | import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
20 | import com.nostra13.universalimageloader.core.assist.ImageScaleType;
21 | import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
22 | import com.homeworkreminder.R;
23 |
24 |
25 | public class MyApplication extends Application {
26 | //ImageLoader显示图片过程中的参数
27 | private static DisplayImageOptions mLoaderOptions;
28 | //Volley网络请求的队列对象
29 | private static RequestQueue mQueue;
30 |
31 | private CheckUserInfoUtil userInfoUtil;
32 |
33 | private UserInfo userInfo;
34 |
35 | private boolean STATE_LOGIN = false;
36 | private boolean STATE_REGISTER = false;
37 |
38 | public boolean isSTATE_LOGIN() {
39 | return STATE_LOGIN;
40 | }
41 |
42 | public void setSTATE_LOGIN(boolean STATE_LOGIN) {
43 | this.STATE_LOGIN = STATE_LOGIN;
44 | }
45 |
46 | public boolean isSTATE_REGISTER() {
47 | return STATE_REGISTER;
48 | }
49 |
50 | public void setSTATE_REGISTER(boolean STATE_REGISTER) {
51 | this.STATE_REGISTER = STATE_REGISTER;
52 | }
53 |
54 | public UserInfo getUserInfo() {
55 | return userInfo;
56 | }
57 |
58 |
59 |
60 | public void setUserInfo(UserInfo userInfo) {
61 | this.userInfo = userInfo;
62 | }
63 |
64 | @Override
65 | public void onCreate() {
66 | super.onCreate();
67 | //初始化ImageLoader
68 | initImageLoader(getApplicationContext());
69 | //初始化Volley的队列对象
70 | mQueue = Volley.newRequestQueue(getApplicationContext());
71 |
72 | getUserInfoFromSharedPreference();
73 |
74 | //app_checkUserState();
75 |
76 |
77 | }
78 |
79 | public static void initImageLoader(Context context) {
80 | //初始化一个ImageLoaderConfiguration配置对象
81 | ImageLoaderConfiguration config = new ImageLoaderConfiguration.
82 | Builder(context).
83 | denyCacheImageMultipleSizesInMemory().
84 | threadPriority(Thread.NORM_PRIORITY - 2).
85 | diskCacheFileNameGenerator(new Md5FileNameGenerator()).
86 | tasksProcessingOrder(QueueProcessingType.FIFO).
87 | build();
88 | //用ImageLoaderConfiguration配置对象完成ImageLoader的初始化,单例
89 | ImageLoader.getInstance().init(config);
90 | //示图片过程中的参数
91 | mLoaderOptions = new DisplayImageOptions.Builder().
92 | showImageOnLoading(R.drawable.no_image).//正加载,显示no_image
93 | showImageOnFail(R.drawable.no_image).//加载失败时
94 | showImageForEmptyUri(R.drawable.no_image).//加载的Uri为空
95 | imageScaleType(ImageScaleType.EXACTLY_STRETCHED).
96 | cacheInMemory(true).//是否进行缓冲
97 | cacheOnDisk(true).
98 | considerExifParams(true).
99 | build();
100 | }
101 |
102 |
103 |
104 | public static RequestQueue getHttpQueue() {
105 | return mQueue;
106 | }
107 |
108 | public static DisplayImageOptions getLoaderOptions() {
109 | return mLoaderOptions;
110 | }
111 | //Volley请求,传入消息编号Tag。将request请求放入队列中缓存
112 | public static void addRequest(Request request, Object tag) {
113 | request.setTag(tag);
114 | request.setRetryPolicy(new DefaultRetryPolicy(10000,
115 | DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
116 | DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
117 | mQueue.add(request);
118 | }
119 | // 通过消息编号在队列中删除请求
120 | public static void removeRequest(Object tag) {
121 | mQueue.cancelAll(tag);
122 | }
123 |
124 |
125 | private String TAG = "MyApplication";
126 | public void getUserInfoFromSharedPreference(){
127 | userInfoUtil = new CheckUserInfoUtil(getApplicationContext());
128 | String userinfo = userInfoUtil.readUserInfo("userinfo");
129 | Log.d(TAG, "getUserInfoFromSharedPreference: " + userinfo);
130 |
131 | // VolleyUtil volleyUtil = new VolleyUtil(getApplicationContext());
132 | if (!userinfo.equals("false")){
133 | UserInfo userInfo1 = MyGson.parseJsonByGson(userinfo,UserInfo.class);
134 | Log.d(TAG, "getUserInfoFromSharedPreference: userInfo1:" + userInfo1);
135 | setUserInfo(userInfo1);
136 | }
137 | }
138 |
139 |
140 |
141 |
142 | public boolean checkState(boolean isLogin){
143 | CheckUserInfoUtil checkUserInfoUtil = new CheckUserInfoUtil(getApplicationContext());
144 | String loginState = checkUserInfoUtil.readUserInfo("login");
145 | if (loginState.equals("true")){
146 | isLogin = true;
147 | }else {
148 | isLogin = false;
149 | }
150 |
151 | return isLogin;
152 | }
153 |
154 | }
155 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/utils/TimeUtil.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.utils;
2 |
3 | import android.util.Log;
4 |
5 | import java.text.SimpleDateFormat;
6 | import java.util.Calendar;
7 | import java.util.Date;
8 |
9 |
10 | /*
11 | * 时间工具类
12 | * 获取当前时间:https://blog.csdn.net/feifei454498130/article/details/6540133
13 | * 时间戳参数:http://www.runoob.com/java/date-timestamp2date.html
14 | * 时间戳和时间相互转换:(1) https://blog.csdn.net/Silent_Paladin/article/details/54647438
15 | * (2) https://blog.csdn.net/yxb_yingu/article/details/51166553
16 | * (3) https://blog.csdn.net/sinat_32238399/article/details/80512452
17 | */
18 |
19 |
20 | public class TimeUtil {
21 |
22 |
23 | //将日期时间转换成毫秒
24 | public static Long transformateFromDateToMilis(int year, int month, int dayOfMonth, int hourOfDay, int minute) {
25 | Calendar calendar = Calendar.getInstance();
26 | calendar.set(year, month, dayOfMonth, hourOfDay, minute, 00);
27 | Long time = calendar.getTimeInMillis();
28 | return time;
29 | }
30 |
31 |
32 | //转化毫秒到时间
33 | public static String transformateFromMilisToDate(Long clockTime) {
34 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm E");
35 | Date date2 = new Date(clockTime);
36 | String str = simpleDateFormat.format(date2);
37 | return str;
38 | }
39 |
40 |
41 | //转化毫秒到特定格式的时间
42 | public static String transformateFromMilisToStringDate(Long currerntTime, Long clockTime){
43 |
44 | Long mss = clockTime - currerntTime;
45 |
46 | long days = mss / (1000 * 60 * 60 * 24);
47 | long hours = (mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60);
48 | long minutes = (mss % (1000 * 60 * 60)) / (1000 * 60);
49 | long seconds = (mss % (1000 * 60)) / 1000;
50 |
51 | String day = null;
52 | String hour = null;
53 | String min = null;
54 | String s = null;
55 |
56 | if (days != 0){
57 | day = days + "天";
58 | }else {
59 | day = "";
60 | }
61 |
62 | if (hours != 0){
63 | hour = hours + "小时";
64 | }else {
65 | hour = "";
66 | }
67 |
68 | if (minutes != 0){
69 | min = minutes + "分";
70 | }else {
71 | min = "";
72 | }
73 |
74 | if (days == 0 && hours == 0 && minutes == 0){
75 | s = seconds + "s";
76 | }else {
77 | s = "";
78 | }
79 |
80 | String remainTime = "任务还剩:" + day + hour + min + s;
81 |
82 | Log.d("TAG",remainTime);
83 |
84 | if (mss > 0){
85 | return remainTime;
86 | }else {
87 | return "任务已结束";
88 | }
89 |
90 | }
91 |
92 |
93 | //得到当前时间
94 | public static String getCurrentTime() {
95 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm E");
96 | Date curDate = new Date();
97 | String str = format.format(curDate);
98 | return str;
99 | }
100 |
101 | //得到当前时间(毫秒)
102 | public static Long getCurrentMilisTime(){
103 | Calendar calendar = Calendar.getInstance();
104 | return calendar.getTimeInMillis();
105 | }
106 |
107 | //得到当前时间是周几
108 | public static String getCurrentWendday(){
109 | SimpleDateFormat format = new SimpleDateFormat("E");
110 | Date curDate = new Date();
111 | String str = format.format(curDate);
112 | return str;
113 | }
114 |
115 |
116 | }
117 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/utils/networkUtil/MyGson.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.utils.networkUtil;
2 |
3 | import android.util.Log;
4 |
5 | import com.google.gson.Gson;
6 |
7 | public class MyGson {
8 |
9 | /**
10 | * 使用Gson解析json数据,这个比较简单,以下是使用步骤(3步,其实前2步就算拿到数据了)
11 | * @param json 要解析的json
12 | */
13 | public static T parseJsonByGson(String json, Class t){
14 | //1、创建Gson对象
15 | Gson gson = new Gson();
16 | //2、调用Gson的fromJson()方法,将json转成javaBean,将要显示的数据封装到这个javaBean
17 | //fromJson(参数1,参数2)方法 参数1:需要解析的json 参数2:一个javaBean,接收需要封装的数据(总数据的javaBean)
18 |
19 | T data = (T) gson.fromJson(json, t);
20 |
21 | Log.d("data", "parseJsonByGson: data : " + data);
22 |
23 | return data;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/utils/networkUtil/VolleyInterface.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.utils.networkUtil;
2 |
3 | import com.android.volley.VolleyError;
4 | import com.android.volley.Response.ErrorListener;
5 | import com.android.volley.Response.Listener;
6 |
7 | import android.content.Context;
8 |
9 | public abstract class VolleyInterface {
10 | private Context mContext;
11 | public static Listener mListener;
12 | public static ErrorListener mErrorListener;
13 |
14 | public VolleyInterface(Context context, Listener listener, ErrorListener errorListener) {
15 | this.mContext = context;
16 | this.mListener = listener;
17 | this.mErrorListener = errorListener;
18 | }
19 |
20 | public abstract void onMySuccess(String result);
21 | public abstract void onMyError(VolleyError error);
22 |
23 | public Listener loadingListener() {
24 | mListener = new Listener() {
25 | @Override
26 | public void onResponse(String response) {
27 | onMySuccess(response);
28 | }
29 | };
30 | return mListener;
31 | }
32 |
33 | public ErrorListener errorListener() {
34 | mErrorListener = new ErrorListener() {
35 | @Override
36 | public void onErrorResponse(VolleyError error) {
37 | onMyError(error);
38 | }
39 | };
40 | return mErrorListener;
41 |
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/utils/networkUtil/VolleyListener.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.utils.networkUtil;
2 |
3 | import android.content.Context;
4 |
5 | import com.android.volley.Response;
6 |
7 | public interface VolleyListener {
8 | public void onSuccessResponse();
9 | public void onFailResponse();
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/utils/networkUtil/VolleyUtil.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.utils.networkUtil;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 | import android.widget.Toast;
6 |
7 | import com.android.volley.AuthFailureError;
8 | import com.android.volley.Request;
9 | import com.android.volley.RequestQueue;
10 | import com.android.volley.VolleyError;
11 | import com.android.volley.toolbox.StringRequest;
12 | import com.android.volley.toolbox.Volley;
13 | import com.google.gson.Gson;
14 | import com.homeworkreminder.entity.UserInfo;
15 | import com.homeworkreminder.utils.MyApplication;
16 |
17 | import java.util.Map;
18 |
19 |
20 | public class VolleyUtil {
21 | private static Context context;
22 | //private RequestQueue requestQueue;
23 |
24 | // public VolleyUtil(Context context){
25 | // this.context = context;
26 | // this.requestQueue = Volley.newRequestQueue(this.context);
27 | // }
28 |
29 |
30 | public static StringRequest stringRequest;
31 |
32 | public static void volleyGET(
33 | Context mcontext,String url,String tag,VolleyInterface vif){
34 | //防止重复请求,所以先取消tag标识的请求队列
35 | MyApplication.getHttpQueue().cancelAll(tag);
36 | stringRequest=new StringRequest(Request.Method.GET, url,
37 | vif.loadingListener(),
38 | vif.errorListener()
39 | );
40 | stringRequest.setTag(tag);
41 | MyApplication.getHttpQueue().add(stringRequest);
42 |
43 | //注意千万不要调用start来开启。这样写是不对的。
44 | //因为在源码里,当我们调用Volley.newRequestQueue()来实例化一个请求队列的时候
45 | //就已经使用queue.start(); 方法来开启了一个工作线程,所以我们如果多次调用
46 | //newRequestQueue来实例化请求队列就会多次调用start方法,这样做势必增加性能的消耗
47 | //所以我们一定要把volley的请求队列全局化(可以使用单例模式或在application初始化)。
48 | //并且我们不应当手动调用start。
49 | // MyApplication.getHttpQueue().start();
50 | }
51 |
52 |
53 |
54 | public static void volleyPOST(Context context,String url,String tag,final Map params,
55 | VolleyInterface vif){
56 | MyApplication.getHttpQueue().cancelAll(tag);
57 | stringRequest = new StringRequest(url, vif.loadingListener(), vif.errorListener()){
58 | @Override
59 | protected Map getParams() throws AuthFailureError {
60 | return params;
61 | }
62 | };
63 | stringRequest.setTag(tag);
64 | MyApplication.getHttpQueue().add(stringRequest);
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/com/homeworkreminder/utils/userUtil/CheckUserInfoUtil.java:
--------------------------------------------------------------------------------
1 | package com.homeworkreminder.utils.userUtil;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 | import android.widget.Toast;
6 |
7 | import java.io.FileInputStream;
8 | import java.io.FileOutputStream;
9 | import java.io.IOException;
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | import static android.content.Context.MODE_PRIVATE;
14 |
15 | public class CheckUserInfoUtil{
16 | private Context context;
17 |
18 | public CheckUserInfoUtil(Context context){
19 | this.context = context;
20 | }
21 |
22 | /**
23 | * 检查用户信息 start ==================================
24 | */
25 | byte[] buffer = null;
26 | /**
27 | * 读取用户信息
28 | * @return 读取保存的状态
29 | */
30 | public String readUserInfo(String whatStateFileName){
31 | String state = "false";
32 | FileInputStream fis = null;
33 | try {
34 | fis = context.openFileInput(whatStateFileName);
35 | buffer = new byte[fis.available()];
36 | fis.read(buffer);
37 |
38 | } catch (IOException e) {
39 | writeUserInfo("false", whatStateFileName);
40 |
41 | e.printStackTrace();
42 | }finally {
43 | if (fis != null){
44 | try {
45 | fis.close();
46 | //todo
47 | state = new String(buffer);
48 | Log.d("userinfo", "用户状态信息:readUserInfo: " + state + ", fileName: " + whatStateFileName);
49 |
50 | return state;
51 | } catch (IOException e) {
52 | e.printStackTrace();
53 | }
54 | }
55 | }
56 |
57 | return state;
58 | }
59 |
60 | /**
61 | * 写入状态信息
62 | * @param state 状态信息
63 | * @param fileName 要写入文件的文件名
64 | */
65 | public void writeUserInfo(String state, String fileName){
66 | FileOutputStream fos = null;
67 | try {
68 | fos = context.openFileOutput(fileName, MODE_PRIVATE);
69 | //写入状态信息
70 | fos.write(state.getBytes());
71 | fos.flush();
72 | } catch (IOException e) {
73 | e.printStackTrace();
74 | }finally {
75 | if (fos != null){
76 | try {
77 | fos.close();
78 | //todo
79 | Log.d("userinfo", "writeUserInfo:" + state +",用户信息写入成功:" + fileName);
80 | } catch (IOException e) {
81 | e.printStackTrace();
82 | }
83 | }
84 | }
85 | }
86 |
87 | /**
88 | * 检测用户信息 end ----------------------------------
89 | */
90 |
91 |
92 | /**
93 | * 检查用户状态
94 | * 通过SharedPreference将用户状态保存
95 | * 通过读取保存的用户状态信息,设置当前用户状态
96 | */
97 | //*
98 | public List checkUserState(){
99 | String registerState;
100 | String loginState;
101 | List userStates = new ArrayList<>();
102 | //检查注册状态
103 | registerState = readUserInfo("register");
104 | Log.d("userinfo", "注册状态:" + registerState);
105 |
106 | //检查登录状态
107 | loginState = readUserInfo("login");
108 | Log.d("login", "登录状态:" + loginState);
109 |
110 | userStates.add(registerState);
111 | userStates.add(loginState);
112 |
113 | return userStates;
114 | }
115 |
116 | //*/
117 |
118 | //*
119 | public String getLocalUserInfo(){
120 | return readUserInfo("userinfo");
121 | }
122 |
123 | //*/
124 |
125 | }
126 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_in_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_in_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_out_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_out_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/about_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/about_bg.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/app_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/app_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/app_logo2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/app_logo2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/app_logo_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/app_logo_background.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/app_logo_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/app_logo_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/head.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/head.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/icon_about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/icon_about.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/icon_add_to_my.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/icon_add_to_my.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/icon_edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/icon_edit.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/icon_selected_all_hw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/icon_selected_all_hw.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/icon_selected_home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/icon_selected_home.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/icon_selected_my.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/icon_selected_my.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/icon_selected_my_hw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/icon_selected_my_hw.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/icon_tomato.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/icon_tomato.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/icon_unselected_all_hw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/icon_unselected_all_hw.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/icon_unselected_home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/icon_unselected_home.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/icon_unselected_my.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/icon_unselected_my.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/icon_unselected_my_hw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/icon_unselected_my_hw.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/img_clock_bg2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/img_clock_bg2.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/img_count_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/img_count_bg.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/img_count_bg2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/img_count_bg2.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/img_count_bg3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/img_count_bg3.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/img_edit_user_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/img_edit_user_top.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/img_modify_pw_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/img_modify_pw_top.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/img_new_hw_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/img_new_hw_top.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/img_user_top.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/img_user_top.jpeg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/img_user_top2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/img_user_top2.jpeg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/index_bg1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/index_bg1.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/index_bg2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/index_bg2.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/index_btn_bg1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/index_btn_bg1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/index_btn_bg2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/index_btn_bg2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/index_btn_bg3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/index_btn_bg3.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/index_btn_bg4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/index_btn_bg4.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/index_btn_bg5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/index_btn_bg5.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/info_header_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/info_header_bg.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/login_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/login_bg.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/menu_register.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/menu_register.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/new_homework_ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/new_homework_ok.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/reg_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable-v24/reg_bg.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/add2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable/add2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/card_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/color_shape.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/color_shape_radius.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_camera.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_gallery.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_manage.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_send.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_share.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_slideshow.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/menu_home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable/menu_home.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/menu_homework.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable/menu_homework.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/menu_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable/menu_setting.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/nav_bar_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable/nav_bar_bg.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/new_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable/new_bg.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/no_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable/no_image.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable/ok.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/point_deep.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/point_smiple.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/side_nav_bar.xml:
--------------------------------------------------------------------------------
1 |
3 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/welcome_img1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable/welcome_img1.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/welcome_img2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable/welcome_img2.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/welcome_img3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/drawable/welcome_img3.jpg
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
28 |
29 |
35 |
36 |
37 |
38 |
39 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_edit_homework.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
27 |
28 |
34 |
35 |
36 |
37 |
38 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_homework.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
23 |
24 |
29 |
30 |
31 |
38 |
39 |
44 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_homework_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
27 |
28 |
34 |
35 |
36 |
37 |
38 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_index.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
22 |
23 |
26 |
27 |
34 |
35 |
40 |
41 |
42 |
49 |
50 |
55 |
56 |
57 |
58 |
65 |
66 |
71 |
72 |
73 |
74 |
75 |
82 |
83 |
88 |
89 |
90 |
91 |
92 |
93 |
97 |
106 |
107 |
108 |
118 |
119 |
129 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
20 |
21 |
29 |
37 |
46 |
47 |
48 |
49 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_modify_password.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
15 |
16 |
20 |
21 |
25 |
26 |
35 |
36 |
39 |
43 |
44 |
45 |
50 |
58 |
69 |
70 |
71 |
76 |
84 |
85 |
86 |
87 |
92 |
93 |
102 |
103 |
104 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_my_homework_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
27 |
28 |
34 |
35 |
36 |
37 |
38 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_new_homework.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
27 |
28 |
31 |
37 |
38 |
39 |
46 |
47 |
48 |
49 |
50 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_register.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
22 |
23 |
31 |
40 |
50 |
51 |
52 |
53 |
63 |
64 |
68 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_reminder.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_set_smc.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_splash.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
11 |
17 |
18 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
47 |
48 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_test_bmob.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
19 |
20 |
28 |
29 |
37 |
38 |
46 |
47 |
51 |
57 |
66 |
67 |
68 |
72 |
78 |
87 |
88 |
89 |
90 |
91 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_test_qmui.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_tomato_clock.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
15 |
16 |
22 |
29 |
30 |
31 |
37 |
48 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_user.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
27 |
28 |
34 |
35 |
36 |
37 |
38 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_bar_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
25 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
24 |
25 |
31 |
32 |
38 |
39 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/foot_load_tips.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_done_homework.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
13 |
14 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_undo_homework.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
12 |
13 |
14 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_user.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
14 |
15 |
25 |
26 |
32 |
33 |
34 |
35 |
36 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/home_fragment_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
21 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/homework_done_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
18 |
22 |
23 |
27 |
33 |
40 |
43 |
52 |
53 |
54 |
55 |
56 |
60 |
68 |
76 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/homework_fragment_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
19 |
20 |
21 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/homework_recycler_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/homework_undo_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
18 |
22 |
23 |
27 |
33 |
40 |
43 |
52 |
53 |
54 |
55 |
56 |
60 |
68 |
76 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/nav_header_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
23 |
24 |
32 |
33 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/setting_fragment_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/activity_main_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
73 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_about.xml:
--------------------------------------------------------------------------------
1 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_edit_homework.xml:
--------------------------------------------------------------------------------
1 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_homework_detail.xml:
--------------------------------------------------------------------------------
1 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_my_homework_detail.xml:
--------------------------------------------------------------------------------
1 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_new_homework.xml:
--------------------------------------------------------------------------------
1 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_user.xml:
--------------------------------------------------------------------------------
1 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/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/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/raw/bgm.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/app/src/main/res/raw/bgm.mp3
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #03A9F4
4 | #0288D1
5 | #B3E5FC
6 | #448AFF
7 | #212121
8 | #757575
9 | #FFFFFF
10 | #BDBDBD
11 | #F8F8F8
12 | #535353
13 | #3D3D3D
14 | #FF5B5B
15 |
16 |
17 |
18 | #55ffffff
19 | #ffffff
20 |
21 | #F4A5A0
22 |
23 | #E9E9E9
24 | #000
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 8dp
6 | 176dp
7 | 16dp
8 | 220dp
9 | 16dp
10 | 16sp
11 | 25dp
12 | 16dp
13 | 8dp
14 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/test/java/com/homeworkreminder/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.homeworkremider;
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 | }
--------------------------------------------------------------------------------
/app/src/test/java/com/homeworkreminder/homeworkreminder.plantuml:
--------------------------------------------------------------------------------
1 | @startuml
2 |
3 | title __HOMEWORKREMINDER's Class Diagram__\n
4 |
5 |
6 |
7 | right footer
8 |
9 |
10 | PlantUML diagram generated by SketchIt! (https://bitbucket.org/pmesmeur/sketch.it)
11 | For more information about this tool, please contact philippe.mesmeur@gmail.com
12 | endfooter
13 |
14 | @enduml
15 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | google()
6 | jcenter()
7 |
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.4.2'
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | jcenter()
21 |
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/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=-Xmx1536m
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 |
15 |
16 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanLee97/HomeworkReminder/19331687a9b2a8c0028d99f625328fee9c8adf73/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Aug 25 07:57:49 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-5.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':TestTabbedActivity2', ':TestRecyclerViewInFragment', ':TestScrollingActivity', ':TestLogin', ':TestLogin2', ':TestAlarm'
2 |
--------------------------------------------------------------------------------