Clip checkout sheet content to rounded top corners#391
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
afa89d8 to
246f5ba
Compare
8d13f41 to
99b2d1c
Compare
62c238d to
e1cb2aa
Compare
99b2d1c to
de950ef
Compare
e1cb2aa to
15347cc
Compare
f000a91 to
90d60c5
Compare
15347cc to
f55f940
Compare
90d60c5 to
429d910
Compare
f55f940 to
4a40d2c
Compare
429d910 to
9578921
Compare
4a40d2c to
c098f51
Compare
| @RunWith(RobolectricTestRunner::class) | ||
| class CheckoutBottomSheetStyleTest { | ||
|
|
||
| private lateinit var activityController: ActivityController<ComponentActivity> |
There was a problem hiding this comment.
Ensuring resources are cleared up at the end of tests
| private const val TEST_SHEET_SIZE = 1000 | ||
| private const val TEST_SHEET_HEADER_SIZE = 120 | ||
| private const val MATERIAL_COMPONENTS_SCRIM_COLOR = 0x52000000 | ||
| private const val LEGACY_LIGHT_BACKGROUND_NAVIGATION_BAR_COLOR = 0x52000000 |
There was a problem hiding this comment.
on Android versions before O/API 26, apps cannot request dark navigation bar buttons. If the checkout background is light, transparent nav bar + light buttons can have poor contrast. So the code uses this semi-transparent black nav bar color on legacy
Android to preserve contrast.
| private val Window.isAppearanceLightNavigationBars: Boolean | ||
| get() = WindowCompat.getInsetsController(this, decorView).isAppearanceLightNavigationBars | ||
|
|
||
| private class RecordingCheckoutListener : DefaultCheckoutListener() { |
There was a problem hiding this comment.
allows us to prevent mocking a static
| } | ||
| } | ||
| shadowOf(activity.packageManager).addResolveInfoForIntent(intent, resolveInfo) | ||
| shadowOf(activity.packageManager).setResolveInfosForIntent(intent, listOf(resolveInfo)) |
There was a problem hiding this comment.
Avoids deprecation warning during the build
| } | ||
| } | ||
| shadowOf(activity.packageManager).addResolveInfoForIntent(intent, resolveInfo) | ||
| shadowOf(activity.packageManager).setResolveInfosForIntent(intent, listOf(resolveInfo)) |
There was a problem hiding this comment.
Avoids deprecation warning during the build
Package Size
Android file breakdown
Measured from the PR base SHA and PR head SHA. The file breakdown shows uncompressed sizes within each package artifact, so individual files do not sum to the compressed artifact total. This comment reports package artifact sizes only; it is not a final app binary-size report. |
9578921 to
4252bcb
Compare
c098f51 to
15323c3
Compare
4252bcb to
d60c4c5
Compare
15323c3 to
41afb6b
Compare
21b2781 to
c7e2b9e
Compare
d60c4c5 to
6a324dc
Compare
Assisted-By: devx/6db0ff39-6d19-4074-ab7f-a027dc8b067f
6a324dc to
7fcd2f0
Compare
c7e2b9e to
9c116eb
Compare

What changes are you making?
Fixes square child surfaces (e.g. the WebView background) visually leaking outside the rounded top corners of the checkout bottom sheet. Previously, only the header toolbar had rounded top corners applied via its background drawable, but child views could still render with square corners that were visible at the sheet edges.
To address this,
CheckoutBottomSheetLayoutnow overridesdraw()to clip its canvas to a rounded-top-corner path matching the configuredcornerRadiusDp. The corner radius is converted to pixels once inCheckoutBottomSheetand shared between the header drawable and the newtopCornerRadiusPxproperty onCheckoutBottomSheetLayout.Additionally,
settleExpanded()has been refactored into a top-level extension functionanimateExpanded()onView, making it reusable across the gesture handling paths where it was previously duplicated.How to test
cornerRadiusDpviaCheckoutSheetStyle(e.g.18f).Before you merge
Important
platforms/swift/README.mdand/orplatforms/android/README.md)Releasing a new Swift version?
ShopifyCheckoutKit.podspecplatforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swiftplatforms/swift/README.md(major version only)Releasing a new Embedded Checkout Protocol version?
embeddedCheckoutProtocolAndroidinplatforms/android/gradle/libs.versions.tomlprotocol/languages/kotlin/embedded-checkout-protocol/api/embedded-checkout-protocol.apiif the public API changedReleasing a new Android version?
checkoutKitAndroidinplatforms/android/gradle/libs.versions.tomlplatforms/android/README.mdTip
See the Contributing documentation for the full release process per platform.