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

Update Google Pay button #6471

Merged
merged 9 commits into from
Apr 24, 2023
Merged

Conversation

jameswoo-stripe
Copy link
Contributor

@jameswoo-stripe jameswoo-stripe commented Apr 4, 2023

Summary

Previous work to update the Google Pay button: #5487

  • Update Google Pay button to match updated brand guidelines.
  • Update the com.google.android.gms:play-services-wallet version from 19.1.0 to 19.2.0-beta01.
  • Update Link button to match size and corner radius.
  • Use the Appearance API corner radius.

Motivation

Google Pay branding guidelines changed.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After

Changelog

  • [CHANGED]6471 Updated Google Pay button to match new brand guidelines. You can now change the radius of the Google Pay and Link button with the Appearance API. Additionally, this change updates the com.google.android.gms:play-services-wallet version from 19.1.0 to 19.2.0-beta01.

@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/update-google-pay-button branch from 87ff129 to 2a911fd Compare April 4, 2023 20:29
@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2023

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V1, V2)

          │             compressed             │           uncompressed            
          ├───────────┬───────────┬────────────┼───────────┬──────────┬────────────
 APK      │ old       │ new       │ diff       │ old       │ new      │ diff       
──────────┼───────────┼───────────┼────────────┼───────────┼──────────┼────────────
      dex │   3.3 MiB │   3.3 MiB │  +13.7 KiB │   7.3 MiB │  7.3 MiB │  +18.8 KiB 
     arsc │   2.2 MiB │   2.1 MiB │  -80.9 KiB │   2.2 MiB │  2.1 MiB │  -80.9 KiB 
 manifest │   4.6 KiB │   4.6 KiB │        0 B │  22.3 KiB │ 22.3 KiB │        0 B 
      res │     1 MiB │ 867.3 KiB │ -192.6 KiB │   1.8 MiB │  1.3 MiB │ -450.3 KiB 
   native │   2.6 MiB │   2.6 MiB │        0 B │     6 MiB │    6 MiB │        0 B 
    asset │     3 MiB │     3 MiB │   +1.3 KiB │     3 MiB │    3 MiB │   +1.3 KiB 
    other │ 204.7 KiB │ 199.6 KiB │   -5.2 KiB │ 458.5 KiB │  447 KiB │  -11.5 KiB 
──────────┼───────────┼───────────┼────────────┼───────────┼──────────┼────────────
    total │  12.3 MiB │    12 MiB │ -263.7 KiB │  20.7 MiB │ 20.2 MiB │ -522.6 KiB 

 DEX     │ old   │ new   │ diff                 
─────────┼───────┼───────┼──────────────────────
   files │     1 │     1 │    0                 
 strings │ 35671 │ 35823 │ +152 (+3431 -3279)   
   types │ 11781 │ 11812 │  +31 (+3287 -3256)   
 classes │  9905 │  9924 │  +19 (+2765 -2746)   
 methods │ 52592 │ 52685 │  +93 (+25783 -25690) 
  fields │ 33441 │ 33485 │  +44 (+16797 -16753) 

 ARSC    │ old  │ new  │ diff         
─────────┼──────┼──────┼──────────────
 configs │  333 │  291 │ -42 (+0 -42) 
 entries │ 6921 │ 6916 │  -5 (+9 -14)
APK
      compressed       │      uncompressed      │                                                              
──────────┬────────────┼───────────┬────────────┤                                                              
 size     │ diff       │ size      │ diff       │ path                                                         
