- 设置自定义日期角标
- 农历切换
- 左右滑动切换上下周月,上下滑动切换周月模式
- 抽屉式周月切换效果
- 标记指定日期(marker)
- 跳转到指定日期
<com.android.calendarlibrary.CollapseCalendarView
android:id="@+id/calendar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
mManager = new CalendarManager(LocalDate.now(),
CalendarManager.State.MONTH,
LocalDate.now().withYear(100),
LocalDate.now().plusYears(100));
calendarView.init(mManager);
是否显示农历
calendarView.showChinaDay(true);
回到今天
calendarView.changeDate(LocalDate.now().toString());
周月切换
// TODO Auto-generated method stub
mManager.toggleView();
calendarView.populateLayout();
班排
calendarView.setArrayData(json);
calendarView.populateLayout();
月份切换监听器
mManager.setMonthChangeListener(new CalendarManager.OnMonthChangeListener() {
@Override
public void monthChange(String month, LocalDate mSelected) {
// TODO Auto-generated method stub
//Toast.makeText(MainActivity.this, month, Toast.LENGTH_SHORT).show();
}
});
日期选中监听器
calendarView.setDateSelectListener(new CollapseCalendarView.OnDateSelect() {
@Override
public void onDateSelected(LocalDate date) {
// Toast.makeText(MainActivity.this, date.toString(), Toast.LENGTH_SHORT).show();
}
});
安装 apk 文件预览效果,或者通过下面二维码去下载安装:
Copyright 2017 chenyongci
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.