Support more formats (#112)
* Added support for FB2 book format * Add support for CBZ files by introducing a `ReaderDocument` abstraction. Key changes: - Defined `ReaderDocument`, `ReaderPage`, and `ReaderTextPage` interfaces to provide a unified API for different document types. - Implemented `PdfDocumentWrapper` and `CbzDocumentWrapper` to handle PDF and CBZ files respectively. - Updated `PdfViewerScreen`, `PdfPageComposable`, and `MainViewModel` to use the new unified document interfaces. - Added CBZ file type detection and cover generation logic. * Add support for CBR and CB7 comic book formats - Add `me.zhanghai.android.libarchive` dependency to support RAR and 7z archives. - Implement `ArchiveDocumentWrapper` using `libarchive` to handle CBZ, CBR, and CB7 files uniformly, replacing the previous CBZ-only implementation. - Update `MainViewModel` and `DocumentFactory` to recognize and process `.cbr` and `.cb7` extensions and their associated MIME types. - Add support for extracting and caching cover images from CBR and CB7 archives. - Update UI components (`HomeScreen`, `LibraryScreen`, `AppNavigation`) to handle the new comic book file types.
This commit is contained in:
parent
32e29dfc07
commit
4db2c97a30
12 changed files with 871 additions and 93 deletions
|
|
@ -90,6 +90,37 @@
|
|||
<data android:pathPattern=".*\\.azw3" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- FB2 Filter 1: Catch by specific and common MIME types -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="content" />
|
||||
<data android:scheme="file" />
|
||||
<data android:mimeType="application/x-fictionbook+xml" />
|
||||
<data android:mimeType="application/x-fictionbook" />
|
||||
<data android:mimeType="application/fb2+xml" />
|
||||
<data android:mimeType="application/x-fb2" />
|
||||
<data android:mimeType="application/fb2" />
|
||||
<data android:mimeType="application/x-zip-compressed-fb2" />
|
||||
<data android:mimeType="application/zip" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- FB2 Filter 2: Catch by Extension when MIME is unknown (octet-stream) -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="content" />
|
||||
<data android:scheme="file" />
|
||||
<data android:mimeType="application/octet-stream" />
|
||||
<data android:mimeType="text/xml" />
|
||||
<data android:mimeType="text/plain" />
|
||||
<data android:host="*" />
|
||||
<data android:pathPattern=".*\\.fb2" />
|
||||
<data android:pathPattern=".*\\.fb2\\.zip" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- Markdown and Plain Text Filter -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue