Skip to content

Commit

Permalink
Remove force portrait for tablets
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswoo-stripe committed Apr 12, 2022
1 parent 1761a90 commit 169e788
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

### PaymentSheet
* [FIXED] [4861](https://github.com/stripe/stripe-android/pull/4861) Remove font resource to save space and default to system default
* [CHANGED] [4855](https://github.com/stripe/stripe-android/pull/4855) Remove force portrait mode for tablets.

## 20.0.1 - 2022-04-11
This release includes several PaymentSheet bug fixes.
Expand Down
4 changes: 4 additions & 0 deletions payments-core/res/values-sw600dp/attrs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="isTablet">true</bool>
</resources>
2 changes: 2 additions & 0 deletions payments-core/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@
</attr>
<attr name="backgroundColorStateList" format="reference" />
</declare-styleable>

<bool name="isTablet">false</bool>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.activity.viewModels
import androidx.annotation.VisibleForTesting
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.ViewModelProvider
import com.stripe.android.R
import com.stripe.android.view.AuthActivityStarterHost

/**
Expand All @@ -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)
) {
// In Oreo, Activities where `android:windowIsTranslucent=true` can't request
// orientation. See https://stackoverflow.com/a/50832408/11103900
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
Expand Down

0 comments on commit 169e788

Please sign in to comment.