Skip to content

fix(ui): prevent vertical swipes from adjusting sliders#420

Draft
qiin2333 wants to merge 1 commit into
masterfrom
agent/fix-game-menu-slider-gesture
Draft

fix(ui): prevent vertical swipes from adjusting sliders#420
qiin2333 wants to merge 1 commit into
masterfrom
agent/fix-game-menu-slider-gesture

Conversation

@qiin2333

Copy link
Copy Markdown
Owner

改了啥呀

  • 给游戏菜单滑条加上触摸阈值和方向判断
  • 只有明确的横向拖动才会锁住父级滚动
  • 纵向滑动继续交给菜单滚动,码率和陀螺仪灵敏度滑条都不再乱抢手势啦

为啥要改

之前手指一落到滑条区域,父级纵向滚动就会立刻被禁用,完全没等用户表明是想横拖还是上下滑。结果路过滑条的纵向手势也会被这个杂鱼手势锁截住,很容易误调码率。

现在会先等待位移超过系统触摸阈值,再比较横纵方向;只有横向位移占优时才进入滑条手势。

影响

  • 上下滑过码率控制条时可以正常滚动游戏菜单
  • 有意横拖滑条的行为保持不变
  • 共用手势逻辑的陀螺仪灵敏度滑条同步受益

验证

  • git diff --check:通过
  • .\gradlew.bat :app:compileNonRootDebugKotlin:未进入源码编译;本地 moonlight-haptics-android 项目没有可用构建变体,依赖解析失败

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant