Horologist
repository·main·Indexed 20 days ago
https://github.com/google/horologistA suite of libraries for Wear OS developers providing essential components and abstractions not yet in standard AndroidX libraries, including Media toolkits, specialized Composables, Authentication flows, and Health Service lifecycle management.
What's inside Horologist
- The Health Composables library provides Jetpack Compose components specifically designed for health-related use cases. It is primarily built to work with Android Health Services.
Overview of Auth Composables
mainHorologist provides a set of Jetpack Compose components, screens, and dialogs designed to handle common authentication UI flows.
Key characteristics:
- Implementation Agnostic: The library does not depend on any specific authentication provider (e.g., Google Sign-In, Firebase). It provides the UI layer that you integrate with your own authentication logic.
- Component Types: The library includes full-screen components, dialogs for confirmation, and small UI elements like chips for sign-in options.
Overview of Horologist Auth libraries
mainHorologist provides a suite of authentication libraries designed to help developers build apps that follow the Sign-In guidelines for Wear OS. The libraries cover various authentication methods for both Wear and Mobile platforms.
Depending on your project's needs, you can choose from the following libraries:
auth-composables: Provides composable screens for authentication use cases. This library has no dependency onauth-data, making it suitable if you want to provide your own data layer.auth-ui: Provides composable screens for authentication use cases that are pre-integrated with theauth-datalibrary.auth-data: Provides the implementation for Wear apps for most authentication methods listed in the Authentication on wearables guide.auth-data-phone: Provides the implementation for Mobile apps for a subset of the authentication methods provided byauth-data.
Overview of Horologist libraries
mainHorologist is a collection of libraries designed to supplement Wear OS developers with common features not yet available in standard AndroidX libraries. It provides specialized toolkits for Media, Composables, Layout, Material Design, Authentication, DataLayer, and Tiles.Overview of Wear Media3 Backend features
mainThe
horologist-media3-backendmodule provides optimized media playback capabilities for Wear OS by building on top of the Media3 player (ExoPlayer).Key features include:
- Optimized Playback: Leverages ExoPlayer configurations specifically tuned for Wear OS.
- Audio Offload: Uses
AudioOffloadManagerto manage background audio playback efficiently to save battery. - Best Practices: Implements Android-recommended approaches for wearable audio overlays and power management.
Overview of the Horologist Media Toolkit
mainThe Horologist Media Toolkit is a collection of libraries designed to help developers build media applications for Wear OS. It is organized into layers (UI, domain, and data) to allow for modular integration based on your project's specific needs.
Core Modules
media-ui: Common media UI components and screens (e.g.,PlayerScreen).media: The domain model providing an abstraction for media functionality that is agnostic of the specificPlayerimplementation.media-data: An implementation of themediadomain module using Media3.media3-backend: APlayerimplementation built on top of Media3, including features like avoiding music playback on the watch speaker.audio: Domain model for audio-related functionality, such as Volume Control and Output switching, providing aFlowof changes.audio-ui: UI components for audio functionality (e.g., Volume Control and Output switching).media-sample: A sample application demonstrating how to use the toolkit to listen to downloaded music.
Use the Media UI library for media player components
mainThe Media UI library provides a set of Jetpack Compose components designed for media player applications. It includes:
- Individual controls: Play, Pause, and Seek buttons.
- Combined components: Components like
PlayPauseButtonandMediaControlButtonsthat group multiple controls. - Screens: High-level layouts such as
PlayerScreen,BrowseScreen, andEntityScreen.
The library is decoupled from specific player implementations, allowing it to be used with any media player backend.
Use Horologist Composables for Date and Time selection
mainThe
horologist-composableslibrary provides specialized UI components for common temporal selection tasks in Jetpack Compose, including:- Date Picker: A specialized component for selecting dates.
- Time Pickers: Supports both 12-hour and 24-hour formats.
- Segmented Progress Indicator: A UI component for displaying progress across multiple segments.
Use the Media UI Material 3 Library
mainThe Media UI Material 3 library provides high-quality Wear OS Jetpack Compose components specifically designed for media player applications. It is built on top of Wear Compose Material 3 and is decoupled from specific player implementations.
Key features include:
- Individual Controls: Specialized buttons for play/pause, skip, shuffle, and volume.
- Media Scaffolds: The
MediaPlayerScaffoldwhich manages key-based navigation, volume indicators, and responsive layouts. - Ready-to-use Screens: Full-screen components such as
PlaylistStreamingScreen,PlaylistDownloadScreen, andPlaylistsScreen.
Understand the Audio Model library
mainThe Audio Model library provides shared components and logic used by both theaudio-uiandaudio-ui-material3libraries. It serves as the foundational layer for building audio-related user interfaces within the Horologist ecosystem.Understand the Media UI Model library
mainThemedia-ui-modellibrary provides shared components and abstractions used by both theaudio-uiandaudio-ui-material3libraries. It serves as the foundational layer for media-related UI models in the Horologist ecosystem.Requirements for Token Sharing
mainHorologist's Auth library uses the Wearable Data Layer API to transfer authentication data. For token sharing to work, your phone and watch apps must meet these criteria:
- Have identical APK signatures and signature schemes.
- Share the same package name.