Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar committed Dec 21, 2017
1 parent 7a577eb commit 46e7dce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,19 @@ protected void onCreate(Bundle savedInstanceState) {
// }
// }).init();

DateBean d = calendarView.getSingleDate();

title.setText(d.getSolar()[0] + "年" + d.getSolar()[1] + "月" + d.getSolar()[2] + "日");
title.setText("2017年11月");

calendarView.setOnPagerChangeListener(new OnPagerChangeListener() {
@Override
public void onPagerChanged(int[] date) {
title.setText(date[0] + "年" + date[1] + "月" + date[2] + "日");
title.setText(date[0] + "年" + date[1] + "月");
}
});

calendarView.setOnSingleChooseListener(new OnSingleChooseListener() {
@Override
public void onSingleChoose(View view, DateBean date) {
title.setText(date.getSolar()[0] + "年" + date.getSolar()[1] + "月" + date.getSolar()[2] + "日");
title.setText(date.getSolar()[0] + "年" + date.getSolar()[1] + "月");
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ public void setDateList(List<DateBean> dates, int currentMonthDays) {

//设置禁用日期
if (date.getType() == 1) {
view.setTag(date.getSolar()[2]);
view.setTag(date.getSolar()[2]);
if (mAttrsBean.getDisableStartDate() != null
&& (date.getSolar()[0] < mAttrsBean.getDisableStartDate()[0]
Expand Down Expand Up @@ -225,13 +224,17 @@ public void onClick(View v) {
}
}
} else if (date.getType() == 0) {//点击上月
calendarView.setLastClickDay(day);
if (mAttrsBean.isSwitchChoose()) {
calendarView.setLastClickDay(day);
}
calendarView.lastMonth();
if (clickListener != null) {
clickListener.onSingleChoose(v, date);
}
} else if (date.getType() == 2) {//点击下月
calendarView.setLastClickDay(day);
if (mAttrsBean.isSwitchChoose()) {
calendarView.setLastClickDay(day);
}
calendarView.nextMonth();
if (clickListener != null) {
clickListener.onSingleChoose(v, date);
Expand Down

0 comments on commit 46e7dce

Please sign in to comment.