wordpress-mobile / wordpress-mobile/WordPress-Android

Add support for the predictive back gesture

Open
#18,053 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

[Type] Task
Dominant language
Kotlin
Stars
3.2k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
69

Description

The predictive back gesture feature was introduced in Android 13 but will be available on Android 14. We should prepare the app and enable the feature.

On the Android 13 migration, we updated super.onBackPressed() calls with the function below.

fun AppCompatActivity.onBackPressedCompat(onBackPressedCallback: OnBackPressedCallback) {
    onBackPressedCallback.isEnabled = false
    onBackPressedDispatcher.onBackPressed()
    onBackPressedCallback.isEnabled = true
}

This function mimics the super.onBackPressed behavior but breaks the predictive back gesture behavior, as explained here. Therefore, before enabling predictive back gesture, all usages of onBackPressedCompat should be reviewed and updated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by searching for all usages of onBackPressedCompat and read the linked Android predictive back documentation and discussion. Review each usage against the ahead-of-time back approach, then enable predictive back once the affected usages have been updated and the gesture behavior works correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.