──────────┼────────────┼───────────┼────────────┼──────────────────────────────────────────────────────────────
  2.1 MiB │  -80.9 KiB │   2.1 MiB │  -80.9 KiB │ ∆ resources.arsc                                             
  3.3 MiB │  +13.7 KiB │   7.3 MiB │  +18.8 KiB │ ∆ classes.dex                                                
          │   -5.9 KiB │           │   -5.8 KiB │ - res/bM.9.png                                               
          │   -4.8 KiB │           │  -13.8 KiB │ - res/y9.xml                                                 
          │   -4.6 KiB │           │  -18.4 KiB │ - res/zK.xml                                                 
          │   -4.4 KiB │           │  -16.3 KiB │ - res/WE.xml                                                 
          │   -4.3 KiB │           │  -12.3 KiB │ - res/-O.xml                                                 
          │   -4.3 KiB │           │  -11.4 KiB │ - res/X5.xml                                                 
          │   -4.2 KiB │           │  -11.5 KiB │ - res/qp1.xml                                                
          │   -4.1 KiB │           │  -11.8 KiB │ - res/CW.xml                                                 
          │   -4.1 KiB │           │  -11.8 KiB │ - res/ig.xml                                                 
          │   -3.8 KiB │           │  -10.8 KiB │ - res/UJ.xml                                                 
          │   -3.8 KiB │           │  -10.8 KiB │ - res/WK.xml                                                 
          │   -3.7 KiB │           │   -9.7 KiB │ - res/5N1.xml                                                
          │   -3.7 KiB │           │   -9.7 KiB │ - res/Uy.xml                                                 
          │   -3.6 KiB │           │     -9 KiB │ - res/xN.xml                                                 
    449 B │   -3.6 KiB │     788 B │  -12.5 KiB │ ∆ res/9z.xml                                                 
          │   -3.6 KiB │           │   -9.3 KiB │ - res/py.xml                                                 
          │   -3.6 KiB │           │    -10 KiB │ - res/kr.xml                                                 
          │   -3.5 KiB │           │   -9.2 KiB │ - res/zM1.xml                                                
          │   -3.5 KiB │           │     -9 KiB │ - res/R61.xml                                                
          │   -3.5 KiB │           │     -9 KiB │ - res/Fa.xml                                                 
          │   -3.5 KiB │           │     -9 KiB │ - res/rc.xml                                                 
          │   -3.5 KiB │           │   -9.9 KiB │ - res/Ms.xml                                                 
          │   -3.5 KiB │           │   -3.4 KiB │ - res/2j.9.png                                               
          │   -3.4 KiB │           │   -9.3 KiB │ - res/UT.xml                                                 
          │   -3.4 KiB │           │   -9.7 KiB │ - res/oX.xml                                                 
          │   -3.4 KiB │           │   -9.4 KiB │ - res/oR.xml                                                 
          │   -3.4 KiB │           │   -9.4 KiB │ - res/xr.xml                                                 
          │   -3.3 KiB │           │   -7.7 KiB │ - res/5l.xml                                                 
          │   -3.3 KiB │           │   -7.7 KiB │ - res/i3.xml                                                 
          │   -3.3 KiB │           │   -9.3 KiB │ - res/EV.xml                                                 
          │   -3.3 KiB │           │   -8.3 KiB │ - res/4H.xml                                                 
          │   -3.3 KiB │           │   -7.2 KiB │ - res/jS.xml                                                 
          │   -3.2 KiB │           │   -8.6 KiB │ - res/sU.xml                                                 
          │   -3.1 KiB │           │     -3 KiB │ - res/qJ.9.png                                               
          │   -3.1 K
