Accompanist is a group of libraries that aim to supplement Jetpack Compose with features that are commonly required by developers but not yet available.
Questions tagged [jetpack-compose-accompanist]
128 questions
20
votes
6 answers
onPageSelected callback for JetPack Compose Pager
I am using JetPack Compose Pager from Accompanist and I'm wonder how do I know exactly when my page is Showed at screen. Like onPageSelected method from ViewPager.
Here is my code:
HorizontalPager(
state = pagerState,
modifier =…

Sirelon
- 6,446
- 5
- 26
- 30
16
votes
1 answer
JetPack Compose accompanist Pager lerp not found
I'm learning accompanist pager and I want to set effect on the pager.
I want to use the lerp method like the document
Modifier.graphicsLayer {
// Calculate the absolute offset for the current page from the
// scroll position. We use the…

MohammadBaqer
- 766
- 6
- 32
13
votes
2 answers
HorizontalPager with LazyColumn inside another LazyColumn - Jetpack Compose
I want a similiar effect to TikToks profile screen.
On top is the ProfilPicture and username, below that is a stickyHeader with a TabRow (Posts, Drafts, Likes, Favorites) and below that is a HorizontalPager with the 4 Screens (Posts, Drafts, Likes,…

HavanaSun
- 446
- 3
- 12
- 39
10
votes
1 answer
How can I make an accompanist navigation BottomSheet fully expanded?
I know that a normal bottom sheet can be setup like this
rememberModalBottomSheetState(
initialValue = ModalBottomSheetValue.Hidden,
confirmStateChange = { it != ModalBottomSheetValue.HalfExpanded },
)
So that it will never be half expanded.…

mama
- 2,046
- 1
- 7
- 24
10
votes
1 answer
Swipe to refresh is not working if LazyGridView has no child in compose
I'm using SwipeRefresh view in compose (from accompanist). I have LazyVerticalGrid inside it, and grid populates paging data from network. If there's no content in paging data, i'm showing empty state view. When there's some data, swipe-to-refresh…

Annon
- 633
- 7
- 26
10
votes
1 answer
Compose Horizontal Pager always filling max size, verticalAligment not working
I'm using Google's Accompanist Horizontal Pager, and I need the pager to wrap content size. For some reason it fills max size. Currently it's a child of constraint layout, however I tried putting it inside column with another having…

Nazar Dunets
- 175
- 2
- 10
9
votes
3 answers
How can I scroll in both directions in Jetpack Compose
I've created a fairly classic collapsing image layout in Jetpack compose, where I have an image at the top of the screen which parallax scrolls away and at a certain point I change the toolbar background from transparent to primarySurface. This is…

Barry Irvine
- 13,858
- 3
- 25
- 36
9
votes
6 answers
How to hide bottom bar in Jetpack Compose when using Accompanists` Navigation Animation
Situation
I'm writing a pretty simple app using Kotlin & Android Jetpack Compose
I have a scaffold containing my navHost and a bottomBar.
I can use that bottomBar to navigate between three main screens.
One of those main screens has a detail screen,…

m.reiter
- 1,796
- 2
- 11
- 31
8
votes
1 answer
Prevent closing bottom sheet with background click with accompanist library
I have tried accompanist library for navigation from this article and I want to prevent bottom sheet to be closed when I click on the background of bottom sheet (the gray area) and to make it non clickable at all, how can I achieve this?
This is the…

Svilen Rusev
- 309
- 4
- 15
8
votes
3 answers
Show keyboard over Scaffold's bottomBar in Jetpack Compose and apply proper inset paddings
I'm using Scaffold for my main screen with a fixed bottomBar that is visible in every screen of the app, and I'm applying the innerPadding of the Scaffold to its content.
I want the keyboard to appear over the bottomBar, and for that I'm applying…

rewgoes
- 656
- 2
- 9
- 23
6
votes
2 answers
Horizontal Pager with Paging3 in Jetpack Compose
There are two screens in my app. The first screen shows the list of images on the device by using the Paging3 library in a vertical grid. Now, when the user clicks on an image, I am passing the click position to the second screen where I am using…

Mehul Kanzariya
- 888
- 3
- 27
- 58
6
votes
1 answer
Swipe sensitivity for HorizontalPager in Compose
I implemented a simple HorizontalPager which works mostly as expected. The app I develop is for one specific device, a 8" Tablet in landscape mode. At the moment it is required to swipe more than 50% of the screen-width to get to the next/prev page.…

jpm
- 3,300
- 1
- 19
- 29
6
votes
1 answer
Why does HorizontalPager's automatic scrolling stop after manual scrolling?
I have a HorizontalPager
val pageCount = bannerList.size
val startIndex = Int.MAX_VALUE / 2
val pagerState = rememberPagerState(initialPage = 100)
HorizontalPager(
count = Int.MAX_VALUE,
state = pagerState,
contentPadding =…

MohammadBaqer
- 766
- 6
- 32
5
votes
1 answer
TabRow/Tab Recomposition Issue in Compose Accompanist Pager
I was trying to create a sample Tab View in Jetpack compose, so the structure will be like
Inside a Parent TabRow we are iterating the tab title and create Tab composable.
More precise code will be like…

J.K
- 2,290
- 1
- 18
- 29
5
votes
0 answers
Jetpack Compose Accompanist Navigation: Blank screen after splash screen
I have a splash screen that I show when the app launch. I'm using SplashScreenAPI for the splash screen. I'm also using accompanist navigation library to navigate with animations. After I updated the accompanist version from 0.24.7-alpha to …

Jarnojr
- 543
- 1
- 7
- 18