react-native-ensys-camera-x 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CustomCamera.podspec +20 -0
- package/LICENSE +20 -0
- package/README.md +833 -0
- package/android/build.gradle +135 -0
- package/android/consumer-rules.pro +47 -0
- package/android/src/main/AndroidManifest.xml +72 -0
- package/android/src/main/java/android/print/PdfPrint.java +51 -0
- package/android/src/main/java/com/customcamera/AnimatedImageViewManager.kt +199 -0
- package/android/src/main/java/com/customcamera/AudioPlayerView.kt +322 -0
- package/android/src/main/java/com/customcamera/AudioRecorder.kt +506 -0
- package/android/src/main/java/com/customcamera/BarcodeScannerActivity.kt +361 -0
- package/android/src/main/java/com/customcamera/BlurBackgroundView.kt +199 -0
- package/android/src/main/java/com/customcamera/CacheCleanupManager.kt +386 -0
- package/android/src/main/java/com/customcamera/CameraAspectRatioMode.kt +77 -0
- package/android/src/main/java/com/customcamera/CameraAsset.kt +211 -0
- package/android/src/main/java/com/customcamera/CameraTheme.kt +479 -0
- package/android/src/main/java/com/customcamera/CompressionCacheStore.kt +504 -0
- package/android/src/main/java/com/customcamera/CompressionFileNameUtils.kt +7 -0
- package/android/src/main/java/com/customcamera/CompressionProfile.kt +195 -0
- package/android/src/main/java/com/customcamera/CustomCameraActivity.kt +7291 -0
- package/android/src/main/java/com/customcamera/CustomCameraFileProvider.kt +9 -0
- package/android/src/main/java/com/customcamera/CustomCameraModule.kt +2479 -0
- package/android/src/main/java/com/customcamera/CustomCameraPackage.kt +53 -0
- package/android/src/main/java/com/customcamera/DisplayUtils.kt +9 -0
- package/android/src/main/java/com/customcamera/DocumentPreviewView.kt +846 -0
- package/android/src/main/java/com/customcamera/DrawingView.kt +214 -0
- package/android/src/main/java/com/customcamera/EmojiPickerData.kt +228 -0
- package/android/src/main/java/com/customcamera/FilterStripAdapter.kt +158 -0
- package/android/src/main/java/com/customcamera/GifSupport.kt +215 -0
- package/android/src/main/java/com/customcamera/GlobalAudioPlayer.kt +320 -0
- package/android/src/main/java/com/customcamera/ImageExporter.kt +1394 -0
- package/android/src/main/java/com/customcamera/ImageFormatSupport.kt +163 -0
- package/android/src/main/java/com/customcamera/Localization.kt +206 -0
- package/android/src/main/java/com/customcamera/MediaAdapters.kt +758 -0
- package/android/src/main/java/com/customcamera/MediaCacheManager.kt +782 -0
- package/android/src/main/java/com/customcamera/MediaExportFormats.kt +201 -0
- package/android/src/main/java/com/customcamera/MediaFileIo.kt +310 -0
- package/android/src/main/java/com/customcamera/MediaMetadataStore.kt +494 -0
- package/android/src/main/java/com/customcamera/MediaPreviewEditor.kt +14865 -0
- package/android/src/main/java/com/customcamera/MediaPublisher.kt +423 -0
- package/android/src/main/java/com/customcamera/MediaStorageWorkflow.kt +722 -0
- package/android/src/main/java/com/customcamera/MediaStoreRepository.kt +378 -0
- package/android/src/main/java/com/customcamera/MediaThumbnailView.kt +286 -0
- package/android/src/main/java/com/customcamera/MediaUtils.kt +37 -0
- package/android/src/main/java/com/customcamera/NativeVideoViewManager.kt +845 -0
- package/android/src/main/java/com/customcamera/OfficeDocumentConverter.kt +2791 -0
- package/android/src/main/java/com/customcamera/PendingCaptureCrops.kt +88 -0
- package/android/src/main/java/com/customcamera/PowerPointPreview.kt +4077 -0
- package/android/src/main/java/com/customcamera/RecentPickerStore.kt +74 -0
- package/android/src/main/java/com/customcamera/SecureFileEraser.kt +411 -0
- package/android/src/main/java/com/customcamera/SecureKeyModule.kt +88 -0
- package/android/src/main/java/com/customcamera/SecureMediaDeleter.kt +493 -0
- package/android/src/main/java/com/customcamera/StickerPickerData.kt +107 -0
- package/android/src/main/java/com/customcamera/SvgDrawable.kt +175 -0
- package/android/src/main/java/com/customcamera/SvgIconViewManager.kt +77 -0
- package/android/src/main/java/com/customcamera/TextEntryController.kt +553 -0
- package/android/src/main/java/com/customcamera/ThumbnailLoader.kt +455 -0
- package/android/src/main/java/com/customcamera/UploadService.kt +909 -0
- package/android/src/main/java/com/customcamera/VideoEditUtils.kt +210 -0
- package/android/src/main/java/com/customcamera/VideoRotationTranscoder.kt +1992 -0
- package/android/src/main/java/com/customcamera/gif/AnimatedGifEncoder.kt +473 -0
- package/android/src/main/java/com/customcamera/gif/GifDecoder.kt +690 -0
- package/android/src/main/java/com/customcamera/gif/GifFramesDrawable.kt +160 -0
- package/android/src/main/java/com/customcamera/gif/GifHttp.kt +112 -0
- package/android/src/main/java/com/customcamera/gif/GifImageLoader.kt +186 -0
- package/android/src/main/java/com/customcamera/gif/GifModels.kt +74 -0
- package/android/src/main/java/com/customcamera/gif/GifProvider.kt +49 -0
- package/android/src/main/java/com/customcamera/gif/GifProviders.kt +27 -0
- package/android/src/main/java/com/customcamera/gif/GifRepository.kt +124 -0
- package/android/src/main/java/com/customcamera/gif/GifSafety.kt +33 -0
- package/android/src/main/java/com/customcamera/gif/GiphyGifProvider.kt +146 -0
- package/android/src/main/java/com/customcamera/gif/LZWEncoder.kt +258 -0
- package/android/src/main/java/com/customcamera/gif/NeuQuant.kt +435 -0
- package/android/src/main/java/com/customcamera/gif/TenorGifProvider.kt +147 -0
- package/android/src/main/res/drawable/bg_brush_selected.xml +5 -0
- package/android/src/main/res/drawable/bg_color_swatch.xml +5 -0
- package/android/src/main/res/drawable/bg_editor_toolbar.xml +6 -0
- package/android/src/main/res/drawable/bg_icon_circle.xml +5 -0
- package/android/src/main/res/drawable/bg_icon_circle_light.xml +5 -0
- package/android/src/main/res/drawable/bg_mode_tab_active.xml +6 -0
- package/android/src/main/res/drawable/bg_pill.xml +6 -0
- package/android/src/main/res/drawable/bg_recording_dot.xml +6 -0
- package/android/src/main/res/drawable/bg_selection_badge.xml +8 -0
- package/android/src/main/res/drawable/bg_send_button.xml +5 -0
- package/android/src/main/res/drawable/bg_shutter_inner.xml +5 -0
- package/android/src/main/res/drawable/bg_shutter_recording.xml +6 -0
- package/android/src/main/res/drawable/bg_shutter_ring.xml +8 -0
- package/android/src/main/res/drawable/bg_shutter_video_idle.xml +5 -0
- package/android/src/main/res/drawable/bg_thumbnail.xml +9 -0
- package/android/src/main/res/drawable/ic_aspect_ratio.xml +17 -0
- package/android/src/main/res/drawable/ic_audio.xml +10 -0
- package/android/src/main/res/drawable/ic_back.xml +10 -0
- package/android/src/main/res/drawable/ic_brush_medium.xml +12 -0
- package/android/src/main/res/drawable/ic_brush_thick.xml +12 -0
- package/android/src/main/res/drawable/ic_brush_thin.xml +12 -0
- package/android/src/main/res/drawable/ic_check.xml +17 -0
- package/android/src/main/res/drawable/ic_chevron_down.xml +10 -0
- package/android/src/main/res/drawable/ic_chevron_up.xml +13 -0
- package/android/src/main/res/drawable/ic_clear_drawing.xml +10 -0
- package/android/src/main/res/drawable/ic_close.xml +10 -0
- package/android/src/main/res/drawable/ic_cover.xml +9 -0
- package/android/src/main/res/drawable/ic_crop.xml +10 -0
- package/android/src/main/res/drawable/ic_delete.xml +9 -0
- package/android/src/main/res/drawable/ic_document.xml +10 -0
- package/android/src/main/res/drawable/ic_done.xml +10 -0
- package/android/src/main/res/drawable/ic_download.xml +10 -0
- package/android/src/main/res/drawable/ic_emoji.xml +10 -0
- package/android/src/main/res/drawable/ic_filter.xml +10 -0
- package/android/src/main/res/drawable/ic_flash_auto.xml +7 -0
- package/android/src/main/res/drawable/ic_flash_off.xml +23 -0
- package/android/src/main/res/drawable/ic_flash_on.xml +16 -0
- package/android/src/main/res/drawable/ic_flip.xml +15 -0
- package/android/src/main/res/drawable/ic_gallery.xml +10 -0
- package/android/src/main/res/drawable/ic_gif.xml +24 -0
- package/android/src/main/res/drawable/ic_lock.xml +19 -0
- package/android/src/main/res/drawable/ic_lock_open.xml +22 -0
- package/android/src/main/res/drawable/ic_marker.xml +10 -0
- package/android/src/main/res/drawable/ic_more_vert.xml +18 -0
- package/android/src/main/res/drawable/ic_overlay_close.xml +19 -0
- package/android/src/main/res/drawable/ic_overlay_resize.xml +18 -0
- package/android/src/main/res/drawable/ic_pause.xml +10 -0
- package/android/src/main/res/drawable/ic_photo_mode.xml +10 -0
- package/android/src/main/res/drawable/ic_play.xml +10 -0
- package/android/src/main/res/drawable/ic_redo.xml +10 -0
- package/android/src/main/res/drawable/ic_rotate.xml +9 -0
- package/android/src/main/res/drawable/ic_send.xml +10 -0
- package/android/src/main/res/drawable/ic_share.xml +10 -0
- package/android/src/main/res/drawable/ic_stat_upload.xml +10 -0
- package/android/src/main/res/drawable/ic_sticker.xml +24 -0
- package/android/src/main/res/drawable/ic_text.xml +10 -0
- package/android/src/main/res/drawable/ic_text_align_center.xml +11 -0
- package/android/src/main/res/drawable/ic_text_align_left.xml +11 -0
- package/android/src/main/res/drawable/ic_text_align_right.xml +11 -0
- package/android/src/main/res/drawable/ic_text_bg.xml +11 -0
- package/android/src/main/res/drawable/ic_trim.xml +23 -0
- package/android/src/main/res/drawable/ic_undo.xml +10 -0
- package/android/src/main/res/drawable/ic_video_mode.xml +10 -0
- package/android/src/main/res/drawable/ic_video_note.xml +13 -0
- package/android/src/main/res/drawable/ic_volume_off.xml +9 -0
- package/android/src/main/res/drawable/ic_volume_on.xml +9 -0
- package/android/src/main/res/drawable/sticker_heart.xml +9 -0
- package/android/src/main/res/drawable/sticker_smile.xml +9 -0
- package/android/src/main/res/drawable/sticker_star.xml +9 -0
- package/android/src/main/res/drawable/sticker_thumbsup.xml +9 -0
- package/android/src/main/res/values/colors.xml +34 -0
- package/android/src/main/res/values/ids.xml +15 -0
- package/android/src/main/res/values/strings.xml +15 -0
- package/android/src/main/res/values/styles.xml +20 -0
- package/android/src/main/res/xml/file_paths.xml +34 -0
- package/ios/CustomCamera.h +5 -0
- package/ios/CustomCamera.mm +214 -0
- package/lib/module/AudioPlayerContext.js +233 -0
- package/lib/module/AudioPlayerContext.js.map +1 -0
- package/lib/module/CameraPreview.js +304 -0
- package/lib/module/CameraPreview.js.map +1 -0
- package/lib/module/NativeAnimatedImageView.js +41 -0
- package/lib/module/NativeAnimatedImageView.js.map +1 -0
- package/lib/module/NativeAudioPlayerView.js +33 -0
- package/lib/module/NativeAudioPlayerView.js.map +1 -0
- package/lib/module/NativeBlurView.js +35 -0
- package/lib/module/NativeBlurView.js.map +1 -0
- package/lib/module/NativeCustomCamera.js +128 -0
- package/lib/module/NativeCustomCamera.js.map +1 -0
- package/lib/module/NativeCustomCamera.web.js +143 -0
- package/lib/module/NativeCustomCamera.web.js.map +1 -0
- package/lib/module/NativeCustomVideoView.js +5 -0
- package/lib/module/NativeCustomVideoView.js.map +1 -0
- package/lib/module/NativeDocumentPreviewView.js +156 -0
- package/lib/module/NativeDocumentPreviewView.js.map +1 -0
- package/lib/module/NativeMediaThumbnailView.js +110 -0
- package/lib/module/NativeMediaThumbnailView.js.map +1 -0
- package/lib/module/NativeSvgIcon.js +32 -0
- package/lib/module/NativeSvgIcon.js.map +1 -0
- package/lib/module/ResponsivePreviewContainer.js +171 -0
- package/lib/module/ResponsivePreviewContainer.js.map +1 -0
- package/lib/module/accessibility.js +61 -0
- package/lib/module/accessibility.js.map +1 -0
- package/lib/module/config.js +352 -0
- package/lib/module/config.js.map +1 -0
- package/lib/module/cpuOptimization.js +296 -0
- package/lib/module/cpuOptimization.js.map +1 -0
- package/lib/module/db/DatabaseManager.js +191 -0
- package/lib/module/db/DatabaseManager.js.map +1 -0
- package/lib/module/db/MediaMapper.js +284 -0
- package/lib/module/db/MediaMapper.js.map +1 -0
- package/lib/module/db/MediaRepository.js +242 -0
- package/lib/module/db/MediaRepository.js.map +1 -0
- package/lib/module/db/index.js +41 -0
- package/lib/module/db/index.js.map +1 -0
- package/lib/module/db/migrations.js +180 -0
- package/lib/module/db/migrations.js.map +1 -0
- package/lib/module/db/react-native-sqlcipher.d.js +2 -0
- package/lib/module/db/react-native-sqlcipher.d.js.map +1 -0
- package/lib/module/db/secureKey.js +87 -0
- package/lib/module/db/secureKey.js.map +1 -0
- package/lib/module/db/types.js +57 -0
- package/lib/module/db/types.js.map +1 -0
- package/lib/module/db/useMediaDatabase.js +123 -0
- package/lib/module/db/useMediaDatabase.js.map +1 -0
- package/lib/module/defaultIcons.js +2259 -0
- package/lib/module/defaultIcons.js.map +1 -0
- package/lib/module/deviceCapabilities.js +408 -0
- package/lib/module/deviceCapabilities.js.map +1 -0
- package/lib/module/errors.js +267 -0
- package/lib/module/errors.js.map +1 -0
- package/lib/module/iconConfig.js +796 -0
- package/lib/module/iconConfig.js.map +1 -0
- package/lib/module/icons.js +514 -0
- package/lib/module/icons.js.map +1 -0
- package/lib/module/index.js +251 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/jest-globals.d.js +2 -0
- package/lib/module/jest-globals.d.js.map +1 -0
- package/lib/module/library/MediaLibrary.js +107 -0
- package/lib/module/library/MediaLibrary.js.map +1 -0
- package/lib/module/library/MediaLibraryScreen.js +2597 -0
- package/lib/module/library/MediaLibraryScreen.js.map +1 -0
- package/lib/module/library/components/AudioPreview.js +74 -0
- package/lib/module/library/components/AudioPreview.js.map +1 -0
- package/lib/module/library/components/DocumentPreview.js +331 -0
- package/lib/module/library/components/DocumentPreview.js.map +1 -0
- package/lib/module/library/components/ExpandableFab.js +343 -0
- package/lib/module/library/components/ExpandableFab.js.map +1 -0
- package/lib/module/library/components/FileTiles.js +251 -0
- package/lib/module/library/components/FileTiles.js.map +1 -0
- package/lib/module/library/components/ImagePreview.js +70 -0
- package/lib/module/library/components/ImagePreview.js.map +1 -0
- package/lib/module/library/components/MediaMetadataHeader.js +175 -0
- package/lib/module/library/components/MediaMetadataHeader.js.map +1 -0
- package/lib/module/library/components/RecordAudioScreen.js +816 -0
- package/lib/module/library/components/RecordAudioScreen.js.map +1 -0
- package/lib/module/library/components/VideoPreview.js +453 -0
- package/lib/module/library/components/VideoPreview.js.map +1 -0
- package/lib/module/library/components/ViewerCounter.js +55 -0
- package/lib/module/library/components/ViewerCounter.js.map +1 -0
- package/lib/module/library/compressionEstimate.js +507 -0
- package/lib/module/library/compressionEstimate.js.map +1 -0
- package/lib/module/library/fileMetadata.js +196 -0
- package/lib/module/library/fileMetadata.js.map +1 -0
- package/lib/module/library/index.js +42 -0
- package/lib/module/library/index.js.map +1 -0
- package/lib/module/library/libraryIconRegistry.js +69 -0
- package/lib/module/library/libraryIconRegistry.js.map +1 -0
- package/lib/module/library/libraryIcons.js +858 -0
- package/lib/module/library/libraryIcons.js.map +1 -0
- package/lib/module/library/localizedFormat.js +181 -0
- package/lib/module/library/localizedFormat.js.map +1 -0
- package/lib/module/library/palette.js +225 -0
- package/lib/module/library/palette.js.map +1 -0
- package/lib/module/library/responsive.js +53 -0
- package/lib/module/library/responsive.js.map +1 -0
- package/lib/module/locales.js +416 -0
- package/lib/module/locales.js.map +1 -0
- package/lib/module/localization.js +1064 -0
- package/lib/module/localization.js.map +1 -0
- package/lib/module/logger.js +20 -0
- package/lib/module/logger.js.map +1 -0
- package/lib/module/lowMemoryCache.js +206 -0
- package/lib/module/lowMemoryCache.js.map +1 -0
- package/lib/module/mediaHistory.js +33 -0
- package/lib/module/mediaHistory.js.map +1 -0
- package/lib/module/mediaStorageService.js +402 -0
- package/lib/module/mediaStorageService.js.map +1 -0
- package/lib/module/memory.js +79 -0
- package/lib/module/memory.js.map +1 -0
- package/lib/module/nativeActions.js +307 -0
- package/lib/module/nativeActions.js.map +1 -0
- package/lib/module/nativeComponentSupport.js +61 -0
- package/lib/module/nativeComponentSupport.js.map +1 -0
- package/lib/module/networkPerformance.js +24 -0
- package/lib/module/networkPerformance.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/performance.js +104 -0
- package/lib/module/performance.js.map +1 -0
- package/lib/module/performanceMonitor.js +155 -0
- package/lib/module/performanceMonitor.js.map +1 -0
- package/lib/module/permissions.js +370 -0
- package/lib/module/permissions.js.map +1 -0
- package/lib/module/rendering.js +40 -0
- package/lib/module/rendering.js.map +1 -0
- package/lib/module/security.js +18 -0
- package/lib/module/security.js.map +1 -0
- package/lib/module/state.js +266 -0
- package/lib/module/state.js.map +1 -0
- package/lib/module/storage.js +400 -0
- package/lib/module/storage.js.map +1 -0
- package/lib/module/theme.js +390 -0
- package/lib/module/theme.js.map +1 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils.js +115 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/validation.js +288 -0
- package/lib/module/validation.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/AudioPlayerContext.d.ts +27 -0
- package/lib/typescript/src/AudioPlayerContext.d.ts.map +1 -0
- package/lib/typescript/src/CameraPreview.d.ts +13 -0
- package/lib/typescript/src/CameraPreview.d.ts.map +1 -0
- package/lib/typescript/src/NativeAnimatedImageView.d.ts +33 -0
- package/lib/typescript/src/NativeAnimatedImageView.d.ts.map +1 -0
- package/lib/typescript/src/NativeAudioPlayerView.d.ts +12 -0
- package/lib/typescript/src/NativeAudioPlayerView.d.ts.map +1 -0
- package/lib/typescript/src/NativeBlurView.d.ts +12 -0
- package/lib/typescript/src/NativeBlurView.d.ts.map +1 -0
- package/lib/typescript/src/NativeCustomCamera.d.ts +167 -0
- package/lib/typescript/src/NativeCustomCamera.d.ts.map +1 -0
- package/lib/typescript/src/NativeCustomCamera.web.d.ts +47 -0
- package/lib/typescript/src/NativeCustomCamera.web.d.ts.map +1 -0
- package/lib/typescript/src/NativeCustomVideoView.d.ts +30 -0
- package/lib/typescript/src/NativeCustomVideoView.d.ts.map +1 -0
- package/lib/typescript/src/NativeDocumentPreviewView.d.ts +48 -0
- package/lib/typescript/src/NativeDocumentPreviewView.d.ts.map +1 -0
- package/lib/typescript/src/NativeMediaThumbnailView.d.ts +54 -0
- package/lib/typescript/src/NativeMediaThumbnailView.d.ts.map +1 -0
- package/lib/typescript/src/NativeSvgIcon.d.ts +25 -0
- package/lib/typescript/src/NativeSvgIcon.d.ts.map +1 -0
- package/lib/typescript/src/ResponsivePreviewContainer.d.ts +92 -0
- package/lib/typescript/src/ResponsivePreviewContainer.d.ts.map +1 -0
- package/lib/typescript/src/accessibility.d.ts +20 -0
- package/lib/typescript/src/accessibility.d.ts.map +1 -0
- package/lib/typescript/src/config.d.ts +145 -0
- package/lib/typescript/src/config.d.ts.map +1 -0
- package/lib/typescript/src/cpuOptimization.d.ts +63 -0
- package/lib/typescript/src/cpuOptimization.d.ts.map +1 -0
- package/lib/typescript/src/db/DatabaseManager.d.ts +48 -0
- package/lib/typescript/src/db/DatabaseManager.d.ts.map +1 -0
- package/lib/typescript/src/db/MediaMapper.d.ts +77 -0
- package/lib/typescript/src/db/MediaMapper.d.ts.map +1 -0
- package/lib/typescript/src/db/MediaRepository.d.ts +66 -0
- package/lib/typescript/src/db/MediaRepository.d.ts.map +1 -0
- package/lib/typescript/src/db/index.d.ts +23 -0
- package/lib/typescript/src/db/index.d.ts.map +1 -0
- package/lib/typescript/src/db/migrations.d.ts +31 -0
- package/lib/typescript/src/db/migrations.d.ts.map +1 -0
- package/lib/typescript/src/db/secureKey.d.ts +10 -0
- package/lib/typescript/src/db/secureKey.d.ts.map +1 -0
- package/lib/typescript/src/db/types.d.ts +115 -0
- package/lib/typescript/src/db/types.d.ts.map +1 -0
- package/lib/typescript/src/db/useMediaDatabase.d.ts +41 -0
- package/lib/typescript/src/db/useMediaDatabase.d.ts.map +1 -0
- package/lib/typescript/src/defaultIcons.d.ts +139 -0
- package/lib/typescript/src/defaultIcons.d.ts.map +1 -0
- package/lib/typescript/src/deviceCapabilities.d.ts +92 -0
- package/lib/typescript/src/deviceCapabilities.d.ts.map +1 -0
- package/lib/typescript/src/errors.d.ts +95 -0
- package/lib/typescript/src/errors.d.ts.map +1 -0
- package/lib/typescript/src/iconConfig.d.ts +176 -0
- package/lib/typescript/src/iconConfig.d.ts.map +1 -0
- package/lib/typescript/src/icons.d.ts +217 -0
- package/lib/typescript/src/icons.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +104 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/library/MediaLibrary.d.ts +57 -0
- package/lib/typescript/src/library/MediaLibrary.d.ts.map +1 -0
- package/lib/typescript/src/library/MediaLibraryScreen.d.ts +51 -0
- package/lib/typescript/src/library/MediaLibraryScreen.d.ts.map +1 -0
- package/lib/typescript/src/library/components/AudioPreview.d.ts +6 -0
- package/lib/typescript/src/library/components/AudioPreview.d.ts.map +1 -0
- package/lib/typescript/src/library/components/DocumentPreview.d.ts +10 -0
- package/lib/typescript/src/library/components/DocumentPreview.d.ts.map +1 -0
- package/lib/typescript/src/library/components/ExpandableFab.d.ts +39 -0
- package/lib/typescript/src/library/components/ExpandableFab.d.ts.map +1 -0
- package/lib/typescript/src/library/components/FileTiles.d.ts +8 -0
- package/lib/typescript/src/library/components/FileTiles.d.ts.map +1 -0
- package/lib/typescript/src/library/components/ImagePreview.d.ts +5 -0
- package/lib/typescript/src/library/components/ImagePreview.d.ts.map +1 -0
- package/lib/typescript/src/library/components/MediaMetadataHeader.d.ts +16 -0
- package/lib/typescript/src/library/components/MediaMetadataHeader.d.ts.map +1 -0
- package/lib/typescript/src/library/components/RecordAudioScreen.d.ts +8 -0
- package/lib/typescript/src/library/components/RecordAudioScreen.d.ts.map +1 -0
- package/lib/typescript/src/library/components/VideoPreview.d.ts +20 -0
- package/lib/typescript/src/library/components/VideoPreview.d.ts.map +1 -0
- package/lib/typescript/src/library/components/ViewerCounter.d.ts +13 -0
- package/lib/typescript/src/library/components/ViewerCounter.d.ts.map +1 -0
- package/lib/typescript/src/library/compressionEstimate.d.ts +313 -0
- package/lib/typescript/src/library/compressionEstimate.d.ts.map +1 -0
- package/lib/typescript/src/library/fileMetadata.d.ts +33 -0
- package/lib/typescript/src/library/fileMetadata.d.ts.map +1 -0
- package/lib/typescript/src/library/index.d.ts +40 -0
- package/lib/typescript/src/library/index.d.ts.map +1 -0
- package/lib/typescript/src/library/libraryIconRegistry.d.ts +35 -0
- package/lib/typescript/src/library/libraryIconRegistry.d.ts.map +1 -0
- package/lib/typescript/src/library/libraryIcons.d.ts +85 -0
- package/lib/typescript/src/library/libraryIcons.d.ts.map +1 -0
- package/lib/typescript/src/library/localizedFormat.d.ts +49 -0
- package/lib/typescript/src/library/localizedFormat.d.ts.map +1 -0
- package/lib/typescript/src/library/palette.d.ts +104 -0
- package/lib/typescript/src/library/palette.d.ts.map +1 -0
- package/lib/typescript/src/library/responsive.d.ts +15 -0
- package/lib/typescript/src/library/responsive.d.ts.map +1 -0
- package/lib/typescript/src/locales.d.ts +103 -0
- package/lib/typescript/src/locales.d.ts.map +1 -0
- package/lib/typescript/src/localization.d.ts +1051 -0
- package/lib/typescript/src/localization.d.ts.map +1 -0
- package/lib/typescript/src/logger.d.ts +4 -0
- package/lib/typescript/src/logger.d.ts.map +1 -0
- package/lib/typescript/src/lowMemoryCache.d.ts +64 -0
- package/lib/typescript/src/lowMemoryCache.d.ts.map +1 -0
- package/lib/typescript/src/mediaHistory.d.ts +3 -0
- package/lib/typescript/src/mediaHistory.d.ts.map +1 -0
- package/lib/typescript/src/mediaStorageService.d.ts +155 -0
- package/lib/typescript/src/mediaStorageService.d.ts.map +1 -0
- package/lib/typescript/src/memory.d.ts +21 -0
- package/lib/typescript/src/memory.d.ts.map +1 -0
- package/lib/typescript/src/nativeActions.d.ts +174 -0
- package/lib/typescript/src/nativeActions.d.ts.map +1 -0
- package/lib/typescript/src/nativeComponentSupport.d.ts +30 -0
- package/lib/typescript/src/nativeComponentSupport.d.ts.map +1 -0
- package/lib/typescript/src/networkPerformance.d.ts +12 -0
- package/lib/typescript/src/networkPerformance.d.ts.map +1 -0
- package/lib/typescript/src/performance.d.ts +32 -0
- package/lib/typescript/src/performance.d.ts.map +1 -0
- package/lib/typescript/src/performanceMonitor.d.ts +45 -0
- package/lib/typescript/src/performanceMonitor.d.ts.map +1 -0
- package/lib/typescript/src/permissions.d.ts +132 -0
- package/lib/typescript/src/permissions.d.ts.map +1 -0
- package/lib/typescript/src/rendering.d.ts +9 -0
- package/lib/typescript/src/rendering.d.ts.map +1 -0
- package/lib/typescript/src/security.d.ts +6 -0
- package/lib/typescript/src/security.d.ts.map +1 -0
- package/lib/typescript/src/state.d.ts +102 -0
- package/lib/typescript/src/state.d.ts.map +1 -0
- package/lib/typescript/src/storage.d.ts +117 -0
- package/lib/typescript/src/storage.d.ts.map +1 -0
- package/lib/typescript/src/theme.d.ts +15 -0
- package/lib/typescript/src/theme.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +802 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils.d.ts +50 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/lib/typescript/src/validation.d.ts +52 -0
- package/lib/typescript/src/validation.d.ts.map +1 -0
- package/package.json +204 -0
- package/react-native.config.js +17 -0
- package/src/AudioPlayerContext.tsx +220 -0
- package/src/CameraPreview.tsx +352 -0
- package/src/NativeAnimatedImageView.tsx +71 -0
- package/src/NativeAudioPlayerView.tsx +39 -0
- package/src/NativeBlurView.tsx +40 -0
- package/src/NativeCustomCamera.ts +305 -0
- package/src/NativeCustomCamera.web.ts +192 -0
- package/src/NativeCustomVideoView.ts +30 -0
- package/src/NativeDocumentPreviewView.tsx +196 -0
- package/src/NativeMediaThumbnailView.tsx +167 -0
- package/src/NativeSvgIcon.tsx +46 -0
- package/src/ResponsivePreviewContainer.tsx +227 -0
- package/src/accessibility.ts +80 -0
- package/src/config.ts +406 -0
- package/src/cpuOptimization.ts +365 -0
- package/src/db/DatabaseManager.ts +212 -0
- package/src/db/MediaMapper.ts +377 -0
- package/src/db/MediaRepository.ts +313 -0
- package/src/db/index.ts +73 -0
- package/src/db/migrations.ts +222 -0
- package/src/db/react-native-sqlcipher.d.ts +76 -0
- package/src/db/secureKey.ts +100 -0
- package/src/db/types.ts +123 -0
- package/src/db/useMediaDatabase.ts +191 -0
- package/src/defaultIcons.tsx +2390 -0
- package/src/deviceCapabilities.ts +438 -0
- package/src/errors.ts +350 -0
- package/src/iconConfig.tsx +962 -0
- package/src/icons.tsx +788 -0
- package/src/index.tsx +763 -0
- package/src/jest-globals.d.ts +9 -0
- package/src/library/MediaLibrary.tsx +141 -0
- package/src/library/MediaLibraryScreen.tsx +3003 -0
- package/src/library/components/AudioPreview.tsx +73 -0
- package/src/library/components/DocumentPreview.tsx +361 -0
- package/src/library/components/ExpandableFab.tsx +342 -0
- package/src/library/components/FileTiles.tsx +252 -0
- package/src/library/components/ImagePreview.tsx +72 -0
- package/src/library/components/MediaMetadataHeader.tsx +208 -0
- package/src/library/components/RecordAudioScreen.tsx +845 -0
- package/src/library/components/VideoPreview.tsx +478 -0
- package/src/library/components/ViewerCounter.tsx +71 -0
- package/src/library/compressionEstimate.ts +662 -0
- package/src/library/fileMetadata.ts +212 -0
- package/src/library/index.ts +66 -0
- package/src/library/libraryIconRegistry.tsx +86 -0
- package/src/library/libraryIcons.tsx +928 -0
- package/src/library/localizedFormat.ts +207 -0
- package/src/library/palette.ts +281 -0
- package/src/library/responsive.ts +49 -0
- package/src/locales.ts +381 -0
- package/src/localization.ts +1947 -0
- package/src/logger.ts +20 -0
- package/src/lowMemoryCache.ts +218 -0
- package/src/mediaHistory.ts +42 -0
- package/src/mediaStorageService.ts +546 -0
- package/src/memory.ts +102 -0
- package/src/nativeActions.ts +422 -0
- package/src/nativeComponentSupport.ts +60 -0
- package/src/networkPerformance.ts +30 -0
- package/src/performance.ts +137 -0
- package/src/performanceMonitor.ts +219 -0
- package/src/permissions.ts +403 -0
- package/src/rendering.ts +47 -0
- package/src/security.ts +19 -0
- package/src/state.ts +333 -0
- package/src/storage.ts +453 -0
- package/src/theme.tsx +467 -0
- package/src/types.ts +946 -0
- package/src/utils.ts +177 -0
- package/src/validation.ts +372 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
ext.CustomCamera = [
|
|
3
|
+
kotlinVersion: "2.0.21",
|
|
4
|
+
minSdkVersion: 24,
|
|
5
|
+
compileSdkVersion: 36,
|
|
6
|
+
targetSdkVersion: 36
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
ext.getExtOrDefault = { prop ->
|
|
10
|
+
if (rootProject.ext.has(prop)) {
|
|
11
|
+
return rootProject.ext.get(prop)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return CustomCamera[prop]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
repositories {
|
|
18
|
+
google()
|
|
19
|
+
mavenCentral()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
dependencies {
|
|
23
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
24
|
+
// noinspection DifferentKotlinGradleVersion
|
|
25
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
apply plugin: "com.android.library"
|
|
31
|
+
apply plugin: "kotlin-android"
|
|
32
|
+
|
|
33
|
+
apply plugin: "com.facebook.react"
|
|
34
|
+
|
|
35
|
+
android {
|
|
36
|
+
namespace "com.customcamera"
|
|
37
|
+
|
|
38
|
+
compileSdkVersion getExtOrDefault("compileSdkVersion")
|
|
39
|
+
|
|
40
|
+
defaultConfig {
|
|
41
|
+
minSdkVersion getExtOrDefault("minSdkVersion")
|
|
42
|
+
targetSdkVersion getExtOrDefault("targetSdkVersion")
|
|
43
|
+
|
|
44
|
+
// Ship R8/ProGuard keep rules inside the AAR so any consuming app's release
|
|
45
|
+
// (minified) build automatically protects this library's native module, the
|
|
46
|
+
// React Native bridge entry points, and the Gson model classes. Without this,
|
|
47
|
+
// R8 in the consuming app can strip/rename them, crashing after capture and on
|
|
48
|
+
// relaunch (Gson upload-state recovery runs at startup).
|
|
49
|
+
consumerProguardFiles "consumer-rules.pro"
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
buildFeatures {
|
|
53
|
+
buildConfig true
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
buildTypes {
|
|
57
|
+
release {
|
|
58
|
+
minifyEnabled false
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
lint {
|
|
63
|
+
disable "GradleCompatible"
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
testOptions {
|
|
67
|
+
// The PowerPoint colour/geometry maths is deliberately written free of android.graphics so
|
|
68
|
+
// it can be verified on a bare JVM; no Robolectric or Android resources are needed.
|
|
69
|
+
unitTests.includeAndroidResources = false
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
compileOptions {
|
|
73
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
74
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
dependencies {
|
|
79
|
+
// Test-only: never enters the AAR, so the library stays dependency-free for consumers.
|
|
80
|
+
testImplementation "junit:junit:4.13.2"
|
|
81
|
+
|
|
82
|
+
implementation "com.facebook.react:react-android"
|
|
83
|
+
implementation "androidx.activity:activity:1.9.3"
|
|
84
|
+
implementation "androidx.camera:camera-camera2:1.4.2"
|
|
85
|
+
implementation "androidx.camera:camera-lifecycle:1.4.2"
|
|
86
|
+
implementation "androidx.camera:camera-view:1.4.2"
|
|
87
|
+
implementation "androidx.camera:camera-video:1.4.2"
|
|
88
|
+
implementation "androidx.lifecycle:lifecycle-runtime:2.8.7"
|
|
89
|
+
implementation "androidx.recyclerview:recyclerview:1.4.0"
|
|
90
|
+
// Used directly by UploadService.kt (NotificationCompat/NotificationManagerCompat
|
|
91
|
+
// for the upload progress/success/failure notifications, and OkHttp for the
|
|
92
|
+
// multipart upload requests). These were previously resolved only transitively
|
|
93
|
+
// through react-android/androidx.camera; declaring them explicitly keeps the
|
|
94
|
+
// upload+notification feature from silently breaking if that transitive graph
|
|
95
|
+
// ever changes in a future dependency upgrade.
|
|
96
|
+
implementation "androidx.core:core:1.13.1"
|
|
97
|
+
implementation "com.squareup.okhttp3:okhttp:4.12.0"
|
|
98
|
+
// Gson for JSON serialization
|
|
99
|
+
implementation "com.google.code.gson:gson:2.10.1"
|
|
100
|
+
|
|
101
|
+
// Keystore-backed encrypted key storage for the SQLCipher database passphrase.
|
|
102
|
+
// Used by SecureKeyModule.kt (EncryptedSharedPreferences + MasterKey) so the
|
|
103
|
+
// database encryption key is generated on-device and sealed by the Android
|
|
104
|
+
// Keystore rather than shipped in the JS bundle.
|
|
105
|
+
implementation "androidx.security:security-crypto:1.1.0-alpha06"
|
|
106
|
+
|
|
107
|
+
// SQLCipher for the NATIVE compression cache (CompressionCacheStore.kt): a separate
|
|
108
|
+
// encrypted compression_cache.db, opened in Kotlin and keyed with the same
|
|
109
|
+
// Keystore-sealed passphrase SecureKeyModule mints for the JS media_secure.db.
|
|
110
|
+
//
|
|
111
|
+
// These are the EXACT coordinates the JS driver react-native-sqlcipher@0.0.4 already
|
|
112
|
+
// pulls into the app (classes net.sqlcipher.database.*). Matching them means Gradle
|
|
113
|
+
// resolves a single version — one libsqlcipher.so and no duplicate classes — so the
|
|
114
|
+
// app's existing packagingOptions.pickFirst for libcrypto/libssl/libc++_shared is all
|
|
115
|
+
// the packaging config needed. Do NOT bump to the newer `sqlcipher-android` artifact:
|
|
116
|
+
// a different coordinate would ship a second SQLCipher runtime and a risky .so pickFirst.
|
|
117
|
+
implementation "net.zetetic:android-database-sqlcipher:4.3.0@aar"
|
|
118
|
+
implementation "androidx.sqlite:sqlite:2.0.1"
|
|
119
|
+
|
|
120
|
+
// Image editing (text / stickers / emoji / brush / filters)
|
|
121
|
+
// NOTE: Updated to 3.1.0 to support Kotlin 2.0. The library package remains ja.burhanrashid52.photoeditor.*
|
|
122
|
+
// and exposes exactly the API this module uses (saveAsFile -> SaveFileResult, setFilterEffect,
|
|
123
|
+
// addText/addImage, clearAllViews, OnPhotoEditorListener, setClipSourceImage/setDeleteView).
|
|
124
|
+
api "com.burhanrashid52:photoeditor:3.1.0"
|
|
125
|
+
// Cropping
|
|
126
|
+
api "com.vanniktech:android-image-cropper:4.6.0"
|
|
127
|
+
|
|
128
|
+
// Barcode / QR scanning (BarcodeScannerActivity.kt). Bundled variant ships the
|
|
129
|
+
// detection model inside the app, so scanning works fully offline with no
|
|
130
|
+
// Google Play Services model download. Do NOT swap for the
|
|
131
|
+
// com.google.android.gms:play-services-mlkit-barcode-scanning variant, which
|
|
132
|
+
// downloads the model at runtime.
|
|
133
|
+
implementation "com.google.mlkit:barcode-scanning:17.3.0"
|
|
134
|
+
implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.1.0"
|
|
135
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# Consumer R8 / ProGuard rules for react-native-custom-camera
|
|
3
|
+
#
|
|
4
|
+
# These rules are packaged INSIDE the published AAR (via `consumerProguardFiles`
|
|
5
|
+
# in android/build.gradle) and are automatically applied by R8 in any app that
|
|
6
|
+
# consumes this library. The library itself is not minified (an AAR ships plain
|
|
7
|
+
# bytecode); the CONSUMING app's release build is what runs R8, so this file is
|
|
8
|
+
# the only place the library can protect its own classes there.
|
|
9
|
+
#
|
|
10
|
+
# Without these rules, a release build with minify enabled can strip or rename
|
|
11
|
+
# the classes this library reaches reflectively (the React Native bridge) or
|
|
12
|
+
# reflectively (de)serializes (Gson) — which crashes after capture and, because
|
|
13
|
+
# upload-state recovery runs in Activity.onCreate, on app relaunch.
|
|
14
|
+
# ============================================================================
|
|
15
|
+
|
|
16
|
+
# --- This library's own classes -------------------------------------------
|
|
17
|
+
# The native module, ReactPackage, view manager, Activity, foreground Service
|
|
18
|
+
# and the Gson model classes are entry points reached from React Native, the
|
|
19
|
+
# Android manifest, or Gson reflection. Keeping the (small) package intact — and
|
|
20
|
+
# unobfuscated — guarantees all of those survive minification in the consuming
|
|
21
|
+
# app. Both rules are needed: -keep protects the classes, -keepclassmembers
|
|
22
|
+
# protects fields/methods (Gson maps JSON keys to field names by reflection).
|
|
23
|
+
-keep class com.customcamera.** { *; }
|
|
24
|
+
-keepclassmembers class com.customcamera.** { *; }
|
|
25
|
+
|
|
26
|
+
# --- Gson reflective (de)serialization ------------------------------------
|
|
27
|
+
# UploadService.UploadState (has a List<String> field) and NotificationHistoryItem
|
|
28
|
+
# are (de)serialized via Gson — UploadState at startup in recoverUploadStateIfNeeded().
|
|
29
|
+
# Gson needs the generic Signature to reconstruct parameterized types like
|
|
30
|
+
# List<String>, and the annotation/inner-class attributes to resolve the nested
|
|
31
|
+
# model classes. The models themselves are already covered by the com.customcamera.**
|
|
32
|
+
# keep above; these attributes are the missing piece R8 would otherwise drop.
|
|
33
|
+
-keepattributes Signature,*Annotation*,EnclosingMethod,InnerClasses
|
|
34
|
+
|
|
35
|
+
# --- React Native bridge reflection (defensive) ---------------------------
|
|
36
|
+
# React Native invokes @ReactMethod / @ReactProp members and instantiates
|
|
37
|
+
# @ReactModule classes by reflection. React Native ships its own keep rules for
|
|
38
|
+
# these, but declaring them here keeps this library self-contained across RN
|
|
39
|
+
# versions and consuming-app configurations.
|
|
40
|
+
-keepclassmembers,allowobfuscation class * {
|
|
41
|
+
@com.facebook.react.bridge.ReactMethod <methods>;
|
|
42
|
+
}
|
|
43
|
+
-keep,allowobfuscation @com.facebook.react.module.annotations.ReactModule class * { *; }
|
|
44
|
+
-keepclassmembers,allowobfuscation class * {
|
|
45
|
+
@com.facebook.react.uimanager.annotations.ReactProp <methods>;
|
|
46
|
+
@com.facebook.react.uimanager.annotations.ReactPropGroup <methods>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
<!-- Every runtime permission below is requested JUST-IN-TIME by the feature that needs it
|
|
3
|
+
(see CustomCameraActivity); declaring one here never means it is asked for at launch. -->
|
|
4
|
+
|
|
5
|
+
<!-- Requested when the camera opens — the ONLY permission the camera launch asks for. -->
|
|
6
|
+
<uses-permission android:name="android.permission.CAMERA" />
|
|
7
|
+
<!-- Requested when the first video recording starts (a denial records a silent clip). -->
|
|
8
|
+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
9
|
+
<!-- Requested when the user first opens the gallery (bottom-left thumbnail / swipe up). -->
|
|
10
|
+
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
|
11
|
+
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
|
12
|
+
<!-- Requested on demand when the gallery's "Audio" filter is first selected (Android 13+). -->
|
|
13
|
+
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
|
14
|
+
<!-- Never requested directly: it is the system's "selected photos" outcome of the media
|
|
15
|
+
request above, and is accepted as partial gallery access. -->
|
|
16
|
+
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
|
|
17
|
+
<!-- Pre-Android 13 form of the same on-demand gallery request. -->
|
|
18
|
+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
|
|
19
|
+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
|
|
20
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
21
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
|
22
|
+
<!-- Install-time (normal) permission, no runtime prompt. Used by the in-editor GIF picker to
|
|
23
|
+
fetch GIFs from the configured provider (GIPHY/Tenor). The picker degrades to a "no
|
|
24
|
+
connection" state when offline; nothing else in the plugin performs network I/O at launch. -->
|
|
25
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
26
|
+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
27
|
+
<!-- TEMPORARILY DISABLED: system upload notifications are replaced by the in-app
|
|
28
|
+
progress banner ("onUploadProgress" events from UploadService). To re-enable,
|
|
29
|
+
uncomment this AND flip UploadService.SYSTEM_NOTIFICATIONS_ENABLED to true.
|
|
30
|
+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
31
|
+
-->
|
|
32
|
+
|
|
33
|
+
<uses-feature android:name="android.hardware.camera.any" android:required="false" />
|
|
34
|
+
|
|
35
|
+
<queries>
|
|
36
|
+
<intent>
|
|
37
|
+
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
|
38
|
+
</intent>
|
|
39
|
+
</queries>
|
|
40
|
+
|
|
41
|
+
<application>
|
|
42
|
+
<activity
|
|
43
|
+
android:name=".CustomCameraActivity"
|
|
44
|
+
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
|
45
|
+
android:exported="false"
|
|
46
|
+
android:screenOrientation="portrait"
|
|
47
|
+
android:theme="@android:style/Theme.Material.NoActionBar.Fullscreen" />
|
|
48
|
+
|
|
49
|
+
<activity
|
|
50
|
+
android:name=".BarcodeScannerActivity"
|
|
51
|
+
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
|
52
|
+
android:exported="false"
|
|
53
|
+
android:screenOrientation="portrait"
|
|
54
|
+
android:theme="@android:style/Theme.Material.NoActionBar.Fullscreen" />
|
|
55
|
+
|
|
56
|
+
<service
|
|
57
|
+
android:name=".UploadService"
|
|
58
|
+
android:foregroundServiceType="dataSync"
|
|
59
|
+
android:exported="false" />
|
|
60
|
+
|
|
61
|
+
<!-- Exposes edited/shared media files via content:// URIs for sharing and result returns -->
|
|
62
|
+
<provider
|
|
63
|
+
android:name=".CustomCameraFileProvider"
|
|
64
|
+
android:authorities="${applicationId}.camera.fileprovider"
|
|
65
|
+
android:exported="false"
|
|
66
|
+
android:grantUriPermissions="true">
|
|
67
|
+
<meta-data
|
|
68
|
+
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
69
|
+
android:resource="@xml/file_paths" />
|
|
70
|
+
</provider>
|
|
71
|
+
</application>
|
|
72
|
+
</manifest>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
package android.print;
|
|
2
|
+
|
|
3
|
+
import android.os.CancellationSignal;
|
|
4
|
+
import android.os.ParcelFileDescriptor;
|
|
5
|
+
|
|
6
|
+
public class PdfPrint {
|
|
7
|
+
|
|
8
|
+
public interface PdfPrintCallback {
|
|
9
|
+
void onSuccess();
|
|
10
|
+
void onFailure(String error);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public static void print(final PrintDocumentAdapter adapter, final PrintAttributes attributes, final ParcelFileDescriptor fd, final CancellationSignal signal, final PdfPrintCallback callback) {
|
|
14
|
+
adapter.onLayout(null, attributes, null, new PrintDocumentAdapter.LayoutResultCallback() {
|
|
15
|
+
@Override
|
|
16
|
+
public void onLayoutFinished(PrintDocumentInfo info, boolean changed) {
|
|
17
|
+
adapter.onWrite(
|
|
18
|
+
new PageRange[]{PageRange.ALL_PAGES},
|
|
19
|
+
fd,
|
|
20
|
+
signal,
|
|
21
|
+
new PrintDocumentAdapter.WriteResultCallback() {
|
|
22
|
+
@Override
|
|
23
|
+
public void onWriteFinished(PageRange[] pages) {
|
|
24
|
+
callback.onSuccess();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@Override
|
|
28
|
+
public void onWriteFailed(CharSequence error) {
|
|
29
|
+
callback.onFailure(error != null ? error.toString() : "Write failed");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@Override
|
|
33
|
+
public void onWriteCancelled() {
|
|
34
|
+
callback.onFailure("Write cancelled");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Override
|
|
41
|
+
public void onLayoutFailed(CharSequence error) {
|
|
42
|
+
callback.onFailure(error != null ? error.toString() : "Layout failed");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@Override
|
|
46
|
+
public void onLayoutCancelled() {
|
|
47
|
+
callback.onFailure("Layout cancelled");
|
|
48
|
+
}
|
|
49
|
+
}, null);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
package com.customcamera
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.graphics.Bitmap
|
|
5
|
+
import android.graphics.BitmapFactory
|
|
6
|
+
import android.graphics.ImageDecoder
|
|
7
|
+
import android.graphics.drawable.Animatable
|
|
8
|
+
import android.graphics.drawable.Drawable
|
|
9
|
+
import android.net.Uri
|
|
10
|
+
import android.os.Build
|
|
11
|
+
import android.os.Handler
|
|
12
|
+
import android.os.Looper
|
|
13
|
+
import android.widget.ImageView
|
|
14
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
15
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
16
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
17
|
+
import java.io.File
|
|
18
|
+
import java.util.concurrent.Executors
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* ReactNative view manager for animated images (GIF) in the full-screen media viewer.
|
|
22
|
+
*
|
|
23
|
+
* ReactNative's own `<Image>` renders only a static first frame for a GIF on Android unless the
|
|
24
|
+
* host app adds Fresco's `animated-gif` decoder — a dependency every consumer of this library
|
|
25
|
+
* would have to add for themselves. Decoding here instead keeps the AAR dependency-free and
|
|
26
|
+
* makes animation work out of the box for every consumer.
|
|
27
|
+
*
|
|
28
|
+
* Mirrors [NativeVideoViewManager]'s prop contract exactly, because the viewer drives both the
|
|
29
|
+
* same way: `src` with a same-src guard so a recycled FlatList cell never shows the previous
|
|
30
|
+
* item, and `active` so only the currently-visible page animates.
|
|
31
|
+
*/
|
|
32
|
+
class AnimatedImageViewManager : SimpleViewManager<AnimatedImageView>() {
|
|
33
|
+
override fun getName() = "NativeAnimatedImageView"
|
|
34
|
+
|
|
35
|
+
override fun createViewInstance(reactContext: ThemedReactContext): AnimatedImageView =
|
|
36
|
+
AnimatedImageView(reactContext)
|
|
37
|
+
|
|
38
|
+
override fun onDropViewInstance(view: AnimatedImageView) {
|
|
39
|
+
view.release()
|
|
40
|
+
super.onDropViewInstance(view)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@ReactProp(name = "src")
|
|
44
|
+
fun setSrc(view: AnimatedImageView, src: String?) {
|
|
45
|
+
view.setSource(src)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Whether this slide is the currently-visible page. Deactivating stops the animation and
|
|
50
|
+
* leaves the frame it stopped on, so an off-screen or recycled cell never burns CPU
|
|
51
|
+
* animating something the user cannot see.
|
|
52
|
+
*
|
|
53
|
+
* Defaults to true so a single-image consumer that never sets it just animates.
|
|
54
|
+
*/
|
|
55
|
+
@ReactProp(name = "active", defaultBoolean = true)
|
|
56
|
+
fun setActive(view: AnimatedImageView, active: Boolean) {
|
|
57
|
+
view.setActive(active)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** `contain` (default) or `cover`, matching the `resizeMode` names used on the JS side. */
|
|
61
|
+
@ReactProp(name = "resizeMode")
|
|
62
|
+
fun setResizeMode(view: AnimatedImageView, resizeMode: String?) {
|
|
63
|
+
view.setResizeMode(resizeMode)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* An [ImageView] that decodes and plays an animated image, falling back to a static first
|
|
69
|
+
* frame wherever animation is unavailable.
|
|
70
|
+
*
|
|
71
|
+
* [ImageDecoder] and `AnimatedImageDrawable` are API 28+. This library's minSdk is 24, so on
|
|
72
|
+
* API 24-27 the view decodes the first frame with BitmapFactory — the same frame the grid and
|
|
73
|
+
* strip thumbnails already show. The image is still displayed correctly and the underlying
|
|
74
|
+
* file is untouched either way; only the animation is absent on those versions.
|
|
75
|
+
*/
|
|
76
|
+
class AnimatedImageView(context: Context) : ImageView(context) {
|
|
77
|
+
private val mainHandler = Handler(Looper.getMainLooper())
|
|
78
|
+
|
|
79
|
+
// Decoding reads and inflates a whole animated image, which must never run on the main
|
|
80
|
+
// thread during a swipe. A single-thread executor also serialises decodes, so a fast swipe
|
|
81
|
+
// through several slides can't run N decodes in parallel and spike memory.
|
|
82
|
+
private val decodeExecutor = Executors.newSingleThreadExecutor()
|
|
83
|
+
|
|
84
|
+
private var currentSrc: String? = null
|
|
85
|
+
private var isActive = true
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Incremented on every source change. A decode that finishes after its source has been
|
|
89
|
+
* replaced (fast swipe, cell recycled) compares its captured value against this and drops
|
|
90
|
+
* its result instead of painting the wrong image into the cell.
|
|
91
|
+
*/
|
|
92
|
+
private var decodeGeneration = 0
|
|
93
|
+
|
|
94
|
+
init {
|
|
95
|
+
scaleType = ScaleType.FIT_CENTER
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
fun setSource(src: String?) {
|
|
99
|
+
if (src == currentSrc) return
|
|
100
|
+
currentSrc = src
|
|
101
|
+
decodeGeneration++
|
|
102
|
+
val generation = decodeGeneration
|
|
103
|
+
|
|
104
|
+
stopAnimation()
|
|
105
|
+
setImageDrawable(null)
|
|
106
|
+
|
|
107
|
+
if (src.isNullOrEmpty()) return
|
|
108
|
+
|
|
109
|
+
decodeExecutor.execute {
|
|
110
|
+
val drawable = decode(src)
|
|
111
|
+
mainHandler.post {
|
|
112
|
+
if (generation != decodeGeneration) {
|
|
113
|
+
// A newer source won the race — discard this result rather than flashing it.
|
|
114
|
+
return@post
|
|
115
|
+
}
|
|
116
|
+
if (drawable == null) return@post
|
|
117
|
+
setImageDrawable(drawable)
|
|
118
|
+
if (isActive) startAnimation()
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
fun setActive(active: Boolean) {
|
|
124
|
+
if (isActive == active) return
|
|
125
|
+
isActive = active
|
|
126
|
+
if (active) startAnimation() else stopAnimation()
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
fun setResizeMode(resizeMode: String?) {
|
|
130
|
+
scaleType = if (resizeMode == "cover") ScaleType.CENTER_CROP else ScaleType.FIT_CENTER
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Stop animating and drop the decoded frames; called when ReactNative discards the view. */
|
|
134
|
+
fun release() {
|
|
135
|
+
decodeGeneration++
|
|
136
|
+
stopAnimation()
|
|
137
|
+
setImageDrawable(null)
|
|
138
|
+
decodeExecutor.shutdownNow()
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
override fun onDetachedFromWindow() {
|
|
142
|
+
stopAnimation()
|
|
143
|
+
super.onDetachedFromWindow()
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
override fun onAttachedToWindow() {
|
|
147
|
+
super.onAttachedToWindow()
|
|
148
|
+
if (isActive) startAnimation()
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
private fun startAnimation() {
|
|
152
|
+
(drawable as? Animatable)?.let { if (!it.isRunning) it.start() }
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
private fun stopAnimation() {
|
|
156
|
+
(drawable as? Animatable)?.let { if (it.isRunning) it.stop() }
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Decode [src] into an animated drawable where the platform supports it, else a static
|
|
161
|
+
* first-frame bitmap drawable. Any failure returns null and leaves the cell empty rather
|
|
162
|
+
* than crashing the viewer.
|
|
163
|
+
*/
|
|
164
|
+
private fun decode(src: String): Drawable? {
|
|
165
|
+
val uri = runCatching { Uri.parse(src) }.getOrNull() ?: return null
|
|
166
|
+
|
|
167
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
168
|
+
runCatching {
|
|
169
|
+
val source = imageDecoderSource(uri) ?: return@runCatching null
|
|
170
|
+
ImageDecoder.decodeDrawable(source)
|
|
171
|
+
}.getOrNull()?.let { return it }
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return decodeStaticFrame(uri)?.let { android.graphics.drawable.BitmapDrawable(resources, it) }
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@androidx.annotation.RequiresApi(Build.VERSION_CODES.P)
|
|
178
|
+
private fun imageDecoderSource(uri: Uri): ImageDecoder.Source? {
|
|
179
|
+
// A plain path or file:// URI is read directly; going through the resolver for a file the
|
|
180
|
+
// app already owns would only add an IPC round trip.
|
|
181
|
+
val path = if (uri.scheme == null || uri.scheme == "file") uri.path else null
|
|
182
|
+
if (path != null) {
|
|
183
|
+
val file = File(path)
|
|
184
|
+
if (file.exists()) return ImageDecoder.createSource(file)
|
|
185
|
+
}
|
|
186
|
+
return ImageDecoder.createSource(context.contentResolver, uri)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
private fun decodeStaticFrame(uri: Uri): Bitmap? =
|
|
190
|
+
runCatching {
|
|
191
|
+
val path = if (uri.scheme == null || uri.scheme == "file") uri.path else null
|
|
192
|
+
if (path != null && File(path).exists()) {
|
|
193
|
+
return@runCatching BitmapFactory.decodeFile(path)
|
|
194
|
+
}
|
|
195
|
+
context.contentResolver.openInputStream(uri)?.use { stream ->
|
|
196
|
+
BitmapFactory.decodeStream(stream)
|
|
197
|
+
}
|
|
198
|
+
}.getOrNull()
|
|
199
|
+
}
|