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

Add autocomplete affordance to the address element. #5927

Merged
merged 15 commits into from
Jan 18, 2023

Conversation

jaynewstrom-stripe
Copy link
Collaborator

@jaynewstrom-stripe jaynewstrom-stripe commented Dec 7, 2022

Summary

Motivation

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

AutocompleteAffordanceDemo.webm
Screenshot 2022-12-07 at 5 56 28 PM
Screenshot 2022-12-07 at 5 56 16 PM

Changelog

  • [Changed]5927 Customers can now re-enter the autocomplete flow of the Address Element by tapping an icon in the line 1 text field.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2022

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 │     +4 B │  14.9 MiB │  14.9 MiB │    -60 B 
     arsc │    2 MiB │    2 MiB │ +4.1 KiB │     2 MiB │     2 MiB │ +4.1 KiB 
 manifest │  4.4 KiB │  4.4 KiB │     +1 B │    21 KiB │    21 KiB │      0 B 
      res │  1.1 MiB │  1.1 MiB │   +568 B │   1.8 MiB │   1.8 MiB │   +832 B 
   native │  2.6 MiB │  2.6 MiB │      0 B │     6 MiB │     6 MiB │      0 B 
    asset │    3 MiB │    3 MiB │    -43 B │     3 MiB │     3 MiB │    -43 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 │ +4.6 KiB │    28 MiB │    28 MiB │ +4.8 KiB 

         │          raw           │               unique                
         ├────────┬────────┬──────┼────────┬────────┬───────────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff              
─────────┼────────┼────────┼──────┼────────┼────────┼───────────────────
   files │      2 │      2 │    0 │        │        │                   
 strings │  91584 │  91551 │  -33 │  76908 │  76920 │ +12 (+253 -241)   
   types │  24360 │  24319 │  -41 │  22031 │  22032 │  +1 (+228 -227)   
 classes │  19832 │  19833 │   +1 │  19832 │  19833 │  +1 (+223 -222)   
 methods │ 104837 │ 104783 │  -54 │ 100508 │ 100525 │ +17 (+4032 -4015) 
  fields │ 104436 │ 104406 │  -30 │ 103144 │ 103162 │ +18 (+2188 -2170) 

 ARSC    │ old  │ new  │ diff       
─────────┼──────┼──────┼────────────
 configs │  334 │  334 │  0         
 entries │ 6434 │ 6437 │ +3 (+3 -0)
APK
     compressed     │    uncompressed    │                                
─────────┬──────────┼─────────┬──────────┤                                
 size    │ diff     │ size    │ diff     │ path                           
