Repository navigation
Commit fdeed0f
committed
fix: restore in-app back navigation under predictive back
MainActivity overrode onBackPressed() to return to the home view from the
settings and info screens. Apps targeting SDK 36 can no longer opt out of
predictive back, and the platform now routes back gestures through
OnBackPressedDispatcher instead of calling onBackPressed(), so back was
leaving the app instead of returning home. Lint flags this as
GestureBackNavigation, and only at targetSdk 36 -- the bump in #623 is what
introduced the regression.
Replace the override with an OnBackPressedCallback registered on the
dispatcher. The callback is enabled only while a non-home view is showing,
mirroring the existing up-arrow logic in chooseView(), so back still exits
the app from the home view. isShowingHomeView() is now unused and removed.
This needs androidx.activity 1.6+ to bridge the platform callback; the
pinned appcompat 1.4.0 only brings in activity 1.2.4. Upgrade appcompat to
1.7.1, which pulls activity 1.8.0 and still supports minSdk 21. Deliberately
not 1.8.0, which would require raising minSdk to 23.1 parent 3d26924 commit fdeed0f
3 files changed
Lines changed: 300 additions & 15 deletions
File tree
- Android
- app
- src/main/java/app/intra/ui
- gradle
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| 181 | + | |
| 182 | + | |
180 | 183 | | |
181 | 184 | | |
182 | 185 | | |
| |||
722 | 725 | | |
723 | 726 | | |
724 | 727 | | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
731 | 743 | | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
| 744 | + | |
739 | 745 | | |
740 | 746 | | |
741 | 747 | | |
| |||
781 | 787 | | |
782 | 788 | | |
783 | 789 | | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
784 | 794 | | |
785 | 795 | | |
786 | 796 | | |
| |||
0 commit comments