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 font resource to save space and default to system default #4861

Merged
merged 2 commits into from
Apr 12, 2022

Conversation

skyler-stripe
Copy link
Contributor

@skyler-stripe skyler-stripe commented Apr 12, 2022

Summary

  • Change default font for PaymentsTheme to use system default rather than a provided roboto.ttf

Motivation

  • saves space in SDK
  • JJ approved. This is actually closer to the roboto used in Figma.
  • See the bottom of this doc for more info

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
CardFormBefore CardFormAfter
SelectorBefore SelectorAfter

Changelog

Added

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.

🎉

@github-actions
Copy link
Contributor

github-actions bot commented Apr 12, 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 │ 13.2 MiB │  13.2 MiB │    -504 B │  44.1 MiB │  44.1 MiB │     -724 B 
     arsc │  1.6 MiB │   1.6 MiB │    -174 B │   1.6 MiB │   1.6 MiB │     -168 B 
 manifest │  2.9 KiB │   2.9 KiB │       0 B │  12.3 KiB │  12.3 KiB │        0 B 
      res │  762 KiB │ 676.2 KiB │ -85.9 KiB │   1.2 MiB │   1.1 MiB │ -164.3 KiB 
    asset │ 79.4 KiB │  78.9 KiB │    -527 B │ 108.9 KiB │ 108.4 KiB │     -527 B 
    other │ 80.3 KiB │  80.3 KiB │      -2 B │ 154.9 KiB │ 154.9 KiB │        0 B 
──────────┼──────────┼───────────┼───────────┼───────────┼───────────┼────────────
    total │ 15.7 MiB │  15.6 MiB │   -87 KiB │  47.2 MiB │  47.1 MiB │ -165.7 KiB 

         │          raw           │             unique             
         ├────────┬────────┬──────┼────────┬────────┬──────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff         
─────────┼────────┼────────┼──────┼────────┼────────┼──────────────
   files │      3 │      3 │    0 │        │        │              
 strings │ 213147 │ 213143 │   -4 │ 187978 │ 187973 │ -5 (+11 -16) 
   types │  36821 │  36819 │   -2 │  34233 │  34229 │ -4 (+0 -4)   
 classes │  31659 │  31655 │   -4 │  31659 │  31655 │ -4 (+0 -4)   
 methods │ 189780 │ 189777 │   -3 │ 183859 │ 183855 │ -4 (+7 -11)  
  fields │ 130648 │ 130646 │   -2 │ 129810 │ 129806 │ -4 (+1 -5)   

 ARSC    │ old  │ new  │ diff       
─────────┼──────┼──────┼────────────
 configs │  293 │  292 │ -1 (+0 -1) 
 entries │ 5597 │ 5596 │ -1 (+0 -1)
APK
      compressed      │     uncompressed      │                                                       
──────────┬───────────┼──────────┬────────────┤                                                       
 size     │ diff      │ size     │ diff       │ path                                                  
