User Tools

Site Tools


Sidebar

Privacy Policy

News

Version 2.50 is out since Jan 1st 2022


Frequently Asked Questions


Namespaces

Note for contributors

If you wish to create a new page in the DroidScript wiki, please click on the most appropriate namespace above and follow the notes for contributors there.

Because of spam, it has been necessary to add a CAPTCHA to the registration form and the save option for editing pages. You will not need to prove you are human if you are logged in, so please register.

Please feel free to improve any existing page, as well as adding new pages to increase the sum of public knowledge about DroidScript.

Formatting Syntax

built_in:lists

This is an old revision of the document!


Lists

Create

Create List objects using the CreateList method of the app object:

lst = app.CreateList( list, width, height, options );

Use the SetOnTouch and SetOnLongTouch methods of the List object to set the name of a function you want to be called when a list item is selected. The selected item is passed into your OnTouch callback function as a parameter every time an item is selected or long touched.

Methods

Some controls use the same methods.
For examples of the same methods look here.

Method Description
ListView.AddItem( title,body,image )
ListView.Destroy()
ListView.GetAbsHeight()
ListView.GetAbsWidth()
ListView.GetHeight()
ListView.GetList( delim ) string = list.GetList(“,”);
ListView.GetPosition()
ListView.GetTextSize( mode )
ListView.GetType()
ListView.GetVisibility()
ListView.GetWidth()
ListView.Release()
ListView.RemoveItem( title )
ListView.ScrollToItem( name,body )
ListView.SelectItem( title,body,scrollTo )
ListView.SelectItemByIndex( index,scroll ) index is a number,
scroll could be true or false
ListView.SetBackColor( color )
ListView.SetBackGradient( color1,color2,color3,p4,p5,p6,p7 )
ListView.SetBackGradientRadial( x,y,r,color1,color2,color3,p7 )
ListView.SetBackground( imagefile,options )
ListView.SetDivider( height,color )
ListView.SetEllipsize( mode )
ListView.SetEllipsize1( mode )
ListView.SetEllipsize2( mode )
ListView.SetFontFile( file )
ListView.SetHiTextColor1( color )
ListView.SetHiTextColor2( color )
ListView.SetItem( title,newTitle,newBody,newImage )
ListView.SetList( list,delimeter )
ListView.SetMargins( left,top,right,bottom )
ListView.SetOnLongTouch( callback ) sets the function called when list is long-touched
ListView.SetOnTouch( callback ) sets the function called when list is touched
ListView.SetPadding( left,top,right,bottom )
ListView.SetPosition( left,top,width,height )
ListView.SetScale( x,y )
ListView.SetSize( width,height )
ListView.SetTextColor( color )
ListView.SetTextColor1( color )
ListView.SetTextColor2( color )
ListView.SetTextMargins( left,top,right,bottom )
ListView.SetTextShadow( radius,dx,dy,color )
ListView.SetTextShadow1( radius,dx,dy,color )
ListView.SetTextShadow2( radius,dx,dy,color )
ListView.SetTextSize( size,mode )
ListView.SetVisibility( ShowHide )

Options

Option Description
FontAwesomeUse this to display Icons
from this inbuilt font

Sample callbacks

function lst_OnTouch( title, body, type, index ) 
{ 
  app.ShowPopup( "id: " + title + " nick: " + body ); 
} 
function lst_OnLongTouch( title, body, type, index ) 
{ 
  app.ShowPopup( "id: " + title + " nick: " + body ); 
}
function lst_OnTouch( title, body, type, index )
{
    //Shows the index of the touched item
    app.ShowPopup(index)  
}
function lst_OnTouch( item )
{
    //Shows the touched item
    app.ShowPopup(item)  
}
built_in/lists.1425753540.txt.gz · Last modified: 2015/03/08 02:39 (external edit)