How use Yailist to make listItem?

Dear all,

How use Yailist to make listItem?

example ,i have little code like this:

        LuckyItem luckyItem1 = new LuckyItem();
        luckyItem1.topText = "100";
        luckyItem1.icon = test1;
        luckyItem1.color = 0xffFFF3E0;
        data.add(luckyItem1);

        LuckyItem luckyItem2 = new LuckyItem();
        luckyItem2.topText = "200";
        luckyItem2.icon = test2;
        luckyItem2.color = 0xffFFE0B2;
        data.add(luckyItem2);

        LuckyItem luckyItem3 = new LuckyItem();
        luckyItem3.topText = "300";
        luckyItem3.icon = test3;
        luckyItem3.color = 0xffFFCC80;
        data.add(luckyItem3);

How to make ArrayList icon and color… ?

I want set data listitem to luckyView.setData(data);

I sorry my question is confusing…

I just wany make function like this:

@SImpleFunction
public void AddItemList(String listIcons, String listColors){
//code here…
}

I hope anyone can understand :grinning: :pray:

Thank you very much before.

regard,
kangris

The easiest thing to do in most cases is to just pass back a Java List from a call. The YAIL runtime will automatically coerce this into a YailList and ensure that all of its elements are valid YAIL objects. If you want to have named fields, you may want to look at storing the information in a YailDictionary.