Giter Club home page Giter Club logo

camerax-compose-app's Introduction

CameraXComposeApp

Overview

This Android app leverages Jetpack Compose and CameraX library to provide camera functionality for capturing photos and recording videos.

Features

  • Switch between front and back cameras.
  • Capture photos with rotation correction.
  • Record videos with audio.
  • Display captured photos in a staggered grid layout.

Usage

  1. Ensure necessary permissions (camera and audio recording) are granted.
  2. Use the camera switch icon to toggle between front and back cameras.
  3. Click the "Take Photo" icon to capture a photo with rotation correction.
  4. Click the "Record Video" icon to start/stop recording videos with audio.
  5. Captured photos are displayed in a staggered grid layout below the camera preview.

Components

  • MainActivity: Controls the app flow and sets up the camera preview and UI.
  • MainViewModel: Manages the state of captured photos using a ViewModel.
  • CameraPreview: Displays the camera preview using a Compose composable.
  • PhotoBottomSheetContent: Displays the captured photos in a staggered grid layout using a Compose composable.

Dependencies

  • Jetpack Compose: Used for building the UI declaratively.
  • CameraX: Provides camera functionality abstraction.
    • androidx.camera.core: Core library using the camera2 implementation.
    • androidx.camera.camera2: CameraX Camera2 library.
    • androidx.camera.lifecycle: CameraX Lifecycle library.
    • androidx.camera.video: CameraX VideoCapture library.
    • androidx.camera.view: CameraX View class.
    • androidx.camera.mlkit.vision: CameraX ML Kit Vision Integration.
  • AndroidX Material Icons Extended: Provides extended Material icons support.
  • AndroidX Lifecycle ViewModel Compose: ViewModel integration for Jetpack Compose.

Permissions

Ensure the following permissions are added to your app's manifest file:

<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>

camerax-compose-app's People

Watchers

AISWARYA JAYADAS avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.