Skip to content

3.0.0

Latest

Choose a tag to compare

@Petterpx Petterpx released this 30 Aug 13:22
· 15 commits to main since this release
3.0.0
e4abf8c

FloatingX 3.0 是一次彻底重写:拆成 5 个可按需依赖的模块,API 与 2.x 不兼容(迁移见 从 2.x 迁移)。

依赖

implementation "io.github.petterpx:floatingx-core:3.0.0"      // 其它模块会自动带上
implementation "io.github.petterpx:floatingx-app:3.0.0"       // App 级全局浮窗(跟随 Activity)
implementation "io.github.petterpx:floatingx-system:3.0.0"    // 系统级浮窗(WindowManager + 权限)
implementation "io.github.petterpx:floatingx-scope:3.0.0"     // 局部浮窗(Activity / ViewGroup / Fragment)
implementation "io.github.petterpx:floatingx-compose:3.0.0"   // Jetpack Compose 内容

主要变化

  • 架构:Host(挂在哪)/ Engine(状态机 + 命令队列)/ Feature(容器行为插件)三个正交角色,取代 2.x 的 Helper → Control → Provider。
  • 换页不重建:同一容器在 Activity 间静默 reparent,状态、位置、动画全部保留。
  • 锚点定位:按「贴哪条边 + 偏移」定位,内容尺寸变化、旋转不再跑偏;margin / 边界 / safeArea / 越界不裁剪。
  • 手势:拖动、边缘吸附与半隐藏、dragRegion、与子 view 滚动的冲突策略(childPriority)。
  • 系统浮窗:权限三策略(自动 / 手动 / 跳过),被拒自动降级为 App 级;LayoutParams 可定制;键盘 / 返回键。
  • Modal 浮窗、黑白名单按 Class 匹配(含子类)、位置持久化(tag + 方向)、任意时机调用(未就绪自动排队)。
  • Compose 原生:每个浮窗自带 FxComposeOwner,viewModel() / rememberSaveable 跨页存活,stateFlow() / positionFlow()。
  • Kotlin DSL + Java Builder 双入口,explicitApi;模块依赖边界有 CI 断言。

修复的 issue

#37 #38 #90 #92 #108 #117 #124 #133 #137 #140 #148 #150 #151 #154 #155 #157 #165 #167 #172 #178 #180 #183 #184 #187 #188 #189 #192 #194 #195 #198 #200 #201 #203 #204 #205 #206 #207 #209 #210 #211 #212 #218 #220 #221 #222 #235 #238 #239 #240 #241 #242 #243 #244 —— 逐条处理方式见 Issue 覆盖矩阵。

文档

Wiki · 快速开始 · English · README


3.0 is a ground-up rewrite split into five opt-in modules; the API is not compatible with 2.x (see Migration from 2.x). Docs: Getting Started.