Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for Calendar events #310

Closed
wants to merge 31 commits into from
Closed

Adding support for Calendar events #310

wants to merge 31 commits into from

Conversation

nmitsou
Copy link
Collaborator

@nmitsou nmitsou commented Nov 14, 2015

Events on calendar are added to search. At the moment, events at the next 30 days are only loaded.
The user can disable it on settings.
android.permission.READ_CALENDAR is added.
If you type "events: " all events are shown

I don't know if you find this useful and want to merge at some point.
I like it and use it already since I am missing a calendar widget.
Any comments are welcome.

@nmitsou
Copy link
Collaborator Author

nmitsou commented Nov 15, 2015

Just to clarify, there are two major open points:

  • I don't know how it behaves on older apis. I have to check if this is correctly coded.
  • The event list is not updated when an event is added or removed. I don't know if there is any way to be informed about calendar event changes... Any ideas?

Apart from that, it is working fine.

I have watched the discussions about searching in apps. Is it for calendar events too?

event.displayName = event.name.replaceFirst(
"(?i)(" + Pattern.quote(query) + ")", "{$1}");

//event.setDisplayNameHighlightRegion(matchPositionStart, matchPositionEnd);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented code

@saveman71
Copy link
Collaborator

Also, it's my opinion, but if it can't detect new events / changes, I'm afraid the use is somewhat limited, and can lead to unexpected behaviour from users not aware of that...

Also, there is some work to do about the icon. Is it possible to get the default calendar app icon? (I assume the event is opened in this app, so that would make sense)

@nmitsou
Copy link
Collaborator Author

nmitsou commented Nov 22, 2015

Hi saveman71, thank you for the comments!
I added support for new events / changes on existing events so the event list is now updated.
Still, I would like to work on the following points:

  • Check behaviour on older version
  • Default calendar icon (if possible)
  • Search should favour more recent events than other in the future.

@nmitsou
Copy link
Collaborator Author

nmitsou commented Nov 28, 2015

Could maybe someone comment on the current state?

I use the system icon now.

Special search queries:

  • events: Returns the 50 most recent upcoming events
  • !day : show the events in the next 24 hours
  • !week : show the events in the next 7 days
  • !month : well, for the next 30 days

edit: To monitor changes, I listen to modifications on the data. If someone is not using the stock calendar app but lets say only the google calendar (i don't know if this is technically possible), then no events will be shown.

@Neamar
Copy link
Owner

Neamar commented Dec 3, 2015

Hey @nmitsou ,

Sorry for the delay. I know, I'm lagging ><

I saw this PR a few days ago, and although I did not test it yet, I'm still asking myself. It looks impressive, and yet I find myself asking whether or not this is a feature I want, or if it would just pollute my search history.

Now, this could be an option disabled by default too, in which case I probably won't have any bad feeling about it!

I'll put this on my device on run with it for a few days, to see how this goes.

And once again, sorry for the lack of reply.

@Neamar
Copy link
Owner

Neamar commented Dec 3, 2015

(edit. Used it for a few second and already love the !week. I'm a heavy Calendar user though... and i'll have to wait a few days to see if it's more convenient than using the actual agenda)

@nmitsou
Copy link
Collaborator Author

nmitsou commented Dec 4, 2015

Hi, since you are testing, I made a modification on the icon to make it useful (but not ready to push yet). I attach a screenshot.
screenshot_2015-12-04-09-43-08

If the user has selected no-app-icon mode, then the old icon is shown

@nmitsou
Copy link
Collaborator Author

nmitsou commented Dec 4, 2015

if you agree, i will add a switch on settings to enable/disable the appearance of events on search.
the provider will be still enabled to allow the special queries to work

edit: i wouldnt see this as a replacement of calendar but as a quick view of events complimentary to calendar. to be more useful i would like to pin the !week itself on the kissbar or add it on the history

@nmitsou
Copy link
Collaborator Author

nmitsou commented Dec 5, 2015

I added the additional option to include or not events on search (the description string might need some work) and uploaded the icon improvement.

@nmitsou
Copy link
Collaborator Author

nmitsou commented Dec 6, 2015

I don't know why the checks are failing. Locally everything is working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants