Function

canScrollHorizontally

This method is required to correctly support swipe-to-dismiss layouts on WearOS, which search their children for scrollable views to determine whether or not to intercept touch events – a sort of simplified nested scrolling mechanism.

canScrollHorizontally

Source set: Android
override fun canScrollHorizontally(direction: Int): Boolean

This method is required to correctly support swipe-to-dismiss layouts on WearOS, which search their children for scrollable views to determine whether or not to intercept touch events – a sort of simplified nested scrolling mechanism.

Because a composition may contain many scrollable and non-scrollable areas, and this method doesn't know which part of the view the caller cares about, it uses the lastDownPointerPosition as the location to check.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: