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

feat(android): added new methods in Ti.Calendar.Calendar module for bulk operations #14149

Merged
merged 12 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,9 @@ protected void fillIntent(Activity activity, Intent intent)
// We're opening child activity from Titanium root activity. Have it exit out of app by default.
// Note: If launched via startActivityForResult(), then root activity won't be the task's root.
intent.putExtra(TiC.INTENT_PROPERTY_FINISH_ROOT, true);

// Set default value as stated in docs on first window also if not already set above.
setProperty(TiC.PROPERTY_EXIT_ON_CLOSE, true);
prashantsaini1 marked this conversation as resolved.
Show resolved Hide resolved
}

// Set the theme property
Expand Down
51 changes: 51 additions & 0 deletions apidoc/Titanium/Calendar/CalendarProxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ methods:
type: Dictionary<Titanium.Calendar.Event>
platforms: [android, iphone, ipad, macos]

- name: createEvents
summary: Create multiple events at once in this Calendar.
description: |
Use this method to create bulk events for faster performance.
Success or failed results are returned at same positions as passed in the parameters list.
For failed events, it will be *null*, otherwise Titanium.Calendar.Event.
returns:
type: Array<Titanium.Calendar.Event | null>
parameters:
- name: propertiesArray
summary: Array of the event properties
type: Array<Dictionary<Titanium.Calendar.Event>
platforms: [android]
since: {android: "12.6.0"}

- name: getEventById
summary: Gets the event with the specified identifier.
returns:
Expand All @@ -27,6 +42,42 @@ methods:
type: String
platforms: [android, iphone, ipad, macos]

- name: getEventsById
summary: Get multiple events with their specified identifier.
description: |
Use this method to fetch bulk events for faster performance.
Only successful events are returned, so the identifier of events
should be used to compare which events were not fetched successfully.
returns:
type: Array<Titanium.Calendar.Event>
parameters:
- name: ids
summary: Array of identifiers of events.
type: [Array<Number>,Array<String>]
platforms: [android]
since: {android: "12.6.0"}

- name: deleteEvents
summary: Delete multiple events with their specified identifier.
description: |
Use this method to delete bulk events for faster performance.
This method only returns the count of successfully deleted events only.
If it is important for apps to know whether the event was deleted or not,
then either [event's remove](Titanium.Calendar.Event.remove) method can be used, or
a single identifier can be passed in array of this method argument.
If a specified identifier event does not exist, it will not be treated as a count.
so count range can be in `0 <= count <= ids.length`.
returns:
name: count
type: Number
summary: Count of successfully deleted events.
parameters:
- name: ids
summary: Array of identifiers of events.
type: [Array<Number>, Array<String>]
platforms: [android]
since: {android: "12.6.0"}

- name: getEventsBetweenDates
summary: Gets events that occur between two dates.
returns:
Expand Down
24 changes: 24 additions & 0 deletions apidoc/Titanium/UI/ListView.yml
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,30 @@ events:
summary: |
The expected y axis offset when the scrolling action decelerates to a stop.
type: Number

- name: visibleItemCount
summary: The number of visible items in the list view when the event fires.
type: Number

- name: firstVisibleItem
summary: The first visible item in the list view when the event fires; this item might not be fully visible. May be -1 on iOS.
type: [Object, Number]

- name: firstVisibleSection
summary: The first visible section in the list view when the event fires.
type: Titanium.UI.ListSection

- name: firstVisibleItemIndex
summary: |
The index of the first visible item in the list view when the event fires; this item might not be fully visible.
Note: The index is `-1` when there are no items in the <Titanium.UI.ListView>.
type: Number

- name: firstVisibleSectionIndex
summary: |
The index of the first visible section in the list view when the event fires.
Note: The index is `-1` when there are no items in the <Titanium.UI.ListView>.
type: Number
m1ga marked this conversation as resolved.
Show resolved Hide resolved

properties:
- name: allowsSelection
Expand Down
Loading