──────────┼───────────┼──────────┼────────────┼───────────────────────────────────────────────────────
          │ -85.8 KiB │          │ -164.3 KiB │ - res/1v.ttf                                          
  3.5 MiB │    -706 B │ 10.2 MiB │     -528 B │ ∆ classes3.dex                                        
    7 KiB │    -527 B │  6.9 KiB │     -527 B │ ∆ assets/dexopt/baseline.prof                         
  3.2 MiB │    +186 B │  8.7 MiB │     -196 B │ ∆ classes2.dex                                        
  1.6 MiB │    -174 B │  1.6 MiB │     -168 B │ ∆ resources.arsc                                      
  6.5 MiB │     +16 B │ 25.3 MiB │        0 B │ ∆ classes.dex                                         
    500 B │      -6 B │    404 B │        0 B │ ∆ res/06.png                                          
  2.5 KiB │      -6 B │  2.4 KiB │        0 B │ ∆ res/33.9.png                                        
    995 B │      +6 B │  2.8 KiB │        0 B │ ∆ res/AE.xml                                          
    506 B │      -6 B │    410 B │        0 B │ ∆ res/Ao.png                                          
 16.3 KiB │      -6 B │ 16.2 KiB │        0 B │ ∆ res/C9.png                                          
    641 B │      -6 B │    541 B │        0 B │ ∆ res/HS.9.png                                        
    315 B │      -6 B │    215 B │        0 B │ ∆ res/Pq.9.png                                        
    317 B │      +6 B │    211 B │        0 B │ ∆ res/Q1.9.png                                        
    360 B │      -6 B │    260 B │        0 B │ ∆ res/VK.9.png                                        
    335 B │      -6 B │    235 B │        0 B │ ∆ res/X3.9.png                                        
    344 B │      -6 B │    244 B │        0 B │ ∆ res/_6.9.png                                        
    321 B │      -6 B │    221 B │        0 B │ ∆ res/dH.9.png                                        
    310 B │      -6 B │    214 B │        0 B │ ∆ res/ee.png                                          
  1.8 KiB │      -6 B │  1.7 KiB │        0 B │ ∆ res/wi.9.png                                        
  1,004 B │      -6 B │    904 B │        0 B │ ∆ res/yx.9.png                                        
  1.3 KiB │      -4 B │  1.2 KiB │        0 B │ ∆ res/6t.9.png                                        
    290 B │      +4 B │    186 B │        0 B │ ∆ res/Ac.9.png                                        
    749 B │      -4 B │    651 B │        0 B │ ∆ res/BG.png                                          
    346 B │      -4 B │    244 B │        0 B │ ∆ res/Dt.9.png                                        
  3.4 KiB │      -4 B │  3.3 KiB │        0 B │ ∆ res/SD.png                                          
    887 B │      +4 B │    785 B │        0 B │ ∆ res/f9.png                                          
    282 B │      +4 B │    178 B │        0 B │ ∆ res/ii.9.png                                        
    1 KiB │      -4 B │    966 B │        0 B │ ∆ res/uB.9.png                                        
    523 B │      +3 B │    840 B │        0 B │ ∆ res/zq.xml                                          
    192 B │      -2 B │     14 B │        0 B │ ∆ META-INF/androidx.activity_activity-compose.version 
  1.2 KiB │      +2 B │  1.1 KiB │        0 B │ ∆ res/1N.9.png                                        
    309 B │      +2 B │    207 B │        0 B │ ∆ res/2C.9.png                                        
    295 B │      +2 B │    197 B │        0 B │ ∆ res/3_.png                                          
    611 B │      +2 B │    513 B │        0 B │ ∆ res/48.png                                          
    335 B │      +2 B │    229 B │        0 B │ ∆ res/7P.9.png                                        
  3.4 KiB │      +2 B │  3.3 KiB │        0 B │ ∆ res/7c.png                                          
    374 B │      +2 B │    272 B │        0 B │ ∆ res/8T.png                                          
    763 B │      +2 B │  1.4 KiB │        0 B │ ∆ res/BA.xml                                          
    628 B │      +2 B │    524 B │        0 B │ ∆ res/Cg.9.png         
