1

I've solved this previously with nested layouts in a scrollview. But its pretty bad performance-wise and a pain in the ass to add anything new/update the functionality.

A quick mockup:

enter image description here

Basically there's a few tabs, all of them have different category of settings, since this is just an app to configure a Windows/macOS application. I'm getting a JSON string from my server, it's pretty big, roughly 3k lines, and deserialize it to a big object. Not sure yet if I want to have local SQLite database or just keep editing the object in memory, serialize it, and post it back to the server when I'm finished editing.

How the hell would one approach this? The view type depends on the data type, but sometimes I'll use a spinner to limit the range/items one can chose. I don't think there's a depedency for marking the fields in the model, so the recyclerview would know what view to use?

Zoe
  • 27,060
  • 21
  • 118
  • 148
p_d
  • 101
  • 1
  • 12
  • do you have a layout design limitation or you can change layout to have better performance? – LunaVulpo Sep 15 '18 at 12:38
  • No design limitations at all, was simply the most convenient way to edit the configuration. There's lots of attributes that need to be accessible tho. Any suggestions for a different layout? – p_d Sep 15 '18 at 13:46
  • so mainly your question is: how to use viewtypes in RecyclerView? – LunaVulpo Sep 16 '18 at 06:44
  • Yes and no, i know how to use different view types. But i'd need to be able to select the view types depending on the attribute of the object, or rows of database if i chose to go that route. Thats why i was asking if there's a library that does something like this. Would need the values to be saved aswell when item gets recycled in the recyclerview. – p_d Sep 16 '18 at 13:22
  • So you have problem: how to overwrite method getViewType()? Can you post what you have till now? Some hints: https://stackoverflow.com/a/46454246/1461568 https://github.com/DevAhamed/MultiViewAdapter – LunaVulpo Sep 17 '18 at 08:00

0 Answers0