SpongeBobSun / mCalendarView

Customizable & Shrinkable Calendar Widget for Android
Apache License 2.0
243 stars 73 forks source link

How to set ExpCalendarView default to ShrinkView #31

Open htooaunghlaing opened 7 years ago

htooaunghlaing commented 7 years ago

Hi Developer,

How can I set 1.ExpCalendarView default to ShrinkView ( WeekView ) 2.Set DateCellView background to custom drawable or any color. 3.Set MinDate or Max Date. (Disable previous days to select). Can you please advise. Thanks.

htooaunghlaing commented 7 years ago

To get ShrinkView as default, it is OK with this,

CellConfig.Month2WeekPos = CellConfig.middlePosition; CellConfig.ifMonth = false; expandIV.setImageResource(R.mipmap.icon_arrow_down); expCalendarView.shrink();

mBigFlower commented 7 years ago

Hello,

For the second question.

DateCellView is just extend the LinearLayout, so you can set its background or backgroundcolor easily.

and the third.

You can detect it when you click the date, for example: In the class: CalendarExpAdapter.class

((BaseCellView) ret).setDate(dayData.getDate()); if (OnDateClickListener.instance != null) { ((BaseCellView) ret).setOnDateClickListener(OnDateClickListener.instance); }

you can compare the dayData.getDate() with your minDate or MaxDate, then decide if the ret need the OnDateClickListener

Hope these above can help you .