Skip to content

Respect system Reduce Motion in the dictionary selection popup - #45

Merged
Batmancpu merged 3 commits into
mainfrom
a11y/dictionary-popup-reduce-motion-2026-11-09
Nov 14, 2026
Merged

Batmancpu merged 3 commits into
mainfrom
a11y/dictionary-popup-reduce-motion-2026-11-09

Conversation

@Batmancpu

@Batmancpu Batmancpu commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Evidence

The exported DictionaryActivity handles Android ACTION_PROCESS_TEXT selections. Its bottom definition popup currently always runs spring-based fadeIn + scaleIn + slideInVertically and animateContentSize, even when the user has disabled system animations.

The app's minimum SDK is 26, so Android's ValueAnimator.areAnimatorsEnabled() is available. Android documents it as the system-wide animator state; it returns false when the developer animator scale is zero or Battery Saver disables animations. This avoids introducing a settings observer or timer:

The active integration PR #34's own UI roadmap identifies this exact popup as the next Reduce Motion candidate; no equivalent open PR exists.

Change

  • Read ValueAnimator.areAnimatorsEnabled() once when the short-lived popup composition is created.
  • Preserve the existing spring entrance and content-size animation when system animations are enabled.
  • Use EnterTransition.None and omit animateContentSize when system animations are disabled.
  • Keep Android 12+ FLAG_BLUR_BEHIND, the existing high-contrast fallback, popup geometry, haptics, offline WordNet lookup, and the native text-selection/action-mode menu unchanged.
  • Add a small pure policy and two JVM tests for enabled/disabled system animation states.

Verification

  • Changes are isolated to DictionaryActivity.kt, DictionaryMotionPolicy.kt, and DictionaryMotionPolicyTest.kt.
  • No new dependency, permission, network request, timer, observer, persistence, or navigation destination.
  • Tests added but not executed. Canonical main's workflow remains push-only; no manual workflow dispatch or rerun was used.
  • No OPPO device screenshot, accessibility-service or runtime Reduce Motion verification was available.

Risk / limitation

The preference is sampled once per popup instance. Changing the system animation setting while the popup is already open will take effect the next time it is opened; this deliberately avoids a lifecycle-sensitive observer for a transient surface.

Draft for focused accessibility review.

Copy link
Copy Markdown
Owner Author

Integration-port verification — 9 November 2026

The same Reduce Motion behaviour and DictionaryMotionPolicyTest have now been ported into the active integration branch black-box-bihar-news in commit 21317fd4f3dc625c4e49ec598e59736e0a4b6237 (alongside the branch's continuity/roadmap updates).

Natural integration runs on that exact head both passed:

Run #385 completed WordNet generation, :app:testDebugUnitTest, :app:assembleDebug, and artifact upload. The test APK artifact is 13644482167, 39,129,205 bytes, SHA-256 55357f9ff060bd1881c42cba2465660c365ce5331bbe2e53882726c6158b0c62, expiring 23 November 2026.

This verifies the equivalent implementation/tests in the integration branch, not this standalone PR head fbadd56e0e119cf70b865af8a58843190cce249d; the standalone head still has no check runs because canonical main's workflow is push-only. Keep the two paths coordinated: if PR #34 lands with this code, do not separately merge this duplicate implementation. Physical-device Reduce Motion/TalkBack verification remains outstanding.

@Batmancpu
Batmancpu merged commit 58031f0 into main Nov 14, 2026
@Batmancpu
Batmancpu deleted the a11y/dictionary-popup-reduce-motion-2026-11-09 branch November 14, 2026 10:51
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