google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.43k stars 598 forks source link

[Pager] Modifier.pagerTabIndicatorOffset doesn't support Material3 TabPositions #1507

Closed riggaroo closed 1 year ago

riggaroo commented 1 year ago

Description Modifier.pagerTabIndicatorOffset(pagerState, tabPositions) only supports Material 2 TabPositions.

I'm in the process of writing the migration guide and deprecating Pager in #1504, however, I've noticed even though we've added Modifier.pagerTabIndicatorOffset(pagerState, tabPositions) to work with androidx.compose.foundation.pager, the tab positions object is Material 2 and there isn't an option for Material 3.

Should we add another variant of this Modifier for Material 3? Or how best would it be to proceed here?

cc @Levi-Moreira

andkulikov commented 1 year ago

I don't think it is something we should solve as part of migration/deprecation of Pagers because we didn't have material3 support for old pager, and we will not have it for the new pager. We stay on the same level of support here.

This question is complex in solving, we can't just add one more modifier as we shouldn't have a library which depends on both material versions. So we or create a separate material3 specific library in accompanist for such indicator, or just not solve it for now, with the idea that long term such modifier should live in compose.material3 library, not in accompanist

riggaroo commented 1 year ago

That makes sense, I'll leave it as is then. Thanks @andkulikov!