─────────┼──────────┼─────────┼──────────┼────────────────────────────────
   2 MiB │ +4.1 KiB │   2 MiB │ +4.1 KiB │ ∆ resources.arsc               
   559 B │   +559 B │   832 B │   +832 B │ + res/2M.xml                   
 3.4 MiB │   +242 B │ 8.4 MiB │   -304 B │ ∆ classes.dex                  
 2.4 MiB │   -238 B │ 6.6 MiB │   +244 B │ ∆ classes2.dex                 
 8.2 KiB │    -46 B │ 8.1 KiB │    -46 B │ ∆ assets/dexopt/baseline.prof  
   998 B │     -4 B │ 2.8 KiB │      0 B │ ∆ res/AE.xml                   
   977 B │     +4 B │ 2.6 KiB │      0 B │ ∆ res/R5.xml                   
   809 B │     +3 B │   677 B │     +3 B │ ∆ assets/dexopt/baseline.profm 
   529 B │     +2 B │   984 B │      0 B │ ∆ res/WT.xml                   
   806 B │     +2 B │ 2.3 KiB │      0 B │ ∆ res/yn.xml                   
 4.4 KiB │     +1 B │  21 KiB │      0 B │ ∆ AndroidManifest.xml          
   615 B │     +1 B │ 1.2 KiB │      0 B │ ∆ res/38.xml                   
   952 B │     +1 B │ 2.5 KiB │      0 B │ ∆ res/5d.xml                   
 1.1 KiB │     +1 B │ 3.1 KiB │      0 B │ ∆ res/Cm.xml                   
 1.1 KiB │     -1 B │ 3.1 KiB │      0 B │ ∆ res/FR.xml                   
   798 B │     +1 B │ 1.6 KiB │      0 B │ ∆ res/LG.xml                   
   601 B │     +1 B │ 1.1 KiB │      0 B │ ∆ res/MP1.xml                  
   459 B │     -1 B │   1 KiB │      0 B │ ∆ res/MY.xml                   
 1.3 KiB │     +1 B │ 3.9 KiB │      0 B │ ∆ res/U9.xml                   
 1.4 KiB │     -1 B │   5 KiB │      0 B │ ∆ res/WO.xml                   
   759 B │     +1 B │ 1.4 KiB │      0 B │ ∆ res/WZ.xml                   
 1.2 KiB │     +1 B │ 3.8 KiB │      0 B │ ∆ res/_n.xml                   
   753 B │     -1 B │ 1.7 KiB │      0 B │ ∆ res/ew.xml                   
   720 B │     +1 B │ 1.5 KiB │      0 B │ ∆ res/gK.xml                   
   620 B │     +1 B │ 1.1 KiB │      0 B │ ∆ res/ib1.xml                  
   835 B │     -1 B │ 1.8 KiB │      0 B │ ∆ res/jf.xml                   
─────────┼──────────┼─────────┼──────────┼────────────────────────────────
 7.8 MiB │ +4.6 KiB │  17 MiB │ +4.8 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff            
  ───────┼───────┼─────────────────
   76908 │ 76920 │ +12 (+253 -241) 
  + La3/k;
  + La3/l;
  + Landroidx/compose/ui/platform/c2_a;
  + Landroidx/compose/ui/platform/f3_a_a;
  + Landroidx/compose/ui/platform/f3_a;
  + Landroidx/compose/ui/platform/j2_a;
  + Landroidx/compose/ui/platform/k1_a;
  + Landroidx/compose/ui/platform/m1_a;
  + Landroidx/compose/ui/platform/r1<
  + Landroidx/compose/ui/platform/s1_a;
  + Landroidx/compose/ui/platform/s2_a_a;
  + Landroidx/compose/ui/platform/s2_a_b;
  + Landroidx/compose/ui/platform/s2_a_c;
  + Landroidx/compose/ui/platform/s2_a;
  + Landroidx/compose/ui/platform/w2_a;
  + Landroidx/compose/ui/platform/w2_b;
  + Landroidx/compose/ui/platform/w2_c;
  + Landroidx/compose/ui/platform/w2_d;
  + Lb5/r_a;
  + Lb5/r_b;
  + Lb5/r_c;
  + Lb5/r_d;
  + Lb5/r_e;
  + Lb5/r_f;
  + Lb5/r_g_a_a;
  + Lb5/r_g_a;
  + Lb5/r_g;
  + Lb5/v;
  + Lc1/a_a_a;
  + Lc1/a_a;
  + Lc1/a_b;
  + Lc1/a_c;
  + Lc1/a_d;
  + Lc1/a_e_a;
  + Lc1/a_e;
  + Lc1/a_f;
  + Lc1/b6_a;
  + Lc1/c0_a;
  + Lc1/c3_a;
  + Lc1/c3_b;
  + Lc1/c4_a;
  + Lc1/c4_b;
  + Lc1/c4_c;
  + Lc1/c4_d;
  + Lc1/c4_e;
  + Lc1/c4_f;
  + Lc1/c5_a;
  + Lc1/c5_b;
  + Lc1/c5_c_a;
  + Lc1/c5_c;
  + Lc1/c5_d;
  + Lc1/c5_e;
  + Lc1/c5_f;
  + Lc1/c7_a;
  + Lc1/c7_b;
  + Lc1/c7_c;
  + Lc1/c7_d;
  + Lc1/c7_e;
  + Lc1/d1_a;
  + Lc1/d1_b;
  + Lc1/d2_a;
  + Lc1/e2_a;
  + Lc1/e2_b;
  + Lc1/e7_a;
  + Lc1/e7_b;
  + Lc1/e7_c;
  + Lc1/f0_a;
  + Lc1/f3_a;
  + Lc1/f6_a;
  + Lc1/f6_b;
  + Lc1/f6_c;
  + Lc1/f6_d;
  + Lc1/g_a;
  + Lc1/g_b;
  + Lc1/g_c;
  + Lc1/g_d;
  + Lc1/g1_a;
  + Lc1/g4_c;
  + Lc1/g4_d;
  + Lc1/h5_a;
  + Lc1/h5_b;
  + Lc1/i5_a;
  + Lc1/i7_a;
  + Lc1/j2_a;
  + Lc1/j2_b;
  + Lc1/k_a;
  + Lc1/k_b;
  + Lc1/k_c;
  + Lc1/k_d;
  + Lc1/k_e;
  + Lc1/k2_a;
  + Lc1/k6_a;
  + Lc1/l0_a;
  + Lc1/l7_b;
  + Lc1/l7_c;
  + Lc1/l7_d;
  + Lc1/l7_e;
  + Lc1/l7_f;
  + Lc1/m2_b;
  + Lc1/m2_c;
  + Lc1/m2_d;
  + Lc1/m2_e;
  + Lc1/m2_f;
  + Lc1/m2_g;
  + Lc1/m6_a_a;
  + Lc1/m6_b;
  + Lc1/m6_c;
  + Lc1/m6_d;
  + Lc1/m6_e;
  + Lc1/m6_f_a_a;
  + Lc1/m6_f_a;
  + Lc1/m6_f;
  + Lc1/m6_g;
  + Lc1/m6<
  + Lc1/n6_a;
  + Lc1/n7_a;
  + Lc1/n7_b;
  + Lc1/n7_c;
  + Lc1/n7_d;
  + Lc1/n7_e;
  + Lc1/n7_f;
  + Lc1/p3_a;
  + Lc1/p3_b;
  + Lc1/p3_c;
  + Lc1/p3_d;
  + Lc1/p5_a;
  + Lc1/p5_b;
  + Lc1/p5_c;
  + Lc1/p5_d;
  + Lc1/p5_e;
  + Lc1/p7_a;
  + Lc1/p7_b;
  + Lc1/r4_a;
  + Lc1/s_a;
  + Lc1/s_b;
  + Lc1/s0_a;
  + Lc1/s1_a;
  + Lc1/s1_b;
  + Lc1/t6_a;
  + Lc1/t6_b;
  + Lc1/t6_c;
  + Lc1/t6_d;
  + Lc1/u3_a;
  + Lc1/u5_a;
  + Lc1/v_a;
  + Lc1/v_b;
  + Lc1/v_c;
  + Lc1/v_d;
  + Lc1/v_e;
  + Lc1/v_f;
  + Lc1/v_g;
  + Lc1/v1<
  + Lc1/w1<
  + Lc1/x_a;
  + Lc1/y5_a;
  + Lc1/y5_b;
  + Lc1/y5_c;
  + Lc1/y5_d;
  + Lc1/y5_e;
  + Lc1/z_b;
  + Lc1/z_c;
  + Lc1/z_d;
  + Lc1/z1_a;
  + Lc1/z1_b;
  + Lc1/z1_c;
  + Lc1/z1_d;
  + Lcom/google/android/material/datepicker/d0_a;
  + Ld0/e_a;
  + Ld0/e_b;
  + Ld0/e_c;
  + Ld0/i<
  + Ld0/l;
  + Ld0/m_a;
  + Ld0/m;
  + Lf3/a_a;
  + Lf4/g_a;
  + Lf4/i_b;
  + Lf4/i_c;
  + Lf4/i_d;
  + Lf4/j_a;
  + Lf4/j;
  + Li4/e1_a;
  + Li4/j1_a;
  + Li4/j1_b;
  + Li4/j1_c_a_a;
  + Li4/j1_c_a_b;
  + Li4/j1_c_a_c;
  + Li4/j1_c_a;
  + Li4/j1_c;
  + Li4/j1_d_a;
  + Li4/j1_d;
  + Li4/j1_e;
  + Li4/o1_a;
  + Li4/o1_b;
  + Li4/o1_c;
  + Li4/o1_d;
  + Li4/o1_e;
  + Li4/o1_f;
  + Li4/o1_g;
  + Li4/o1_h;
  + Li4/o1_i;
  + Li4/o1_j;
  + Li4/o1_k;
  + Li4/o1_l;
  + Li4/o1_m;
  + Li4/q1;
  + Li4/x0_a;
  + Li4/x0_b;
  + Ly/a0_a;
  + Ly/b1_a;
  + Ly/e0_a;
  + Ly/z<
  + [Lc1/f2;
  + [Lc1/m7;
  + [Lc1/o1;
  + [Lc1/o3;
  + [Lc1/o4;
  + address_search_content_description
  + invalid_email_address
  + stripe_ic_search
  + ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:7a8b4c9,r8-mode:compatibility,version:4.0.48}
  + _addressType
  + Lcom/stripe/android/paymentsheet/addresselement/AddressSpecFactory_WhenMappings;
  + Lcom/stripe/android/paymentsheet/addresselement/AddressSpecFactory;
  + Lcom/stripe/android/paymentsheet/addresselement/InputAddressViewModel_buildFormSpec_spec_1;
  + Lcom/stripe/android/paymentsheet/addresselement/InputAddressViewModel_navigateToAutocompleteScreen_1;
  + Lcom/stripe/android/ui/core/elements/AddressElement_fieldsUpdatedFlow_lambda_5__inlined_combine_1_2;
  + Lcom/stripe/android/ui/core/elements/AddressElement_fieldsUpdatedFlow_lambda_5__inlined_combine_1_3;
  + Lcom/stripe/android/ui/core/elements/AddressElement_fieldsUpdatedFlow_lambda_5__inlined_combine_1;
  + Lcom
...✂
ARSC
ENTRIES:

   old  │ new  │ diff       
  ──────┼──────┼────────────
   6434 │ 6437 │ +3 (+3 -0) 
  + drawable/stripe_ic_search
  + string/address_search_content_description
  + string/invalid_email_address

@jaynewstrom-stripe jaynewstrom-stripe force-pushed the jaynewstrom/autocomplete branch 5 times, most recently from fec446e to 41a2051 Compare January 17, 2023 14:01
@jaynewstrom-stripe
Copy link
Collaborator Author

Waiting for search strings to be localized: https://jira.corp.stripe.com/browse/L10N-4155

@jaynewstrom-stripe jaynewstrom-stripe marked this pull request as ready for review January 18, 2023 14:24
@@ -230,3 +226,47 @@ open class AddressElement constructor(
this.rawValuesMap = rawValuesMap
}
}

internal suspend fun updateLine1WithAutocompleteAffordance(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't claim this to be my finest work. But this was the best place I could find to do it. And it is tested.

Copy link
Collaborator

@tillh-stripe tillh-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected. Only a single comment about the release notes.

CHANGELOG.md Outdated Show resolved Hide resolved
tillh-stripe
tillh-stripe previously approved these changes Jan 18, 2023
Copy link
Contributor

@jameswoo-stripe jameswoo-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small nit, but lgtm

@jaynewstrom-stripe jaynewstrom-stripe merged commit e0ba9e8 into master Jan 18, 2023
@jaynewstrom-stripe jaynewstrom-stripe deleted the jaynewstrom/autocomplete branch January 18, 2023 18:19
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.

None yet

3 participants