-
Notifications
You must be signed in to change notification settings - Fork 26
Feature/camera x integration #710
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
base: next
Are you sure you want to change the base?
Conversation
…ndling - Add custom camera implementation using CameraX with Compose UI - Support both photo and video capture with configurable options - Implement preview screen with video playback using ExoPlayer - Add smart permission handling that distinguishes between first-time requests, "ask every time", and permanent denials - Integrate custom camera across MainActivity, PreviewActivity, and HomeActivity - Add proper edge-to-edge display support for Android 15+ with display cutout handling - Enhance MIME type detection with fallback to file extension matching - Add dynamic permission state refresh when returning from app settings
# Conflicts: # gradle/libs.versions.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates CameraX functionality into the OpenArchive app to provide a custom camera interface for capturing photos and videos. The implementation replaces the previous system camera integration with a comprehensive custom camera solution that offers enhanced user control and features.
- Adds CameraX libraries and Media3 ExoPlayer dependencies for camera functionality and video preview
- Implements a complete custom camera UI with photo/video capture, flash controls, grid overlay, and camera switching
- Integrates the custom camera throughout the app's media capture workflows
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| gradle/libs.versions.toml | Adds CameraX and Media3 library version definitions and dependency declarations |
| app/src/main/java/net/opendasharchive/openarchive/features/media/camera/*.kt | Implements the complete custom camera functionality including UI, state management, and capture logic |
| app/src/main/java/net/opendasharchive/openarchive/features/media/PreviewActivity.kt | Updates media capture calls to use the new custom camera instead of system camera |
| app/src/main/java/net/opendasharchive/openarchive/features/media/Picker.kt | Adds custom camera launcher and enhanced mime type detection for captured media |
| app/src/main/java/net/opendasharchive/openarchive/features/media/MediaLaunchers.kt | Extends MediaLaunchers to include custom camera launcher |
| app/src/main/java/net/opendasharchive/openarchive/features/main/*.kt | Updates MainActivity and HomeActivity to use custom camera for media capture |
| app/src/main/AndroidManifest.xml | Adds camera permissions and CameraActivity registration |
| app/build.gradle.kts | Includes CameraX and Media3 dependencies |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| import android.content.Context | ||
| import android.net.Uri | ||
| import android.webkit.MimeTypeMap |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MimeTypeMap is imported but never used in this file. This unused import should be removed.
| import android.webkit.MimeTypeMap |
| .padding(4.dp), | ||
| horizontalArrangement = Arrangement.spacedBy(4.dp) | ||
| ) { | ||
| CameraCaptureMode.entries.forEach { mode -> |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using 'entries' property assumes Kotlin 1.9+ and may not be available in older versions. Consider using 'values()' for better compatibility or ensure the project uses Kotlin 1.9+.
| CameraCaptureMode.entries.forEach { mode -> | |
| CameraCaptureMode.values().forEach { mode -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
No description provided.