forked from kiwix/kiwix-apple
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add live activities for download progress
Fixes kiwix#1037 Add Live Activities support for displaying download progress on the lock screen and in the Dynamic Island. * Import `ActivityKit` and create a new `DownloadActivityAttributes` struct in `App/App_iOS.swift`. * Update `Model/DownloadService.swift` to manage Live Activities during download progress changes. * Modify `Views/BuildingBlocks/DownloadTaskCell.swift` to include Live Activities updates. * Update `Views/Library/ZimFileDetail.swift` to handle Live Activities for download details. * Add Live Activities updates in `Views/Library/ZimFilesDownloads.swift`. * Add a new setting to enable or disable Live Activities in `Views/Settings/Settings.swift`. * Handle alerts for Live Activities in `Views/ViewModifiers/AlertHandler.swift`. * Add `Model/DownloadActivityAttributes.swift` to define the attributes for Live Activities. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/kiwix/kiwix-apple/issues/1037?shareId=XXXX-XXXX-XXXX-XXXX).
- Loading branch information
Showing
8 changed files
with
127 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Foundation | ||
import ActivityKit | ||
|
||
struct DownloadActivityAttributes: ActivityAttributes { | ||
public struct ContentState: Codable, Hashable { | ||
var progress: Double | ||
var speed: Double | ||
} | ||
|
||
var fileID: UUID | ||
var fileName: String | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters