I am using a ScrollableColumn in an embedded ComposeView in a Fragment, but it is not scrolling all the way to the bottom as it should. I am sure it is sized properly, since I inserted the same way as the RecyclerView it replaces, and that works fine. Here is an example: the ‘time views’ are all locked to a constant height, so I would expect this to be okay.
Has anybody else seen any issues with the ScrollableColumn like this?
j
jaqxues
12/28/2020, 12:10 AM
Is it just the bottom bar that is overlapping?
t
tylerwilson
12/28/2020, 12:18 AM
Well, it is not really overlapping. The Fragment view is above the tab bar, as seen here in the layout inspector (the blue line is the border of the ComposeView):
Perhaps it could be a timing issue, where the ComposeView is grabbing the size before it is fully rendered or attached to the Fragment?
j
jaqxues
12/28/2020, 6:36 AM
I meant more like, is all you want to see just 9:45 PM
Since that would mean that it is kind of overlapping. Scaffold draws the body behind the bottomBar, if you want sth else, you need to use padding inside the body
i know what you mean, but I am not using scaffold or bottom bar in compose - just the inner content view of the fragment. everything else is standard xml using constraintlayout, with the composeview aligned with navbar and bottom tab bar.
I built a small sample project that shows the issue. It appears that the ComposeView, even when embedded in a Fragment, is somehow using the display size to calculate height/scrolling area. I will see if I can post a bug to the compose bug tracker…
Are you using a CoordinatorLayout at all? Looks like familiar behaviour I've seen when using that
t
tylerwilson
01/03/2021, 11:30 PM
I am not. The root is a ConstraintLayout with AppBarLayout on top, BottomNavigation on bottom and fragment in between where the fragment/ComposeView live.
FYI, I worked around it for now by adding an empty row below the elements that is height of the toolbar + bottomnav. So far, so good.