roomorama / Caldroid

A better calendar for Android
Other
1.42k stars 532 forks source link

Adding Text to events #468

Open FajarKhan opened 6 years ago

FajarKhan commented 6 years ago

I am able to show events with different color. Like this:

caldroidFragment.setBackgroundDrawableForDate(blue, Date);

But I also wants to add some text in date or lets say when pressing that date shows name of event in a toast message (or both). Is there anything am i missing? is this library support this?

groomefyvik commented 6 years ago

@FajarKhan have you tried anything ? I am also looking for same type of customization.

FajarKhan commented 6 years ago

@groomefyvik I have done it by like this: I have created a Text View below calendar. So whenever user press a date, it will pass that date and show related text in Text View.

Code example if you have trouble to understand:

final CaldroidListener listener = new CaldroidListener() {
            @Override
            public void onSelectDate(Date date, View view) {
             //Get selected date and pass to a function where set Event Text based on that date
             SetEventText(date);
            }
        };
        caldroidFragment.setCaldroidListener(listener);

I really hope they add an event text feature soon!

tommmt commented 6 years ago

hi FajarKhan how can i various event text output in the textview by the clickable dates?

Thankyou

FajarKhan commented 6 years ago

Can you elaborate? I don't quite understand what you meant

tommmt commented 6 years ago

hi, sorry, you have input the SetEventText(date); in the code above onSelectDate. my answer is how you can show different textviews by the selected dates? example: 1.1. 2018 event this is an event text 3.2.2018 this is the 2nd event text. how do you do this with an array or database? have the code for the function

Thank you very much

FajarKhan commented 6 years ago

You mean multiple event date selection? This function only trigger on single event selection. I am not very sure about multiple date selection.

On 07-Jan-2018 11:08 AM, "tommmt" notifications@github.com wrote:

hi, sorry, you have input the SetEventText(date); in the code above onSelectDate. my answer is how you can show different textviews by the selected dates? example: 1.1. 2018 event this is an event text 3.2.2018 this is the 2nd event text. how do you do this with an array or database? have the code for the function

Thank you very much

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/roomorama/Caldroid/issues/468#issuecomment-355801211, or mute the thread https://github.com/notifications/unsubscribe-auth/ASh_uDkdc6Si5qYSlsmXWhMc21-_WA_uks5tIFhQgaJpZM4O8RUe .

tommmt commented 6 years ago

and how you have implement the single event in the dates? i need only one event for a date.