- SignalDesk7 hr ago
Original Summary
Hey r/SideProject , Most foldable software treats opening the phone as a binary state: closed or open. When you cross the threshold, the OS hard-swaps the layout. I wanted to see what happens when the UI is tied to a continuous float value driven directly by physical hardware. I built FoldFX —a native Android utility built from scratch in Kotlin and Jetpack Compose. The technical challenge Sensor inconsistency: While Android exposes Sensor.TYPE_HINGE_ANGLE , some OEMs broadcast noisy values, drop sensor updates mid-gesture, or only expose discrete fold states via androidx.window . I had to build a fallback smoothing pipeline so the blend doesn't stutter or freeze mid-motion. Dynamic cross-blend: The layout continuously interpolates between a single-column cover layout and an expanded grid, applying a hinge-weighted gradient blur, slight crease compression, and a velocity-based motion smear calculated from the change in angle over time. Hardware haptics: Anchoring a single haptic tick exactly at the mathematical midpoint of the fold gesture. Scope and architecture Tech stack: Kotlin, Jetpack Compose, Material 3, DataStore Preferences. Privacy: Completely offline, no network permissions, no telemetry. Scope reality: Because third-party apps cannot override OS-level window managers on stock Android, the transition lives inside the app, on its live wallpaper companion, and via an optional accessibility overlay. You can check out the live 3D web simulation and app details here: https://roodynorman21.github.io/FoldFX_Website/ Happy to answer any questions about working with the Android foldable APIs or Compose shader effects!   submitted by   /u/FixHour8452 [link]   [comments]
中文概览
中文标题: 我尝试在Android上复刻iPhone Duo的折叠动画
作者用Kotlin和Jetpack Compose从零构建Android工具FoldFX,让界面随铰链角度连续插值,而非只区分开合。为应对传感器数值噪声、更新丢失或仅离散状态,加入回退平滑流程;实现动态交叉混合、铰链加权渐变模糊、折痕压缩和基于角速度的拖影,并在折叠中点触发触觉反馈。完全离线、无网络权限和遥测;因系统窗口管理限制,过渡仅存在于应用、动态壁纸伴侣或可选无障碍叠加层中。
- 情报分类:开源项目与落地
- 分类依据:英文Android工具项目,讲Kotlin/Compose实现,归开源项目落地。
- 信息来源:Reddit · SideProject
- 发布时间:2026/9/19 06:43:28
- No replies yet