Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content

feat: import multiple events from .ics file

Fahim Masud Choudhury requested to merge 8183-t-fix-multi-import-FAHIM into v1-t

Description

This MR bring a new feature: It allows to import iCal file (aka .ics) with multiple event.

So now, when you try to import such a file, it opens Calendar main view (AllinOneActivity) and a dialog. The Dialog let the user pick in which calendar s.he wants to import all the events. Then the click on import and a Toast confirm (or not) the importation.

Screenshots

Dark mode

Screenshot_20240822_134628

Screenshot_20240822_134615

Screenshot_20240822_134601

Screenshot_20240822_134549

Light mode

Screenshot_20240822_134747

Screenshot_20240822_134739

Screenshot_20240822_134724

Screenshot_20240822_134716

Screenrecord

reduced

Technical details

Importing Event's color need a separate issue, as it also concerns single event & recurring event. The problem is that some colors are provided with name (e.g: cadetblue) which is not usable with Android API (or we would need to implement a list of color's name associated to rgb or hexa value)

Importing Reminder is not supported either. Instead Calendar set a default reminder based on User settings. I saw default value is an Alarm 10 min before.

Tests

Entry point is from FileManager.

How to reproduce:

  • Open File apps.
  • navigate til you reach the .ics file on your device
  • tap on it, and choose to open it with Calendar.
  • Calendar apps open & show the dialog
  • Select the calendar in which to import
  • Click on Okay

What to check:

  • check the event are imported and all expected value are set correctly:
    • Title
    • Calendar
    • Attendees
    • location
    • url
    • description
    • recurring rules
  • no regression about importing recurring single event or simple single event
  • importing if no calendar is set up
  • All the available calendars are listed in the calendar picker except Birthday calendar.

Issues

https://gitlab.e.foundation/e/backlog/-/issues/8183+

10 commandments of code reviews

👪 https://gitlab.e.foundation/internal/wiki/-/wikis/mobile-team/guidelines/Code-review

Summary by CodeRabbit

  • New Features

    • Introduced the ability to handle multiple calendar events, improving event management.
    • Added a calendar picker dialog for selecting calendars during event imports.
    • Enhanced event data handling with new utility functions for better integration and usability.
    • Implemented a dropdown view for selecting calendars in the UI.
    • Introduced a query handler for managing asynchronous calendar queries.
  • Bug Fixes

    • Improved logic for differentiating between single and multiple event imports.
  • Documentation

    • Updated string resources for enhanced user prompts and feedback in the event import process.
  • Chores

    • Added new layout files for the calendar selection dialog and dropdown items.
Edited by CodeRabbitAI

Merge request reports

Loading