Java Question ScrollViewList

thedesolatesoul

Expert
Licensed User
Longtime User
I have many ideas for creating custom views in libraries and they are all coming in my head at the same time.
In my app I have to use the scrollview for lists many times. I want to create a generic view that will make it easy for me to deal with this.

So I start with extending the ScrollViewWrapper class.
I need to add two methods:

CreateLayout
This method needs to create a layout with a panel and many children. My initial idea was to let the user design a panel and assign it using this method. However, I do not know how to duplicate this panel across.

AddItem
This simply creates a clone of the layout from CreateLayout and adds it to a linearlayout that is assigned to the scrollview.

So it looks simple, but how do I clone the panel that the user assigns. Is there a better way using layouts?
Any ideas.
 

thedesolatesoul

Expert
Licensed User
Longtime User
I think that you will get better results if you create a code module instead of a library.
Especially if you plan to share this feature with other developers.
I do plan to share my work with other developers if I get it in an enough generic form, afterall I rely on fellow developers to test it and suggest features to make it perfect.
Even thinking in terms of code modules, how do I replicate a panel or layout that is defined by the user?
I know I can ask the user to create a sub that returns a new panel each time by generating it in code (which is what I currently do). But I want to define the layout just once, and be able to re-use it.
If I am going down the complex route of ListAdapters I shall probably stop and do everything manually.
Sorry to bother you too much :eek:
 
Top