Some compose updates dropped today: Version 1.3.2...
# compose
c
Some compose updates dropped today: Version 1.3.2 Stable released today. As far as I can see, nothing really tangible released. Should be an uneventful version bump. Version 1.4.0-alpha03 released today. LOTS of really cool changes! • Some animation updates, mostly related to testing it looks like? • Introduce
HorizontalPager
and
VerticalPager
, a way of showing composables in a Pager manner. Introduced
PagerState
to control the Pagers as well as query information about the Pager's current state. Introduced
PageSize
, a way of controlling the size of a Pager's page, this can be used to create a carousel like Pagers. Introduced
PagerSnapDistance
, a way to control how snapping will work in Pager's fling behavior. (I01120) • Introduced an overload in
SnapFlingBehavior.performFling
to help to understand where the fling will settle. (I569f6) • ^^ So it looks like accompanist pager is basically not needed anymore? cc: Chris banes? • Removed
OverscrollEffect#isEnabled
. • Added
ScrollableState#canScrollForward
and
ScrollableState#canScrollBackward
to query whether a
ScrollableState
has room to scroll in either direction • Added an Modifier API to query ancestors scroll info. (I2ba9d, b/203141462) • Used in
Clickable
to correctly delay press interactions, when gestures could become scroll events. • Fixed
Clickables
not correctly delaying ripples, when used inside an
Scrollable ViewGroup
. • Updated Drawers and Sheets to correctly delay presses in case gestures can become scroll events. • Update
snapStepSize
naming to be consistent with other methods in
SnapLayoutInfoProvider
. (Ife67c) • Added
EmojiCompat
to
Compose
(Ibf6f9, b/139326806) • Renamed
consumedWindowInsets()
to
consumeWindowInsets()
and
withConsumedWindowInsets()
to
onConsumedWindowInsetsChanged()
and made the Modifiers public. (Ie44e1) • Added
EmojiCompat
to
Compose
WOOO • Adding
@JvmDefaultWithCompatibility
annotation (I8f206) • Incorporated changes in the
Swipeable
APIs in
ModalDrawer
. `DrawerState`'s
animateTo
has been replaced by the
open
and
close
methods and the offset is now nullable. Use
requireOffset
to require the offset. (I3de9e) • Updated Drawers and Sheets to correctly delay presses in case gestures can become scroll events. • Fixed an issue where
PullRefreshIndicator
could get stuck after
onRefresh
is called, if the refreshing state was not changed to true. (Ie2416, b/248274004) • Add new default content padding for text button with icon to use. (I8f662) • Added disabled colors for navigation bar and rail. (Ia7892, b/258867034) • Snapshot apply notifications are now sent after the
Recomposer
finishes applying changes. (Iad6c0, b/222093277) • Added new wallpaper parameter to
@Preview
for dynamic colour support (I9f512) • Introduced changes in
captureToImage
to allow for capturing multi window screenshots. This is useful for screenshot tests that use compose PopUps. (I169c5)
👏🏽 1
🎉 14
🙏 9
👏 18
❤️ 2
b
Correct about Accompanist Pager, we plan to deprecate it when 1.4 goes stable assuming everything goes well
c
The new wallpaper parameter should be useful for folks using Material3 and opting in to dynamic theming!
c
@Ben Trengrove [G] I tried using the new pager. From what I see I can't calculate the offest for each page. but I can with accompanest. am i missing something?
c
@Colton Idle looks like calculating via PagerScope was removed and instead you can get the current offset through PagerState with
currentPageOffsetFraction