Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usage of onBackPressed() #6012

Merged
merged 3 commits into from
Jan 17, 2023
Merged

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Jan 12, 2023

Summary

This pull request removes usage of onBackPressed() and replaces it with onBackPressedDispatcher.addCallback().

Motivation

Resolves #5951

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

[ADDED] Support for the predictive back gesture.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 12, 2023

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: none)
NEW: paymentsheet-example-release-pr.apk (signature: none)

          │          compressed          │           uncompressed           
          ├──────────┬──────────┬────────┼───────────┬───────────┬──────────
 APK      │ old      │ new      │ diff   │ old       │ new       │ diff     
──────────┼──────────┼──────────┼────────┼───────────┼───────────┼──────────
      dex │  5.7 MiB │  5.7 MiB │ -623 B │  14.9 MiB │  14.9 MiB │ +2.5 KiB 
     arsc │    2 MiB │    2 MiB │    0 B │     2 MiB │     2 MiB │      0 B 
 manifest │  4.4 KiB │  4.4 KiB │    0 B │    21 KiB │    21 KiB │      0 B 
      res │  1.1 MiB │  1.1 MiB │    0 B │   1.9 MiB │   1.9 MiB │      0 B 
   native │  2.6 MiB │  2.6 MiB │    0 B │     6 MiB │     6 MiB │      0 B 
    asset │    3 MiB │    3 MiB │  -17 B │     3 MiB │     3 MiB │    -17 B 
    other │ 82.9 KiB │ 82.9 KiB │    0 B │ 158.3 KiB │ 158.3 KiB │      0 B 
──────────┼──────────┼──────────┼────────┼───────────┼───────────┼──────────
    total │ 14.4 MiB │ 14.4 MiB │ -640 B │    28 MiB │    28 MiB │ +2.5 KiB 

         │          raw           │               unique                
         ├────────┬────────┬──────┼────────┬────────┬───────────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff              
─────────┼────────┼────────┼──────┼────────┼────────┼───────────────────
   files │      2 │      2 │    0 │        │        │                   
 strings │  91502 │  91504 │   +2 │  76908 │  76920 │ +12 (+328 -316)   
   types │  24332 │  24330 │   -2 │  22033 │  22040 │  +7 (+316 -309)   
 classes │  19834 │  19841 │   +7 │  19834 │  19841 │  +7 (+309 -302)   
 methods │ 104760 │ 104771 │  +11 │ 100525 │ 100544 │ +19 (+3838 -3819) 
  fields │ 104396 │ 104406 │  +10 │ 103126 │ 103137 │ +11 (+2162 -2151) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  334 │  334 │  0   
 entries │ 6439 │ 6439 │  0
APK
    compressed    │    uncompressed     │                                
─────────┬────────┼──────────┬──────────┤                                
 size    │ diff   │ size     │ diff     │ path                           
─────────┼────────┼──────────┼──────────┼────────────────────────────────
 3.4 MiB │ -899 B │  8.4 MiB │   +876 B │ ∆ classes.dex                  
 2.3 MiB │ +276 B │  6.5 MiB │ +1.7 KiB │ ∆ classes2.dex                 
 8.2 KiB │  -10 B │  8.1 KiB │    -10 B │ ∆ assets/dexopt/baseline.prof  
   809 B │   -7 B │    677 B │     -7 B │ ∆ assets/dexopt/baseline.profm 
