import Panel from "../views/Panel";
import FavoriteMusicItem from "../item/FavoriteMusicItem";
import LineLayoutGroup from "../components/LayoutGroup";

export default class FavoriteMusicPanel extends Panel {
    public get skinKey() { return "FavoriteMusicPanel" }
    public get groupName() { return "favorite_music_panel" }

    public scroller: eui.Scroller;
    public scrollerGroup: eui.Group;
    public list: eui.List;

    onSkinComplete() {
        super.onSkinComplete();
        let dataProvider = this.list.dataProvider as eui.ArrayCollection;
        dataProvider.source = [];

        for (let i = 0; i <= 10; i++) {
            dataProvider.source.push({
                musicName: "缺氧" + i.toString(),
                singer: "杨丞琳",
                favorite: true
            });
        }

        this.list.itemRenderer = FavoriteMusicItem;
    }
}