|
|
@@ -433,12 +433,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener, Wo
|
|
|
c.setTime(curDate);
|
|
|
int day = c.get(Calendar.DAY_OF_MONTH);
|
|
|
calendarView = pagerAdapter.getmViews().get(position);
|
|
|
- calendarView.setDateListener(new OACalendarView.OnSelectDateListener() {
|
|
|
- @Override
|
|
|
- public void result(Date date) {
|
|
|
- setClickDay(date);
|
|
|
- }
|
|
|
- });
|
|
|
+ setCalenderOnClicklistener();
|
|
|
posItem = position;
|
|
|
calendarView.setDownIndex(day);
|
|
|
curDate = calendarView.getDownDate();
|
|
|
@@ -609,7 +604,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener, Wo
|
|
|
private void loadSuccess() {//下拉成功后添加到适配器
|
|
|
setAdapterBeans();
|
|
|
setDateToListener(isMe ? meInt : otherInt);
|
|
|
-
|
|
|
+ setCalenderOnClicklistener();
|
|
|
}
|
|
|
|
|
|
private void setAdapterBeans() {
|
|
|
@@ -649,20 +644,6 @@ public class OAActivity extends BaseActivity implements View.OnClickListener, Wo
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 通过JSONObject获取开始时间,用于筛选
|
|
|
- *
|
|
|
- * @param object
|
|
|
- * @return
|
|
|
- */
|
|
|
- private long getTimeForObject(JSONObject object) {
|
|
|
- if (isB2b) {
|
|
|
- return OACheckUtil.getJsonLong(object, "mp_visittime", "mpd_arrivedate", "recorddate", "vr_startdate", "vr_enddate");
|
|
|
- }
|
|
|
- return TimeUtils.f_str_2_long(OACheckUtil.getJson2Text(object, "startdate", "vr_visittime", "mpd_arrivedate"));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
//弹出菜单
|
|
|
private PopupWindow popupWindow = null;
|
|
|
|
|
|
@@ -904,10 +885,27 @@ public class OAActivity extends BaseActivity implements View.OnClickListener, Wo
|
|
|
}
|
|
|
|
|
|
public void setDateToListener(Set<Integer> in) {
|
|
|
- if (calendarView == null) {
|
|
|
+ OACalendarView calendarView = getCalendarView();
|
|
|
+ if (calendarView != null)
|
|
|
+ calendarView.setDecoratDays(in);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setCalenderOnClicklistener() {
|
|
|
+ OACalendarView calendarView = getCalendarView();
|
|
|
+ if (calendarView != null)
|
|
|
+ calendarView.setDateListener(new OACalendarView.OnSelectDateListener() {
|
|
|
+ @Override
|
|
|
+ public void result(Date date) {
|
|
|
+ setClickDay(date);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ private OACalendarView getCalendarView() {
|
|
|
+ if (calendarView == null && pagerAdapter != null && pagerAdapter.getmViews() != null) {
|
|
|
calendarView = pagerAdapter.getmViews().get(posItem);
|
|
|
}
|
|
|
- calendarView.setDecoratDays(in);
|
|
|
+ return calendarView;
|
|
|
}
|
|
|
|
|
|
@Override
|