Giter Site home page Giter Site logo

indicator issue about compactcalendarview HOT 9 CLOSED

sundeepk avatar sundeepk commented on July 29, 2024
indicator issue

from compactcalendarview.

Comments (9)

SundeepK avatar SundeepK commented on July 29, 2024

Are you talking about event indicator in the sample? There is a line in the code which removes the event on day click:

https://github.com/SundeepK/CompactCalendarView/blob/master/sample/src/main/java/sundeepk/github/com/sample/MainActivity.java#L80

This has the effect of removing the event from the calendar so it will no longer display it.

from compactcalendarview.

bij-ace avatar bij-ace commented on July 29, 2024

i want it to be removed when that date is selected but i want it to reappear when i click other date

from compactcalendarview.

SundeepK avatar SundeepK commented on July 29, 2024

Then delete that line in the sample code. It will no longer remove the event from the calendar.

from compactcalendarview.

bij-ace avatar bij-ace commented on July 29, 2024

yes but is there any way to hide the indicator only when it is selected, then on clicking other day it will be visible again?

from compactcalendarview.

SundeepK avatar SundeepK commented on July 29, 2024

Sorry I don't quite understand. Lets start from the beginning. What is it exactly you need to do?

There are 3 types of indicators. No. 1 indicator for events (small circle below day in the sample). No. 2 indicator for the current day (dark red in sample) and No. 3 indicator for currently selected day (light red in sample).

Which one of these do you want to show when an event is selected?

The calendar will draw the light red circle when ever you select a day except when you select the current day (No. 2 dark circle) even if there is an event indicator.

from compactcalendarview.

bij-ace avatar bij-ace commented on July 29, 2024

im talking about the small one for events (ie No. 1). initailly when the sample code is executed they are shown. but when i click on the date which has event, the small indicator disappears on that particular date and when i click on other date it never appears again on that date. so is there any way to make the small indicator appear on that date again when i choose other date?

from compactcalendarview.

bij-ace avatar bij-ace commented on July 29, 2024

i solved it by adding addEvents(compactCalendarView); like this:

@OverRide
public void onDayClick(Date dateClicked) {
date.setText(dateFormatForMonth.format(dateClicked));
List bookingsFromMap = bookings.get(dateClicked);
mutableBookings.clear();
if(bookingsFromMap != null){
Log.d("MainActivity", bookingsFromMap.toString());
for(Booking booking : bookingsFromMap){
mutableBookings.add(booking.title);
}
}
addEvents(compactCalendarView);
compactCalendarView.removeEvent(new CalendarDayEvent(dateClicked.getTime(), Color.argb(255, 169, 68, 65)), true);
adapter.notifyDataSetChanged();
}

sorry for all the trouble and thanks :)

from compactcalendarview.

SundeepK avatar SundeepK commented on July 29, 2024

Are you running the sample code? This seems to be working fine for me as long as you delete/comment out line 80 in the MainActvitiy class.

from compactcalendarview.

SundeepK avatar SundeepK commented on July 29, 2024

Yep thats the line which removes events. I'm going to remove that line from the MainAcitivty to get rid of any confusion :).

Thanks.

from compactcalendarview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.