Refactor, Modernize & Enhance Android Camera Samples with new features#636
Refactor, Modernize & Enhance Android Camera Samples with new features#636madebymozart wants to merge 41 commits into
Conversation
…iewfinder` for camera preview and remove unused MLKit dependencies.
…0x1920 and set viewfinder scale type to `FIT_CENTER`.
…introduce `createSample.gradle.kts` for sample generation, and remove `GeminiDataSource.kt`.
…age structure and update build configurations and the `camera2-takeaphoto` sample's package.
…r dynamic video configuration.
…ave recorded videos to the public Movies directory.
…ead of Movies/camera-samples.
There was a problem hiding this comment.
Code Review
This pull request performs a major cleanup of the repository by deleting several camera-related sample applications, including Camera2Basic, Camera2Extensions, Camera2SlowMotion, Camera2Video, CameraX-MLKit, and CameraX-TFLite, along with their associated source code, resources, and utility modules. Additionally, it updates the .editorconfig file with ktlint naming rules for Composable functions and modifies the CODEOWNERS file to assign new owners. There are no review comments to assess, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
This looks great, Mozart! Really nice overhaul! I did an AI code review and some manual testing. Manual testing comments:
AI review comments: 🏗️ 1. Code Pattern & Architecture Review
🛡️ 2. Security Review
🏎️ 3. Performance & Memory Review
📱 4. Modern Android Development (MAD) Review
|
donovanfm
left a comment
There was a problem hiding this comment.
See my comment on the PR for the requested changes.
Overview
The legacy
camera-samplesrepo was a loose collection of ~12 independent Gradle projects(
CameraXBasic,Camera2Basic,CameraXAdvanced, …), each with its own build, largely View-basedUI, and copy-pasted boilerplate. This PR replaces all of them with a single, modern, Compose-first
Camera Samples Catalog app — one cohesive application that showcases Camera2 and CameraX
through small, self-contained samples that share a common architecture and design system.
Screenshots
Highlights
filterable catalog on the home screen routes to each sample.
:core-theme,:core-camera, and:core-ui, withone thin library module per sample under
:samples/{api}-{feature}.UiState → ViewModel → Controller → Screenpattern (documented inandroid_architecture.md) — asealed interfaceUi state, a@HiltViewModelexposing oneStateFlow, a@Stablecontrollerthat owns the camera lifecycle, and a
Screenthat renders withwhen(state).2-column catalog, a viewfinder HUD (accent focus reticle, rule-of-thirds, torch glow), and
console-styled in-app settings menus.
createSamplegenerator../gradlew createSample -PsampleName=… -PscreenName=…scaffolds aworking, preview-only module and wires it into the build + catalog automatically.
Navigation-Compose. Formatting is enforced with Spotless (ktlint + Apache license headers).
spotlessCheck+assembleDebug.Samples
28 samples across six categories (the home screen filters by these; within a category, CameraX is
listed first, then Camera2):
HDR Video (CameraX · Camera2) · Video Stabilization (CameraX) · Flip While Recording (CameraX)
Effects (CameraX — featured)
Low-Light Boost (CameraX) · Feature Combination (CameraX)
Samples that depend on optional hardware (extensions, high-speed/HDR recording, manual sensor) detect
support at runtime and show a friendly "not supported on this device" state instead of crashing.
Module layout
Breaking changes
Removes the legacy standalone projects —
Camera2Basic,Camera2Extensions,Camera2Video,Camera2SlowMotion,CameraXBasic,CameraXAdvanced,CameraXExtensions,CameraXVideo,CameraX-MLKit,HdrViewfinder,CameraUtils, andPresentations. Their functionality isre-implemented and consolidated in the new catalog app.
Testing
./gradlew assembleDebugand./gradlew spotlessCheckpass from the project root.