...✂
DEX
STRINGS:

   old   │ new   │ diff               
  ───────┼───────┼────────────────────
   35671 │ 35823 │ +152 (+3431 -3279) 
  +  and remote module com.google.android.gms.wallet_dynamite:
  +  and remote version is 
  + _onPressed
  + ' didn't match expected id 'com.google.android.gms.wallet_dynamite'
  + , googlePayAllowCreditCards=
  + , googlePayBillingAddressParameters=
  + 3ds2/authenticate
  + 3ds2/challenge_complete
  + Binder object is null.
  + C2
  + Considering local module com.google.android.gms.wallet_dynamite:
  + Could not access the field in remoteBinder.
  + D2
  + Dynamite loader version < 2, falling back to createModuleContext
  + Dynamite loader version < 2, falling back to loadModule2
  + Dynamite loader version >= 2, using loadModule2NoCrashUtils
  + DynamiteLoaderV2 was not cached.
  + DynamiteLoaderV2CL
  + DynamiteModule
  + E2
  + F2
  + Failed to connect to dynamite module ContentResolver.
  + Failed to create IDynamiteLoader.
  + Failed to create PayButton using dynamite package
  + Failed to create buttonView
  + Failed to create buttonView: allowedPaymentMethods cannot be empty.
  + Failed to determine which loading route to use.
  + Failed to enumerate thread/threadgroup 
  + Failed to get module context
  + Failed to get the actual PayButtonCreatorChimeraImpl.
  + Failed to get thread context classloader 
  + Failed to instantiate dynamite loader
  + Failed to instantiate module class: 
  + Failed to load IDynamiteLoader from GmsCore: 
  + Failed to load module descriptor class: 
  + Failed to load module via V2: 
  + Failed to load remote module.
  + Failed to load remote module: 
  + Failed to retrieve remote module version.
  + Failed to retrieve remote module version: 
  + G2
  + GmsDynamite
  + H2
  + I2
  + IDynamite loader version < 2, falling back to getModuleVersion2
  + IDynamite loader version = 2
  + IDynamite loader version = 2, no high precision latency measurement.
  + ILZ
  + IObjectWrapper declared field not private!
  + J2
  + JSONArray().put(
         …   )
          ).toString()
  + K2
  + L2
  + LLZJ
  + La9/b;
  + La9/c;
  + La9/d;
  + La9/e;
  + La9/f;
  + La9/g;
  + La9/h;
  + Lab/q;
  + Lab/r;
  + Lac/a0;
  + Lac/a1;
  + Lac/a2;
  + Lac/a3;
  + Lac/a4;
  + Lac/a5;
  + Lac/b0;
  + Lac/b1;
  + Lac/b2;
  + Lac/b3;
  + Lac/b4;
  + Lac/b5;
  + Lac/c0;
  + Lac/c1;
  + Lac/c2;
  + Lac/c3;
  + Lac/c4;
  + Lac/c5;
  + Lac/d0;
  + Lac/d1;
  + Lac/d2;
  + Lac/d3;
  + Lac/d4;
  + Lac/d5;
  + Lac/e0;
  + Lac/e1;
  + Lac/e2;
  + Lac/e3;
  + Lac/e4;
  + Lac/e5;
  + Lac/f0;
  + Lac/f1;
  + Lac/f2;
  + Lac/f3;
  + Lac/f4;
  + Lac/f5;
  + Lac/g0;
  + Lac/g1;
  + Lac/g2;
  + Lac/g3;
  + Lac/g4;
  + Lac/g5;
  + Lac/h0;
  + Lac/h1;
  + Lac/h2;
  + Lac/h3;
  + Lac/h4;
  + Lac/h5;
  + Lac/h;
  + Lac/i0;
  + Lac/i1;
  + Lac/i2;
  + Lac/i3;
  + Lac/i4;
  + Lac/i5;
  + Lac/i;
  + Lac/j0;
  + Lac/j1;
  + Lac/j2;
  + Lac/j3;
  + Lac/j4;
  + Lac/j5;
  + Lac/j;
  + Lac/k0;
  + Lac/k1;
  + Lac/k2;
  + Lac/k3;
  + Lac/k4;
  + Lac/k5;
  + Lac/k;
  + Lac/l0;
  + Lac/l1;
  + Lac/l2;
  + Lac/l3;
  + Lac/l4;
  + Lac/l5;
  + Lac/l;
  + Lac/m0;
  + Lac/m1;
  + Lac/m2;
  + Lac/m3;
  + Lac/m4;
  + Lac/m;
  + Lac/n0;
  + Lac/n1;
  + Lac/n2;
  + Lac/n3;
  + Lac/n4;
  + Lac/n;
  + Lac/o0;
  + Lac/o1;
  + Lac/o2;
  + Lac/o3;
  + Lac/o4;
  + Lac/o;
  + Lac/p0;
  + Lac/p1;
  + Lac/p2;
  + Lac/p3;
  + Lac/p4;
  + Lac/p;
  + Lac/q0;
  + Lac/q1;
  + Lac/q2;
  + Lac/q3;
  + Lac/q4;
  + Lac/q;
  + Lac/r0;
  + Lac/r1;
  + Lac/r2;
  + Lac/r3;
  + Lac/r4;
  + Lac/r;
  + Lac/s0;
  + Lac/s1;
  + Lac/s2;
  + Lac/s3;
  + Lac/s4;
  + Lac/s;
  + Lac/t0;
  + Lac/t1;
  + Lac/t2;
  + Lac/t3;
  + Lac/t4;
  + Lac/t;
  + Lac/u0;
  + Lac/u1;
  + Lac/u2;
  + Lac/u3;
  + Lac/u4;
  + Lac/u;
  + Lac/v0;
  + Lac/v1;
  + Lac/v2;
  + Lac/v3;
  + Lac/v4;
  + Lac/v;
  + Lac/w0;
  + Lac/w1;
  + Lac/w2;
  + Lac/w3;
  + Lac/w4;
  + Lac/w;
  + Lac/x0;
  + Lac/x1;
  + Lac/x2;
  + Lac/x3;
  + Lac/x4;
  + Lac/x;
  + Lac/y0;
  + Lac/y1;
  + Lac/y2;
  + Lac/y3;
  + Lac/y4;
  + Lac/y;
  + Lac/z0;
  + Lac/z1;
  + Lac/z2;
  + Lac/z3;
  + Lac/z4;
  + Lac/z;
  + Lad/i;
  + Lad/j;
  + Lad/k;
  + Lad/l;
  + Lad/m;
  + Lad/n;
  + Lad/o;
  + Lad/p;
  + Lad/q;
  + Lad/r;
  + Lad/s;
  + Lad/t;
  + Lad/u;
  + Lae/l;
  + Lah/a0;
  + Lah/a1;
  + Lah/b0;
  + Lah/b1;
  + Lah/b;
  + Lah/c0;
  + Lah/c1;
  + Lah/c;
  + Lah/d0;
  + Lah/d1;
  + Lah/d;
  + Lah/e0;
  + Lah/e1;
  + Lah/e;
  + Lah/f0;
  + Lah/f1;
  + Lah/f;
  + Lah/g0;
  + Lah/g1;
  + Lah/g;
  + Lah/h
