i made this on a quick run... you might want to check it out. did not add other features
let me know if this works for you
//Called when application is started.
function OnStart()
{
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
//Create a text label and add it to layout.
txt = app.CreateText( "Hello" );
txt.SetTextSize( 32 );
lay.AddChild( txt );
tx=spinner2('[fa-bars] line 1,[fa-power-off] line 2,line 3',0.5);
lay.AddChild(tx);
//Add layout to app.
app.AddLayout( lay );
}
function spinner2(list,width,height,options) {
width=width || 0.5;
height=height || 0.05;
var lst=list;
var self=this;
var left,top;
var collapse=true;
var lay=null;
//var lay=app.CreateLayout('linear','vertical');
if (typeof list=='string') lst=list.split(',');
var titleTxt=app.CreateText(lst[0],width,height,'left,fontawesome');
titleTxt.SetBackColor('#ee44ee');
newlist=function() {
lay=app.CreateLayout('linear','vcenter');
tray=app.CreateLayout('linear');
for (var i=0;i<lst.length;i++) {
var t=app.CreateText(lst[i],width,height,'left,fontawesome');
t.SetBackColor('#3344ee');
t.SetOnTouchDown( toggle);
t.item=lst[i];
tray.AddChild(t);
}
lay.AddChild(tray);
lay.SetPadding(left,top);
//lay.SetSize(width,-1);
app.AddLayout(lay);
}
toggle=function() {
if (!lay) {
left=this.GetLeft();
top=this.GetTop();
newlist();
}
if (collapse) {
titleTxt.SetVisibility('hide');
collapse=false;
lay.SetVisibility('true');
}
else {
app.ShowPopup(this.item);
titleTxt.SetText(this.item);
titleTxt.SetVisibility('show');
lay.SetVisibility('hide');
collapse=true;
}
}
titleTxt.SetOnTouchDown( toggle);
return titleTxt;
}