// this is my main class... ScrollPanel is <ScrollView>.Panel
public class ASHyperList extends ViewWrapper<HyperList>
{
...
public void Initialize(BA pBA, String EventName, ViewGroup ScrollPanel)
{
super.Initialize(pBA, EventName);
eventName = EventName;
panel = ScrollPanel;
}
public void innerInitialize(BA pBA, String EventName, boolean pKeepOldObject)
{
if (!pKeepOldObject)
{
setObject(new HyperList(pBA.context));
}
super.innerInitialize(pBA, EventName, pKeepOldObject);
ba = pBA;
}
public void Connect()
{
getObject().panel = panel;
}
public void Add(String Key, ASHyperItem Item)
{
getObject().addItem(Key, Item);
}
}
public class HyperList extends View
{
public HyperList(Context context)
{
super(context);
// android.view.ViewGroup.LayoutParams;
this.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
}
public void addItem(String Key, ASHyperItem Item)
{
// data is an HashMap
data.Add(Key, Item);
HyperListItem view = new HyperListItem(this.getContext(), Item);
panel.addView(view);
}
}
public class HyperListItem extends View
{
public HyperListItem(Context context, ASHyperItem Item)
{
super(context);
this.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
item = Item;
}
@Override
public void draw(Canvas canvas)
{
super.draw(canvas);
...
}
}