shichaohui / EasyCalendar

Quickly customize the calendar UI. You can use EasyCalendar to quickly get the calendar style UI.
598 stars 72 forks source link

Change date text color and change DayViewDecorator #9

Closed droidstered closed 6 years ago

droidstered commented 6 years ago

I want to change the text color of date and also want to change day view background view like DayViewDecorator .

I have checked this library but there is no any specific method to do that.

So please give me some solution.

shichaohui commented 6 years ago

You can specific layout for day, or override the flagToday() and flagNotToday() functions of Adapter.

private class MyVagueAdapter extends VagueAdapter<Map<String, Map<String, Checkin>>> {

    /**
     * @params dateLayout layout resource id for date, must hava a TextView that's id is tv_day_of_month
     */
    MyVagueAdapter(@LayoutRes int dateLayout) {
        super(dateLayout);
    }

    @Override
    public void onBindVague(View itemView, int year, @Month int month, @DayOfMonth int dayOfMonth) {
        // do something, show custom data  
    }

    @Override
    public void flagToday(View todayView) {            
        // do something, set a flag for today's view
    }

    @Override
    public void flagNotToday(View dayView, Date date) {
       // do something, set a flag for not today's view
    }
}