Closed ArunVicky001 closed 5 years ago
The calendar_bg_selector resource is a state selector file which has different colors for different states, For your case you can create two different selector files and pass them in xml as an attr app:tsquare_dayBackground to your calendarpicker views Please have a look at calendar_bg_selector.xml from rangepicker module to create your own custom selector files
Thanks you very much for your library and support, I have solved this issues with different selector_bg.xml and made changes in this method in @Override public View getView(int position, View convertView, ViewGroup parent) {
based on my condition now its working perfect.
Happy to help 👍
In my case I have two different calendar when I click the first calendar the months name and selected date colour should be blue and when I click the second calendar the months name and selected date colour should be displayed in orange colour.
I have checked your library below two lines are responsible for the months name and selected date colour, also i have prepared two different drawable file showing the colours
dayBackgroundResId = a.getResourceId(R.styleable.CalendarPickerView_tsquare_dayBackground, R.drawable.calendar_bg_selector); titleTextColor = a.getColor(R.styleable.CalendarPickerView_tsquare_titleTextColor, res.getColor(R.color.dateTimeRangePickerTitleTextColor));
So I have created the separate method for call this CalendarPickerView
CalendarPickerView(Context context, AttributeSet attrs)
during the runtime I am passing the boolean value based on the value different colour has been assigned to the
dayBackgroundResId
andtitleTextColor
like below,the method is calling fine in the runtime but the colour is not changing to the month name and selected date.
Could you please tell me how to achieve my requirement ?
Thanks.