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

support edge to edge on android 15 #9759

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

toluo-stripe
Copy link
Contributor

@toluo-stripe toluo-stripe commented Dec 6, 2024

Summary

Android 35 enforces edge-to-edge displays on all activities. We need to modify our screens to support this.

This is what an app that doesn't support edge to edge looks like on android 35
edge-to-edge-6

This is what edge to edge support looks like
edge-to-edge-2

Motivation

JIRA

Testing

  • Added tests
  • Modified tests
  • Manually verified

Recordings

PaymentSheeet With edge to edge update
https://github.com/user-attachments/assets/696f06ea-973f-4cb1-a873-e823ad65b84d

PaymentSheeet Without edge to edge update
https://github.com/user-attachments/assets/84943f6e-d91e-426a-bb60-c2e2c349b9eb

Identity With edge to edge update
https://github.com/user-attachments/assets/657e2c5e-7edc-4338-af4b-fc85a4a7a6fb

Identity Without edge to edge update
https://github.com/user-attachments/assets/b34878d0-d07c-4e12-811d-cd88e52d1584

Connect With edge to edge update
https://github.com/user-attachments/assets/77e1c9ce-4892-4424-a354-69f4c908aa27

Connect Without edge to edge update
https://github.com/user-attachments/assets/ef7b440b-9f4b-4d0e-b7c5-f5497ee66144

3ds With edge to edge update
https://github.com/user-attachments/assets/b58ca04f-9e79-499d-8316-874fa3a1a334

3ds Without edge to edge update
https://github.com/user-attachments/assets/1e924eee-7089-466c-a01f-92aecb6ce4a9

Financial Connections With edge to edge update
https://github.com/user-attachments/assets/6c34a376-9b18-4d35-aec1-4989270bc43a

Financial Connections Without edge to edge update
https://github.com/user-attachments/assets/74ccedee-75c0-430a-ba2a-771fc75c7584

CardScan With edge to edge update
https://github.com/user-attachments/assets/ed8477b1-9b58-4c22-84ec-92c12068fea1

CardScan Without edge to edge update
https://github.com/user-attachments/assets/92361939-a905-48f9-8cf6-3dfd1bd49038

TODO

JIRA - Screens that use supportActionBar have a transparent status bar. These only appear on the example apps, but they need to be resolved.

Changelog

Copy link
Contributor

github-actions bot commented Dec 9, 2024

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 │ +3.2 KiB │  8.6 MiB │  8.6 MiB │ +5.5 KiB 
     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.2 KiB │ 908.3 KiB │    +54 B │  1.4 MiB │  1.4 MiB │   +116 B 
   native │   2.6 MiB │   2.6 MiB │      0 B │    6 MiB │    6 MiB │      0 B 
    asset │   1.6 MiB │   1.6 MiB │    -17 B │  1.6 MiB │  1.6 MiB │    -17 B 
    other │   1.4 MiB │   1.4 MiB │     -7 B │  1.6 MiB │  1.6 MiB │      0 B 
──────────┼───────────┼───────────┼──────────┼──────────┼──────────┼──────────
    total │  12.7 MiB │  12.7 MiB │ +3.2 KiB │ 21.6 MiB │ 21.6 MiB │ +5.6 KiB 

 DEX     │ old   │ new   │ diff              
─────────┼───────┼───────┼───────────────────
   files │     1 │     1 │   0               
 strings │ 40570 │ 40587 │ +17 (+35 -18)     
   types │ 14002 │ 14010 │  +8 (+23 -15)     
 classes │ 11679 │ 11687 │  +8 (+13 -5)      
 methods │ 59604 │ 59626 │ +22 (+1391 -1369) 
  fields │ 39798 │ 39815 │ +17 (+953 -936)   

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  243 │  243 │  0   
 entries │ 6209 │ 6209 │  0
APK
     compressed      │     uncompressed     │                                           
──────────┬──────────┼───────────┬──────────┤                                           
 size     │ diff     │ size      │ diff     │ path                                      
