ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.52k stars 2.21k forks source link

Handle "predictive back" / ActivityTransitionAnimation deprecation in API34 #14558

Open BrayanDSO opened 11 months ago

BrayanDSO commented 11 months ago

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 commented 11 months ago

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

lukstbit commented 11 months ago

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

mikehardy commented 11 months ago

@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 commented 11 months ago

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 commented 11 months ago

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

github-actions[bot] commented 8 months ago

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