小编Sha*_* GN的帖子

在 Android 多产材料日历视图中的日期下方添加多个点指示器

我已经在我的 Android 应用程序中使用 Android 多产材料 CalendarView 外部库实现了 CalendarView。现在,我必须在某些日期下方添加多个点指示器,以指示每个日期中的事件数量。我尝试过,但只在日期下方得到一个点。请帮忙

这是我的日历片段和装饰器类:

public class CalendarFragment extends Fragment {
    private View v;
    private List<Schedule> schedules = new ArrayList<Schedule>( );
    private MaterialCalendarView calendarView;

    public CalendarFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        try {
        v = inflater.inflate(R.layout.fragment_calendar, container, false);
        initViews();
        schedules = ScheduleDAO.getInstance().getScheduleListWithId();
            highlightDates(schedules);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return v;
    }

    private void highlightDates(List<Schedule>scheduleList) throws ParseException {
        for (int position = 0;position<scheduleList.size();position++)
        {
            Schedule schedule = scheduleList.get(position); …
Run Code Online (Sandbox Code Playgroud)

android android-layout android-fragments

5
推荐指数
1
解决办法
5166
查看次数