CompactCalendarView
CompactCalendarView copied to clipboard
Today and selected date circle color hide EventIndicator
Today and selected date circle color hide EventIndicator so i can't see current date EventIndicator dot's
Have you tried this method? https://github.com/SundeepK/CompactCalendarView/blob/master/library/src/main/java/com/github/sundeepk/compactcalendarview/CompactCalendarView.java#L164
Set calendar.shouldDrawIndicatorsBelowSelectedDays(true) to true. This will draw dots below selected days with large circles around them.
not working..
for (int i = 0; i < scheduleList.size(); i++) {
compactcalendarView.addEvent(new Event(Color.parseColor(scheduleList.get(i).getColor()), Long.parseLong(scheduleList.get(i).getStartTimestamp() + "000")));
Log.i(TAG, "onResponse DATES: " + CommonMethod.getDateAndTimeCurrentTimeZone(Long.parseLong(scheduleList.get(i).getStartTimestamp())));
Log.i(TAG, "onResponse DATES: " + scheduleList.get(i).getJobId());
}
Date date = compactcalendarView.getFirstDayOfCurrentMonth();
displayMonth.setText(DateFormat.format("MMM", date) + ", " + DateFormat.format("yyyy", date));
displayTotalJob.setText("(You have " + compactcalendarView.getEventsForMonth(date).size() + " Jobs This Month)");
final ScheduleListAdapter adapter = new ScheduleListAdapter(json.getResult(), context, clickListener);
Calendar now = Calendar.getInstance();
adapter.getFilter().filter(String.valueOf(DateFormat.format("dd", now) + " " + DateFormat.format("MMM", now) + " " + DateFormat.format("yyyy", now)));
Log.i(TAG, "onResponse: Today " + DateFormat.format("dd", now) + " " + DateFormat.format("MMM", now) + " " + DateFormat.format("yyyy", now));
compactcalendarView.setListener(new CompactCalendarView.CompactCalendarViewListener() {
@Override
public void onDayClick(Date dateClicked) {
List<Event> events = compactcalendarView.getEvents(dateClicked);
adapter.getFilter().filter(String.valueOf(DateFormat.format("dd", dateClicked) + " " + DateFormat.format("MMM", dateClicked) + " " + DateFormat.format("yyyy", dateClicked)));
Log.d(TAG, "Day was clicked: " + dateClicked + " with events " + events);
}
@Override
public void onMonthScroll(Date firstDayOfNewMonth) {
Date date = compactcalendarView.getFirstDayOfCurrentMonth();
displayMonth.setText(DateFormat.format("MMM", date) + ", " + DateFormat.format("yyyy", date));
displayTotalJob.setText("(You have " + compactcalendarView.getEventsForMonth(date).size() + " Jobs This Month)");
adapter.getFilter().filter(DateFormat.format("MMM", date) + " " + DateFormat.format("yyyy", date));
Log.d(TAG, "Month was scrolled to: " + firstDayOfNewMonth.getMonth() + ", " + firstDayOfNewMonth.getYear());
}
});
list.setAdapter(adapter);
compactcalendarView.shouldDrawIndicatorsBelowSelectedDays(false);
Ok, maybe I miss understood. Is this what you want? https://cloud.githubusercontent.com/assets/3941281/19624368/fd24ac36-9910-11e6-84b8-3a6e1bc5ff15.png
If so, then you need to call compactcalendarView.shouldDrawIndicatorsBelowSelectedDays(true); Let me know if you have something else in mind.
calendarView.setCurrentDayBackgroundColor(Color.BLUE);
calendarView.setCurrentDayIndicatorStyle(CompactCalendarView.FILL_LARGE_INDICATOR);
calendarView.setCurrentSelectedDayBackgroundColor(Color.GREEN);
calendarView.setCurrentSelectedDayIndicatorStyle(CompactCalendarView.FILL_LARGE_INDICATOR);
calendarView.setEventIndicatorStyle(CompactCalendarView.FILL_LARGE_INDICATOR);
calendarView.addEvent(new Event(Color.RED, 1541572467000L, "test"));
I'm not sure if this is what OP means, but it seems that events are drawn at the bottom of the hierarchy. from bottom to top: Event, Current Date, Selected Date. It would be nice to be able to control that hierarchy some how.
Thank you, @SundeepK Working
I lost the dots when I move from one fragment to another. Current month always selected and has the dots but when I changed the month and back from another fragment than lost the dots.
compactcalendarView.shouldDrawIndicatorsBelowSelectedDays(true); this line could not help