──────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
  3.9 MiB │ +3.2 KiB │   8.6 MiB │ +5.5 KiB │ ∆ classes.dex                             
    596 B │    +33 B │   1.1 KiB │    +48 B │ ∆ res/v9.xml                              
  7.8 KiB │    -29 B │   7.6 KiB │    -29 B │ ∆ assets/dexopt/baseline.prof             
    907 B │    +27 B │   2.4 KiB │    +48 B │ ∆ res/YB.xml                              
    990 B │    +12 B │     858 B │    +12 B │ ∆ assets/dexopt/baseline.profm            
 50.2 KiB │     -9 B │ 118.4 KiB │      0 B │ ∆ META-INF/MANIFEST.MF                    
    845 B │     -6 B │   1.8 KiB │    +20 B │ ∆ res/8Q.xml                              
    272 B │     +2 B │     120 B │      0 B │ ∆ META-INF/version-control-info.textproto 
──────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
    4 MiB │ +3.2 KiB │   8.7 MiB │ +5.6 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff          
  ───────┼───────┼───────────────
   40570 │ 40587 │ +17 (+35 -18) 
  
  +  only 
  + LF7/m;
  + LH/p0;
  + Landroidx/activity/C;
  + Landroidx/activity/D;
  + Landroidx/activity/E;
  + Landroidx/activity/F;
  + Landroidx/activity/G;
  + Landroidx/activity/H;
  + Landroidx/activity/I;
  + Landroidx/activity/J;
  + Landroidx/lifecycle/f0_a;
  + Lm7/x;
  + Lt1/i;
  + VLLLLLLLIZLZLFJJJJJLIII
  + VLLLLLLLIZLZLFJJJJJLLIII
  + VLLLLZZ
  + VLZLZLLII
  + VLZLZLLLII
  + WindowInsetsSides(
  + [LO8/M0;
  + [LO8/N;
  + [LO8/Q0;
  + [LO8/S;
  + [LO8/T0;
  + [LO8/g0;
  + [LO8/y0;
  + [Lm7/q;
  + [Lm7/w;
  + [Lt1/h;
  + navigationBarStyle
  + setStatusBarContrastEnforced
  + statusBarStyle
  + view.resources
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"801a692","r8-mode":"full","version":"8.7.14"}
  
  - LO8/C1;
  - Landroidx/lifecycle/g0_a;
  - Landroidx/lifecycle/v0;
  - Ls/d;
  - Lv0/q;
  - VLLLLLLLIZLZLFJJJJJLII
  - VLLLLLLLIZLZLFJJJJJLLII
  - [LO8/N0;
  - [LO8/P;
  - [LO8/R0;
  - [LO8/T;
  - [LO8/U0;
  - [LO8/i0;
  - [LO8/z0;
  - [Lm7/p;
  - [Lm7/v;
  - [Lt1/g;
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"6246da4","r8-mode":"full","version":"8.7.14"}
  

TYPES:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   14002 │ 14010 │ +8 (+23 -15) 
  
  + LF7/m;
  + LH/p0;
  + Landroidx/activity/C;
  + Landroidx/activity/D;
  + Landroidx/activity/E;
  + Landroidx/activity/F;
  + Landroidx/activity/G;
  + Landroidx/activity/H;
  + Landroidx/activity/I;
  + Landroidx/activity/J;
  + Landroidx/lifecycle/f0_a;
  + Lm7/x;
  + Lt1/i;
  + [LO8/M0;
  + [LO8/N;
  + [LO8/Q0;
  + [LO8/S;
  + [LO8/T0;
  + [LO8/g0;
  + [LO8/y0;
  + [Lm7/q;
  + [Lm7/w;
  + [Lt1/h;
  
  - LO8/C1;
  - Landroidx/lifecycle/g0_a;
  - Landroidx/lifecycle/v0;
  - Ls/d;
  - Lv0/q;
  - [LO8/N0;
  - [LO8/P;
  - [LO8/R0;
  - [LO8/T;
  - [LO8/U0;
  - [LO8/i0;
  - [LO8/z0;
  - [Lm7/p;
  - [Lm7/v;
  - [Lt1/g;
  

METHODS:

   old   │ new   │ diff              
  ───────┼───────┼───────────────────
   59604 │ 59626 │ +22 (+1391 -1369) 
  
  + Aa.j <init>(g, e, Application, U, g0, e)
  + Aa.j <init>(g0, P)
  + B.m0 w(i, String, int) → j1
  + B6.f <init>(boolean, boolean, W, f, p, a, int)
  + B6.l <init>(d1, k0, d1, b, a, int)
  + B8.d <init>(q, X, boolean, Throwable, p, int)
  + B8.d <init>(boolean, b0, Set, S, p, int)
  + B8.d <init>(boolean, a, S, H0, p, int)
  + B8.e <init>(O, int, int, boolean, Set, S, int)
  + C0.c r0(Integer, List) → I0
  + D5.W F(q, X, boolean, Throwable, p, p, int)
  + D5.W z(boolean, I0, Set, S, p, int, int, p, int)
  + D7.p <init>(n0, int)
  + E0.e <init>(r0, p0, c)
  + E0.e C(String) → j1
  + E0.e E(String, e) → n0
  + E6.a b(Map) → I0
  + E6.b b(Map) → I0
  + E6.c b(Map) → I0
  + E6.d b(Map) → I0
  + E6.e <init>(s0, F, j, a, f, e, boolean)
  + E6.g b(x, int) → Typeface
  + E6.g c(Preference) → CharSequence
  + E6.g d(float, float[], float[]) → float
  + E6.g e(g, F1, i1) → R1
  + E6.g f(Context, v, Bundle, u, p) → j
  + E6.g i(String) → i
  + E6.g j(String) → StripeIntent_Status
  + E6.g l(R1, String) → String
  + E6.g m(String) → List
  + E6.g n(String) → ArrayList
  + E6.g o(i3, String) → f
  + E6.g p(View) → float
  + E6.g t(b, int, c) → Object
  + E6.g u(View, int, int, int, int)
  + E6.g v(View, float)
  + E6.g w(View, int)
  + E6.g x(View, Matrix)
  + E6.g y(View, Matrix)
  + F7.h <init>(String, boolean, boolean, i1, a, a, int, int)
  + F7.h <init>(p, String, boolean, String, boolean, c, int, int)
  + F7.h <init>(p, boolean, c, boolean, e, a, int, int)
  + F7.h <init>(boolean, boolean, int, u, String, a, p, int)
  + F7.i <init>(String, int, String, int)
  + F7.i d(Object, Object) → Object
  + F7.j <init>(int, int, c)
  + F7.j a() → Object
  + F7.k <init>(boolean, String, int, String, int, boolean, c, int)
  + F7.l <init>(c, boolean, boolean, e)
  + F7.l <init>(boolean, p, boolean, String)
  + F7.m <init>(D0, boolean, c, boolean, e, a)
  + F7.m <init>(q, c, boolean, boolean, a, a)
  + F7.m d(Object, Object) → Object
  + F8.A0 <init>(int, S, Z1, List)
  + F8.A0 <init>(S, Z1, ArrayList)
  + F8.B0 <init>(S, String, int)
  + F8.B0 a() → S
  + F8.B0 g() → T
  + F8.B1 a() → S
  + F8.C C(String) → j1
  + F8.D <init>(S, V0, a)
  + F8.D a() → S
  + F8.D g() → T
  + F8.E0 <init>(int, S)
  + F8.E0 <init>(S)
  + F8.E0 k(Map) → I0
  + F8.F0 a() → S
  + F8.F C(String) → j1
  + F8.H <ini
...✂

@toluo-stripe toluo-stripe force-pushed the tolu/android_15_insets branch from 990dd27 to 23100c9 Compare December 9, 2024 17:33
@toluo-stripe toluo-stripe changed the title support edge to edge support edge to edge on android 15 Dec 9, 2024
super.onCreate(savedInstanceState)

setContent {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
window.isNavigationBarContrastEnforced = false
Copy link
Contributor Author

@toluo-stripe toluo-stripe Dec 9, 2024

Choose a reason for hiding this comment

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

window.isNavigationBarContrastEnforced ensures that the 3-button navigation bar has enough contrast when a fully transparent background is requested.

https://developer.android.com/codelabs/edge-to-edge#2

@toluo-stripe toluo-stripe marked this pull request as ready for review December 9, 2024 17:42
@toluo-stripe toluo-stripe requested review from a team as code owners December 9, 2024 17:42
Copy link
Collaborator

@simond-stripe simond-stripe left a comment

Choose a reason for hiding this comment

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

Looks good for connect-example

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