─────────┼────────┼──────────┼──────────┼────────────────────────────────
 5.7 MiB │ -640 B │ 14.9 MiB │ +2.5 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff            
  ───────┼───────┼─────────────────
   76908 │ 76920 │ +12 (+328 -316) 
  + La3/l;
  + Landroidx/activity/result/h_a;
  + Landroidx/activity/result/h_b;
  + Landroidx/activity/result/j_a;
  + Landroidx/activity/result/j;
  + Landroidx/appcompat/widget/h1_a;
  + Landroidx/appcompat/widget/h1_b;
  + Landroidx/appcompat/widget/h2_a;
  + Landroidx/appcompat/widget/i2_a;
  + Landroidx/appcompat/widget/j1_a;
  + Landroidx/appcompat/widget/j1_b;
  + Landroidx/appcompat/widget/j1_c;
  + Landroidx/appcompat/widget/j1_d;
  + Landroidx/appcompat/widget/l1_a;
  + Landroidx/appcompat/widget/l1_b;
  + Landroidx/appcompat/widget/n0_a;
  + Landroidx/appcompat/widget/n0_b;
  + Landroidx/appcompat/widget/n0_c;
  + Landroidx/appcompat/widget/n0_d;
  + Landroidx/appcompat/widget/n0_e;
  + Landroidx/appcompat/widget/n0_f;
  + Landroidx/appcompat/widget/n0_g;
  + Landroidx/appcompat/widget/n0_h_a;
  + Landroidx/appcompat/widget/n0_h_b;
  + Landroidx/appcompat/widget/n0_h_c;
  + Landroidx/appcompat/widget/n0_h;
  + Landroidx/appcompat/widget/n0_i_a;
  + Landroidx/appcompat/widget/n0_i;
  + Landroidx/appcompat/widget/n0_j;
  + Landroidx/appcompat/widget/o1_a;
  + Landroidx/appcompat/widget/o1_b;
  + Landroidx/appcompat/widget/o1_c;
  + Landroidx/appcompat/widget/o1_d;
  + Landroidx/appcompat/widget/o1_e;
  + Landroidx/appcompat/widget/o1_f;
  + Landroidx/appcompat/widget/o1_g;
  + Landroidx/appcompat/widget/q0_a;
  + Landroidx/appcompat/widget/r0_b;
  + Landroidx/appcompat/widget/r0_c;
  + Landroidx/appcompat/widget/r0_d;
  + Landroidx/appcompat/widget/r0_e;
  + Landroidx/appcompat/widget/r0_f;
  + Landroidx/appcompat/widget/s1_a;
  + Landroidx/appcompat/widget/s1_b;
  + Landroidx/appcompat/widget/s1_c_a;
  + Landroidx/appcompat/widget/s1_c;
  + Landroidx/appcompat/widget/t1_a;
  + Landroidx/appcompat/widget/t1_b;
  + Landroidx/appcompat/widget/t1_c;
  + Landroidx/appcompat/widget/t1_d;
  + Landroidx/appcompat/widget/t1_e;
  + Landroidx/appcompat/widget/t1_f;
  + Landroidx/appcompat/widget/t1_g;
  + Landroidx/appcompat/widget/y1_a;
  + Landroidx/appcompat/widget/z0_a;
  + Landroidx/appcompat/widget/z0_b;
  + Landroidx/appcompat/widget/z0_c;
  + Landroidx/appcompat/widget/z0_d;
  + Landroidx/appcompat/widget/z0_e;
  + Landroidx/appcompat/widget/z0_f;
  + Landroidx/compose/ui/platform/a1_a;
  + Landroidx/compose/ui/platform/a1_b;
  + Landroidx/compose/ui/platform/a1_c;
  + Landroidx/compose/ui/platform/a1_d;
  + Landroidx/compose/ui/platform/a1_e;
  + Landroidx/compose/ui/platform/a1_f;
  + Landroidx/compose/ui/platform/a1_g;
  + Landroidx/compose/ui/platform/a1_h;
  + Landroidx/compose/ui/platform/a1_i;
  + Landroidx/compose/ui/platform/a1_j;
  + Landroidx/compose/ui/platform/a1_k;
  + Landroidx/compose/ui/platform/a1_l;
  + Landroidx/compose/ui/platform/a1_m;
  + Landroidx/compose/ui/platform/a1_n;
  + Landroidx/compose/ui/platform/a1_o;
  + Landroidx/compose/ui/platform/a1_p;
  + Landroidx/compose/ui/platform/a1_q;
  + Landroidx/compose/ui/platform/a1_r;
  + Landroidx/compose/ui/platform/f2_a;
  + Landroidx/compose/ui/platform/h0_a;
  + Landroidx/compose/ui/platform/h0_b;
  + Landroidx/compose/ui/platform/h0_c;
  + Landroidx/compose/ui/platform/h0_d;
  + Landroidx/compose/ui/platform/h0_e;
  + Landroidx/compose/ui/platform/h0_f;
  + Landroidx/compose/ui/platform/h0_g;
  + Landroidx/compose/ui/platform/h0_h;
  + Landroidx/compose/ui/platform/h0_i;
  + Landroidx/compose/ui/platform/h0_j;
  + Landroidx/compose/ui/platform/i3_a_a;
  + Landroidx/compose/ui/platform/i3_a;
  + Landroidx/compose/ui/platform/m0_a;
  + Landroidx/compose/ui/platform/m1_a;
  + Landroidx/compose/ui/platform/m2_a;
  + Landroidx/compose/ui/platform/p0_a;
  + Landroidx/compose/ui/platform/p0_b;
  + Landroidx/compose/ui/platform/p0_c;
  + Landroidx/compose/ui/platform/q1_a;
  + Landroidx/compose/ui/platform/t1<
  + Landroidx/compose/ui/platform/u1_a;
  + Landroidx/compose/ui/platform/v2_a_a;
  + Landroidx/compose/ui/platform/v2_a_b;
  + Landroidx/compose/ui/platform/v2_a_c;
  + Landroidx/compose/ui/platform/v2_a;
  + Landroidx/compose/ui/platform/v3;
  + Landroidx/compose/ui/platform/w3;
  + Landroidx/compose/ui/platform/z2_a;
  + Landroidx/compose/ui/platform/z2_b;
  + Landroidx/compose/ui/platform/z2_c;
  + Landroidx/compose/ui/platform/z2_d;
  + Landroidx/constraintlayout/widget/k_a;
  + Landroidx/constraintlayout/widget/k_b;
  + Landroidx/constraintlayout/widget/l;
  + Landroidx/emoji2/text/s_a;
  + Landroidx/emoji2/text/s_
...✂

@tillh-stripe tillh-stripe force-pushed the tillh/remove-onbackpressed branch from 3c882bd to 32a12ed Compare January 13, 2023 16:38
@tillh-stripe
Copy link
Collaborator Author

How do we typically announce a change affecting multiple modules? I added the note to payments, paymentsheet, financialconnections, and cardscan for now.

@tillh-stripe tillh-stripe merged commit 429be50 into master Jan 17, 2023
@tillh-stripe tillh-stripe deleted the tillh/remove-onbackpressed branch January 17, 2023 16:31
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.

[BUG] Activity.onBackPressed() implementation should be replaced with OnBackPressedCallback
6 participants