...✂
DEX
STRINGS:

   old    │ new    │ diff         
  ────────┼────────┼──────────────
   187978 │ 187973 │ -5 (+11 -16) 
  + .
  ���
  ��
  
  ���
  ���
  ���
  
  ���
  ��-
  ���
  ���
  ���
  ����2�0�Bd������0�������0�������0�������0�������0	���
  ��0	������0	�����0	���
  ��0	������0	�
  ��������0�ø�¢����J	���0�HÆ�J��#��0	HÆ�ø�ø��ø��¢���_��J��%����0�HÆ�¢����J	�&��0�HÆ�J	�'��0�HÆ�J	�(��0�HÆ�J��)��0	HÆ�ø�ø��ø��¢���*��J��+��0	HÆ�ø�ø��ø��¢���,��J��-��0	HÆ�ø�ø��ø��¢���.��J��/��0	HÆ�ø�ø��ø��¢���0��J��1��0	HÆ�ø�ø��ø��¢���2��J���3��02�������0�2�������0�2�������0�2�������0�2�������0	2����
  ��0	2�������0	2������0	2����
  ��0	2�������0	2
  ��������0�HÆ�ø�ø��¢���4�5J��6��072��8����0�HÖ�J	�9��0�HÖ�J	�:��0;HÖ�R�������0�¢�
  
  ���������R�����0�¢��
  ������R�����0�¢��
  ������R�����0�¢��
  ������R�����0�¢��
  ������R��
  ��0	ø�ø��ø��¢�
  
  ���������R����0	ø�ø��ø��¢�
  
  ���������R�����0	ø�ø��ø��¢�
  
  ���������R�����0	ø�ø��ø��¢�
  
  ���������R��
  ��0	ø�ø��ø��¢�
  
  ������ ��R�����0	ø�ø��ø��¢�
  
  ������!�����
  ���
  ��¡�0�
  ��!¨�<
  + n
  
  ���
  
  ���
  ���
  ���
  ���
  
  ���
  
  ���
  
  ���
  
  ���
  
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���� ���0�2����
  ����0�0�¢����H�¢�����C����0�2�������0	2��
  ��0�2����0
  2�����0�2
  ��������0�H�ø�ø��¢�������!����0�*�0�2�����0
  H�ø�ø��¢�����������0�*�0�H�������0�*�0�H�ø�ø��¢������������0�*�0 H�¢���!�����0#*�0_H�¢���%���&��0'*�0(H�¢���)���
  ���
  ��¡�0�¨�*
  + (IIIFJJJJJJLjava/lang/Integer;)Lcom/stripe/android/ui/core/PaymentsTypography;
  + (IIIFJJJJJJLjava/lang/Integer;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
  + (Ljava/lang/String;Landroid/content/Context;FJLjava/lang/Integer;)Landroid/text/SpannableString;
  + LIIIFJJJJJJL
  + LLIIIFJJJJJJLIL
  + LLLFJL
  + SMAP
  PaymentsTheme.kt
  Kotlin
  *S Kotlin
  *F
  + 1 PaymentsTheme.kt
  com/stripe/android/ui/core/PaymentsThemeKt
  + 2 Dp.kt
  androidx/compose/ui/unit/DpKt
  + 3 TextUnit.kt
  androidx/compose/ui/unit/TextUnit
  + 4 Composables.kt
  androidx/compose/runtime/ComposablesKt
  + 5 Composer.kt
  androidx/compose/runtime/ComposerKt
  *L
  1#1,397:1
  175#2:398
  175#2:399
  175#2:400
  175#2:401
  141#3,2:402
  141#3,2:404
  141#3,2:406
  141#3,2:408
  141#3,2:410
  141#3,2:412
  141#3,2:414
  36#4:416
  36#4:423
  957#5,6:417
  957#5,6:424
  *S KotlinDebug
  *F
  + 1 PaymentsTheme.kt
  com/stripe/android/ui/core/PaymentsThemeKt
  *L
  182#1:398
  183#1:399
  185#1:400
  186#1:401
  201#1:402,2
  209#1:404,2
  218#1:406,2
  227#1:408,2
  235#1:410,2
  244#1:412,2
  252#1:414,2
  274#1:416
  277#1:423
  274#1:417,6
  277#1:424,6
  *E
  
  + VIIIFJJJJJJL
  + VIIIFJJJJJJLL
  
  - Lcom/stripe/android/link/R_font;
  - roboto
  - .
  ���
  ��
  
  ���
  ���
  ���
  
  ���
  ��+
  ���
  ���
  ���
  ����2�0�Bb������0�������0�������0�������0�������0	���
  ��0	������0	�����0	���
  ��0	������0	��������0�ø�¢����J	� ��0�HÆ�J��!��0	HÆ�ø�ø��ø��¢�����J	�#��0�HÆ�J	�_��0�HÆ�J	�%��0�HÆ�J	�&��0�HÆ�J��'��0	HÆ�ø�ø��ø��¢���(��J��)��0	HÆ�ø�ø��ø��¢���*��J��+��0	HÆ�ø�ø��ø��¢���,��J��-��0	HÆ�ø�ø��ø��¢���.��J��/��0	HÆ�ø�ø��ø��¢���0��J���1��02�������0�2�������0�2�������0�2�������0�2�������0	2����
  ��0	2�������0	2������0	2����
  ��0	2�������0	2�������0�HÆ�ø�ø��¢���2�3J��4��052��6����0�HÖ�J	�7��0�HÖ�J	�8��09HÖ�R�����0�¢��
  ������R�����0�¢��
  ������R�����0�¢��
  ������R�����0�¢��
  ������R�����0�¢��
  ������R��
  ��0	ø�ø��ø��¢�
  
  ���������R����0	ø�ø��ø��¢�
  
  ���������R�����0	ø�ø��ø��¢�
  
  ���������R�����0	ø�ø��ø��¢�
  
  ���������R��
  ��0	ø�ø��ø��¢�
  
  ���������R�����0	ø�ø��ø��¢�
  
  ������������
  ���
  ��¡�0�
  ��!¨�:
  - n
  
  ���
  
  ���
  ���
  ���
  ���
  
  ���
  
  ���
  
  ���
  
  ���
  
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���� ���0�2����
  ����0�0�¢����H�¢�����A����0�2�������0	2��
  ��0�2����0
  2�����0�2�������0�H�ø�ø��¢�������!����0�*�0�2�����0
  H�ø�ø��¢�����������0�*�0�H�������0�*�0�H�ø�ø��¢������������0�*�0 H�¢���!�����0#*�0_H�¢���%���&��0'*�0(H�¢���)���
  ���
  ��¡�0�¨�*
  - (IIIFJJJJJJI)Lcom/stripe/android/ui/core/PaymentsTypography;
  - (IIIFJJJJJJILkotlin/jvm/internal/DefaultConstructorMarker;)V
  - (Ljava/lang/String;Landroid/content/Context;FJI)Landroid/text/SpannableString;
  - LIIIFJJJJJJI
  - LLIIIFJJJJJJIIL
  - LLLFJI
  - Lcom/stripe/android/paymentsheet/R_font;
  - Lcom/stripe/android/paymentsheet/example/R_font;
  
...✂
ARSC
CONFIGS:

   old │ new │ diff       
  ─────┼─────┼────────────
   293 │ 292 │ -1 (+0 -1) 
  - font
  

ENTRIES:

   old  │ new  │ diff       
  ──────┼──────┼────────────
   5597 │ 5596 │ -1 (+0 -1) 
  - font/roboto

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