feat: 姿态检测优化、多样本校准、退出隐藏后台与悬浮窗保活 - #5
Merged
Merged
Conversation
- 姿态检测:大幅晃动需持续 3 秒以上才识别为运动姿态,短暂晃动不误判 - 多样本校准:静坐/站立支持多次采集样本,应对不同体位(口袋、手持、桌面等) - 退出隐藏后台:设置页新增开关,退出应用时自动从最近任务隐藏,返回保留页面状态 - 悬浮窗保活:showWindow 时启动前台服务,解除 Activity 绑定后悬浮窗不消失 - 所有 Activity 统一继承 BaseActivity,便于全局功能扩展
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
功能概述
本次 PR 包含三项功能改进:
1. 姿态检测算法优化(运动姿态判定)
问题:原算法仅凭加速度标准差瞬时值判定运动,短暂晃动(调整姿势、拿取手机)会误判为运动姿态。
优化:
2. 静坐/站立多样本校准
问题:手机在不同体位(口袋、手持、桌面)下加速度朝向不同,单一校准样本容易匹配失败。
优化:
3. 退出应用隐藏后台
功能:设置页「常规」区新增开关,开启后退出应用时自动从「最近任务」列表隐藏,不销毁 Activity。
实现:
截图