# android/user-interface-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-user-interface-samples).**

4,631 stars · 1,679 forks · Kotlin · apache-2.0 · archived

## Links

- GitHub: https://github.com/android/user-interface-samples
- awesome-repositories: https://awesome-repositories.com/repository/android-user-interface-samples.md

## Description

This repository provides a collection of runnable code samples that demonstrate best practices for building Android user interfaces across a wide range of devices and scenarios. The samples cover the full spectrum of modern Android UI patterns, from adaptive layouts that automatically adjust to large screens and foldable devices to interactive home screen widgets and conversation-style notifications.

The samples explore key capability areas including adaptive layouts powered by window size classes, foldable screen adaptation with hinge state handling, and declarative UI construction using Compose. They also demonstrate notification integrations such as conversation channels, bubbles, and direct share targets, as well as haptic feedback design that synchronizes vibration patterns with visual animations. Keyboard-aware UI components, rich text rendering with hyphenation and emoji support, and dynamic shortcut management are also covered.

Additional topics include settings screen composition, splash screen customization, immersive mode, on-demand font loading, drag-and-drop interactions, custom quick settings tiles, and widget pin-to-home-screen functionality. The project is written in Kotlin and is organized into runnable demos that developers can inspect and adapt for their own applications.

## Tags

### Mobile Development

- [UI Pattern Samples](https://awesome-repositories.com/f/mobile-development/android-ecosystem/android-ui-components/ui-pattern-samples.md) — A collection of runnable code examples demonstrating best practices for building Android user interfaces across devices and scenarios.
- [Conversation Notification Styling](https://awesome-repositories.com/f/mobile-development/android-notification-channels/conversation-notification-styling.md) — Posts Android notifications styled as conversations with bubbles, per-conversation channels, and direct share targets.
- [Conversation Shortcut Integrations](https://awesome-repositories.com/f/mobile-development/dynamic-shortcut-management/conversation-shortcut-integrations.md) — Examples that create conversation notification bubbles, manage channels, and publish dynamic shortcuts for quick actions and sharing.
- [Keyboard-Aware UI Management](https://awesome-repositories.com/f/mobile-development/keyboard-aware-ui-management.md) — Demos that animate views with keyboard visibility changes and toggle the keyboard via scroll gestures for smooth input handling.
- [Notification Bubbles](https://awesome-repositories.com/f/mobile-development/android-notification-channels/conversation-notification-styling/notification-bubbles.md) — Android Notification Bubbles: Floats notifications above other content as expandable bubbles that collapse when idle for quick access. ([source](https://github.com/android/user-interface-samples/tree/main/People))
- [Dynamic Shortcut Management](https://awesome-repositories.com/f/mobile-development/dynamic-shortcut-management.md) — Publishes dynamic shortcuts and direct share targets via ShortcutManager and ChooserTargetService contracts.

### Networking & Communication

- [Conversation Notification Channels](https://awesome-repositories.com/f/networking-communication/notification-integrations/conversation-notification-channels.md) — Posts conversation-style notifications using NotificationCompat and manages per-channel importance preferences.
- [Direct Share Targets](https://awesome-repositories.com/f/networking-communication/share-target-providers/direct-share-targets.md) — Android Direct Share Target Exposure: Publishes share targets as direct conversation links in the system share sheet for quick sharing. ([source](https://github.com/android/user-interface-samples/tree/main/People))

### User Interface & Experience

- [Declarative UI Paradigms](https://awesome-repositories.com/f/user-interface-experience/declarative-ui-paradigms.md) — Builds interfaces by describing the UI tree as composable functions that re-render automatically when state changes.
- [Home Screen Widgets](https://awesome-repositories.com/f/user-interface-experience/home-screen-widgets.md) — Creates interactive home screen widgets by updating RemoteViews and handling user touch intents.
- [Interactive App Widgets](https://awesome-repositories.com/f/user-interface-experience/home-screen-widgets/interactive-app-widgets.md) — Creates home screen widgets that display dynamic content and respond to user touch events. ([source](https://github.com/android/user-interface-samples/tree/main/AppWidget))
- [Foldable Screen Layouts](https://awesome-repositories.com/f/user-interface-experience/responsive-layout-adapters/adaptive-ui-layouts/foldable-screen-layouts.md) — Adjusts interface layout to foldable screen sizes and hinge states across device generations. ([source](https://github.com/android/user-interface-samples/tree/main/WindowManager))
- [Large Screen Adaptation Patterns](https://awesome-repositories.com/f/user-interface-experience/responsive-layout-adapters/adaptive-ui-layouts/large-screen-adaptation-patterns.md) — Adjusts Android app layouts for foldable screens and large-screen devices using adaptive patterns.
- [Large Screen Layouts](https://awesome-repositories.com/f/user-interface-experience/responsive-layout-adapters/adaptive-ui-layouts/large-screen-layouts.md) — Provides adaptive layouts for large screens and foldable devices using canonical patterns like list-detail and supporting pane. ([source](https://github.com/android/user-interface-samples/tree/main/CanonicalLayouts))
- [Window Size Class Layouts](https://awesome-repositories.com/f/user-interface-experience/responsive-layout-adapters/adaptive-ui-layouts/window-size-class-layouts.md) — Chooses between list-detail, feed, and supporting pane layouts based on the canonical WindowSizeClass.
- [Android Rich Text Rendering](https://awesome-repositories.com/f/user-interface-experience/rich-text-renderers/android-rich-text-rendering.md) — Samples that construct styled text with multiple formats, automatic hyphenation, clickable links, and emoji rendering on older devices.
- [Interactive Feedback Demos](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interaction-and-event-handling/drag-and-drop-interactions/interactive-feedback-demos.md) — Runnable code that demonstrates haptic sequences synchronized with animations, drag-and-drop content, and interactive app widgets.
- [Haptic Feedback Controllers](https://awesome-repositories.com/f/user-interface-experience/haptic-feedback-controllers.md) — Generates rich haptic sequences by chaining vibration effects with millisecond timing and custom amplitude.
- [Animation-Synchronized Haptic Sequences](https://awesome-repositories.com/f/user-interface-experience/haptic-feedback-controllers/animation-synchronized-haptic-sequences.md) — Android Haptic-Animation Synchronization: Ties vibration patterns to visual animation progress so tactile feedback reinforces on-screen motion. ([source](https://github.com/android/user-interface-samples/tree/main/Haptics))
- [Rich Haptic Sequence Composition](https://awesome-repositories.com/f/user-interface-experience/haptic-feedback-controllers/rich-haptic-sequence-composition.md) — Android Rich Haptic Sequence Composition: Chains vibration primitives with controlled amplitude and timing to create complex tactile effects. ([source](https://github.com/android/user-interface-samples/tree/main/Haptics))
- [Haptic Feedback Customization](https://awesome-repositories.com/f/user-interface-experience/haptic-feedback-customization.md) — Choreographs haptic patterns by synchronizing vibration amplitude and timing with visual animations and touch events.
- [Immersive Mode System Bars](https://awesome-repositories.com/f/user-interface-experience/immersive-mode-system-bars.md) — Temporarily hides status and navigation bars during full-screen experiences, revealing them on edge swipes. ([source](https://github.com/android/user-interface-samples/tree/main/ImmersiveMode))
- [Scroll-Triggered Keyboard Toggles](https://awesome-repositories.com/f/user-interface-experience/navigation-scrolling-tools/keyboard-driven-scroll-alignment/scroll-triggered-keyboard-toggles.md) — Android Scroll-Triggered Keyboard Toggle: Toggles keyboard visibility in response to scroll gestures, sliding it smoothly on and off the screen. ([source](https://github.com/android/user-interface-samples/tree/main/WindowInsetsAnimation))
- [Rich Text Styling](https://awesome-repositories.com/f/user-interface-experience/rich-text-styling.md) — Constructs styled text with multiple formats like bold, italic, and color using a composable builder. ([source](https://github.com/android/user-interface-samples/tree/main/Text))
- [Modular Preference Controls](https://awesome-repositories.com/f/user-interface-experience/settings-screen-extensions/modular-preference-controls.md) — Builds settings screens by composing modular preference controls into a structured interface. ([source](https://github.com/android/user-interface-samples/tree/main/Preferences))
- [Splash Screen Customizations](https://awesome-repositories.com/f/user-interface-experience/splash-screen-customizations.md) — Adds animated icon or custom transition animation at app launch to improve perceived loading performance. ([source](https://github.com/android/user-interface-samples/tree/main/SplashScreen))
- [Lightweight Markup Converters](https://awesome-repositories.com/f/user-interface-experience/text-styling/lightweight-markup-converters.md) — Converts plain text markers into styled quotes, code blocks, and bullet points. ([source](https://github.com/android/user-interface-samples/tree/main/TextStyling))
- [Inset-Driven Animations](https://awesome-repositories.com/f/user-interface-experience/window-management/inset-adjusters/inset-driven-animations.md) — Coordinates system bar visibility with view animations by listening to window insets changes.
