https://kotlinlang.org logo
#android
Title
# android
s

scottiedog45

04/15/2019, 4:15 PM
Hi everyone Happy Monday 😃. What’s the best solution for creating a static list, something like a settings screen, where the options don’t change? Is a ListView the best way to go, and then still setting up an adapter? My only hesitation is that it seems weird to wire up all this logic if the screen is basically static, but if that’s the only way (with an adapter) then that’s what I’ll do 👍🏻. (My mental model for layout construction is coming from xcode where I could basically do everything in the storyboard).
google 4
r

r2vq

04/15/2019, 5:26 PM
If the screen is static then I usually wouldn’t create an adapter.
👍 1
t

tseisel

04/15/2019, 6:36 PM
It depends on the number of options and the density of content for each item. For less that 5 items that are basically one-line text + icon, maybe you could use another navigation pattern (tabs, bottom nav) For more than 5 items (and potentially more in the future), using a ListView/RecyclerView whose content is backed by a constant Java List or an XML file seems easier to maintain.
👍 1
s

Sam

04/15/2019, 6:50 PM
you could use epoxy, it abstracts out a bunch of boiler plate associated with recycler view adapter
👍 1
a

alexsullivan114

04/15/2019, 7:10 PM
There's no analogous system to a static tableview in Android. You could just use a linear layout and manually add five items in. I would go with the recyclerview + adapter approach though.
👍 1
s

scottiedog45

04/15/2019, 7:38 PM
Ok thanks a lot everyone!