APISonar


com.sch.calendar.entity.Date.Date

> com > sch > calendar > entity > Date > Date
com APIs sch APIs calendar APIs entity APIs Date APIs Date APIs

Example 1
private void handleNormalDate(Date today, View itemView, int index) {
        itemView.setVisibility(VISIBLE); // show item view of date that is a part of current month
        int dayOfMonth = index - firstWeekOfMonth + 1;
        // bind date and custom data
        vagueAdapter.onBindDate(itemView, year, month, dayOfMonth);
        vagueAdapter.onBindVague(itemView, year, month, dayOfMonth);
        if (dayOfMonth == today.getDayOfMonth() && month == today.getMonth() && year == today.getYear()) {
            vagueAdapter.flagToday(itemView); // set flag for today
        } else {
            vagueAdapter.flagNotToday(itemView, new Date(year, month, dayOfMonth)); // set flag for date except today
        }
    }
Example 2
public void setVagueAdapter(VagueAdapter vagueAdapter) {
        this.vagueAdapter = vagueAdapter;
        vagueAdapter.addOnVagueDataSetChangeListener(new OnVagueDataSetChangeListener() {
            @Override
            public void onVagueDataSetChange() {
                notifyDataSetChanged();
            }

            @Override
            public void onVagueDataSetChange(int year, @Month int month) {
                notifyItemChanged(dateList.indexOf(new Date(year, month, 1)));
            }
        });
    }
Example 3
private void handleEndOverflowDate(View itemView, int index) {
        // hide or show item view of date that isn't a part of current month
        itemView.setVisibility(showOverflowDate ? VISIBLE : INVISIBLE);
        Date nextMonth = DateUtil.nextMonth(new Date(year, month, 1));
        int dayOfMonth = index - dayCountOfMonth - firstWeekOfMonth + 1;
        // bind date and custom data
        vagueAdapter.onBindEndOverflowDate(itemView, nextMonth.getYear(), nextMonth.getMonth(), dayOfMonth);
        vagueAdapter.onBindVagueOfEndOverflowDate(itemView, nextMonth.getYear(), nextMonth.getMonth(), dayOfMonth);
    }
Example 4
private void handleStartOverflowDate(View itemView, int index) {
        // hide or show item view of date that isn't a part of current month
        itemView.setVisibility(showOverflowDate ? VISIBLE : INVISIBLE);
        Date lastMonth = DateUtil.lastMonth(new Date(year, month, 1));
        int dayOfMonth = DateUtil.getDayCountOfMonth(lastMonth) + index - firstWeekOfMonth + 1;
        // bind date and custom data
        vagueAdapter.onBindStartOverflowDate(itemView, lastMonth.getYear(), lastMonth.getMonth(), dayOfMonth);
        vagueAdapter.onBindVagueOfStartOverflowDate(itemView, lastMonth.getYear(), lastMonth.getMonth(), dayOfMonth);
    }