Skip to content

refactor: extract activity animationEnabled/animationDisabled into :common:android#21182

Merged
david-allison merged 4 commits into
ankidroid:mainfrom
david-allison:base-activity
Jun 11, 2026
Merged

refactor: extract activity animationEnabled/animationDisabled into :common:android#21182
david-allison merged 4 commits into
ankidroid:mainfrom
david-allison:base-activity

Conversation

@david-allison

@david-allison david-allison commented May 30, 2026

Copy link
Copy Markdown
Member

Note

Assisted-by: Claude Opus 4.8 - all

Purpose / Description

Note: this is also an initial pattern for Profile-aware Preferences in a multimodule situation

Note: This also sets a pattern for handling singletons in EmptyApplication

AnkiActivity needs to be moved to common as prep for multi-modules: it needs to be below feature modules which use it.

I'm focusing on AnkiActivity due to :widgets containing:

class CardAnalysisWidgetConfig : AnkiActivity(R.layout.activity_card_analysis_widget_config)

This PR extracts 'animations' from AnkiActivity: moving them to extension methods on FragmentActivity.

Fixes

Approach

See commits: iterative extractions

How Has This Been Tested?

⚠️ Untested, should be typical refactors.

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label May 31, 2026
@david-allison david-allison marked this pull request as draft May 31, 2026 00:39
@david-allison david-allison removed Needs Author Reply Waiting for a reply from the original author Has Conflicts labels May 31, 2026
@david-allison david-allison marked this pull request as ready for review May 31, 2026 20:56
@david-allison david-allison force-pushed the base-activity branch 2 times, most recently from 6349c04 to da271b9 Compare June 3, 2026 04:25
AnkiActivity needs to be moved to common for multimodule prep.
Therefore AnimUtils needs to move
Therefore `PrefsRepository(context).removeAppAnimations`

This is the first step: making 'PrefsRepository' an
'AnimationPreferences'

Part of 20737

Assisted-by: Claude Opus 4.8
It was decided that Preferences are per-profile, so this preference
needs to be profile-aware.

----

AnkiActivity needs to be moved to common for multimodule prep.
Therefore AnimUtils needs to move

This is the second step: exposing
'AnimationPreferences' in a profile-safe manner and moving AnimUtils.

Part of 20737

Assisted-by: Claude Opus 4.8
This commit was deferred so the previous commit was detected as a rename

Assisted-by: Claude Opus 4.8
AnkiActivity needs to be moved to common as prep for multi-modules.

This is the final step of extracting animations from AnkiActivity:
moving them to extension methods on FragmentActivity.

Part of 20737

Assisted-by: Claude Opus 4.8
@david-allison david-allison merged commit d04d324 into ankidroid:main Jun 11, 2026
20 checks passed
@david-allison david-allison deleted the base-activity branch June 11, 2026 22:09
@github-actions github-actions Bot added this to the 2.25 release milestone Jun 11, 2026
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