├── AndroidManifest.xml
├── README.md
├── bin
├── AndroidManifest.xml
├── SuperCourseTable.apk
├── classes.dex
├── classes
│ └── com
│ │ ├── app
│ │ └── lll
│ │ │ ├── MainActivity$$ViewBinder.class
│ │ │ ├── MainActivity.class
│ │ │ ├── bean
│ │ │ ├── CustomDate.class
│ │ │ └── Lesson.class
│ │ │ ├── db
│ │ │ └── module
│ │ │ │ └── Lesson.class
│ │ │ ├── fragment
│ │ │ ├── CourseTable$$ViewBinder.class
│ │ │ ├── CourseTable$1.class
│ │ │ ├── CourseTable$2.class
│ │ │ ├── CourseTable$Cell.class
│ │ │ ├── CourseTable$MyGestureListener.class
│ │ │ ├── CourseTable$Row.class
│ │ │ ├── CourseTable$State.class
│ │ │ └── CourseTable.class
│ │ │ ├── listener
│ │ │ └── GestureListener.class
│ │ │ ├── util
│ │ │ ├── AppLog.class
│ │ │ ├── ColorUtils.class
│ │ │ ├── DateUtil.class
│ │ │ ├── DensityUtils.class
│ │ │ └── ScreenUtils.class
│ │ │ └── view
│ │ │ └── ScrollViewExtend.class
│ │ ├── art
│ │ └── lll
│ │ │ ├── BuildConfig.class
│ │ │ ├── R$attr.class
│ │ │ ├── R$color.class
│ │ │ ├── R$drawable.class
│ │ │ ├── R$id.class
│ │ │ ├── R$layout.class
│ │ │ ├── R$string.class
│ │ │ ├── R$style.class
│ │ │ └── R.class
│ │ └── lll
│ │ └── app
│ │ └── db
│ │ └── LessonDAO.class
├── dexedLibs
│ ├── android-support-v4-66190fd653bb0d07b81c482a710a5089.jar
│ ├── android-support-v4-ac81c8c020d67db1216263f0afb192a4.jar
│ ├── butterknife-7.0.1-0ccd256357e82f5592af4fc426a4108e.jar
│ └── butterknife-7.0.1-7a8959418a1e605eaf361fd37a04c3ab.jar
├── jarlist.cache
├── res
│ └── crunch
│ │ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ │ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ │ ├── drawable-xhdpi
│ │ ├── bg_course_add.png
│ │ ├── btn_back_g.png
│ │ ├── btn_week_class_ok.png
│ │ └── ic_launcher.png
│ │ └── drawable-xxhdpi
│ │ └── ic_launcher.png
└── resources.ap_
├── gen
└── com
│ └── art
│ └── lll
│ ├── BuildConfig.java
│ └── R.java
├── ic_launcher-web.png
├── libs
├── android-support-v4.jar
└── butterknife-7.0.1.jar
├── proguard-project.txt
├── project.properties
├── res
├── drawable-hdpi
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ ├── bg_course_add.png
│ ├── bg_main.jpg
│ ├── btn_back_g.png
│ ├── btn_week_class_ok.png
│ └── ic_launcher.png
├── drawable-xxhdpi
│ └── ic_launcher.png
├── drawable
│ ├── course_bg.xml
│ ├── course_info_blue.xml
│ ├── course_info_green.xml
│ ├── course_info_light_grey.xml
│ ├── course_info_red.xml
│ ├── course_info_yellow.xml
│ └── course_text_time_view_bg.xml
├── layout
│ ├── activity_main.xml
│ ├── course_week_date.xml
│ ├── fragment_course_table.xml
│ ├── header.xml
│ └── line_gray.xml
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
└── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
└── src
└── com
├── app
└── lll
│ ├── MainActivity.java
│ ├── bean
│ ├── CustomDate.java
│ └── Lesson.java
│ ├── db
│ └── module
│ │ └── Lesson.java
│ ├── fragment
│ └── CourseTable.java
│ ├── listener
│ └── GestureListener.java
│ ├── util
│ ├── AppLog.java
│ ├── ColorUtils.java
│ ├── DateUtil.java
│ ├── DensityUtils.java
│ └── ScreenUtils.java
│ └── view
│ └── ScrollViewExtend.java
└── lll
└── app
└── db
└── LessonDAO.java
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
9 |
10 |
15 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CourseTable
2 | 高仿超级课程表周视图
3 |
--------------------------------------------------------------------------------
/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
9 |
10 |
15 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/bin/SuperCourseTable.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/SuperCourseTable.apk
--------------------------------------------------------------------------------
/bin/classes.dex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes.dex
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/MainActivity$$ViewBinder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/MainActivity$$ViewBinder.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/MainActivity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/MainActivity.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/bean/CustomDate.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/bean/CustomDate.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/bean/Lesson.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/bean/Lesson.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/db/module/Lesson.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/db/module/Lesson.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/fragment/CourseTable$$ViewBinder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/fragment/CourseTable$$ViewBinder.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/fragment/CourseTable$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/fragment/CourseTable$1.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/fragment/CourseTable$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/fragment/CourseTable$2.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/fragment/CourseTable$Cell.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/fragment/CourseTable$Cell.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/fragment/CourseTable$MyGestureListener.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/fragment/CourseTable$MyGestureListener.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/fragment/CourseTable$Row.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/fragment/CourseTable$Row.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/fragment/CourseTable$State.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/fragment/CourseTable$State.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/fragment/CourseTable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/fragment/CourseTable.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/listener/GestureListener.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/listener/GestureListener.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/util/AppLog.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/util/AppLog.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/util/ColorUtils.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/util/ColorUtils.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/util/DateUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/util/DateUtil.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/util/DensityUtils.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/util/DensityUtils.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/util/ScreenUtils.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/util/ScreenUtils.class
--------------------------------------------------------------------------------
/bin/classes/com/app/lll/view/ScrollViewExtend.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/app/lll/view/ScrollViewExtend.class
--------------------------------------------------------------------------------
/bin/classes/com/art/lll/BuildConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/art/lll/BuildConfig.class
--------------------------------------------------------------------------------
/bin/classes/com/art/lll/R$attr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/art/lll/R$attr.class
--------------------------------------------------------------------------------
/bin/classes/com/art/lll/R$color.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/art/lll/R$color.class
--------------------------------------------------------------------------------
/bin/classes/com/art/lll/R$drawable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/art/lll/R$drawable.class
--------------------------------------------------------------------------------
/bin/classes/com/art/lll/R$id.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/art/lll/R$id.class
--------------------------------------------------------------------------------
/bin/classes/com/art/lll/R$layout.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/art/lll/R$layout.class
--------------------------------------------------------------------------------
/bin/classes/com/art/lll/R$string.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/art/lll/R$string.class
--------------------------------------------------------------------------------
/bin/classes/com/art/lll/R$style.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/art/lll/R$style.class
--------------------------------------------------------------------------------
/bin/classes/com/art/lll/R.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/art/lll/R.class
--------------------------------------------------------------------------------
/bin/classes/com/lll/app/db/LessonDAO.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/classes/com/lll/app/db/LessonDAO.class
--------------------------------------------------------------------------------
/bin/dexedLibs/android-support-v4-66190fd653bb0d07b81c482a710a5089.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/dexedLibs/android-support-v4-66190fd653bb0d07b81c482a710a5089.jar
--------------------------------------------------------------------------------
/bin/dexedLibs/android-support-v4-ac81c8c020d67db1216263f0afb192a4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/dexedLibs/android-support-v4-ac81c8c020d67db1216263f0afb192a4.jar
--------------------------------------------------------------------------------
/bin/dexedLibs/butterknife-7.0.1-0ccd256357e82f5592af4fc426a4108e.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/dexedLibs/butterknife-7.0.1-0ccd256357e82f5592af4fc426a4108e.jar
--------------------------------------------------------------------------------
/bin/dexedLibs/butterknife-7.0.1-7a8959418a1e605eaf361fd37a04c3ab.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/dexedLibs/butterknife-7.0.1-7a8959418a1e605eaf361fd37a04c3ab.jar
--------------------------------------------------------------------------------
/bin/jarlist.cache:
--------------------------------------------------------------------------------
1 | # cache for current jar dependency. DO NOT EDIT.
2 | # format is
3 | # Encoding is UTF-8
4 |
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/res/crunch/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/res/crunch/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xhdpi/bg_course_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/res/crunch/drawable-xhdpi/bg_course_add.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xhdpi/btn_back_g.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/res/crunch/drawable-xhdpi/btn_back_g.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xhdpi/btn_week_class_ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/res/crunch/drawable-xhdpi/btn_week_class_ok.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/res/crunch/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/res/crunch/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/resources.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/bin/resources.ap_
--------------------------------------------------------------------------------
/gen/com/art/lll/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.art.lll;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/gen/com/art/lll/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package com.art.lll;
9 |
10 | public final class R {
11 | public static final class attr {
12 | }
13 | public static final class color {
14 | public static final int Grey=0x7f04002c;
15 | public static final int LightGray=0x7f04002d;
16 | public static final int background_common=0x7f040003;
17 | public static final int background_menu=0x7f040005;
18 | public static final int background_menu_divider=0x7f040004;
19 | public static final int black=0x7f04000b;
20 | public static final int black1=0x7f040020;
21 | public static final int black2=0x7f040021;
22 | public static final int blue=0x7f04000f;
23 | public static final int calendar_class_title_bg=0x7f040032;
24 | /** 暗灰色
25 | */
26 | public static final int calendar_event=0x7f04001d;
27 | public static final int calendar_text=0x7f040031;
28 | public static final int calendar_title_bg=0x7f040030;
29 | public static final int course_notes_bg=0x7f04004b;
30 | public static final int darkgray=0x7f04000e;
31 | /** 淡白色
32 | */
33 | public static final int darkorange=0x7f04000a;
34 | public static final int date_1=0x7f04002a;
35 | public static final int date_2=0x7f04002b;
36 | /** 背景色
37 | */
38 | public static final int delete_user_bg=0x7f04003f;
39 | public static final int dialogColor=0x7f04001e;
40 | public static final int dialog_gray=0x7f04001f;
41 | /** 亮灰色
42 | */
43 | public static final int dimgray=0x7f04001b;
44 | /** 暗灰色
45 | */
46 | public static final int dimgrey=0x7f04001c;
47 | public static final int focus_circle_bg=0x7f040029;
48 | public static final int font_default=0x7f040006;
49 | public static final int font_light=0x7f040007;
50 | public static final int gray=0x7f04000c;
51 | public static final int gray1=0x7f04002e;
52 | public static final int green=0x7f040010;
53 | /** 绿色
54 | */
55 | public static final int green1=0x7f040011;
56 | /** 灰色
57 | */
58 | public static final int header_bg=0x7f04002f;
59 | /** A really bright Holo shade of blue
60 | */
61 | public static final int holo_blue_bright=0x7f040018;
62 | /** A light Holo shade of blue
63 | */
64 | public static final int holo_blue_light=0x7f040016;
65 | /** A light Holo shade of green
66 | */
67 | public static final int holo_green_light=0x7f040017;
68 | public static final int index_bg=0x7f040045;
69 | public static final int indexcshape0=0x7f040022;
70 | public static final int indexcshape1=0x7f040023;
71 | public static final int indexcshape2=0x7f040024;
72 | public static final int indexcshape3=0x7f040025;
73 | public static final int indexcshape4=0x7f040026;
74 | public static final int item_common_pressed=0x7f040001;
75 | public static final int item_common_selected=0x7f040002;
76 | public static final int item_divider=0x7f040000;
77 | public static final int lightblue=0x7f040013;
78 | public static final int lightgrey=0x7f04001a;
79 | public static final int line=0x7f040047;
80 | public static final int milk_white=0x7f040049;
81 | public static final int mine_bg=0x7f040048;
82 | /** 绿色
83 | */
84 | public static final int orange=0x7f040012;
85 | public static final int red=0x7f04000d;
86 | public static final int rippelColor=0x7f040028;
87 | public static final int send_msg_bg=0x7f040041;
88 | public static final int sky=0x7f040042;
89 | public static final int teacher_index_bg=0x7f040046;
90 | public static final int teacher_info_bg=0x7f040044;
91 | public static final int tel_phone_bg=0x7f040040;
92 | /** 深绿色
93 | */
94 | public static final int textColor=0x7f040034;
95 | /** 深绿色
96 | */
97 | public static final int textColor1=0x7f040036;
98 | /** 深灰色
99 | */
100 | public static final int textColor_black=0x7f040037;
101 | /** 黑色
102 | */
103 | public static final int textColor_black1=0x7f040038;
104 | public static final int textColor_black2=0x7f040039;
105 | /** 浅黑色
106 | */
107 | public static final int textColor_black3=0x7f04003a;
108 | /** 深绿色
109 | */
110 | public static final int textColor_g=0x7f040035;
111 | /** 橙色
112 | */
113 | public static final int textColor_gray=0x7f04003c;
114 | public static final int textColor_o=0x7f04003b;
115 | /** 灰色
116 | */
117 | public static final int textColorwhite=0x7f04003d;
118 | /** 文字颜色
119 | */
120 | public static final int titleTextColor=0x7f040033;
121 | public static final int today=0x7f040019;
122 | public static final int top_bg_color=0x7f040043;
123 | public static final int top_title_green=0x7f040027;
124 | public static final int transparent=0x7f040015;
125 | public static final int transparent_gray=0x7f040014;
126 | public static final int ui_bg=0x7f04004a;
127 | public static final int week_view_black=0x7f04003e;
128 | public static final int week_view_bule=0x7f04004e;
129 | public static final int week_view_date_highted=0x7f040056;
130 | /** 周视图课程颜色
131 | */
132 | public static final int week_view_gray=0x7f04004c;
133 | public static final int week_view_green=0x7f04004f;
134 | public static final int week_view_orange=0x7f040050;
135 | public static final int week_view_pubple=0x7f040052;
136 | public static final int week_view_pubple1=0x7f040053;
137 | public static final int week_view_red=0x7f04004d;
138 | public static final int week_view_sky=0x7f040051;
139 | public static final int week_view_text=0x7f040054;
140 | public static final int week_view_text_date=0x7f040055;
141 | public static final int white=0x7f040008;
142 | public static final int white_light=0x7f040009;
143 | }
144 | public static final class drawable {
145 | public static final int bg_course_add=0x7f020000;
146 | public static final int bg_main=0x7f020001;
147 | public static final int btn_back_g=0x7f020002;
148 | public static final int btn_week_class_ok=0x7f020003;
149 | public static final int course_bg=0x7f020004;
150 | public static final int course_info_blue=0x7f020005;
151 | public static final int course_info_green=0x7f020006;
152 | public static final int course_info_light_grey=0x7f020007;
153 | public static final int course_info_red=0x7f020008;
154 | public static final int course_info_yellow=0x7f020009;
155 | public static final int course_text_time_view_bg=0x7f02000a;
156 | public static final int ic_launcher=0x7f02000b;
157 | }
158 | public static final class id {
159 | public static final int fl_view=0x7f070001;
160 | public static final int iv_back=0x7f07001f;
161 | public static final int ll_layout1=0x7f070003;
162 | public static final int ll_layout2=0x7f070006;
163 | public static final int ll_layout3=0x7f070009;
164 | public static final int ll_layout4=0x7f07000c;
165 | public static final int ll_layout5=0x7f07000f;
166 | public static final int ll_layout6=0x7f070012;
167 | public static final int ll_layout7=0x7f070015;
168 | public static final int ll_time=0x7f07001b;
169 | public static final int ll_weekView=0x7f07001a;
170 | public static final int rl_courses=0x7f07001c;
171 | public static final int rl_header=0x7f07001e;
172 | public static final int rl_user_courses=0x7f07001d;
173 | public static final int scroll_body=0x7f070019;
174 | public static final int tv_cur_date=0x7f070000;
175 | public static final int tv_day1=0x7f070004;
176 | public static final int tv_day2=0x7f070007;
177 | public static final int tv_day3=0x7f07000a;
178 | public static final int tv_day4=0x7f07000d;
179 | public static final int tv_day5=0x7f070010;
180 | public static final int tv_day6=0x7f070013;
181 | public static final int tv_day7=0x7f070016;
182 | public static final int tv_friday_course=0x7f070011;
183 | public static final int tv_monday_course=0x7f070005;
184 | public static final int tv_month=0x7f070002;
185 | public static final int tv_saturday_course=0x7f070014;
186 | public static final int tv_sunday_course=0x7f070017;
187 | public static final int tv_thursday_course=0x7f07000e;
188 | public static final int tv_tuesday_course=0x7f070008;
189 | public static final int tv_wednesday_course=0x7f07000b;
190 | public static final int weekday=0x7f070018;
191 | }
192 | public static final class layout {
193 | public static final int activity_main=0x7f030000;
194 | public static final int course_week_date=0x7f030001;
195 | public static final int fragment_course_table=0x7f030002;
196 | public static final int header=0x7f030003;
197 | public static final int line_gray=0x7f030004;
198 | }
199 | public static final class string {
200 | public static final int app_name=0x7f050000;
201 | public static final int friday=0x7f050005;
202 | /** 星期
203 | */
204 | public static final int monday=0x7f050001;
205 | public static final int saturday=0x7f050006;
206 | public static final int sunday=0x7f050007;
207 | public static final int thursday=0x7f050004;
208 | public static final int tuesday=0x7f050002;
209 | public static final int wednesday=0x7f050003;
210 | }
211 | public static final class style {
212 | /**
213 | Base application theme, dependent on API level. This theme is replaced
214 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
215 |
216 |
217 | Theme customizations available in newer API levels can go in
218 | res/values-vXX/styles.xml, while customizations related to
219 | backward-compatibility can go here.
220 |
221 |
222 | Base application theme for API 11+. This theme completely replaces
223 | AppBaseTheme from res/values/styles.xml on API 11+ devices.
224 |
225 | API 11 theme customizations can go here.
226 |
227 | Base application theme for API 14+. This theme completely replaces
228 | AppBaseTheme from BOTH res/values/styles.xml and
229 | res/values-v11/styles.xml on API 14+ devices.
230 |
231 | API 14 theme customizations can go here.
232 | */
233 | public static final int AppBaseTheme=0x7f060000;
234 | /** Application theme.
235 | All customizations that are NOT specific to a particular API-level can go here.
236 | */
237 | public static final int AppTheme=0x7f060001;
238 | public static final int courseTableText=0x7f060002;
239 | public static final int headerLeftStyle=0x7f060004;
240 | /** 标题栏右边图片按钮
241 | */
242 | public static final int headerRightButtonStyle=0x7f060005;
243 | public static final int weekViewTimeText=0x7f060003;
244 | }
245 | }
246 |
--------------------------------------------------------------------------------
/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/ic_launcher-web.png
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/libs/butterknife-7.0.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/libs/butterknife-7.0.1.jar
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-16
15 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/bg_course_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/res/drawable-xhdpi/bg_course_add.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/bg_main.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/res/drawable-xhdpi/bg_main.jpg
--------------------------------------------------------------------------------
/res/drawable-xhdpi/btn_back_g.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/res/drawable-xhdpi/btn_back_g.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/btn_week_class_ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/res/drawable-xhdpi/btn_week_class_ok.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liulongling/CourseTable/ae8603cbcf8f35bba84e364153748083ce44eaeb/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable/course_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/drawable/course_info_blue.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/res/drawable/course_info_green.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/res/drawable/course_info_light_grey.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/res/drawable/course_info_red.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/res/drawable/course_info_yellow.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/res/drawable/course_text_time_view_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
9 |
10 |
11 | -
13 |
14 |
15 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
21 |
22 |
23 |
24 |
28 |
29 |
--------------------------------------------------------------------------------
/res/layout/course_week_date.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
14 |
15 |
21 |
22 |
29 |
30 |
35 |
36 |
43 |
44 |
45 |
52 |
53 |
58 |
59 |
66 |
67 |
68 |
75 |
76 |
81 |
82 |
89 |
90 |
91 |
98 |
99 |
104 |
105 |
112 |
113 |
114 |
121 |
122 |
127 |
128 |
135 |
136 |
137 |
144 |
145 |
150 |
151 |
158 |
159 |
160 |
167 |
168 |
173 |
174 |
181 |
182 |
183 |
184 |
185 |
186 |
--------------------------------------------------------------------------------
/res/layout/fragment_course_table.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
18 |
19 |
22 |
23 |
28 |
29 |
34 |
35 |
36 |
40 |
41 |
45 |
46 |
47 |
48 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/res/layout/header.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/res/layout/line_gray.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #fafafa
5 | #e0e0e0
6 | #5e5e5e
7 | #fafafa
8 | #d0d0d0
9 | #e0e0e0
10 | #222222
11 | #777777
12 | #ffffff
13 | #888888
14 | #20c36e
15 | #000000
16 | #FFDBDBDB
17 | #FF0000
18 | #50808080
19 | #20c36e
20 | #008000
21 | #8dce3f
22 | #eb923e
23 | #36c77b
24 | #8000
25 | #00000000
26 |
27 | #36c77b
28 |
29 | #36c77b
30 |
31 | #36c77b
32 | #ffff3e45
33 | #D3D3D3
34 | #696969
35 | #696969
36 |
37 | #999999
38 | #f0ffffff
39 | #e6e6e6
40 | #333333
41 | #666666
42 | #fe8a7f
43 | #b9a571
44 | #71b9a5
45 | #719bb8
46 | #a15679
47 | #8DCE3F
48 | #FFFFFF
49 | #F24949
50 | #F24949
51 | #40000000
52 | #BEBEBE
53 | #D3D3D3
54 | #eaeaea
55 |
56 | #FCFCFB
57 | #E8E8E7
58 | #75B174
59 | #F2F2F2
60 |
61 |
62 | #75B174
63 |
64 | #7cbd7b
65 | #64a461
66 | #777878
67 | #646262
68 | #9b9999
69 | #646464
70 | #939493
71 | #eeb886
72 | #999999
73 | #f9f9f9
74 |
75 | #9db8b3
76 |
77 |
78 |
79 | #ff9090
80 | #eceaea
81 | #dddddd
82 | #0f66fe
83 | #75B174
84 | #E6E7E8
85 | #E4E5E6
86 | #f7f7f7
87 | #a5a5a5
88 | #f5f5f5
89 | #FCFCFB
90 | #F9F9F9
91 | #dbe0db
92 |
93 |
94 | #8db18a
95 | #f67979
96 | #9adbf3
97 | #89c997
98 | #fdb680
99 | #58dcf0
100 | #f0acf2
101 | #b9b9f1
102 |
103 | #313334
104 | #abadae
105 | #ac9fc5
106 |
107 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | SuperCourseTable
4 |
5 | 周一
6 | 周二
7 | 周三
8 | 周四
9 | 周五
10 | 周六
11 | 周日
12 |
13 |
14 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
26 |
27 |
31 |
32 |
42 |
43 |
44 |
52 |
53 |
--------------------------------------------------------------------------------
/src/com/app/lll/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.app.lll;
2 |
3 | import com.app.lll.bean.CustomDate;
4 | import com.app.lll.fragment.CourseTable;
5 | import com.app.lll.util.DateUtil;
6 | import com.art.lll.R;
7 |
8 |
9 | import butterknife.Bind;
10 | import butterknife.ButterKnife;
11 |
12 | import android.os.Bundle;
13 | import android.support.v4.app.FragmentActivity;
14 | import android.widget.FrameLayout;
15 |
16 | /**
17 | *
18 | * @author liulongling
19 | *
20 | */
21 | public class MainActivity extends FragmentActivity {
22 |
23 | protected static final String TAG = "MainActivity";
24 |
25 | /**月视图 or 周视图*/
26 | @Bind(R.id.fl_view)
27 | FrameLayout mFrameLayout;
28 |
29 | private CustomDate mClickDate;
30 |
31 | @Override
32 | protected void onCreate(Bundle savedInstanceState) {
33 | super.onCreate(savedInstanceState);
34 | setContentView(R.layout.activity_main);
35 | ButterKnife.bind(this);
36 | CourseTable table = new CourseTable();
37 | table.setmContext(this);
38 | //设置选中日期
39 | if(mClickDate!=null){
40 | CustomDate mShowDate = mClickDate;
41 | int curMonthDays = DateUtil.getMonthDays(mShowDate.year, mShowDate.month);
42 | //获取周日
43 | if (mShowDate.day - mShowDate.week+7 > curMonthDays){
44 | if (mShowDate.month == 12) {
45 | mShowDate.month = 1;
46 | mShowDate.year += 1;
47 | } else {
48 | mShowDate.month += 1;
49 | }
50 | mShowDate.day = (mShowDate.day- mShowDate.week-1)+7-curMonthDays;
51 | }else{
52 | mShowDate.day = mShowDate.day - mShowDate.week+7;
53 | }
54 | table.setShowDate(mShowDate);
55 | }
56 |
57 | this.getSupportFragmentManager().beginTransaction().replace(R.id.fl_view, table).commit();
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/src/com/app/lll/bean/CustomDate.java:
--------------------------------------------------------------------------------
1 | package com.app.lll.bean;
2 |
3 | import java.io.Serializable;
4 |
5 | import com.app.lll.util.DateUtil;
6 |
7 | /**
8 | * 自定义的日期类
9 | * @author huang
10 | *
11 | */
12 | public class CustomDate implements Serializable{
13 |
14 |
15 | private static final long serialVersionUID = 1L;
16 | public int year;
17 | public int month;
18 | public int day;
19 | public int week;
20 | public int style;
21 |
22 | public CustomDate(int year,int month,int day){
23 | if(month > 12){
24 | month = 1;
25 | year++;
26 | }else if(month <1){
27 | month = 12;
28 | year--;
29 | }
30 | this.year = year;
31 | this.month = month;
32 | this.day = day;
33 | }
34 |
35 | public CustomDate(){
36 | this.year = DateUtil.getYear();
37 | this.month = DateUtil.getMonth();
38 | this.day = DateUtil.getCurrentMonthDay();
39 | }
40 |
41 | public static CustomDate modifiDayForObject(CustomDate date,int day){
42 | CustomDate modifiDate = new CustomDate(date.year,date.month,day);
43 | return modifiDate;
44 | }
45 |
46 | public static CustomDate modifiDayForObject(int year ,int month,int day){
47 | CustomDate modifiDate = new CustomDate(year,month,day);
48 | return modifiDate;
49 | }
50 |
51 | @Override
52 | public String toString() {
53 | String month,day;
54 |
55 | if(this.month < 10){
56 | month = "0"+this.month;
57 | }else{
58 | month = ""+this.month;
59 | }
60 |
61 | if(this.day < 10){
62 | day = "0"+this.day;
63 | }else{
64 | day = ""+this.day;
65 | }
66 | return year+"-"+month+"-"+day;
67 | }
68 |
69 |
70 | public String toDateString() {
71 | String month,day;
72 |
73 | if(this.month < 10){
74 | month = "0"+this.month;
75 | }else{
76 | month = ""+this.month;
77 | }
78 |
79 | if(this.day < 10){
80 | day = "0"+this.day;
81 | }else{
82 | day = ""+this.day;
83 | }
84 | return year+"年"+month+"月"+day+"日";
85 | }
86 |
87 |
88 | /**
89 | * 下一天
90 | * @return
91 | */
92 | public String nextDay() {
93 | int days = DateUtil.getMonthDays(this.year, this.month);
94 | String year,month,day;
95 |
96 | if(this.day + 1 > days){
97 | if (this.month == 12) {
98 | year =String.valueOf(this.year+1);
99 | month = "01";
100 | }else{
101 | year =String.valueOf(this.year);
102 | if(this.month+1 < 10){
103 | month = "0"+this.month+1;
104 | }else{
105 | month = ""+this.month+1;
106 | }
107 | }
108 | day = "01";
109 | }else{
110 | year = String.valueOf(this.year);
111 | month = String.valueOf(this.month);
112 | day = String.valueOf(this.day+1);
113 | }
114 | return year+"-"+month+"-"+day;
115 | }
116 |
117 | public int getYear() {
118 | return year;
119 | }
120 |
121 | public void setYear(int year) {
122 | this.year = year;
123 | }
124 |
125 | public int getMonth() {
126 | return month;
127 | }
128 |
129 | public void setMonth(int month) {
130 | this.month = month;
131 | }
132 |
133 | public int getDay() {
134 | return day;
135 | }
136 |
137 | public void setDay(int day) {
138 | this.day = day;
139 | }
140 |
141 | public int getWeek() {
142 | return week;
143 | }
144 |
145 | public void setWeek(int week) {
146 | this.week = week;
147 | }
148 |
149 | public void setStyle(int style){
150 | this.style = style;
151 | }
152 |
153 | public int getStyle(){
154 | return style;
155 | }
156 | }
157 |
--------------------------------------------------------------------------------
/src/com/app/lll/bean/Lesson.java:
--------------------------------------------------------------------------------
1 | package com.app.lll.bean;
2 |
3 | import java.io.Serializable;
4 |
5 | @SuppressWarnings("serial")
6 | public class Lesson implements Serializable{
7 | private long id; //课程id
8 | private String name;
9 | private int num; //第几课
10 | private String lessonDate; //上课日期
11 | private String sTime; //课程开始时间
12 | private String eTime; //课程结束时间
13 | private int status; //0 未上 1已上2 系统确认
14 |
15 |
16 | public long getId() {
17 | return id;
18 | }
19 |
20 | public void setId(long id) {
21 | this.id = id;
22 | }
23 |
24 | public String getName() {
25 | return name;
26 | }
27 |
28 | public void setName(String name) {
29 | this.name = name;
30 | }
31 |
32 | public int getStatus() {
33 | return status;
34 | }
35 |
36 | public void setStatus(int status) {
37 | this.status = status;
38 | }
39 |
40 | public int getNum() {
41 | return num;
42 | }
43 |
44 | public void setNum(int num) {
45 | this.num = num;
46 | }
47 |
48 | public String getLessonDate() {
49 | return lessonDate;
50 | }
51 |
52 | public void setLessonDate(String lessonDate) {
53 | this.lessonDate = lessonDate;
54 | }
55 |
56 | public String getsTime() {
57 | return sTime;
58 | }
59 |
60 | public void setsTime(String sTime) {
61 | this.sTime = sTime;
62 | }
63 |
64 | public String geteTime() {
65 | return eTime;
66 | }
67 |
68 | public void seteTime(String eTime) {
69 | this.eTime = eTime;
70 | }
71 |
72 | public String getLessonDateSTime(){
73 | return new StringBuffer().append(lessonDate).append(" ").append(this.sTime).toString();
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/src/com/app/lll/db/module/Lesson.java:
--------------------------------------------------------------------------------
1 | package com.app.lll.db.module;
2 |
3 | public class Lesson {
4 |
5 |
6 | }
7 |
--------------------------------------------------------------------------------
/src/com/app/lll/fragment/CourseTable.java:
--------------------------------------------------------------------------------
1 | package com.app.lll.fragment;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import butterknife.Bind;
7 | import butterknife.ButterKnife;
8 |
9 | import com.app.lll.bean.CustomDate;
10 | import com.app.lll.bean.Lesson;
11 | import com.app.lll.listener.GestureListener;
12 | import com.app.lll.util.ColorUtils;
13 | import com.app.lll.util.DateUtil;
14 | import com.app.lll.util.DensityUtils;
15 | import com.app.lll.util.ScreenUtils;
16 | import com.app.lll.view.ScrollViewExtend;
17 | import com.art.lll.R;
18 | import com.lll.app.db.LessonDAO;
19 |
20 | import android.content.Context;
21 | import android.graphics.Color;
22 | import android.graphics.drawable.GradientDrawable;
23 | import android.os.Bundle;
24 | import android.support.v4.app.Fragment;
25 | import android.view.LayoutInflater;
26 | import android.view.View;
27 | import android.view.ViewGroup;
28 | import android.view.View.OnClickListener;
29 | import android.view.animation.AlphaAnimation;
30 | import android.view.animation.LinearInterpolator;
31 | import android.widget.ImageView;
32 | import android.widget.LinearLayout;
33 | import android.widget.RelativeLayout;
34 | import android.widget.TextView;
35 |
36 | public class CourseTable extends Fragment{
37 | protected static final String TAG = "CourseTable";
38 | /** 第一个月份格子 */
39 | @Bind(R.id.tv_month)
40 | TextView mMonth;
41 |
42 | /**周一至周日格子*/
43 | @Bind({R.id.tv_monday_course,R.id.tv_tuesday_course,R.id.tv_wednesday_course,R.id.tv_thursday_course,R.id.tv_friday_course,R.id.tv_saturday_course,R.id.tv_sunday_course})
44 | List mWeekViews;
45 |
46 | /**日期*/
47 | @Bind({R.id.ll_layout1,R.id.ll_layout2,R.id.ll_layout3,R.id.ll_layout4,R.id.ll_layout5,R.id.ll_layout6,R.id.ll_layout7})
48 | List mLayouts;
49 |
50 | @Bind({R.id.tv_day1,R.id.tv_day2,R.id.tv_day3,R.id.tv_day4,R.id.tv_day5,R.id.tv_day6,R.id.tv_day7})
51 | List mTextViews;
52 |
53 | /** 课程表 */
54 | @Bind({R.id.ll_weekView})
55 | LinearLayout courseTableLayout;
56 |
57 | /**时间轴*/
58 | @Bind(R.id.ll_time)
59 | LinearLayout timeLayout;
60 |
61 | /**课程轴*/
62 | @Bind(R.id.rl_courses)
63 | RelativeLayout courseLayout;
64 |
65 | /**课程轴*/
66 | @Bind(R.id.rl_user_courses)
67 | RelativeLayout mUserCourseLayout;
68 |
69 | @Bind(R.id.scroll_body)
70 | ScrollViewExtend scrollView;
71 |
72 | /** 课程格子平均宽度 高度 **/
73 | protected int aveWidth,gridHeight;
74 | //第一个格子宽度
75 | private int firstGridWidth;
76 | //一小时区域
77 | RelativeLayout.LayoutParams mHourParams;
78 | //时间文字
79 | RelativeLayout.LayoutParams mHourTextParams;
80 | //时间截止线
81 | RelativeLayout.LayoutParams mHourLineParams;
82 |
83 | //七种颜色的背景
84 | int[] background = {R.color.week_view_gray,R.color.week_view_red, R.color.week_view_bule, R.color.week_view_green,R.color.week_view_orange,R.color.week_view_sky,R.color.week_view_pubple,R.color.week_view_pubple1};
85 |
86 | //24小时
87 | public final static int HOUR = 24;
88 |
89 | private static final int WEEK = 7;
90 | private static final int TOTAL_COL = 7;
91 | private static final int TOTAL_ROW = 1;
92 | private Row rows[] = new Row[TOTAL_ROW];
93 |
94 | private CustomDate mShowDate;//自定义的日期 包括year month day
95 | private Context mContext;
96 | private View view;
97 |
98 | public List lessons = null;
99 | private View curClickView;
100 |
101 | private boolean isInit;
102 |
103 | public static final int[] HOURS = {8,9,10,11,12,13,14,15,16,17,18,19,20,21,22};
104 |
105 | private int month = 0,year = 0;
106 |
107 |
108 | public void setmContext(Context mContext) {
109 | this.mContext = mContext;
110 | }
111 |
112 | public void setShowDate(CustomDate mShowDate){
113 | this.mShowDate = mShowDate;
114 | }
115 |
116 | @Override
117 | public void onCreate(Bundle savedInstanceState)
118 | {
119 | super.onCreate(savedInstanceState);
120 | }
121 |
122 | @Override
123 | public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
124 | view = inflater.inflate(R.layout.fragment_course_table, container, false);
125 | ButterKnife.bind(this,view);
126 | return view;
127 | }
128 |
129 | @Override
130 | public void onViewCreated(View view, Bundle savedInstanceState) {
131 | super.onViewCreated(view, savedInstanceState);
132 | if(!isInit){
133 | isInit = true;
134 | //第一个格子宽度
135 | firstGridWidth =DensityUtils.dp2px(mContext, 50+2);
136 | //格子平均宽度
137 | aveWidth = (ScreenUtils.getScreenWidth(mContext)-firstGridWidth) / 7;
138 | //格子平均高度
139 | gridHeight =ScreenUtils.getScreenHeight(mContext) / 12;
140 | }
141 |
142 | //初始化24小时view
143 | initTwentyFourHourViews();
144 | //导入日期
145 | initDate();
146 | //添加手势
147 | scrollView.setGestureDetector(new MyGestureListener(mContext).getGestureDetector());
148 | }
149 |
150 |
151 | /**
152 | * 监听手势方向 切换显示不同的课程数据
153 | *
154 | */
155 | public class MyGestureListener extends GestureListener{
156 | public MyGestureListener(Context context) {
157 | super(context);
158 | }
159 |
160 | @Override
161 | public boolean left() {
162 | rightSilde();
163 | return super.left();
164 | }
165 |
166 | @Override
167 | public boolean right() {
168 | leftSilde();
169 | return super.right();
170 | }
171 | }
172 |
173 | /**
174 | * 初始化日期数据
175 | */
176 | public void initDate(){
177 | if(mShowDate == null){
178 | mShowDate = DateUtil.getNextSunday();
179 | }
180 | fillDate();
181 | mMonth.setText(mShowDate.getMonth() < 10 ?"0"+mShowDate.getMonth():mShowDate.getMonth()+"月");
182 | }
183 |
184 |
185 | /**
186 | * 更新周视图上的课程数据
187 | */
188 | public void updateClassData(){
189 | //周视图上的数据是按每月查询一次 通过更改月份来达到更新数据的效果
190 | month = 0;
191 | fillDate();
192 | }
193 |
194 |
195 | /**
196 | * 更新UI+数据
197 | */
198 | public void update(){
199 | fillDate();
200 | mMonth.setText(String.valueOf(mShowDate.getMonth())+"月");
201 | }
202 |
203 |
204 | /**
205 | * 导入日期数据
206 | */
207 | public void fillDate(){
208 | fillWeekDate();
209 |
210 | if(lessons == null){
211 | lessons = new ArrayList();
212 | }
213 |
214 | //每月查询一次
215 | if(month!=mShowDate.month || year !=mShowDate.year){
216 | month = mShowDate.month;
217 | year = mShowDate.year;
218 |
219 | lessons = LessonDAO.getLessonsByYearAndMonth(mShowDate.year, mShowDate.month);
220 | }
221 |
222 | //更新数据前 移除view
223 | mUserCourseLayout.removeAllViews();
224 | for (int i = 0; i < TOTAL_ROW; i++) {
225 | if (rows[i] != null)
226 | rows[i].drawCells();
227 | }
228 | }
229 |
230 |
231 | public void initViewParams(){
232 | if(mHourParams == null){
233 | mHourParams = new RelativeLayout.LayoutParams(firstGridWidth,gridHeight);
234 | }
235 |
236 | if(mHourTextParams == null){
237 | mHourTextParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
238 | mHourTextParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
239 | mHourTextParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
240 | }
241 |
242 | if(mHourLineParams == null){
243 | mHourLineParams = new RelativeLayout.LayoutParams(DensityUtils.dp2px(mContext, 10),DensityUtils.dp2px(mContext, (float)1.5));
244 | mHourLineParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
245 | mHourLineParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
246 | }
247 | }
248 |
249 | /**
250 | * 初始化24小时*8view
251 | */
252 | public void initTwentyFourHourViews(){
253 | initViewParams();
254 | for(int i=1;i 1){
269 | rp.addRule(RelativeLayout.BELOW, (i - 2) * 7+j);
270 | }
271 | }else{
272 | //字体样式
273 | tx.setTextAppearance(mContext, R.style.courseTableText);
274 | rp.addRule(RelativeLayout.RIGHT_OF, (i - 1) * 7 + j - 1);
275 | rp.addRule(RelativeLayout.ALIGN_TOP, (i - 1) * 7 + j - 1);
276 | tx.setText("");
277 | }
278 |
279 | tx.setLayoutParams(rp);
280 | tx.setOnClickListener(new OnClickListener() {
281 | @Override
282 | public void onClick(View v) {
283 | int hour = (v.getId()-2)/7;
284 | int weekofday=(v.getId() -1)%7;
285 | if(weekofday == 0){
286 | weekofday = 7;
287 | }
288 |
289 | if(hour < 0){
290 | hour = 0;
291 | }
292 | //莫忘了计算点击的时间时 加上开始时间
293 | hour += HOURS[0];
294 | if(curClickView!=null){
295 | curClickView.setBackground(null);
296 | if(curClickView.getId() == v.getId()){
297 | curClickView = null;
298 | //跳转到添加课程界面
299 | return;
300 | }
301 | }
302 | curClickView = v;
303 | curClickView.setBackground(getResources().getDrawable(R.drawable.bg_course_add));
304 | curClickView.setAlpha((float)0.5);
305 | }
306 | });
307 | courseLayout.addView(tx);
308 | }
309 | }
310 | }
311 | }
312 |
313 |
314 | /**
315 | * 周视图上面的小点
316 | * @param hour
317 | * @param j
318 | */
319 | public void addDotView(int hour,int j){
320 | if(j == 7){
321 | return;
322 | }
323 | RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(DensityUtils.dp2px(mContext, 3),DensityUtils.dp2px(mContext, 3));
324 | params.topMargin = hour*gridHeight;
325 | params.leftMargin = aveWidth*j;
326 |
327 | ImageView view = new ImageView(mContext);
328 | view.setLayoutParams(params);
329 | view.setBackgroundColor(getResources().getColor(R.color.week_view_text_date));
330 |
331 | courseLayout.addView(view);
332 | }
333 |
334 |
335 | /**
336 | * 时间轴
337 | * @param hour 几点
338 | */
339 | public void addTimeView(int hour){
340 | RelativeLayout layout = new RelativeLayout(mContext);
341 | layout.setLayoutParams(mHourParams);
342 |
343 | //第一个格子里显示2个时间 24点 1点
344 | if(hour == 0)
345 | {
346 | RelativeLayout.LayoutParams layoutParams= new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
347 | layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
348 | layoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
349 |
350 | TextView textView = new TextView(mContext);
351 | textView.setText("0"+HOURS[0]+":00");
352 | textView.setLayoutParams(layoutParams);
353 | textView.setTextAppearance(mContext, R.style.weekViewTimeText);
354 | layout.addView(textView);
355 | }
356 | //第一个时间显示在格子顶部 其它时间显示在底部
357 | hour = HOURS[hour+1];
358 |
359 | TextView textView = new TextView(mContext);
360 | textView.setLayoutParams(mHourTextParams);
361 | textView.setTextAppearance(mContext, R.style.weekViewTimeText);
362 |
363 | StringBuilder builder = new StringBuilder();
364 | builder.append(hour < 10?("0"+hour):hour);
365 | builder.append(":00");
366 |
367 | //22点不显示
368 | textView.setText(builder.toString());
369 |
370 | if(hour == 22){
371 | textView.setVisibility(View.INVISIBLE);
372 | }
373 |
374 | layout.addView(textView);
375 |
376 | //22点横线不显示
377 | if(hour != 22){
378 | TextView lineView = new TextView(mContext);
379 | lineView.setLayoutParams(mHourLineParams);
380 | lineView.setBackgroundColor(getResources().getColor(R.color.week_view_black));
381 | layout.addView(lineView);
382 | }
383 | timeLayout.addView(layout);
384 | }
385 |
386 | /**
387 | * 根据课程时间绘制课程显示的位置
388 | * @param name 课程名称
389 | * @param sHour 课程开始时间
390 | * @param sHour 课程开始分钟
391 | * @param min 这节课有多少分钟
392 | * @param weekday 周几
393 | */
394 | public void addCourseView(Lesson bean){
395 |
396 | int[] sParams = DateUtil.getTime(bean.getsTime());
397 | int[] eParams = DateUtil.getTime(bean.geteTime());
398 | if(sParams == null || eParams == null){
399 | return;
400 | }
401 |
402 | //开始时间 分钟 总时间
403 | int sHour,sMin,eHour,eMin,min;
404 |
405 | sHour = sParams[0];
406 | sMin = sParams[1];
407 |
408 | eHour= eParams[0];
409 | eMin = eParams[1];
410 |
411 | if(eHour > sHour || eMin > sMin){
412 | min = (eHour - sHour)*60+(eMin - sMin);
413 | if(min < 40){
414 | min = 40;
415 | }
416 | //课程高度
417 | float minHeight = (float)gridHeight/(float)60;
418 | int cHeight = (int)(((float)gridHeight/(float)60)*min);
419 | int weekday = DateUtil.getWeekOfDate(bean.getLessonDate());
420 | if(weekday == 0){
421 | weekday = 7;
422 | }
423 |
424 | //1.添一个相对布局 来存储图片和文字
425 | RelativeLayout layout = new RelativeLayout(mContext);
426 | layout.setTag(String.valueOf(bean.getId()));
427 | RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(aveWidth,cHeight);
428 | //Calculate the location of the course Since the beginning of the course is from 7 points
429 | rlp.topMargin = (sHour-7)*gridHeight+(int)(minHeight*sMin);
430 | rlp.leftMargin = firstGridWidth+(weekday-1)*aveWidth;
431 | layout.setLayoutParams(rlp);
432 | //设置背景框
433 | layout.setBackgroundResource(R.drawable.course_bg);
434 | //设置背景颜色
435 | GradientDrawable drawable =(GradientDrawable) layout.getBackground();
436 | drawable.setColor(ColorUtils.getFillColor(1));
437 | //设置描边颜色
438 | drawable.setStroke(DensityUtils.dp2px(mContext, 2),ColorUtils.getStrokeColor(2));
439 |
440 | //bean.status == ClientCode.YS?mContext.getResources().getColor(background[0]):mContext.getResources().getColor(background[DateUtil.getWeekDay()])
441 |
442 | //设置不透明度
443 | layout.getBackground().setAlpha(222);
444 |
445 | //2.添加课程
446 | TextView courseInfo = new TextView(mContext);
447 |
448 | StringBuilder builder = new StringBuilder();
449 | builder.append(bean.getsTime());
450 | builder.append("\n");
451 | builder.append(" ");
452 | builder.append(bean.getName());
453 | courseInfo.setText(builder.toString());
454 |
455 | // 偏移由这节课是星期几决定
456 | //rlp.addRule(RelativeLayout.RIGHT_OF, 1);
457 | // 字体居中
458 | //courseInfo.setGravity(Gravity.CENTER);
459 | RelativeLayout.LayoutParams layoutParams= new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
460 | courseInfo.setTextSize(12);
461 | courseInfo.setLayoutParams(layoutParams);
462 | courseInfo.setTextColor(Color.WHITE);
463 |
464 | layout.setOnClickListener(new OnClickListener() {
465 | @Override
466 | public void onClick(View v) {
467 | //课程信息界面
468 | }
469 | });
470 |
471 | layout.addView(courseInfo);
472 | //课程以上显示已经图标
473 | if(bean.getStatus() == 1){
474 | layout.addView(addClassOkIcon());
475 | }
476 | mUserCourseLayout.addView(layout);
477 | }
478 | }
479 |
480 |
481 | /**
482 | * 添加确认上课图标
483 | */
484 | public ImageView addClassOkIcon(){
485 | //图标显示在右下角
486 | RelativeLayout.LayoutParams params= new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
487 | params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
488 | params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
489 | //设置图标
490 | ImageView view = new ImageView(mContext);
491 | view.setBackgroundResource(R.drawable.btn_week_class_ok);
492 | view.setLayoutParams(params);
493 | return view;
494 | }
495 |
496 | /**
497 | * 填充星期模式下的数据 默认通过当前日期得到所在星期天的日期,然后依次填充日期
498 | */
499 | private void fillWeekDate() {
500 | int lastMonthDays = DateUtil.getMonthDays(mShowDate.year, mShowDate.month-1);
501 | rows[0] = new Row(0);
502 | int year = mShowDate.year;
503 | int month = mShowDate.month;
504 | int day = mShowDate.day;
505 | for (int i = TOTAL_COL -1; i >= 0 ; i--) {
506 | day -= 1;
507 | if (day < 1) {
508 | if (month == 1) {
509 | year--;
510 | month = 12;
511 | }else{
512 | month--;
513 | }
514 | day = lastMonthDays;
515 | }
516 | CustomDate date = CustomDate.modifiDayForObject(year,month, day);
517 | date.year = year;
518 | date.week = i;
519 | //今天
520 | if(DateUtil.isToday(date)){
521 | rows[0].cells[i] = new Cell(date, State.CLICK_DAY, i, 0);
522 | continue;
523 | }
524 | rows[0].cells[i] = new Cell(date, State.CURRENT_MONTH_DAY,i, 0);
525 | }
526 | }
527 |
528 | /**
529 | *
530 | * cell的state
531 | *当前月日期,过去的月的日期,下个月的日期,今天,点击的日期
532 | *
533 | */
534 | enum State {
535 | CURRENT_MONTH_DAY, PAST_MONTH_DAY, NEXT_MONTH_DAY, TODAY, CLICK_DAY;
536 | }
537 |
538 | // 组
539 | class Row {
540 | public int j;
541 |
542 | Row(int j) {
543 | this.j = j;
544 | }
545 |
546 | public Cell[] cells = new Cell[TOTAL_COL];
547 |
548 | public void drawCells(){
549 | for (int i = 0; i < cells.length; i++) {
550 | if (cells[i] != null){
551 | TextView view = mTextViews.get(i);
552 | view.setText(String.valueOf(cells[i].date.day));
553 | if(cells[i].state == State.CLICK_DAY){
554 | mTextViews.get(i).setTextColor(mContext.getResources().getColor(R.color.white));
555 | mLayouts.get(i).setBackgroundColor(mContext.getResources().getColor(R.color.week_view_date_highted));
556 | }else{
557 | mTextViews.get(i).setTextColor(mContext.getResources().getColor(R.color.textColor_black));
558 | mLayouts.get(i).setBackgroundColor(mContext.getResources().getColor(R.color.transparent));
559 | }
560 |
561 | //不是本月数据 从数据库查询
562 | if(cells[i].date.year != mShowDate.year || cells[i].date.month != mShowDate.month){
563 | List list = LessonDAO.getLessonsByDate(mShowDate.toString(), mShowDate.nextDay());
564 | if(list!=null){
565 | for(Lesson bean:list){
566 | addCourseView(bean);
567 | }
568 | }
569 | }else{
570 | if(lessons!=null){
571 | //本月数据 从缓存中读取
572 | for(Lesson bean:lessons){
573 | if(bean.getLessonDate().substring(0, 10).equals(cells[i].date.toString())){
574 | addCourseView(bean);
575 | }
576 | }
577 | }
578 | }
579 | }
580 | }
581 | }
582 | }
583 |
584 |
585 | // 单元格
586 | class Cell {
587 | public CustomDate date;
588 | public State state;
589 | public int i;
590 | public int j;
591 |
592 | public Cell(CustomDate date, State state, int i, int j) {
593 | super();
594 | this.date = date;
595 | this.state = state;
596 | this.i = i;
597 | this.j = j;
598 | }
599 | }
600 |
601 | /**
602 | * 向右滑动
603 | */
604 | public void rightSilde() {
605 | int currentMonthDays = DateUtil.getMonthDays(mShowDate.year, mShowDate.month);
606 | startAnimation();
607 | if (mShowDate.day + WEEK > currentMonthDays) {
608 | if (mShowDate.month == 12) {
609 | mShowDate.month = 1;
610 | mShowDate.year += 1;
611 | } else {
612 | mShowDate.month += 1;
613 | }
614 | mShowDate.day = WEEK - currentMonthDays + mShowDate.day;
615 | }else{
616 | mShowDate.day += WEEK;
617 | }
618 | //更新课程数据
619 | update();
620 | }
621 |
622 | /**
623 | * 向左滑动
624 | */
625 | public void leftSilde() {
626 | int lastMonthDays = DateUtil.getMonthDays(mShowDate.year, mShowDate.month);
627 | startAnimation();
628 | if (mShowDate.day - WEEK < 1) {
629 | if (mShowDate.month == 1) {
630 | mShowDate.month = 12;
631 | mShowDate.year -= 1;
632 | } else {
633 | mShowDate.month -= 1;
634 | }
635 | mShowDate.day = lastMonthDays - WEEK + mShowDate.day;
636 | }else{
637 | mShowDate.day -= WEEK;
638 | }
639 | update();
640 | }
641 |
642 | /**
643 | * 滑动页面动画
644 | */
645 | private void startAnimation() {
646 | AlphaAnimation alphaAnim=new AlphaAnimation(1.0f, 0.4f);
647 | alphaAnim.setDuration(400);
648 | alphaAnim.setInterpolator(new LinearInterpolator());
649 | alphaAnim.setFillAfter(false);
650 | view.startAnimation(alphaAnim);
651 |
652 | AlphaAnimation alphaAnim1=new AlphaAnimation(0.4f, 1.0f);
653 | alphaAnim1.setDuration(400);
654 | alphaAnim1.setInterpolator(new LinearInterpolator());
655 | alphaAnim1.setFillAfter(false);
656 | view.startAnimation(alphaAnim);
657 |
658 | }
659 |
660 | /**
661 | * 返回今天
662 | */
663 | public void backToday(){
664 | mShowDate = null;
665 | initDate();
666 | }
667 |
668 | public void removeAllViews(){
669 | courseLayout.removeAllViews();
670 | mUserCourseLayout.removeAllViews();
671 | timeLayout.removeAllViews();
672 | }
673 | }
674 |
--------------------------------------------------------------------------------
/src/com/app/lll/listener/GestureListener.java:
--------------------------------------------------------------------------------
1 | package com.app.lll.listener;
2 |
3 | import android.content.Context;
4 | import android.view.GestureDetector.SimpleOnGestureListener;
5 | import android.view.GestureDetector;
6 | import android.view.MotionEvent;
7 |
8 | /**
9 | * 实现监听左右滑动的事件,哪个view需要的时候直接setOnTouchListener就可以用了
10 | *
11 | */
12 | public class GestureListener extends SimpleOnGestureListener{
13 | private static final String TAG = "GestureListener";
14 | private final static int VERTICALMINISTANCE = 200 ; //表示向左滑动的最小距离
15 | private final static int MINVELOCITY = 10 ; //表示向左滑动的最小的加速度
16 | private GestureDetector gestureDetector;
17 |
18 | public GestureListener(Context context) {
19 | super();
20 | gestureDetector = new GestureDetector(context, this);
21 | }
22 |
23 | @Override
24 | public boolean onSingleTapUp(MotionEvent e) {
25 | // TODO Auto-generated method stub
26 | return false;
27 | }
28 |
29 | @Override
30 | public void onShowPress(MotionEvent e) {
31 | // TODO Auto-generated method stub
32 |
33 | }
34 |
35 | @Override
36 | public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
37 | float distanceY) {
38 | // TODO Auto-generated method stub
39 | return false;
40 | }
41 |
42 | @Override
43 | public void onLongPress(MotionEvent e) {
44 | // TODO Auto-generated method stub
45 |
46 | }
47 |
48 | @Override
49 | public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
50 | float velocityY) {
51 | // TODO Auto-generated method stub
52 | /*// 根据velocityX(x方向上的加速度),velocityY(y方向上的加速度)
53 | // 根据两个速度的大小比较可以判断出手势是左右侧滑还是上下滑动
54 | if (Math.abs(velocityX) > Math.abs(velocityY) ) {
55 | //表示
56 | }*/
57 |
58 | //大于设定的最小滑动距离并且在水平/竖直方向速度绝对值大于设定的最小速度,则执行相应方法(表示向左滑动)
59 | if(e1.getX()-e2.getX() > VERTICALMINISTANCE && Math.abs(velocityX) > MINVELOCITY){
60 | //左滑一系列的操作
61 | left();
62 | }
63 |
64 | //表示右划
65 | if (e2.getX()-e1.getX() > VERTICALMINISTANCE && Math.abs(velocityX) > MINVELOCITY) {
66 | //右滑一系列的操作
67 | right();
68 | }
69 | return false;
70 | }
71 |
72 | @Override
73 | public boolean onDown(MotionEvent e) {
74 | // TODO Auto-generated method stub
75 | return false;
76 | }
77 |
78 | /**
79 | * 向左滑的时候调用的方法,子类应该重写
80 | * @return
81 | */
82 | public boolean left() {
83 | return false;
84 | }
85 |
86 | /**
87 | * 向右滑的时候调用的方法,子类应该重写
88 | * @return
89 | */
90 | public boolean right() {
91 | return false;
92 | }
93 |
94 | public GestureDetector getGestureDetector() {
95 | return gestureDetector;
96 | }
97 |
98 | public void setGestureDetector(GestureDetector gestureDetector) {
99 | this.gestureDetector = gestureDetector;
100 | }
101 |
102 | }
103 |
--------------------------------------------------------------------------------
/src/com/app/lll/util/AppLog.java:
--------------------------------------------------------------------------------
1 | package com.app.lll.util;
2 |
3 | import android.util.Log;
4 |
5 | /**
6 | * log 统一管理类
7 | * @author liulongling
8 | *
9 | */
10 | public class AppLog {
11 |
12 | public static boolean DEBUG=true;
13 |
14 | /**
15 | * 输出颜色是蓝色
16 | * @param tag
17 | * @param msg
18 | */
19 | public static void debug(String tag,String msg){
20 | if(DEBUG){
21 | Log.d(tag, msg);
22 | }
23 | }
24 |
25 | /**
26 | * 输出是黑色
27 | * @param tag
28 | * @param msg
29 | */
30 | public static void logv(String tag,String msg){
31 | if(DEBUG){
32 | Log.v(tag, msg);
33 | }
34 | }
35 |
36 | /**
37 | * 输出是橙色
38 | * @param tag
39 | * @param msg
40 | */
41 | public static void logw(String tag,String msg){
42 | if(DEBUG){
43 | Log.v(tag, msg);
44 | }
45 | }
46 |
47 |
48 | /**
49 | * 输出为绿色
50 | * @param tag
51 | * @param msg
52 | */
53 | public static void logi(String tag,String msg){
54 | if(DEBUG){
55 | Log.i(tag, msg);
56 | }
57 | }
58 |
59 | /**
60 | * 输出为红色
61 | * @param tag
62 | * @param msg
63 | */
64 | public static void loge(String tag,String msg){
65 | if(DEBUG){
66 | Log.e(tag, msg);
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/com/app/lll/util/ColorUtils.java:
--------------------------------------------------------------------------------
1 | package com.app.lll.util;
2 |
3 | import android.graphics.Color;
4 |
5 | public class ColorUtils {
6 | // 用数字取fill颜色
7 | public static int getFillColor(int colorFlag) {
8 | if (colorFlag == 1) {
9 | return Color.parseColor("#95e987");
10 | } else if (colorFlag == 2) {
11 | return Color.parseColor("#ffb67e");
12 |
13 | } else if (colorFlag == 3) {
14 | return Color.parseColor("#8cc7fe");
15 |
16 | } else if (colorFlag == 4) {
17 | return Color.parseColor("#7ba3eb");
18 |
19 | } else if (colorFlag == 5) {
20 | return Color.parseColor("#e3ade8");
21 |
22 | } else if (colorFlag == 6) {
23 | return Color.parseColor("#f9728b");
24 |
25 | } else if (colorFlag == 7) {
26 | return Color.parseColor("#85e9cd");
27 |
28 | } else if (colorFlag == 8) {
29 | return Color.parseColor("#f5a8cf");
30 |
31 | } else if (colorFlag == 9) {
32 | return Color.parseColor("#a9e2a0");
33 |
34 | } else if (colorFlag == 10) {
35 | return Color.parseColor("#70cec7");
36 | } else {
37 | return Color.GRAY;// 没有赋值,或赋值错误时,灰色
38 | }
39 | }
40 |
41 | // 用数字取边框颜色
42 | public static int getStrokeColor(int colorFlag) {
43 | if (colorFlag == 1) {
44 | return Color.parseColor("#5ca850");
45 | } else if (colorFlag == 2) {
46 | return Color.parseColor("#d39260");
47 |
48 | } else if (colorFlag == 3) {
49 | return Color.parseColor("#5e91c0");
50 |
51 | } else if (colorFlag == 4) {
52 | return Color.parseColor("#486db0");
53 |
54 | } else if (colorFlag == 5) {
55 | return Color.parseColor("#c789cd");
56 |
57 | } else if (colorFlag == 6) {
58 | return Color.parseColor("#c14b61");
59 |
60 | } else if (colorFlag == 7) {
61 | return Color.parseColor("#5dcaab");
62 |
63 | } else if (colorFlag == 8) {
64 | return Color.parseColor("#cd7aa4");
65 |
66 | } else if (colorFlag == 9) {
67 | return Color.parseColor("#75c269");
68 |
69 | } else if (colorFlag == 10) {
70 | return Color.parseColor("#42918b");
71 |
72 | } else {
73 | return Color.GRAY;// 没有赋值,或赋值错误时,灰色
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/com/app/lll/util/DateUtil.java:
--------------------------------------------------------------------------------
1 | package com.app.lll.util;
2 |
3 | import java.text.ParseException;
4 | import java.text.SimpleDateFormat;
5 | import java.util.Calendar;
6 | import java.util.Date;
7 |
8 | import com.app.lll.bean.CustomDate;
9 |
10 | import android.annotation.SuppressLint;
11 |
12 | /**
13 | * 日期工具类
14 | * @author liulongling
15 | *
16 | */
17 | public class DateUtil {
18 | public static Calendar mRightNow = null;
19 | public static int CUR_YEAR,CUR_MONTH,CUR_DAY;
20 | public static String[] weekName = {"周一", "周二", "周三", "周四", "周五","周六","周日"};
21 | public static CustomDate cDate;
22 |
23 | public static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
24 |
25 | public DateUtil() {
26 | mRightNow = Calendar.getInstance();
27 | CUR_YEAR = mRightNow.get(Calendar.YEAR);
28 | CUR_MONTH = mRightNow.get(Calendar.MONTH);
29 | CUR_DAY = mRightNow.get(Calendar.DAY_OF_MONTH);
30 | }
31 |
32 | public static int getMonthDays(int year, int month) {
33 | if (month > 12) {
34 | month = 1;
35 | year += 1;
36 | } else if (month < 1) {
37 | month = 12;
38 | year -= 1;
39 | }
40 | int[] arr = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
41 | int days = 0;
42 |
43 | if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
44 | arr[1] = 29; // 闰年2月29天
45 | }
46 |
47 | try {
48 | days = arr[month - 1];
49 | } catch (Exception e) {
50 | e.getStackTrace();
51 | }
52 |
53 | return days;
54 | }
55 |
56 | public static int getYear() {
57 | return Calendar.getInstance().get(Calendar.YEAR);
58 | }
59 |
60 | public static int getMonth() {
61 | return Calendar.getInstance().get(Calendar.MONTH) + 1;
62 | }
63 |
64 | public static int getCurrentMonthDay() {
65 | return Calendar.getInstance().get(Calendar.DAY_OF_MONTH);
66 | }
67 |
68 | public static int getWeekDay() {
69 | return Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
70 | }
71 |
72 | public static int getHour() {
73 | return Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
74 | }
75 | public static int getMinute() {
76 | return Calendar.getInstance().get(Calendar.MINUTE);
77 | }
78 | public static CustomDate getNextSunday() {
79 |
80 | Calendar c = Calendar.getInstance();
81 | c.add(Calendar.DATE, 7 - getWeekDay()+2);
82 | CustomDate date = new CustomDate(c.get(Calendar.YEAR),
83 | c.get(Calendar.MONTH)+1, c.get(Calendar.DAY_OF_MONTH));
84 | return date;
85 | }
86 |
87 | public static int[] getWeekSunday(int year, int month, int day, int pervious) {
88 | int[] time = new int[3];
89 | Calendar c = Calendar.getInstance();
90 | c.set(Calendar.YEAR, year);
91 | c.set(Calendar.MONTH, month);
92 | c.set(Calendar.DAY_OF_MONTH, day);
93 | c.add(Calendar.DAY_OF_MONTH, pervious);
94 | time[0] = c.get(Calendar.YEAR);
95 | time[1] = c.get(Calendar.MONTH )+1;
96 | time[2] = c.get(Calendar.DAY_OF_MONTH);
97 | return time;
98 |
99 | }
100 |
101 | public static int getWeekDayFromDate(int year, int month) {
102 | Calendar cal = Calendar.getInstance();
103 | cal.setTime(getDateFromString(year, month));
104 | int week_index= cal.get(Calendar.DAY_OF_WEEK) - 1;
105 | if(week_index == 0){
106 | week_index = 7;
107 | }else if (week_index < 0) {
108 | week_index = 0;
109 | }
110 | return week_index;
111 | }
112 |
113 | @SuppressLint("SimpleDateFormat")
114 | public static Date getDateFromString(int year, int month) {
115 | String dateString = year + "-" + (month > 9 ? month : ("0" + month))
116 | + "-01";
117 | Date date = null;
118 | try {
119 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
120 | date = sdf.parse(dateString);
121 | } catch (ParseException e) {
122 | System.out.println(e.getMessage());
123 | }
124 | return date;
125 | }
126 | public static boolean isToday(CustomDate date){
127 | return(date.year == DateUtil.getYear() &&
128 | date.month == DateUtil.getMonth()
129 | && date.day == DateUtil.getCurrentMonthDay());
130 | }
131 |
132 | public static boolean isCurrentMonth(CustomDate date){
133 | return(date.year == DateUtil.getYear() &&
134 | date.month == DateUtil.getMonth());
135 | }
136 |
137 |
138 | public static Date toDate(int... value) {
139 | int year = value[0];
140 | int month = value[1];
141 | int day = value[2];
142 | String str = year + "-" + month + "-" + day + " 00:00";
143 | Date dt = null;
144 | try {
145 | dt = sdf.parse(str);
146 | } catch (ParseException e) {
147 | // TODO Auto-generated catch block
148 | e.printStackTrace();
149 | }
150 | return dt;
151 | }
152 |
153 | /**
154 | * 根据日期 获取星期几
155 | * @param sDate
156 | * @return -1 日期格式错误
157 | */
158 | public static int getWeekOfDate(String sDate){
159 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");// 定义日期格式
160 | Date date = null;
161 | try {
162 | date = format.parse(sDate);// 将字符串转换为日期
163 | } catch (ParseException e) {
164 | return -1;
165 | }
166 | Calendar calendar = Calendar.getInstance();
167 | if(date != null){
168 | calendar.setTime(date);
169 | }
170 | int w = calendar.get(Calendar.DAY_OF_WEEK) - 1;
171 | if (w < 0){
172 | w = 0;
173 | }
174 | return w;
175 | }
176 |
177 | /**
178 | * 根据日期 获取星期几
179 | * @param sDate
180 | * @return -1 日期格式错误
181 | */
182 | public static String getWeekOfDate(Date date) {
183 |
184 | Calendar calendar = Calendar.getInstance();
185 | if(date != null){
186 | calendar.setTime(date);
187 | }
188 | int w = calendar.get(Calendar.DAY_OF_WEEK) - 1;
189 | if (w < 0){
190 | w = 0;
191 | }
192 | return weekName[w];
193 | }
194 |
195 |
196 | /**
197 | * 获取时间
198 | * @param time 格式08:00
199 | * @return
200 | */
201 | public static int[] getTime(String time){
202 | String[] sParams = time.split("\\:");
203 | int[] times = new int[2];
204 | try {
205 | times[0]= Integer.parseInt(sParams[0]);
206 | times[1]= Integer.parseInt(sParams[1]);
207 | } catch (Exception e) {
208 | return null;
209 | }
210 | return times;
211 | }
212 |
213 |
214 | /**
215 | * 解析日期
216 | * @param date
217 | * @param splitStr
218 | * @return 数字数组
219 | */
220 | public static int[] getDate(String date,String splitStr){
221 | String[] sParams = date.split(splitStr);
222 | int[] date1 = new int[3];
223 | date1[0]= Integer.parseInt(sParams[0]);
224 | date1[1]= Integer.parseInt(sParams[1]);
225 | date1[2]= Integer.parseInt(sParams[2]);
226 | return date1;
227 | }
228 |
229 | /**
230 | * 解析日期 获取时间格式是08的字符串
231 | * @param date
232 | * @param splitStr
233 | * @return 字符串数组
234 | */
235 | public static String[] getDateStr(String date,String splitStr){
236 | if(date==null){
237 | return null;
238 | }
239 | String[] sParams;
240 | try {
241 | sParams = date.split(splitStr);
242 | } catch (Exception e) {
243 | return null;
244 | }
245 |
246 | String[] date1 = new String[3];
247 | date1[0]= sParams[0];
248 | date1[1]= sParams[1];
249 | date1[2]= sParams[2];
250 | return date1;
251 | }
252 |
253 |
254 | /**
255 | * 根据日期 获取星期几
256 | * @param sDate
257 | * @return -1 日期格式错误
258 | */
259 | public static int getWeekOfDateNum(Date date) {
260 |
261 | Calendar calendar = Calendar.getInstance();
262 | if (date != null) {
263 | calendar.setTime(date);
264 | }
265 | int w = calendar.get(Calendar.DAY_OF_WEEK) - 1;
266 | if (w < 0) {
267 | w = 0;
268 | }
269 | return w;
270 | }
271 | }
272 |
--------------------------------------------------------------------------------
/src/com/app/lll/util/DensityUtils.java:
--------------------------------------------------------------------------------
1 | package com.app.lll.util;
2 |
3 | import android.content.Context;
4 | import android.util.TypedValue;
5 |
6 | /**
7 | * 常用单位转换的辅助类
8 | * @author liulongling
9 | *
10 | */
11 | public class DensityUtils
12 | {
13 | private DensityUtils()
14 | {
15 | /* cannot be instantiated */
16 | throw new UnsupportedOperationException("cannot be instantiated");
17 | }
18 |
19 | /**
20 | * dpתpx
21 | *
22 | * @param context
23 | * @param val
24 | * @return
25 | */
26 | public static int dp2px(Context context, float dpVal)
27 | {
28 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
29 | dpVal, context.getResources().getDisplayMetrics());
30 | }
31 |
32 | /**
33 | * spתpx
34 | *
35 | * @param context
36 | * @param val
37 | * @return
38 | */
39 | public static int sp2px(Context context, float spVal)
40 | {
41 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
42 | spVal, context.getResources().getDisplayMetrics());
43 | }
44 |
45 | /**
46 | * pxתdp
47 | *
48 | * @param context
49 | * @param pxVal
50 | * @return
51 | */
52 | public static float px2dp(Context context, float pxVal)
53 | {
54 | final float scale = context.getResources().getDisplayMetrics().density;
55 | return (pxVal / scale);
56 | }
57 |
58 | /**
59 | * pxתsp
60 | *
61 | * @param fontScale
62 | * @param pxVal
63 | * @return
64 | */
65 | public static float px2sp(Context context, float pxVal)
66 | {
67 | return (pxVal / context.getResources().getDisplayMetrics().scaledDensity);
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/src/com/app/lll/util/ScreenUtils.java:
--------------------------------------------------------------------------------
1 | package com.app.lll.util;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.graphics.Bitmap;
6 | import android.graphics.Rect;
7 | import android.util.DisplayMetrics;
8 | import android.view.View;
9 | import android.view.WindowManager;
10 |
11 | /**
12 | * 获得屏幕相关的辅助类
13 | * @author liulongling
14 | *
15 | */
16 | public class ScreenUtils
17 | {
18 | private ScreenUtils()
19 | {
20 | /* cannot be instantiated */
21 | throw new UnsupportedOperationException("cannot be instantiated");
22 | }
23 |
24 | /**
25 | * 获得屏幕高度
26 | *
27 | * @param context
28 | * @return
29 | */
30 | public static int getScreenWidth(Context context)
31 | {
32 | WindowManager wm = (WindowManager) context
33 | .getSystemService(Context.WINDOW_SERVICE);
34 | DisplayMetrics outMetrics = new DisplayMetrics();
35 | wm.getDefaultDisplay().getMetrics(outMetrics);
36 | return outMetrics.widthPixels;
37 | }
38 |
39 | /**
40 | * 获得屏幕宽度
41 | *
42 | * @param context
43 | * @return
44 | */
45 | public static int getScreenHeight(Context context)
46 | {
47 | WindowManager wm = (WindowManager) context
48 | .getSystemService(Context.WINDOW_SERVICE);
49 | DisplayMetrics outMetrics = new DisplayMetrics();
50 | wm.getDefaultDisplay().getMetrics(outMetrics);
51 | return outMetrics.heightPixels;
52 | }
53 |
54 | /**
55 | * 获得状态栏的高度
56 | *
57 | * @param context
58 | * @return
59 | */
60 | public static int getStatusHeight(Context context)
61 | {
62 |
63 | int statusHeight = -1;
64 | try
65 | {
66 | Class> clazz = Class.forName("com.android.internal.R$dimen");
67 | Object object = clazz.newInstance();
68 | int height = Integer.parseInt(clazz.getField("status_bar_height")
69 | .get(object).toString());
70 | statusHeight = context.getResources().getDimensionPixelSize(height);
71 | } catch (Exception e)
72 | {
73 | e.printStackTrace();
74 | }
75 | return statusHeight;
76 | }
77 |
78 | /**
79 | * 获取当前屏幕截图,包含状态栏
80 | *
81 | * @param activity
82 | * @return
83 | */
84 | public static Bitmap snapShotWithStatusBar(Activity activity)
85 | {
86 | View view = activity.getWindow().getDecorView();
87 | view.setDrawingCacheEnabled(true);
88 | view.buildDrawingCache();
89 | Bitmap bmp = view.getDrawingCache();
90 | int width = getScreenWidth(activity);
91 | int height = getScreenHeight(activity);
92 | Bitmap bp = null;
93 | bp = Bitmap.createBitmap(bmp, 0, 0, width, height);
94 | view.destroyDrawingCache();
95 | return bp;
96 |
97 | }
98 |
99 | /**
100 | * 获取当前屏幕截图,不包含状态栏
101 | *
102 | * @param activity
103 | * @return
104 | */
105 | public static Bitmap snapShotWithoutStatusBar(Activity activity)
106 | {
107 | View view = activity.getWindow().getDecorView();
108 | view.setDrawingCacheEnabled(true);
109 | view.buildDrawingCache();
110 | Bitmap bmp = view.getDrawingCache();
111 | Rect frame = new Rect();
112 | activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
113 | int statusBarHeight = frame.top;
114 |
115 | int width = getScreenWidth(activity);
116 | int height = getScreenHeight(activity);
117 | Bitmap bp = null;
118 | bp = Bitmap.createBitmap(bmp, 0, statusBarHeight, width, height
119 | - statusBarHeight);
120 | view.destroyDrawingCache();
121 | return bp;
122 |
123 | }
124 |
125 | }
126 |
--------------------------------------------------------------------------------
/src/com/app/lll/view/ScrollViewExtend.java:
--------------------------------------------------------------------------------
1 | package com.app.lll.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.GestureDetector;
6 | import android.view.MotionEvent;
7 | import android.widget.ScrollView;
8 |
9 | /**
10 | * 重写ScrollView 可以与手势事件共同使用
11 | * @author liulongling
12 | *
13 | */
14 | public class ScrollViewExtend extends ScrollView {
15 |
16 | GestureDetector gestureDetector;
17 |
18 | public ScrollViewExtend(Context context) {
19 | super(context);
20 | }
21 | public ScrollViewExtend(Context context, AttributeSet attrs) {
22 | super(context, attrs);
23 | }
24 | public ScrollViewExtend(Context context, AttributeSet attrs, int defStyle) {
25 | super(context, attrs, defStyle);
26 | }
27 | public void setGestureDetector(GestureDetector gestureDetector) {
28 | this.gestureDetector = gestureDetector;
29 | }
30 |
31 | public boolean onTouchEvent(MotionEvent ev) {
32 | super.onTouchEvent(ev);
33 | return gestureDetector.onTouchEvent(ev);
34 | }
35 |
36 | public boolean dispatchTouchEvent(MotionEvent ev){
37 | gestureDetector.onTouchEvent(ev);
38 | super.dispatchTouchEvent(ev);
39 | return true;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/com/lll/app/db/LessonDAO.java:
--------------------------------------------------------------------------------
1 | package com.lll.app.db;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import com.app.lll.bean.Lesson;
7 |
8 | public class LessonDAO {
9 |
10 | public static List getLessonsByYearAndMonth(int year, int month) {
11 | List lessons = new ArrayList();
12 |
13 | Lesson lesson = new Lesson();
14 | lesson.setId(1);
15 | lesson.setName("语文");
16 | lesson.setNum(1);
17 | lesson.setStatus(1);
18 | lesson.setLessonDate("2016-01-30 12:00");
19 | lesson.setsTime("12:00");
20 | lesson.seteTime("13:00");
21 | lessons.add(lesson);
22 |
23 | Lesson lesson1 = new Lesson();
24 | lesson1.setId(2);
25 | lesson1.setName("数学");
26 | lesson1.setNum(2);
27 | lesson1.setStatus(0);
28 | lesson1.setLessonDate("2016-01-31 15:00");
29 | lesson1.setsTime("15:00");
30 | lesson1.seteTime("16:00");
31 | lessons.add(lesson1);
32 |
33 | Lesson lesson2 = new Lesson();
34 | lesson2.setId(2);
35 | lesson2.setName("英语");
36 | lesson2.setNum(3);
37 | lesson2.setStatus(1);
38 | lesson2.setLessonDate("2016-01-28 08:00");
39 | lesson2.setsTime("08:00");
40 | lesson2.seteTime("09:00");
41 | lessons.add(lesson2);
42 | return lessons;
43 | }
44 |
45 | public static List getLessonsByDate(String string, String nextDay) {
46 | List lessons = new ArrayList();
47 |
48 | Lesson lesson = new Lesson();
49 | lesson.setId(1);
50 | lesson.setName("语文");
51 | lesson.setNum(1);
52 | lesson.setStatus(1);
53 | lesson.setLessonDate("2016-01-30 12:00");
54 | lesson.setsTime("12:00");
55 | lesson.seteTime("13:00");
56 | lessons.add(lesson);
57 |
58 | Lesson lesson1 = new Lesson();
59 | lesson1.setId(2);
60 | lesson1.setName("数学");
61 | lesson1.setNum(2);
62 | lesson1.setStatus(0);
63 | lesson1.setLessonDate("2016-01-31 15:00");
64 | lesson1.setsTime("15:00");
65 | lesson1.seteTime("16:00");
66 | lessons.add(lesson1);
67 |
68 | Lesson lesson2 = new Lesson();
69 | lesson2.setId(2);
70 | lesson2.setName("英语");
71 | lesson2.setNum(3);
72 | lesson2.setStatus(1);
73 | lesson2.setLessonDate("2016-01-28 08:00");
74 | lesson2.setsTime("08:00");
75 | lesson2.seteTime("09:00");
76 | lessons.add(lesson2);
77 | return lessons;
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------