https://kotlinlang.org logo
#compose
Title
# compose
h

humbledroid

04/21/2022, 1:14 PM
One of the problem that I am facing is with
DropDownMenu
, that it uses Column, thus cannot have huge number of items, without allowing it to populate all items at once, and this will lead to frame drop and crashes.
DropDownMenu
as of today cannot leverage
LazyColumn
as intrinsic size for
Subcomposelayouts
is not yet supported, and fixed height width cannot be given to the
LazyList
in
DropDownMenu
because of the use case. The use case is to show list of countries and choose one of them, and for that I am using the
DropDownMenu
but as the size of countries list is enough to make it draw after a few frame drop. I found an issues similar to this, ISSUETRACKER and is closed as it works as intended, because this is not meant for long lists, i guess. maybe a time for
LazyDropDownMenu
I tried replacing the
Column
with
LazyColumn
but that would not work because of the intrinsic measurements , and it works perfectly fine, when the
height
and
width
is supplied via modifier to
LazyColumn
.
👍 1
👍🏽 1
a

Albert Chang

04/21/2022, 1:47 PM
But how do you suppose
LazyColumn
to calculate the desired width given that it doesn't measure all the items at once?
2
h

humbledroid

04/21/2022, 2:24 PM
in non compose world, a PopView was able to do the same, you can inflate a custom layout having a
RecyclerView
and
PopupView
's width and height used to served as intrinsic measures for the childs and thus it worked, and worked as expected
a

Adam Powell

04/21/2022, 2:37 PM
As someone who either wrote or maintained that code for android popup lists, I regret doing it, it was a mistake. 🙂 Give your lazy lists a fixed size in the non-scrolling direction.
3 Views