Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

Handle "predictive back" / ActivityTransitionAnimation deprecation in API34

Open BrayanDSO opened this issue 2 years ago • 7 comments

API34 adds new predictive back behavior, which implies that the transition animation overrides for activity stack change animations now need to know whether the animation override is for activity open or close, whereas we override both as a unit without thought

This needs a solution before the deprecated methods go away, likely in the form of plumbing through (via a new parameter) the idea of whether the call site intended to override open, close, or both animations. For backwards compatibility this will likely need to be a Compat interface (or interfaces) to replace the current implementation

Originally posted by @mikehardy in https://github.com/ankidroid/Anki-Android/pull/14556#discussion_r1364530599

BrayanDSO avatar Oct 19 '23 00:10 BrayanDSO

Predictive back gesture reference: https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture

BrayanDSO avatar Oct 19 '23 00:10 BrayanDSO

We also need to fix the onBackPressed() deprecation in #12364 .

lukstbit avatar Oct 19 '23 05:10 lukstbit

@lukstbit yep - just had to handle that to pass lint in the stack of PRs, commit here - and examination of that commit (probably altering it or the objects slightly...) should be part of the success criteria to close this issue https://github.com/ankidroid/Anki-Android/commit/9ec94edde151cee5a8ed0a7394db05c910b2d784

mikehardy avatar Oct 19 '23 14:10 mikehardy

PR #13586 looks like the proper way to go about things - sad (word directed at myself) that the PR has sat so long and accumulated some conflicts! It looks good and should be considered for fixup + merge to fix this for real

mikehardy avatar Oct 19 '23 14:10 mikehardy

Just adding a quick note here that one item has been provisionally handled, so it may not show up in the deprecation scans anymore, but it needs a more thorough handling as it's a temporary patch:

https://github.com/ankidroid/Anki-Android/pull/14712/files#diff-6d9f7ea7bba9cc72513b5078633cee9bdbbd1ea7646114869679f302ad607459R277-R279

mikehardy avatar Nov 13 '23 14:11 mikehardy

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Feb 11 '24 15:02 github-actions[bot]

  • Opted in to predictive back in: https://github.com/ankidroid/Anki-Android/pull/17826

Reviewer and DeckPicker both have 'exit' callbacks, which take priority over closing the activity, so the animations aren't working as expected

david-allison avatar Jan 16 '25 19:01 david-allison