Docs
Design system
The Material 3 Expressive shapes, colour, type and motion behind Petal's interface.
1. Design Direction: Material 3 Expressive
Petal Browser implements Google's Material 3 Expressive design specification (androidx.compose.material3:material3:1.5.0-alpha17), prioritizing vibrant dynamic geometry, living visual hierarchy, playful spring animations, and tactile responsiveness.
2. Dynamic 35 Material 3 Expressive Shapes Catalog
Implemented in com.petal.browser.ui.theme.PetalMaterialShapes.kt using androidx.graphics.shapes.RoundedPolygon:
Every interactive chip, web shortcut pill, FAB, and dialog accent is mapped across 35 distinct geometric shapes:
CircleSquareSlantedArchSemiCircleOvalPillTriangleArrowFanDiamondClamShellPentagonGemSunnyVerySunnyCookie4SidedCookie6SidedCookie7SidedCookie9SidedCookie12SidedGhostishClover4LeafClover8LeafBurstSoftBurstBoomSoftBoomFlowerPuffyPuffyDiamondPixelCirclePixelTriangleBunHeart
The helper extension RoundedPolygon.toShape() renders smooth Compose-native vector paths with zero bitmap distortion.
3. App Identity & Adaptive Flower Icon
- Vector Foreground: Defined in
res/drawable/ic_launcher_foreground.xmlwith companion drawables inres/mipmap-*/. - Icon Visual Motif: Styled after the blossoming petal flower silhouette using layered geometry:
- Deep midnight expressive background (
#1A0D1E). - Concentric radial glow layers (
#2D1537and#3E1A4A). - Adaptive Android icon support with full compatibility across API 26 through API 36.
- Deep midnight expressive background (
5. Color Palettes, AMOLED Pure Black & Typography Tokens
- Theme Definitions (
com.petal.browser.ui.theme.PetalTheme.kt):- Dynamic Palette: Extracts system wallpaper tones on Android 12+ (API 31+) via
dynamicLightColorSchemeanddynamicDarkColorScheme. - Fallback Palettes: Hand-crafted color harmonies including
Petal,Tide,Sakura,Emerald, andNord. - Color Styles (
ColorStyles.kt): Full support for Material 3 tonal variants:TONAL_SPOT,EXPRESSIVE,FRUIT_SALAD,RAINBOW,VIBRANT, andMONOCHROME. - AMOLED Mode (
applyAmoled()): Replaces dark surfaces with true pitch black (#000000) across all elevation layers (surfaceContainerLowest,surfaceContainerLow,surfaceContainerHigh), saving battery life on OLED displays.
- Dynamic Palette: Extracts system wallpaper tones on Android 12+ (API 31+) via
- Motion & Spring Easing:
- Spring physics parameters:
dampingRatio = Spring.DampingRatioLowBouncy(0.75f) withstiffness = Spring.StiffnessMediumLow. - Emphasized transitions:
CubicBezierEasing(0.05f, 0.7f, 0.1f, 1.0f)over 350ms duration for enter and exit animations.
- Spring physics parameters:
- Tactile Waveform Haptics (
PetalHapticEngine.kt):- Synthesizes distinct vibration patterns (
CLICK,TICK,DOUBLE_CLICK,HEAVY_CLICK) mapped to address bar actions, swipe thresholds, and seek gestures.
- Synthesizes distinct vibration patterns (