A sleek, modern camera application built with Jetpack Compose and CameraX, featuring photo capture, video recording, and automatic gallery saving — all wrapped in a premium dark-themed UI.
- 📷 Photo Capture — Tap to capture high-quality photos with shutter sound feedback
- 🎥 Video Recording — Record videos with audio, pulsing REC indicator, and tone feedback
- 💾 Auto Gallery Save — Photos & videos saved directly to
DCIM/CameraXvia MediaStore - 🔄 Camera Flip — Switch between front and back cameras with smooth rotation animation
- 🖼️ Photo Gallery — Browse captured photos in an elegant bottom sheet with staggered grid
- 🌙 Dark Theme — Immersive camera-first dark UI with transparent system bars
- 🎨 Modern Design — Frosted-glass controls, circular buttons, micro-animations throughout
| Layer | Technology |
|---|---|
| UI | Jetpack Compose + Material 3 |
| Camera | CameraX (Camera2 backend) |
| Architecture | MVVM with ViewModel |
| Media Storage | MediaStore API (scoped storage) |
| Audio Feedback | MediaActionSound + ToneGenerator |
| Language | Kotlin |
| Min SDK | 29 (Android 10) |
| Target SDK | 36 |
com.heptdi.camerax/
├── MainActivity.kt # Main activity — camera logic, UI, gallery saving
├── presentation/
│ ├── CameraPreview.kt # Camera feed composable (PreviewView)
│ ├── MainViewModel.kt # ViewModel holding captured bitmaps
│ └── PhotoBottomSheetContent.kt # Gallery grid in bottom sheet
└── ui/theme/
├── Color.kt # Dark camera color palette
├── Theme.kt # Forced dark theme + transparent bars
└── Type.kt # Typography definitions
- Android Studio Ladybug or newer
- JDK 11+
- Physical Android device (camera required)
# Clone the repository
git clone https://github.com/AyushKCatgithub/CameraX.git
cd CameraX
# Build the debug APK
./gradlew assembleDebug
# Install on connected device
./gradlew installDebugThe app requests at runtime:
CAMERA— Required for photo/video captureRECORD_AUDIO— Required for video recording with audio
No storage permissions needed — uses MediaStore API (Android 10+).
- Floating control bar — Rounded pill-shaped bottom bar with frosted glass effect, clear of navigation buttons
- Capture button — Large white-ring circle with inner fill
- Record button — Animated border color transition (white → red), stop icon when recording
- REC indicator — Pulsing red dot + text overlay during video recording
- Camera flip — 180° rotation animation on the switch icon
// CameraX
androidx.camera:camera-core
androidx.camera:camera-camera2
androidx.camera:camera-lifecycle
androidx.camera:camera-video
androidx.camera:camera-view
androidx.camera:camera-extensions
// Compose
androidx.compose:compose-bom
androidx.compose.material3:material3
androidx.compose.material:material-icons-extended
// Architecture
androidx.lifecycle:lifecycle-viewmodel-composeThis project is open source and available under the MIT License.
Made with ❤️ by AyushKCatgithub