...✂
ARSC
CONFIGS:

   old │ new │ diff         
  ─────┼─────┼──────────────
   333 │ 291 │ -42 (+0 -42) 
  - drawable-ca
  - drawable-cs
  - drawable-da
  - drawable-de
  - drawable-el
  - drawable-en-rAU
  - drawable-en-rCA
  - drawable-en-rGB
  - drawable-en-rIN
  - drawable-es
  - drawable-es-rES
  - drawable-et
  - drawable-fi
  - drawable-fil
  - drawable-fr
  - drawable-fr-rCA
  - drawable-hr
  - drawable-hu
  - drawable-id
  - drawable-it
  - drawable-ja
  - drawable-ko
  - drawable-lt
  - drawable-lv
  - drawable-ms
  - drawable-nl
  - drawable-no
  - drawable-pl
  - drawable-pt-rBR
  - drawable-pt-rPT
  - drawable-ro
  - drawable-ru
  - drawable-sk
  - drawable-sl
  - drawable-sv
  - drawable-sw
  - drawable-th
  - drawable-tr
  - drawable-vi
  - drawable-zh-rCN
  - drawable-zh-rHK
  - drawable-zh-rTW
  

ENTRIES:

   old  │ new  │ diff        
  ──────┼──────┼─────────────
   6921 │ 6916 │ -5 (+9 -14) 
  + attr/buttonTheme
  + color/stripe_paymentsheet_googlepay_primary_button_background_color
  + color/stripe_paymentsheet_googlepay_primary_button_tint_color
  + dimen/stripe_paymentsheet_googlepay_button_bottom_padding
  + dimen/stripe_paymentsheet_googlepay_button_margin
  + dimen/stripe_paymentsheet_googlepay_button_margin_horizontal
  + drawable/stripe_ic_paymentsheet_googlepay_primary_button_checkmark
  + drawable/stripe_ic_paymentsheet_googlepay_primary_button_lock
  + id/google_pay_payment_button
  
  - dimen/stripe_paymentsheet_primary_button_margin
  - drawable/googlepay_button_background
  - drawable/googlepay_button_background_image
  - drawable/googlepay_button_content
  - drawable/pay_with_googlepay_button_content
  - drawable/stripe_googlepay_button_no_shadow_background_image_dark
  - drawable/stripe_googlepay_button_no_shadow_background_image_focused_dark
  - drawable/stripe_googlepay_button_no_shadow_background_image_focused_light
  - drawable/stripe_googlepay_button_no_shadow_background_image_light
  - drawable/stripe_googlepay_button_no_shadow_background_image_pressed_dark
  - drawable/stripe_googlepay_button_no_shadow_background_image_pressed_light
  - drawable/stripe_googlepay_button_overlay
  - drawable/stripe_ic_paymentsheet_primary_button_checkmark
  - id/google_pay_button_content

