# android/compose-samples

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/android-compose-samples).**

22,893 stars · 5,382 forks · Kotlin · apache-2.0

## Links

- GitHub: https://github.com/android/compose-samples
- Homepage: https://developer.android.com/jetpack/compose
- awesome-repositories: https://awesome-repositories.com/repository/android-compose-samples.md

## Topics

`android` `jetpack-compose`

## Description

Compose Samples is a collection of reference implementations for the Jetpack Compose UI library, serving as a practical guide for building native Android user interfaces. It demonstrates the use of a declarative framework where Kotlin functions describe layout structures and data dependencies, enabling developers to construct modern, reactive interfaces.

The repository highlights architectural patterns that prioritize maintainability and testability, such as layered organization and unidirectional data flow. It showcases how to implement adaptive layouts that automatically adjust to various screen sizes, orientations, and foldable form factors, alongside the integration of standardized design systems and theming tools.

These samples cover a broad range of development capabilities, including lifecycle-aware component management, dependency injection, and navigation handling. The collection also illustrates how to manage complex window insets, integrate modern declarative components into legacy view hierarchies, and implement state management patterns that remain consistent across configuration changes.

## Tags

### User Interface & Experience

- [Declarative UI Libraries](https://awesome-repositories.com/f/user-interface-experience/declarative-ui-libraries.md) — Provides a declarative UI library for building native Android interfaces using Kotlin functions.
- [Declarative UI Frameworks](https://awesome-repositories.com/f/user-interface-experience/component-utilities/ui-frameworks/rendering-models/declarative-frameworks/declarative-ui-frameworks.md) — Provides a declarative framework for building native user interfaces using functional component composition.
- [Reactive State Management](https://awesome-repositories.com/f/user-interface-experience/reactive-state-management.md) — Implements reactive data patterns to synchronize user interface components with underlying data sources across configuration changes. ([source](https://developer.android.com/jetpack/compose))
- [Responsive Layouts](https://awesome-repositories.com/f/user-interface-experience/responsive-layouts.md) — Implements responsive interfaces that automatically adjust to various screen sizes and foldable form factors.
- [Material Design Libraries](https://awesome-repositories.com/f/user-interface-experience/material-design-libraries.md) — Implements standardized Material Design components and theming to ensure a consistent visual identity.
- [Display Feature Detectors](https://awesome-repositories.com/f/user-interface-experience/display-mode-detection/display-feature-detectors.md) — Queries information about screen cutouts and display shapes to adapt layouts for irregular device screens. ([source](https://developer.android.com/reference/kotlin/android/view/WindowInsets))
- [Navigation Controllers](https://awesome-repositories.com/f/user-interface-experience/navigation-controllers.md) — Manages application flow and transitions between views while maintaining state across the user journey. ([source](https://developer.android.com/jetpack))
- [Responsive Design Patterns](https://awesome-repositories.com/f/user-interface-experience/responsive-design-patterns.md) — Demonstrates responsive design patterns that adapt interfaces to various screen sizes and foldable form factors.
- [Responsive Layout Adapters](https://awesome-repositories.com/f/user-interface-experience/responsive-layout-adapters.md) — Provides responsive layout components that automatically adjust to varying screen sizes and device form factors.
- [Design System Implementations](https://awesome-repositories.com/f/user-interface-experience/ui-architecture/design-utilities/design-systems/component-implementation-patterns/design-system-implementations.md) — Applies consistent visual styling and typography through centralized design system implementations. ([source](https://cdn.jsdelivr.net/gh/android/compose-samples@main/README.md))
- [Inset Dispatchers](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interaction-and-event-handling/event-handling-architectures/input-event-dispatchers/inset-dispatchers.md) — Signals that window insets have been fully handled at a specific view level to stop further propagation and improve layout performance. ([source](https://developer.android.com/reference/kotlin/android/view/WindowInsets))
- [Hybrid View Bridges](https://awesome-repositories.com/f/user-interface-experience/view-frameworks/hybrid-view-bridges.md) — Integrates modern declarative components into legacy view hierarchies for incremental migration. ([source](https://developer.android.com/jetpack/compose))
- [Inset Adjusters](https://awesome-repositories.com/f/user-interface-experience/window-management/inset-adjusters.md) — Modifies inset data to apply specific padding or margin requirements to child views within the layout hierarchy. ([source](https://developer.android.com/reference/kotlin/android/view/WindowInsets))
- [Inset Calculators](https://awesome-repositories.com/f/user-interface-experience/window-management/inset-calculators.md) — Measures the dimensions of system UI elements or screen areas that overlap with the application window to ensure content remains visible. ([source](https://developer.android.com/reference/kotlin/android/view/WindowInsets))
- [Presentation Transitions](https://awesome-repositories.com/f/user-interface-experience/animation-and-motion-systems/presentation-transitions.md) — Supports fluid motion and state-based transitions between interface elements to improve responsiveness. ([source](https://cdn.jsdelivr.net/gh/android/compose-samples@main/README.md))
- [Visibility Utilities](https://awesome-repositories.com/f/user-interface-experience/visibility-utilities.md) — Checks whether system UI elements are visible and retrieves their potential inset values regardless of their current state. ([source](https://developer.android.com/reference/kotlin/android/view/WindowInsets))
- [Obscured Region Identifiers](https://awesome-repositories.com/f/user-interface-experience/window-management-systems/obscured-region-identifiers.md) — Locates specific rectangular areas of the window covered by system UI components to prevent overlapping critical content. ([source](https://developer.android.com/reference/kotlin/android/view/WindowInsets))
- [Custom Layouts](https://awesome-repositories.com/f/user-interface-experience/layout-components/custom-layouts.md) — Provides base structures for constructing bespoke interface arrangements and complex grid layouts. ([source](https://cdn.jsdelivr.net/gh/android/compose-samples@main/README.md))
- [UI Inspection Tools](https://awesome-repositories.com/f/user-interface-experience/ui-inspection-tools.md) — Provides tools for inspecting UI hierarchies and visualizing interface changes in real-time. ([source](https://developer.android.com/studio))

### Mobile Development

- [Android Development](https://awesome-repositories.com/f/mobile-development/android-ecosystem/android-development.md) — Serves as a comprehensive toolkit for Android application development, including dependency injection and lifecycle management.
- [Android Activity Lifecycle Management](https://awesome-repositories.com/f/mobile-development/android-activity-lifecycle-management.md) — Manages component behavior based on activity and fragment lifecycle states to prevent memory leaks. ([source](https://developer.android.com/jetpack))

### Software Engineering & Architecture

- [Application Architecture Patterns](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/layering-presentation/application-layer-architectures/application-architecture-patterns.md) — Provides architectural patterns that isolate business logic from presentation for maintainability.
- [Unidirectional Data Flow Architectures](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/layering-presentation/application-layer-architectures/state-management-architectures/action-reducer-architectures/unidirectional-data-flow-architectures.md) — Implements unidirectional data flow to maintain predictable synchronization between state and UI. ([source](https://developer.android.com/topic/architecture))
- [Layered Architectures](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/layering-presentation/layered-architectures.md) — Organizes code into distinct interface, data, and domain layers to isolate business logic.
- [Dependency Injection](https://awesome-repositories.com/f/software-engineering-architecture/dependency-injection.md) — Automates dependency provision to simplify testing and component lifecycle management. ([source](https://developer.android.com/jetpack))
- [Dependency Injection Containers](https://awesome-repositories.com/f/software-engineering-architecture/dependency-injection-containers.md) — Implements dependency injection to decouple components and simplify object lifecycle management.
- [Application Layer Architectures](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/layering-presentation/application-layer-architectures.md) — Structures application code into interface, data, and domain layers for improved maintainability. ([source](https://developer.android.com/topic/architecture))

### Web Development

- [Declarative UI Composition](https://awesome-repositories.com/f/web-development/declarative-ui-composition.md) — Uses functional composition to define interface structures and data dependencies for predictable updates. ([source](https://developer.android.com/jetpack))

### Business & Productivity Software

- [Declarative View Embeds](https://awesome-repositories.com/f/business-productivity-software/view-management/declarative-view-embeds.md) — Enables incremental migration by embedding declarative components within legacy view systems.

### Data & Databases

- [Data Persistence and Storage](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage.md) — Provides local database systems for persistent storage and offline capabilities. ([source](https://developer.android.com/jetpack))
- [State Ownership Models](https://awesome-repositories.com/f/data-databases/data-type-managers/state-ownership-models.md) — Ensures consistent state management by designating a single source of truth for data. ([source](https://developer.android.com/topic/architecture))

### Development Tools & Productivity

- [Background Task Schedulers](https://awesome-repositories.com/f/development-tools-productivity/background-task-schedulers.md) — Supports background task scheduling for deferrable operations without blocking the main thread. ([source](https://developer.android.com/jetpack))
- [Performance Benchmarking](https://awesome-repositories.com/f/development-tools-productivity/performance-benchmarking.md) — Provides tools for benchmarking application execution to identify performance bottlenecks. ([source](https://developer.android.com/jetpack))

### Operating Systems & Systems Programming

- [Hardware Emulators](https://awesome-repositories.com/f/operating-systems-systems-programming/virtualization-emulation/hardware-emulators.md) — Tests applications on virtual device instances to ensure responsive layouts adapt to different configurations. ([source](https://developer.android.com/studio))

### DevOps & Infrastructure

- [Build Configuration Management](https://awesome-repositories.com/f/devops-infrastructure/build-configuration-management.md) — Manages build configurations to generate multiple application versions from a single project. ([source](https://developer.android.com/studio))

### Security & Cryptography

- [Biometric Authentication](https://awesome-repositories.com/f/security-cryptography/biometric-authentication.md) — Integrates device-level biometric sensors to verify user identity and protect sensitive data. ([source](https://developer.android.com/jetpack))
