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

[MOBILESDK-2482] Apply appearance API typography to dialog buttons #9850

Merged
merged 6 commits into from
Jan 4, 2025

Conversation

cttsai-stripe
Copy link
Contributor

@cttsai-stripe cttsai-stripe commented Jan 3, 2025

Summary

Apply appearance API typography to dialog buttons by assigning correct style.

Typography.body1 is used instead of Typography.button because the former utilizes the Appearance API, whereas the latter does not.

Motivation

Buttons in remove saved PM dialog don't use appearance API typography
https://jira.corp.stripe.com/browse/MOBILESDK-2482

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After

Copy link
Contributor

github-actions bot commented Jan 3, 2025

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.9 MiB │   3.9 MiB │ -119 B │  8.6 MiB │  8.6 MiB │ +44 B 
     arsc │   2.3 MiB │   2.3 MiB │    0 B │  2.3 MiB │  2.3 MiB │   0 B 
 manifest │     5 KiB │     5 KiB │    0 B │ 24.9 KiB │ 24.9 KiB │   0 B 
      res │ 908.4 KiB │ 908.4 KiB │    0 B │  1.4 MiB │  1.4 MiB │   0 B 
   native │   2.6 MiB │   2.6 MiB │    0 B │    6 MiB │    6 MiB │   0 B 
    asset │   1.6 MiB │   1.6 MiB │    0 B │  1.6 MiB │  1.6 MiB │   0 B 
    other │   1.4 MiB │   1.4 MiB │   -5 B │  1.6 MiB │  1.6 MiB │   0 B 
──────────┼───────────┼───────────┼────────┼──────────┼──────────┼───────
    total │  12.6 MiB │  12.6 MiB │ -124 B │ 21.5 MiB │ 21.5 MiB │ +44 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 40589 │ 40589 │ 0 (+1 -1) 
   types │ 14007 │ 14007 │ 0 (+0 -0) 
 classes │ 11682 │ 11682 │ 0 (+0 -0) 
 methods │ 59625 │ 59625 │ 0 (+0 -0) 
  fields │ 39808 │ 39808 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  243 │  243 │  0   
 entries │ 6208 │ 6208 │  0
APK
    compressed     │   uncompressed    │                                           
──────────┬────────┼───────────┬───────┤                                           
 size     │ diff   │ size      │ diff  │ path                                      
──────────┼────────┼───────────┼───────┼───────────────────────────────────────────
  3.9 MiB │ -119 B │   8.6 MiB │ +44 B │ ∆ classes.dex                             
 53.5 KiB │   -6 B │ 118.5 KiB │   0 B │ ∆ META-INF/CERT.SF                        
 50.2 KiB │   +3 B │ 118.4 KiB │   0 B │ ∆ META-INF/MANIFEST.MF                    
    271 B │   -1 B │     120 B │   0 B │ ∆ META-INF/version-control-info.textproto 
  1.2 KiB │   -1 B │   1.2 KiB │   0 B │ ∆ META-INF/CERT.RSA                       
──────────┼────────┼───────────┼───────┼───────────────────────────────────────────
    4 MiB │ -124 B │   8.8 MiB │ +44 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff      
  ───────┼───────┼───────────
   40589 │ 40589 │ 0 (+1 -1) 
  
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"ec25603","r8-mode":"full","version":"8.7.14"}
  
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"1b8b748","r8-mode":"full","version":"8.7.14"}

@cttsai-stripe cttsai-stripe marked this pull request as ready for review January 3, 2025 20:58
@cttsai-stripe cttsai-stripe requested review from a team as code owners January 3, 2025 20:58
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add another test here for the crazy appearance?

val paparazziWithEveryAppearance = PaparazziRule(
SystemAppearance.entries,
listOf(FontSize.DefaultFont),
listOf(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can replace this with PaymentSheetAppearance.entries

@get:Rule
val paparazziWithEveryAppearance = PaparazziRule(
SystemAppearance.entries,
listOf(FontSize.DefaultFont),
Copy link
Collaborator

Choose a reason for hiding this comment

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

We probably want all the font sizes too.

@cttsai-stripe cttsai-stripe merged commit a318b6a into master Jan 4, 2025
16 checks passed
@cttsai-stripe cttsai-stripe deleted the cttsai/fix_alert_dialog_cta_typography branch January 4, 2025 03:54
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.

2 participants