huanghaibin-dev / CalendarView

Android上一个优雅、万能自定义UI、仿iOS、支持垂直、水平方向切换、支持周视图、自定义周起始、性能高效的日历控件,支持热插拔实现的UI定制!支持标记、自定义颜色、农历、自定义月视图各种显示模式等。Canvas绘制,速度快、占用内存低,你真的想不到日历居然还可以如此优雅!An elegant, highly customized and high-performance Calendar Widget on Android.
Apache License 2.0
9.04k stars 1.78k forks source link

月份变化,获取当前选中日子的星期有误 #705

Open RealMoMo opened 3 years ago

RealMoMo commented 3 years ago

<com.haibin.calendarview.CalendarView android:id="@+id/calendarView" android:layout_width="match_parent" android:layout_height="@dimen/calendar_view_width" app:calendar_padding="10dp" app:current_day_lunar_text_color="#ff0000" app:current_day_text_color="#ff0000" app:current_month_lunar_text_color="#CFCFCF" app:current_month_text_color="#333333" app:lunar_text_size="10sp" app:max_year="2050" app:max_year_day="31" app:max_year_month="12" app:min_year="2008" app:min_year_day="1" app:min_year_month="1" app:month_view="xxxxxxx" app:month_view_auto_select_day="last_select_day_ignore_current" app:month_view_show_mode="mode_only_current" app:other_month_lunar_text_color="#e1e1e1" app:other_month_text_color="#e1e1e1" app:scheme_lunar_text_color="#CFCFCF" app:scheme_text="假" app:scheme_text_color="#333" app:scheme_theme_color="#128c4b" app:selected_lunar_text_color="#128c4b" app:selected_text_color="#FFFFFF" app:selected_theme_color="#1F98F8" />

override fun onMonthChange(year: Int, month: Int) {

    updateScheduleDayInfo(year,month,calendarView.selectedCalendar.day,calendarView.selectedCalendar.week)
}

//calendarView.selectedCalendar.week 月份切换星期数有变化,但不对

RealMoMo commented 3 years ago

加了延迟获取才正常