Skip to content

Conversation

@Elelan
Copy link

@Elelan Elelan commented Sep 11, 2025

No description provided.

Elelan added 6 commits August 28, 2025 14:01
…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
@Copilot Copilot AI review requested due to automatic review settings September 11, 2025 15:19
Copy link

Copilot AI left a 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
Copy link

Copilot AI Sep 11, 2025

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.

Suggested change
import android.webkit.MimeTypeMap

Copilot uses AI. Check for mistakes.
.padding(4.dp),
horizontalArrangement = Arrangement.spacedBy(4.dp)
) {
CameraCaptureMode.entries.forEach { mode ->
Copy link

Copilot AI Sep 11, 2025

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+.

Suggested change
CameraCaptureMode.entries.forEach { mode ->
CameraCaptureMode.values().forEach { mode ->

Copilot uses AI. Check for mistakes.
Copy link

@github-advanced-security github-advanced-security bot left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant