Skip to content

Commit f000a91

Browse files
committed
allow customization
Assisted-By: devx/6db0ff39-6d19-4074-ab7f-a027dc8b067f
1 parent 33b1303 commit f000a91

25 files changed

Lines changed: 707 additions & 74 deletions

platforms/android/README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,15 @@ Configure global presentation defaults before presenting checkout:
168168
```kotlin
169169
ShopifyCheckoutKit.configure {
170170
it.colorScheme = ColorScheme.Automatic()
171+
it.sheetStyle = CheckoutSheetStyle()
171172
it.logLevel = LogLevel.ERROR
172173
}
173174
```
174175

175176
| Option | Default | Purpose |
176177
| --- | --- | --- |
177178
| `colorScheme` | `ColorScheme.Automatic()` | Use device appearance, force `Light` or `Dark`, or use `Web` to match web checkout branding. |
179+
| `sheetStyle` | `CheckoutSheetStyle()` | Customize native sheet chrome such as the top gap, corner radius, title alignment, toolbar elevation, close icon styling, and the optional drag handle. |
178180
| `logLevel` | `LogLevel.WARN` | SDK logging verbosity. Use `LogLevel.DEBUG` during integration. |
179181
| `preloading` | `Preloading(enabled = true)` | Enables best-effort checkout preloading before presentation. |
180182

@@ -199,29 +201,40 @@ ShopifyCheckoutKit.configure {
199201
headerFont = Color.ResourceId(R.color.checkout_header_text_light)
200202
webViewBackground = Color.ResourceId(R.color.checkout_background_light)
201203
progressIndicator = Color.ResourceId(R.color.checkout_progress_light)
202-
closeIconTint = Color.ResourceId(R.color.checkout_close_light)
203204
},
204205
dark = {
205206
headerBackground = Color.ResourceId(R.color.checkout_header_dark)
206207
headerFont = Color.ResourceId(R.color.checkout_header_text_dark)
207208
webViewBackground = Color.ResourceId(R.color.checkout_background_dark)
208209
progressIndicator = Color.ResourceId(R.color.checkout_progress_dark)
209-
closeIconTint = Color.ResourceId(R.color.checkout_close_dark)
210210
},
211211
)
212212
}
213213
```
214214

215-
If both `closeIcon` and `closeIconTint` are set, the custom drawable takes precedence:
215+
### Sheet style
216+
217+
Customize native sheet chrome independently from checkout colors:
216218

217219
```kotlin
218220
ShopifyCheckoutKit.configure {
219-
it.colorScheme = ColorScheme.Light().customize {
220-
closeIcon = DrawableResource(R.drawable.ic_checkout_close)
221-
}
221+
it.sheetStyle = CheckoutSheetStyle(
222+
topGapDp = 24f,
223+
cornerRadiusDp = 32f,
224+
titleAlignment = CheckoutSheetTitleAlignment.CENTER,
225+
toolbarElevationDp = 0f,
226+
closeIconTint = Color.ResourceId(R.color.checkout_close),
227+
dragHandleVisible = false,
228+
)
222229
}
223230
```
224231

232+
Use `closeIcon = DrawableResource(R.drawable.ic_checkout_close)` to provide a custom close drawable. If both
233+
`closeIcon` and `closeIconTint` are set, the custom drawable takes precedence.
234+
235+
Set `dragHandleVisible = true` to show a fixed, visual-only drag handle at the top of the sheet. The handle is hidden
236+
when `dragToDismissEnabled = false` so disabled drag gestures are not presented as available.
237+
225238
### Title localization
226239

227240
Override `checkout_web_view_title` in your app resources:

platforms/android/lib/api/lib.api

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,51 @@ public final class com/shopify/checkoutkit/CheckoutProtocol$Client {
9090
public final fun on (Lcom/shopify/ucp/embedded/checkout/RequestDescriptor;Lkotlin/jvm/functions/Function1;)Lcom/shopify/checkoutkit/CheckoutProtocol$Client;
9191
}
9292

93+
public final class com/shopify/checkoutkit/CheckoutSheetStyle {
94+
public fun <init> ()V
95+
public fun <init> (F)V
96+
public fun <init> (FLcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;)V
97+
public fun <init> (FLcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;F)V
98+
public fun <init> (FLcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;FLcom/shopify/checkoutkit/DrawableResource;)V
99+
public fun <init> (FLcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;FLcom/shopify/checkoutkit/DrawableResource;Lcom/shopify/checkoutkit/Color;)V
100+
public fun <init> (FLcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;FLcom/shopify/checkoutkit/DrawableResource;Lcom/shopify/checkoutkit/Color;Lcom/shopify/checkoutkit/Color;)V
101+
public fun <init> (FLcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;FLcom/shopify/checkoutkit/DrawableResource;Lcom/shopify/checkoutkit/Color;Lcom/shopify/checkoutkit/Color;Z)V
102+
public fun <init> (FLcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;FLcom/shopify/checkoutkit/DrawableResource;Lcom/shopify/checkoutkit/Color;Lcom/shopify/checkoutkit/Color;ZZ)V
103+
public fun <init> (FLcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;FLcom/shopify/checkoutkit/DrawableResource;Lcom/shopify/checkoutkit/Color;Lcom/shopify/checkoutkit/Color;ZZF)V
104+
public synthetic fun <init> (FLcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;FLcom/shopify/checkoutkit/DrawableResource;Lcom/shopify/checkoutkit/Color;Lcom/shopify/checkoutkit/Color;ZZFILkotlin/jvm/internal/DefaultConstructorMarker;)V
105+
public final fun component1 ()F
106+
public final fun component2 ()Lcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;
107+
public final fun component3 ()F
108+
public final fun component4 ()Lcom/shopify/checkoutkit/DrawableResource;
109+
public final fun component5 ()Lcom/shopify/checkoutkit/Color;
110+
public final fun component6 ()Lcom/shopify/checkoutkit/Color;
111+
public final fun component7 ()Z
112+
public final fun component8 ()Z
113+
public final fun component9 ()F
114+
public final fun copy (FLcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;FLcom/shopify/checkoutkit/DrawableResource;Lcom/shopify/checkoutkit/Color;Lcom/shopify/checkoutkit/Color;ZZF)Lcom/shopify/checkoutkit/CheckoutSheetStyle;
115+
public static synthetic fun copy$default (Lcom/shopify/checkoutkit/CheckoutSheetStyle;FLcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;FLcom/shopify/checkoutkit/DrawableResource;Lcom/shopify/checkoutkit/Color;Lcom/shopify/checkoutkit/Color;ZZFILjava/lang/Object;)Lcom/shopify/checkoutkit/CheckoutSheetStyle;
116+
public fun equals (Ljava/lang/Object;)Z
117+
public final fun getCloseIcon ()Lcom/shopify/checkoutkit/DrawableResource;
118+
public final fun getCloseIconTint ()Lcom/shopify/checkoutkit/Color;
119+
public final fun getCornerRadiusDp ()F
120+
public final fun getDragHandleVisible ()Z
121+
public final fun getDragToDismissEnabled ()Z
122+
public final fun getScrimColor ()Lcom/shopify/checkoutkit/Color;
123+
public final fun getTitleAlignment ()Lcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;
124+
public final fun getToolbarElevationDp ()F
125+
public final fun getTopGapDp ()F
126+
public fun hashCode ()I
127+
public fun toString ()Ljava/lang/String;
128+
}
129+
130+
public final class com/shopify/checkoutkit/CheckoutSheetTitleAlignment : java/lang/Enum {
131+
public static final field CENTER Lcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;
132+
public static final field START Lcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;
133+
public static fun getEntries ()Lkotlin/enums/EnumEntries;
134+
public static fun valueOf (Ljava/lang/String;)Lcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;
135+
public static fun values ()[Lcom/shopify/checkoutkit/CheckoutSheetTitleAlignment;
136+
}
137+
93138
public class com/shopify/checkoutkit/CheckoutUnavailableException : com/shopify/checkoutkit/CheckoutException {
94139
public static final field CLIENT_ERROR Ljava/lang/String;
95140
public static final field Companion Lcom/shopify/checkoutkit/CheckoutUnavailableException$Companion;
@@ -374,19 +419,22 @@ public final class com/shopify/checkoutkit/ColorsBuilder {
374419
public final class com/shopify/checkoutkit/Configuration {
375420
public fun <init> ()V
376421
public final fun component1 ()Lcom/shopify/checkoutkit/ColorScheme;
377-
public final fun component2 ()Lcom/shopify/checkoutkit/Platform;
378-
public final fun component3 ()Lcom/shopify/checkoutkit/LogLevel;
379-
public final fun component4 ()Lcom/shopify/checkoutkit/Preloading;
422+
public final fun component2 ()Lcom/shopify/checkoutkit/CheckoutSheetStyle;
423+
public final fun component3 ()Lcom/shopify/checkoutkit/Platform;
424+
public final fun component4 ()Lcom/shopify/checkoutkit/LogLevel;
425+
public final fun component5 ()Lcom/shopify/checkoutkit/Preloading;
380426
public fun equals (Ljava/lang/Object;)Z
381427
public final fun getColorScheme ()Lcom/shopify/checkoutkit/ColorScheme;
382428
public final fun getLogLevel ()Lcom/shopify/checkoutkit/LogLevel;
383429
public final fun getPlatform ()Lcom/shopify/checkoutkit/Platform;
384430
public final fun getPreloading ()Lcom/shopify/checkoutkit/Preloading;
431+
public final fun getSheetStyle ()Lcom/shopify/checkoutkit/CheckoutSheetStyle;
385432
public fun hashCode ()I
386433
public final fun setColorScheme (Lcom/shopify/checkoutkit/ColorScheme;)V
387434
public final fun setLogLevel (Lcom/shopify/checkoutkit/LogLevel;)V
388435
public final fun setPlatform (Lcom/shopify/checkoutkit/Platform;)V
389436
public final fun setPreloading (Lcom/shopify/checkoutkit/Preloading;)V
437+
public final fun setSheetStyle (Lcom/shopify/checkoutkit/CheckoutSheetStyle;)V
390438
public fun toString ()Ljava/lang/String;
391439
}
392440

platforms/android/lib/src/main/java/com/shopify/checkoutkit/CheckoutBottomSheet.kt

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import androidx.core.view.WindowCompat
2929
import androidx.core.view.WindowInsetsCompat
3030
import androidx.core.view.children
3131
import com.shopify.checkoutkit.ShopifyCheckoutKit.log
32+
import kotlin.math.roundToInt
3233

3334
internal class CheckoutBottomSheet(
3435
private val checkoutUrl: String,
@@ -68,12 +69,13 @@ internal class CheckoutBottomSheet(
6869
dismissFinalized = false
6970

7071
setContentView(R.layout.checkout_sheet_content)
72+
val colorScheme = ShopifyCheckoutKit.configuration.colorScheme
73+
val sheetStyle = ShopifyCheckoutKit.configuration.sheetStyle
7174
window?.configureCheckoutBottomSheetWindow()
72-
configureSheet()
75+
configureSheet(sheetStyle)
7376

74-
val colorScheme = ShopifyCheckoutKit.configuration.colorScheme
7577
log.d(LOG_TAG, "Configured colorScheme $colorScheme")
76-
val sheetColors = applySheetColors(colorScheme)
78+
val sheetColors = applySheetColors(colorScheme, sheetStyle)
7779

7880
onBackPressedDispatcher.addCallback(backNavigationCallback)
7981

@@ -110,7 +112,10 @@ internal class CheckoutBottomSheet(
110112
/**
111113
* Applies configured colors to native sheet chrome and returns colors needed by WebView-owned surfaces.
112114
*/
113-
private fun applySheetColors(colorScheme: ColorScheme): SheetColors {
115+
private fun applySheetColors(
116+
colorScheme: ColorScheme,
117+
sheetStyle: CheckoutSheetStyle,
118+
): SheetColors {
114119
val isDarkTheme = activity.isDarkTheme()
115120
val headerBackgroundColor = colorScheme.headerBackgroundColor(isDarkTheme).getValue(activity)
116121
val headerFontColor = colorScheme.headerFontColor(isDarkTheme).getValue(activity)
@@ -119,23 +124,45 @@ internal class CheckoutBottomSheet(
119124
findViewById<Toolbar>(R.id.checkoutKitHeader)?.apply {
120125
log.d(LOG_TAG, "Applying configured header colors and inflating menu.")
121126
title = ""
122-
background = roundedTopCornerDrawable(activity, headerBackgroundColor)
127+
background = roundedTopCornerDrawable(activity, headerBackgroundColor, sheetStyle.cornerRadiusDp)
128+
elevation = sheetStyle.toolbarElevationDp.dpToPx(activity)
123129
setTitleTextColor(headerFontColor)
124130
inflateMenu(R.menu.checkout_menu)
125-
menu.findItem(R.id.shopify_checkout_kit_close_button).setupCloseButton(activity, colorScheme) {
131+
menu.findItem(R.id.shopify_checkout_kit_close_button).setupCloseButton(activity, colorScheme, sheetStyle) {
126132
cancel()
127133
}
128134
}
129135

130-
findViewById<TextView>(R.id.checkoutKitHeaderTitle)
131-
?.setTextColor(headerFontColor)
136+
findViewById<View>(R.id.checkoutKitDragHandle)?.applyCheckoutSheetDragHandleStyle(
137+
color = headerFontColor,
138+
sheetStyle = sheetStyle,
139+
)
140+
141+
findViewById<TextView>(R.id.checkoutKitHeaderTitle)?.apply {
142+
setTextColor(headerFontColor)
143+
(layoutParams as? Toolbar.LayoutParams)?.let { params ->
144+
params.topMargin = if (sheetStyle.showsDragHandle) {
145+
resources.getDimensionPixelSize(R.dimen.checkout_sheet_drag_handle_title_top_margin)
146+
} else {
147+
0
148+
}
149+
params.gravity = when (sheetStyle.titleAlignment) {
150+
CheckoutSheetTitleAlignment.START -> Gravity.START or Gravity.CENTER_VERTICAL
151+
CheckoutSheetTitleAlignment.CENTER -> Gravity.CENTER
152+
}
153+
layoutParams = params
154+
}
155+
}
132156

133157
findViewById<RelativeLayout>(R.id.checkoutKitContainer)
134158
?.setBackgroundColor(webViewBackgroundColor)
135159

136160
findViewById<View>(R.id.checkoutKitLoadingBackground)
137161
?.setBackgroundColor(webViewBackgroundColor)
138162

163+
findViewById<View>(R.id.checkoutKitOutsideTouchTarget)
164+
?.setBackgroundColor(sheetStyle.scrimColor.getValue(activity))
165+
139166
return SheetColors(
140167
webViewBackgroundColor = webViewBackgroundColor,
141168
progressIndicatorColor = colorScheme.progressIndicatorColor(isDarkTheme).getValue(activity),
@@ -145,14 +172,15 @@ internal class CheckoutBottomSheet(
145172
/**
146173
* Wires native sheet dismissal affordances after the layout has been inflated.
147174
*/
148-
private fun configureSheet() {
175+
private fun configureSheet(sheetStyle: CheckoutSheetStyle) {
149176
findViewById<View>(R.id.checkoutKitOutsideTouchTarget)?.setOnClickListener {
150177
log.d(LOG_TAG, "Outside touch cancel invoked.")
151178
cancel()
152179
}
153180

154181
findViewById<CheckoutBottomSheetLayout>(R.id.checkoutKitSheet)?.apply {
155-
applySystemBarTopMargin()
182+
dragToDismissEnabled = sheetStyle.dragToDismissEnabled
183+
applySystemBarTopMargin(sheetStyle.topGapDp.dpToPx(activity).roundToInt())
156184
onDismissRequested = {
157185
if (!dismissing) {
158186
log.d(LOG_TAG, "Bottom sheet dismissed by gesture, cancelling checkout.")
@@ -337,14 +365,16 @@ private fun ComponentActivity.isDarkTheme() =
337365
private fun MenuItem.setupCloseButton(
338366
activity: ComponentActivity,
339367
colorScheme: ColorScheme,
368+
sheetStyle: CheckoutSheetStyle,
340369
onClick: () -> Unit,
341370
) {
342-
val customCloseIcon = colorScheme.closeIcon(activity.isDarkTheme())
371+
val isDarkTheme = activity.isDarkTheme()
372+
val customCloseIcon = sheetStyle.closeIcon ?: colorScheme.closeIcon(isDarkTheme)
343373
if (customCloseIcon != null) {
344374
log.d(LOG_TAG, "Setting custom menu item drawable.")
345375
icon = AppCompatResources.getDrawable(activity, customCloseIcon.id)
346376
} else {
347-
val customTint = colorScheme.closeIconTint(activity.isDarkTheme())
377+
val customTint = sheetStyle.closeIconTint ?: colorScheme.closeIconTint(isDarkTheme)
348378
val closeIcon = icon
349379
if (customTint != null && closeIcon != null) {
350380
log.d(LOG_TAG, "Setting menu item tint.")
@@ -376,14 +406,14 @@ private fun View.applyBottomInsetPadding() {
376406
/**
377407
* Keeps the intended top gap visible below the status bar while the dialog window draws edge-to-edge.
378408
*/
379-
private fun View.applySystemBarTopMargin() {
409+
private fun View.applySystemBarTopMargin(topGapPx: Int) {
380410
val initialLayoutParams = layoutParams as? ViewGroup.MarginLayoutParams ?: return
381-
val initialTopMargin = initialLayoutParams.topMargin
382411
val initialBottomMargin = initialLayoutParams.bottomMargin
412+
updateVerticalMargins(topMargin = topGapPx, bottomMargin = initialBottomMargin)
383413
ViewCompat.setOnApplyWindowInsetsListener(this) { view, insets ->
384414
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
385415
view.updateVerticalMargins(
386-
topMargin = initialTopMargin + systemBars.top,
416+
topMargin = topGapPx + systemBars.top,
387417
bottomMargin = initialBottomMargin,
388418
)
389419
insets
@@ -437,9 +467,9 @@ private fun Window.configureCheckoutBottomSheetWindow() {
437467
setTransparentSystemBars()
438468
WindowCompat.setDecorFitsSystemWindows(this, false)
439469
setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
440-
addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
470+
clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
441471
attributes = attributes.apply {
442-
dimAmount = WINDOW_DIM_AMOUNT
472+
dimAmount = 0f
443473
windowAnimations = 0
444474
}
445475
}
@@ -464,4 +494,3 @@ private fun Window.setTransparentSystemBars() {
464494
}
465495

466496
private const val LOG_TAG = "CheckoutBottomSheet"
467-
private const val WINDOW_DIM_AMOUNT = 0.32f
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.shopify.checkoutkit
2+
3+
import android.graphics.Color
4+
import android.graphics.drawable.GradientDrawable
5+
import android.view.View
6+
import androidx.annotation.ColorInt
7+
8+
/**
9+
* Configures the optional Material-style visual drag affordance. Dismissal remains exposed through close/back/outside
10+
* tap; the handle is decorative and intentionally hidden from accessibility focus.
11+
*/
12+
internal fun View.applyCheckoutSheetDragHandleStyle(
13+
@ColorInt color: Int,
14+
sheetStyle: CheckoutSheetStyle,
15+
) {
16+
visibility = if (sheetStyle.showsDragHandle) View.VISIBLE else View.GONE
17+
importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO
18+
isFocusable = false
19+
isClickable = false
20+
21+
if (!sheetStyle.showsDragHandle) return
22+
23+
val handleHeight = resources.getDimension(R.dimen.checkout_sheet_drag_handle_height)
24+
val handleAlpha = (Color.alpha(color) * CHECKOUT_SHEET_DRAG_HANDLE_ALPHA).toInt().coerceIn(0, ALPHA_MAX)
25+
background = GradientDrawable().apply {
26+
shape = GradientDrawable.RECTANGLE
27+
cornerRadius = handleHeight / 2f
28+
setColor(Color.argb(handleAlpha, Color.red(color), Color.green(color), Color.blue(color)))
29+
}
30+
}
31+
32+
internal val CheckoutSheetStyle.showsDragHandle: Boolean
33+
get() = dragToDismissEnabled && dragHandleVisible
34+
35+
private const val CHECKOUT_SHEET_DRAG_HANDLE_ALPHA = 0.4f
36+
private const val ALPHA_MAX = 255

platforms/android/lib/src/main/java/com/shopify/checkoutkit/CheckoutBottomSheetLayout.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ internal class CheckoutBottomSheetLayout @JvmOverloads constructor(
2424
) : RelativeLayout(context, attrs, defStyleAttr) {
2525

2626
var onDismissRequested: (() -> Unit)? = null
27+
var dragToDismissEnabled = true
2728

2829
private val touchSlop = ViewConfiguration.get(context).scaledTouchSlop
2930
private val minimumFlingVelocity = ViewConfiguration.get(context).scaledMinimumFlingVelocity
@@ -71,6 +72,8 @@ internal class CheckoutBottomSheetLayout @JvmOverloads constructor(
7172
* Starts tracking a gesture that began inside the scrollable child.
7273
*/
7374
fun startScrollableChildGesture(event: MotionEvent) {
75+
if (!canHandleDragToDismiss) return
76+
7477
animate().cancel()
7578
val currentOffsetY = (renderedDragOffsetY + translationY).coerceAtLeast(0f)
7679
translationY = 0f
@@ -89,7 +92,7 @@ internal class CheckoutBottomSheetLayout @JvmOverloads constructor(
8992
* Moves the sheet by drag distance the scrollable child hands off.
9093
*/
9194
fun dragScrollableChildBy(dragDistance: Float, event: MotionEvent): Boolean {
92-
val canDrag = isEnabled && !dismissAnimationRunning && dragDistance != 0f
95+
val canDrag = canHandleDragToDismiss && dragDistance != 0f
9396
var sheetDragDistance = 0f
9497
if (canDrag && dragging) {
9598
sheetDragDistance = dragDistance
@@ -213,7 +216,7 @@ internal class CheckoutBottomSheetLayout @JvmOverloads constructor(
213216
* Intercepts downward drags that start outside the scrollable child so they can move the sheet.
214217
*/
215218
override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
216-
if (!isEnabled || dismissAnimationRunning) return false
219+
if (!canHandleDragToDismiss) return false
217220

218221
var shouldIntercept = false
219222
when (event.actionMasked) {
@@ -247,7 +250,7 @@ internal class CheckoutBottomSheetLayout @JvmOverloads constructor(
247250
* Handles direct sheet drags and settles to either the expanded or dismissed position.
248251
*/
249252
override fun onTouchEvent(event: MotionEvent): Boolean {
250-
if (!isEnabled || dismissAnimationRunning) return false
253+
if (!canHandleDragToDismiss) return false
251254

252255
velocityTracker?.addMovement(event)
253256

@@ -403,6 +406,9 @@ internal class CheckoutBottomSheetLayout @JvmOverloads constructor(
403406
return shouldHandle
404407
}
405408

409+
private val canHandleDragToDismiss: Boolean
410+
get() = isEnabled && dragToDismissEnabled && !dismissAnimationRunning
411+
406412
private companion object {
407413
private const val OPEN_ANIMATION_DURATION_MS = 260L
408414
private const val DISMISS_ANIMATION_DURATION_MS = 200L

0 commit comments

Comments
 (0)