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 force portrait in PaymentLauncher #4855

Merged
merged 2 commits into from
Apr 13, 2022

Conversation

jameswoo-stripe
Copy link
Contributor

@jameswoo-stripe jameswoo-stripe commented Apr 11, 2022

Summary

Removed force portrait mode for tablets.

Motivation

Make sure that PaymentLauncher works in landscape mode on tablets.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

3ds1 testing

paymentlauncher.mov

3ds2 testing

3ds2.mov

Changelog

  • [CHANGED] Removed force portrait mode for tablets

@github-actions
Copy link
Contributor

github-actions bot commented Apr 11, 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 │ +148 B │  44.1 MiB │  44.1 MiB │  -32 B 
     arsc │   1.6 MiB │   1.6 MiB │    0 B │   1.6 MiB │   1.6 MiB │    0 B 
 manifest │   2.9 KiB │   2.9 KiB │    0 B │  12.3 KiB │  12.3 KiB │    0 B 
      res │ 676.2 KiB │ 676.2 KiB │    0 B │   1.1 MiB │   1.1 MiB │    0 B 
    asset │  78.9 KiB │  79.4 KiB │ +530 B │ 108.4 KiB │ 108.9 KiB │ +530 B 
    other │  80.3 KiB │  80.3 KiB │   +4 B │ 154.9 KiB │ 154.9 KiB │    0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
    total │  15.6 MiB │  15.6 MiB │ +682 B │  47.1 MiB │  47.1 MiB │ +498 B 

         │          raw           │            unique            
         ├────────┬────────┬──────┼────────┬────────┬────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff       
─────────┼────────┼────────┼──────┼────────┼────────┼────────────
   files │      3 │      3 │    0 │        │        │            
 strings │ 213143 │ 213143 │    0 │ 187973 │ 187973 │  0 (+1 -1) 
   types │  36819 │  36819 │    0 │  34229 │  34229 │  0 (+0 -0) 
 classes │  31655 │  31655 │    0 │  31655 │  31655 │  0 (+0 -0) 
 methods │ 189777 │ 189776 │   -1 │ 183855 │ 183854 │ -1 (+0 -1) 
  fields │ 130646 │ 130646 │    0 │ 129806 │ 129806 │  0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  292 │  292 │  0   
 entries │ 5596 │ 5596 │  0
APK
    compressed    │   uncompressed    │                                                       
─────────┬────────┼──────────┬────────┤                                                       
 size    │ diff   │ size     │ diff   │ path                                                  
─────────┼────────┼──────────┼────────┼───────────────────────────────────────────────────────
 7.5 KiB │ +530 B │  7.4 KiB │ +530 B │ ∆ assets/dexopt/baseline.prof                         
 3.5 MiB │ +148 B │ 10.2 MiB │  -32 B │ ∆ classes3.dex                                        
   196 B │   +4 B │     14 B │    0 B │ ∆ META-INF/androidx.activity_activity-compose.version 
─────────┼────────┼──────────┼────────┼───────────────────────────────────────────────────────
 3.5 MiB │ +682 B │ 10.2 MiB │ +498 B │ (total)
DEX
STRINGS:

   old    │ new    │ diff      
  ────────┼────────┼───────────
   187973 │ 187973 │ 0 (+1 -1) 
  + SMAP
  PaymentLauncherConfirmationActivity.kt
  Kotlin
  *S Kotlin
  *F
  + 1 PaymentLauncherConfirmationActivity.kt
  com/stripe/android/payments/paymentlauncher/PaymentLauncherConfirmationActivity
  + 2 ActivityViewModelLazy.kt
  androidx/activity/ActivityViewModelLazyKt
  *L
  1#1,102:1
  43#2,5:103
  *S KotlinDebug
  *F
  + 1 PaymentLauncherConfirmationActivity.kt
  com/stripe/android/payments/paymentlauncher/PaymentLauncherConfirmationActivity
  *L
  32#1:103,5
  *E
  
  
  - SMAP
  PaymentLauncherConfirmationActivity.kt
  Kotlin
  *S Kotlin
  *F
  + 1 PaymentLauncherConfirmationActivity.kt
  com/stripe/android/payments/paymentlauncher/PaymentLauncherConfirmationActivity
  + 2 ActivityViewModelLazy.kt
  androidx/activity/ActivityViewModelLazyKt
  *L
  1#1,109:1
  43#2,5:110
  *S KotlinDebug
  *F
  + 1 PaymentLauncherConfirmationActivity.kt
  com/stripe/android/payments/paymentlauncher/PaymentLauncherConfirmationActivity
  *L
  34#1:110,5
  *E
  
  

METHODS:

   old    │ new    │ diff       
  ────────┼────────┼────────────
   183855 │ 183854 │ -1 (+0 -1) 
  - com.stripe.android.payments.paymentlauncher.PaymentLauncherConfirmationActivity setRequestedOrientation(int)

Copy link
Contributor

@skyler-stripe skyler-stripe left a comment

Choose a reason for hiding this comment

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

I want to see some screenshots of the 3ds2 challenges in portrait before we merge this. Unsure if they'll work.

@@ -36,7 +37,9 @@ internal class PaymentLauncherConfirmationActivity : AppCompatActivity() {
@SuppressLint("SourceLockedOrientationActivity")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (Build.VERSION.SDK_INT != Build.VERSION_CODES.O) {
if (Build.VERSION.SDK_INT != Build.VERSION_CODES.O &&
!resources.getBoolean(R.bool.isTablet)
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious why only tablets?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just want to make sure we aren't changing behavior for other device types. If we are confident that all device types can have this change, then I can remove this code.

keithmacklin
keithmacklin previously approved these changes Apr 11, 2022
@keithmacklin
Copy link

FYI This is what the webview looks like in landscape on Android SDK 26 (the one version that currently works)
image

@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/payment-launcher-tablet branch from c4567a6 to 169e788 Compare April 12, 2022 17:53
skyler-stripe
skyler-stripe previously approved these changes Apr 12, 2022
keithmacklin
keithmacklin previously approved these changes Apr 12, 2022
@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/payment-launcher-tablet branch from 07400bc to 70d3296 Compare April 12, 2022 21:11
@jameswoo-stripe jameswoo-stripe changed the title Remove force portrait for tablets Remove force portrait in PaymentLauncher Apr 13, 2022
@jameswoo-stripe jameswoo-stripe enabled auto-merge (squash) April 13, 2022 20:37
@jameswoo-stripe jameswoo-stripe merged commit db28fdb into master Apr 13, 2022
@jameswoo-stripe jameswoo-stripe deleted the jameswoo/payment-launcher-tablet branch April 13, 2022 20:37
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.

3 participants