Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
zfman committed Sep 3, 2018
2 parents a6b2c77 + 5d2f456 commit edabc15
Show file tree
Hide file tree
Showing 95 changed files with 21,604 additions and 62 deletions.
Binary file modified AndroidTimetableView/.idea/caches/build_file_checksums.ser
Binary file not shown.
4 changes: 2 additions & 2 deletions AndroidTimetableView/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AndroidTimetableView/TimetableView/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ publish {
repoName='Maven'
groupId = 'com.zhuangfei'//jcenter上的路径
artifactId = 'TimetableView'//项目名称
publishVersion = '2.0.3'//版本号
publishVersion = '2.0.4'//版本号
desc = 'A beautiful Android based curriculum schedule widget'//描述,不重要
website = 'https://github.com/zfman/TimetableView'//网站,不重要;尽量模拟github上的地址,例如我这样的;当然你有地址最好了
}
Original file line number Diff line number Diff line change
Expand Up @@ -263,48 +263,21 @@ public static List<Schedule> getAllSubjectsWithDay(List<Schedule> scheduleList,
*/
public static List<Schedule> findSubjects(Schedule subject, List<Schedule> data) {
List<Schedule> result = new ArrayList<>();
if(subject==null||data==null) return result;
for (int i = 0; i < data.size(); i++) {
Schedule bean = data.get(i);
if (bean.getStart() >= subject.getStart() && bean.getStart() < (subject.getStart() + subject.getStep()))
result.add(data.get(i));

}
return result;
}

/**
* 返回index处的课程,注意他的真实位置可能并不是index
*
* @param curWeek
* @return
*/
public static Schedule findRealSubject(int start, int curWeek, List<Schedule> scheduleList) {
List<Schedule> list = new ArrayList<>();
for (int i = 0; i < scheduleList.size(); i++) {
Schedule subject = scheduleList.get(i);
if (subject.getStart() == start) {
list.add(subject);
}
}

for (int i = 0; i < list.size(); i++) {
Schedule temp = list.get(i);
if (isThisWeek(temp, curWeek)) {
return temp;
}
}
if (list.size() > 0) return list.get(0);
return null;
}

/**
* 按照上课节次排序
*
* @param data
*/
public static void sortList(List<Schedule>[] data) {
int min;
Schedule tmp;
for (int i = 0; i < data.length; i++)
sortList(data[i]);
}
Expand Down Expand Up @@ -345,29 +318,11 @@ public static boolean isThisWeek(Schedule subject, int cur_week) {
* @return
*/
public static List<Schedule> fliterSchedule(List<Schedule> data, int curWeek, boolean isShowNotCurWeek) {
List<Schedule> filterData = new ArrayList<>();
if (data == null) return filterData;

if (isShowNotCurWeek) filterData = data;
else {
for (Schedule schedule : data) {
if (ScheduleSupport.isThisWeek(schedule, curWeek)) {
filterData.add(schedule);
}
}
}
if (data == null) return new ArrayList<>();
Set<Schedule> result = new HashSet<>();
for (int i = 0; i < filterData.size(); i++) {
Schedule s = filterData.get(i);
if (s != null) {
s.putExtras("zfman_count", 0);
}
}

if (data.size() >= 1) {
result.add(data.get(0));
}

for (int i = 1; i < data.size(); i++) {
Schedule s = data.get(i);
for (int j = 0; j < i; j++) {
Expand All @@ -378,11 +333,6 @@ public static List<Schedule> fliterSchedule(List<Schedule> data, int curWeek, bo
result.remove(s2);
result.add(s);
}
} else {
if (ScheduleSupport.isThisWeek(s, curWeek)) {
s.putExtras("zfman_count", (int) (s.getExtras().get("zfman_count")) + 1);
s2.putExtras("zfman_count", (int) (s2.getExtras().get("zfman_count")) + 1);
}
}
} else {
result.add(s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public void newSlideView(LinearLayout slidelayout) {
* @param curWeek 当前周
* @return View
*/
private View newItemView(final List<Schedule> data, final Schedule subject, Schedule pre, int i, int curWeek) {
private View newItemView(final List<Schedule> originData, final List<Schedule> data, final Schedule subject, Schedule pre, int i, int curWeek) {
//宽高
int width = LinearLayout.LayoutParams.MATCH_PARENT;
int height = mView.itemHeight() * subject.getStep() + mView.marTop() * (subject.getStep() - 1);
Expand Down Expand Up @@ -179,7 +179,14 @@ private View newItemView(final List<Schedule> data, final Schedule subject, Sche
gd.setColor(mView.colorPool().getColorAutoWithAlpha(subject.getColorRandom(), mView.itemAlpha()));
gd.setCornerRadius(mView.corner(true));

int count = (int) subject.getExtras().get("zfman_count");
List<Schedule> clist = ScheduleSupport.findSubjects(subject, originData);
int count =0;
if(clist!=null){
for(int k=0;k<clist.size();k++){
Schedule p=clist.get(k);
if(p!=null&&ScheduleSupport.isThisWeek(p,curWeek)) count++;
}
}
if (count > 1) {
countTextView.setVisibility(View.VISIBLE);
countTextView.setText(count + "");
Expand All @@ -196,7 +203,7 @@ private View newItemView(final List<Schedule> data, final Schedule subject, Sche
textView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
List<Schedule> result = ScheduleSupport.findSubjects(subject, data);
List<Schedule> result = ScheduleSupport.findSubjects(subject, originData);
mView.onItemClickListener().onItemClick(v, result);
}
});
Expand Down Expand Up @@ -229,7 +236,7 @@ private void addToLayout(LinearLayout layout, final List<Schedule> data, int cur
layout.setTag(filter.size());
for (int i = 0; i < filter.size(); i++) {
final Schedule subject = filter.get(i);
View view = newItemView(filter, subject, pre, i, curWeek);
View view = newItemView(data,filter, subject, pre, i, curWeek);
if (view != null) {
layout.addView(view);
pre = subject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ private void initView() {
*/
@Override
public WeekView showView() {
if(curWeek<1) curWeek(1);
if(curWeek>itemCount()) curWeek=itemCount;

container.removeAllViews();
layouts=new ArrayList<>();
textViews=new ArrayList<>();
Expand Down
Binary file modified AndroidTimetableView/app/release/app-release.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void onClick(DialogInterface dialog, int which) {
protected void display(List<Schedule> beans) {
String str = "";
for (Schedule bean : beans) {
str += bean.getName() + "";
str += bean.getName() + ","+bean.getWeekList().toString()+","+bean.getStart()+","+bean.getStep()+"\n";
}
Toast.makeText(this, str, Toast.LENGTH_SHORT).show();
}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
> 你将了解到该控件用法的方方面面,点击`快速开始`按钮体验吧
- [快速开始](https://github.com/zfman/TimetableView/wiki/%E6%9C%80%E6%96%B0%E6%96%87%E6%A1%A3)
- [Javadocs](http://www.liuzhuangfei.com/github/timetableview/docs/v2.0.3/)
- [示例app下载](https://raw.githubusercontent.com/zfman/TimetableView/master/apks/v2.0.3.apk)
- [Javadocs](http://www.liuzhuangfei.com/github/timetableview/docs/v2.0.4/)
- [示例app下载](https://raw.githubusercontent.com/zfman/TimetableView/master/apks/v2.0.4.apk)
- [变更历史](https://github.com/zfman/TimetableView/wiki/%E7%89%88%E6%9C%AC%E8%AF%B4%E6%98%8E)

历史版本的文档可以在 [历史文档以及源码结构分析](https://github.com/zfman/TimetableView/wiki) 中找到
Expand Down
Binary file added apks/v2.0.4.apk
Binary file not shown.
55 changes: 55 additions & 0 deletions docs/v2.0.4/allclasses-frame.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Mon Sep 03 11:16:35 CST 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>所有类</title>
<meta name="date" content="2018-09-03">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<h1 class="bar">所有类</h1>
<div class="indexContainer">
<ul>
<li><a href="com/zhuangfei/timetable/operater/AbsOperater.html" title="com.zhuangfei.timetable.operater中的类" target="classFrame">AbsOperater</a></li>
<li><a href="com/zhuangfei/timetable/utils/ColorUtils.html" title="com.zhuangfei.timetable.utils中的类" target="classFrame">ColorUtils</a></li>
<li><a href="com/zhuangfei/timetable/listener/ISchedule.html" title="com.zhuangfei.timetable.listener中的接口" target="classFrame"><span class="interfaceName">ISchedule</span></a></li>
<li><a href="com/zhuangfei/timetable/listener/ISchedule.OnDateBuildListener.html" title="com.zhuangfei.timetable.listener中的接口" target="classFrame"><span class="interfaceName">ISchedule.OnDateBuildListener</span></a></li>
<li><a href="com/zhuangfei/timetable/listener/ISchedule.OnFlaglayoutClickListener.html" title="com.zhuangfei.timetable.listener中的接口" target="classFrame"><span class="interfaceName">ISchedule.OnFlaglayoutClickListener</span></a></li>
<li><a href="com/zhuangfei/timetable/listener/ISchedule.OnItemBuildListener.html" title="com.zhuangfei.timetable.listener中的接口" target="classFrame"><span class="interfaceName">ISchedule.OnItemBuildListener</span></a></li>
<li><a href="com/zhuangfei/timetable/listener/ISchedule.OnItemClickListener.html" title="com.zhuangfei.timetable.listener中的接口" target="classFrame"><span class="interfaceName">ISchedule.OnItemClickListener</span></a></li>
<li><a href="com/zhuangfei/timetable/listener/ISchedule.OnItemLongClickListener.html" title="com.zhuangfei.timetable.listener中的接口" target="classFrame"><span class="interfaceName">ISchedule.OnItemLongClickListener</span></a></li>
<li><a href="com/zhuangfei/timetable/listener/ISchedule.OnScrollViewBuildListener.html" title="com.zhuangfei.timetable.listener中的接口" target="classFrame"><span class="interfaceName">ISchedule.OnScrollViewBuildListener</span></a></li>
<li><a href="com/zhuangfei/timetable/listener/ISchedule.OnSlideBuildListener.html" title="com.zhuangfei.timetable.listener中的接口" target="classFrame"><span class="interfaceName">ISchedule.OnSlideBuildListener</span></a></li>
<li><a href="com/zhuangfei/timetable/listener/ISchedule.OnSpaceItemClickListener.html" title="com.zhuangfei.timetable.listener中的接口" target="classFrame"><span class="interfaceName">ISchedule.OnSpaceItemClickListener</span></a></li>
<li><a href="com/zhuangfei/timetable/listener/ISchedule.OnWeekChangedListener.html" title="com.zhuangfei.timetable.listener中的接口" target="classFrame"><span class="interfaceName">ISchedule.OnWeekChangedListener</span></a></li>
<li><a href="com/zhuangfei/timetable/listener/IWeekView.html" title="com.zhuangfei.timetable.listener中的接口" target="classFrame"><span class="interfaceName">IWeekView</span></a></li>
<li><a href="com/zhuangfei/timetable/listener/IWeekView.OnWeekItemClickedListener.html" title="com.zhuangfei.timetable.listener中的接口" target="classFrame"><span class="interfaceName">IWeekView.OnWeekItemClickedListener</span></a></li>
<li><a href="com/zhuangfei/timetable/listener/IWeekView.OnWeekLeftClickedListener.html" title="com.zhuangfei.timetable.listener中的接口" target="classFrame"><span class="interfaceName">IWeekView.OnWeekLeftClickedListener</span></a></li>
<li><a href="com/zhuangfei/timetable/listener/OnDateBuildAapter.html" title="com.zhuangfei.timetable.listener中的类" target="classFrame">OnDateBuildAapter</a></li>
<li><a href="com/zhuangfei/timetable/listener/OnFlaglayoutClickAdapter.html" title="com.zhuangfei.timetable.listener中的类" target="classFrame">OnFlaglayoutClickAdapter</a></li>
<li><a href="com/zhuangfei/timetable/listener/OnItemBuildAdapter.html" title="com.zhuangfei.timetable.listener中的类" target="classFrame">OnItemBuildAdapter</a></li>
<li><a href="com/zhuangfei/timetable/listener/OnItemClickAdapter.html" title="com.zhuangfei.timetable.listener中的类" target="classFrame">OnItemClickAdapter</a></li>
<li><a href="com/zhuangfei/timetable/listener/OnItemLongClickAdapter.html" title="com.zhuangfei.timetable.listener中的类" target="classFrame">OnItemLongClickAdapter</a></li>
<li><a href="com/zhuangfei/timetable/listener/OnScrollViewBuildAdapter.html" title="com.zhuangfei.timetable.listener中的类" target="classFrame">OnScrollViewBuildAdapter</a></li>
<li><a href="com/zhuangfei/timetable/listener/OnSlideBuildAdapter.html" title="com.zhuangfei.timetable.listener中的类" target="classFrame">OnSlideBuildAdapter</a></li>
<li><a href="com/zhuangfei/timetable/listener/OnSpaceItemClickAdapter.html" title="com.zhuangfei.timetable.listener中的类" target="classFrame">OnSpaceItemClickAdapter</a></li>
<li><a href="com/zhuangfei/timetable/listener/OnWeekChangedAdapter.html" title="com.zhuangfei.timetable.listener中的类" target="classFrame">OnWeekChangedAdapter</a></li>
<li><a href="com/zhuangfei/timetable/listener/OnWeekItemClickedAdapter.html" title="com.zhuangfei.timetable.listener中的类" target="classFrame">OnWeekItemClickedAdapter</a></li>
<li><a href="com/zhuangfei/timetable/listener/OnWeekLeftClickedAdapter.html" title="com.zhuangfei.timetable.listener中的类" target="classFrame">OnWeekLeftClickedAdapter</a></li>
<li><a href="com/zhuangfei/timetable/view/PerWeekView.html" title="com.zhuangfei.timetable.view中的类" target="classFrame">PerWeekView</a></li>
<li><a href="com/zhuangfei/timetable/model/Schedule.html" title="com.zhuangfei.timetable.model中的类" target="classFrame">Schedule</a></li>
<li><a href="com/zhuangfei/timetable/model/ScheduleColorPool.html" title="com.zhuangfei.timetable.model中的类" target="classFrame">ScheduleColorPool</a></li>
<li><a href="com/zhuangfei/timetable/model/ScheduleEnable.html" title="com.zhuangfei.timetable.model中的接口" target="classFrame"><span class="interfaceName">ScheduleEnable</span></a></li>
<li><a href="com/zhuangfei/timetable/model/ScheduleSupport.html" title="com.zhuangfei.timetable.model中的类" target="classFrame">ScheduleSupport</a></li>
<li><a href="com/zhuangfei/timetable/utils/ScreenUtils.html" title="com.zhuangfei.timetable.utils中的类" target="classFrame">ScreenUtils</a></li>
<li><a href="com/zhuangfei/timetable/operater/SimpleOperater.html" title="com.zhuangfei.timetable.operater中的类" target="classFrame">SimpleOperater</a></li>
<li><a href="com/zhuangfei/timetable/TimetableView.html" title="com.zhuangfei.timetable中的类" target="classFrame">TimetableView</a></li>
<li><a href="com/zhuangfei/timetable/view/WeekView.html" title="com.zhuangfei.timetable.view中的类" target="classFrame">WeekView</a></li>
<li><a href="com/zhuangfei/timetable/model/WeekViewEnable.html" title="com.zhuangfei.timetable.model中的接口" target="classFrame"><span class="interfaceName">WeekViewEnable</span></a></li>
</ul>
</div>
</body>
</html>
Loading

0 comments on commit edabc15

Please sign in to comment.