Skip to content

Instantly share code, notes, and snippets.

@cutiko
Created November 18, 2016 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cutiko/eb1a974ebf7761068ab982b7bbfeb7a5 to your computer and use it in GitHub Desktop.
Save cutiko/eb1a974ebf7761068ab982b7bbfeb7a5 to your computer and use it in GitHub Desktop.
CompactCalendarView
//This lines should help you
@Override
public void onDayClick(Date dateClicked) {
if (today == dateClicked) {
compactCalendarView.setCurrentDayBackgroundColor(ContextCompat.getColor(getContext(), R.color.colorAccent));
} else {
compactCalendarView.setCurrentDayBackgroundColor(ContextCompat.getColor(getContext(), R.color.colorGray));
}
}
@Override
public void onMonthScroll(Date firstDayOfNewMonth) {
//Set the date to a sort of title textview above the view
DateTime month = new DateTime(firstDayOfNewMonth);
monthTv.setText(month.toString("MMMM").toUpperCase());
compactCalendarView.setCurrentDayBackgroundColor(ContextCompat.getColor(getContext(), R.color.colorGray));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment