Material-calendarview: Custom day view

Created on 21 May 2016  路  10Comments  路  Source: prolificinteractive/material-calendarview

I need a CalendarView like this:

| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| --- | --- | --- | --- | --- | --- | --- |
| 1 (Aother TextView) | 2 (Aother TextView) | 3 (Aother TextView) | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 5 | 6 | 7 |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |

So,could I custom day view?
It should be like this:

calendarView.setDayViewProvider(new DayViewProvider(){
    View getDayView(CalendarDay calendarDay){
        return Inflate.from(XxxActivity.this).inflate(xxx,R.layout.xxxx);
    }

    void onSelected(View view){
        ((MyDayView)view).xxxDosomething(....)
        ...
    }

    void onDiselected(...){...}
    void onXxxxxx(){...}
    ...
});
enhancement

Most helpful comment

Hi is there any to customise the date label gravity? currently its centre

All 10 comments

I seed #136,it that usable?

@dyguests I haven't tried it but you should be able to if it's merged. Let me know if you are having trouble implementing it, I'll help you out.

No updates on this, I will close it out. Feel free to reopen if you have more questions about this

After reading #136, I would like to know how to use setDayViewProvider()?
I just added a dependency to the project with version 1.4.0, but cannot find this method. Do I need to clone directly from other branches?

@WilsonHoHK , get branch from Laces (#136)

https://github.com/Laces/material-calendarview

It will be easier a lot if it's merged to master. Anyway, thanks @dyguests

Seems like #136 got lost down the road. i reopen this issue, it might be implemented in the future but it's not on the roadmap.

Hi is there any to customise the date label gravity? currently its centre

Would also like to be able to move the day label to the top instead of center. Is this possible?

do you have people solution this question?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

damianflannery picture damianflannery  路  4Comments

broakenmedia picture broakenmedia  路  5Comments

vincent-etienne picture vincent-etienne  路  7Comments

yuanliu666 picture yuanliu666  路  4Comments

chuks picture chuks  路  6Comments