@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/update-google-pay-button branch from 2a911fd to a4f1d9d Compare April 5, 2023 17:05
@jameswoo-stripe jameswoo-stripe marked this pull request as ready for review April 5, 2023 17:07
@jameswoo-stripe jameswoo-stripe requested review from a team as code owners April 5, 2023 17:07
@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/update-google-pay-button branch from a4f1d9d to 560a962 Compare April 6, 2023 17:16
@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/update-google-pay-button branch from 53d1d01 to 3e68ea2 Compare April 6, 2023 21:50
@jameswoo-stripe
Copy link
Contributor Author

We got UX approval from @jarvis-stripe as well.

@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/update-google-pay-button branch 6 times, most recently from d52c57c to 97d1c28 Compare April 13, 2023 20:36
@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/update-google-pay-button branch 5 times, most recently from 0dd2a0a to 4502199 Compare April 18, 2023 21:31
@github-actions
Copy link
Contributor

Risky Change

This is considered a risky change because it adjusts the sample app build.gradle, please review carefully.
We've seen issues in the past which resulted in failed builds for merchants. Please make sure the build.gradle change is intended.

By adding the label accept-risky-change to this PR, I acknowledge that I'm changing an example app and have verified that the SDK remains in a shippable state.

@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/update-google-pay-button branch 4 times, most recently from 0a9e0ef to bcb71c6 Compare April 19, 2023 19:14
@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/update-google-pay-button branch from bcb71c6 to 8093ea9 Compare April 19, 2023 19:41
@jameswoo-stripe jameswoo-stripe added the accept-risky-change accept-risky-change label Apr 19, 2023
paymentsheet/res/layout/stripe_google_pay_button.xml Outdated Show resolved Hide resolved
Comment on lines +157 to +160
LabelUI(
label = text,
color = defaultLabelColor,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I’m not entirely clear on why we need this now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to be able to change the label color when user switches between light/dark theme. Exposed in setDefaultLabelColor

Comment on lines +154 to +159
val padding = context.resources.getDimensionPixelSize(
R.dimen.stripe_paymentsheet_googlepay_button_bottom_padding
)
viewBinding.googlePayButtonLayout.updatePadding(bottom = padding)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need to update the padding when we start processing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When the Google Pay button changes to not visible, the padding that the Google Pay button had goes away, so we need to adjust for this.

@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/update-google-pay-button branch 3 times, most recently from 45b8e2a to 9d0a072 Compare April 21, 2023 18:20
@@ -2,6 +2,9 @@

## XX.XX.XX - 2023-XX-XX

### PaymentSheet
* [CHANGED][6471](https://github.com/stripe/stripe-android/pull/6471) Updated Google Pay button to match new brand guidelines. You can now change the radius of the Google Pay and Link button with the [Appearance API](https://stripe.com/docs/elements/appearance-api?platform=android#shapes-android). Additionally, this change updates the `com.google.android.gms:play-services-wallet` version from `19.1.0` to `19.2.0-beta01`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don’t think we need this addition.

Suggested change
* [CHANGED][6471](https://github.com/stripe/stripe-android/pull/6471) Updated Google Pay button to match new brand guidelines. You can now change the radius of the Google Pay and Link button with the [Appearance API](https://stripe.com/docs/elements/appearance-api?platform=android#shapes-android). Additionally, this change updates the `com.google.android.gms:play-services-wallet` version from `19.1.0` to `19.2.0-beta01`.
* [CHANGED][6471](https://github.com/stripe/stripe-android/pull/6471) Updated Google Pay button to match new brand guidelines. You can now change the radius of the Google Pay and Link button with the [Appearance API](https://stripe.com/docs/elements/appearance-api?platform=android#shapes-android).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should definitely call it out. Could be a separate line item/section though.

@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/update-google-pay-button branch 2 times, most recently from 09ce0d1 to d43c707 Compare April 24, 2023 20:50
@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/update-google-pay-button branch from d43c707 to 588422a Compare April 24, 2023 20:50
@jameswoo-stripe jameswoo-stripe enabled auto-merge (squash) April 24, 2023 21:09
@jameswoo-stripe jameswoo-stripe merged commit 2aa36a0 into master Apr 24, 2023
13 checks passed
@jameswoo-stripe jameswoo-stripe deleted the jameswoo/update-google-pay-button branch April 24, 2023 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accept-risky-change accept-risky-change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants