Android Programming Press on the image to return to the main documentation page.

UltimateListView

Written by Fr\u00e9d\u00e9ric Leneuf-Magaud

List of types:

UltimateListView
UltimateLVAnimator
UltimateLVPanel

UltimateListView


This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Touch(Action As Int, X As Int, Y As Int, MotionEvent As Object) As Boolean
CellClick(RowID As Long, CellIndex As Byte, Position As Int, ClickedPanel As Panel)
CellLongClick(RowID As Long, CellIndex As Byte, Position As Int, ClickedPanel As Panel)
CellTouch(CellIndex As Byte, Position As Int, Action As Int, X As Int, Y As Int, TouchedPanel As Panel)
ItemClick(ItemID As Long, Position As Int, ClickedPanel As Panel)
ItemLongClick(ItemID As Long, Position As Int, ClickedPanel As Panel)
ItemTouch(Position As Int, Action As Int, X As Int, Y As Int, TouchedPanel As Panel)
ItemSelectedStateChanged(ItemID As Long, Position As Int, Selected As Boolean)
EmptyView(LayoutPanel As Panel)
LayoutCreator(LayoutName As String, LayoutPanel As Panel)
RowLayoutCreator(LayoutName As String, CellPanel As Panel, CellIndex As Byte)
ContentFiller(ItemID As Long, LayoutName As String, LayoutPanel As Panel, Position As Int)
RowContentFiller(RowID As Long, LayoutName As String, CellPanel As Panel, CellIndex As Byte, Position As Int)
Cleaner(PanelToClean As Panel, LayoutName As String)
LoadText(TextID As String) As String
PreLoad(ImageViewWidth As Int, ImageViewHeight As Int) As Object
CustomLoad(Location As String, ImgID As String, ImageViewWidth As Int, ImageViewHeight As Int) As Bitmap
PostLoad(Bmp As Bitmap, ImgID As String, ImageViewWidth As Int, ImageViewHeight As Int) As Bitmap
LoadingError(ImgID As String, ImageViewWidth As Int, ImageViewHeight As Int) As Bitmap
OutOfMemoryError
Scrolled(FirstVisibleItem As Int, VisibleItemCount As Int, TotalItemCount As Int, IsAtTop As Boolean, IsAtBottom As Boolean)
ScrollStateChanged(ScrollState As Int)
Overscrolled(Action As Int, ScrollY As Int)
EnterDropZone(DropView As View)
LeaveDropZone(DropView As View)
DragCancelled(StartPosition As Int, CurrentPosition As Int)
Dropped(DropView As View, StartPosition As Int, DropPosition As Int)
SwipeBegin(Position As Int, LayoutPanel As Panel, LocalX As Int, ScreenX As Int) As Boolean
Swiped(Position As Int, LayoutPanel As Panel, LocalX As Int, ScreenX As Int, DeltaX As Int)
SwipeEnd(Position As Int, LayoutPanel As Panel, LocalX As Int, ScreenX As Int, VelocityX As Float)
SwipeCancelled(Position As Int, LayoutPanel As Panel, LocalX As Int, ScreenX As Int)

Members:


  AddItem (LayoutName As String, ID As Long) As Boolean

  AddItemToSection (ID As Long, SectionName As String) As Boolean

  AddLayout (Name As String, LayoutCallback As String, ContentCallback As String, Height As Int, IsSelectable As Boolean)

  AddRowLayout (Name As String, LayoutCallback As String, ContentCallback As String, Height As Int, NbOfCells As Byte, CellWidths() As Int, DividerWidth As Int, BackgroundColor As Int, IsSelectable As Boolean)

  AddSection (SectionName As String, HeaderLayoutName As String, ItemLayoutName As String, FooterLayoutName As String) As Boolean

  AnimationCleaner As Boolean

  AtLeastOneSelection As Boolean

  Background As android.graphics.drawable.Drawable

  BringToFront

  BulkAddItems (Qty As Int, LayoutName As String, FirstID As Int) As Boolean

  BulkAddItemsToSection (SectionName As String, Qty As Int, FirstID As Long) As Boolean

  CancelDrag

  CancelSwipe

  ClearAllLayouts

  ClearContent

  ClearMemoryCache

  ClearSelection

  CloseCache (DeleteFiles As Boolean)

  CollapseChildren (ParentID As Long) As Boolean

  Color As Int [write only]

  DeleteStateFiles (ListName As String) As Boolean

  DividerDrawable As android.graphics.drawable.Drawable

  DividerHeight As Int

  Enabled As Boolean

  EnsureVisibility (Position As Int)

  ExpandChildren (ParentID As Long) As Boolean

  FadingEdges (Enabled As Boolean)

  FASTSCRL_STATE_DRAGGING As Int

  FASTSCRL_STATE_ERROR As Int

  FASTSCRL_STATE_INVISIBLE As Int

  FASTSCRL_STATE_VISIBLE As Int

  FastScroller (Enabled As Boolean)

  FastScrollerState As Int [read only]

  FeedDiskCacheWithBitmap (Bmp As BitmapWrapper, ImgID As String, Async As Boolean)

  FeedDiskCacheWithData (Data As Object, ID As String, Async As Boolean)

  FeedDiskCacheWithFile (Dir As String, FileName As String, ID As String, DeleteAfter As Boolean)

  FeedMemoryCacheWithBitmap (Bmp As BitmapWrapper, ImgID As String)

  FindIDInVisibleItems (Sender As android.view.View) As Long

  GetChildrenIDs (ParentID As Long) As List

  GetChildrenLayoutName (ParentID As Long) As String

  GetDiskCacheList As Map

  GetFirstItemPositionOfSection (SectionName As String) As Int

  GetFirstVisiblePosition As Int

  GetFooterPositionOfSection (SectionName As String) As Int

  GetHeaderPositionOfSection (SectionName As String) As Int

  GetItemID (Position As Int) As Long

  GetItemLayoutName (Position As Int) As String

  GetItemSectionName (Position As Int) As String

  GetLastVisiblePosition As Int

  GetLayoutProperties (Name As String) As Map

  GetParentID (ChildID As Long) As Long

  GetPositionForID (ID As Long, OnlyInVisibleItems As Boolean) As Int

  GetRelativeIndexForID (ID As Long) As Int

  GetSectionFooterID (SectionName As String) As Long

  GetSectionHeaderID (SectionName As String) As Long

  GetSectionsMap As Map

  GetSelectedIDs As List

  GetStateFilesVersion (ListName As String) As Float

  GetSwipeDirection (Position As Int) As Byte

  GetVisiblePanels As UltimateLVPanel()

  GetVisibleTop (Index As Int) As Int

  Height As Int

  Initialize (MemoryCacheSize As Byte, DiskCacheSize As Int, DiskCacheLocation As String, EventPrefix As String)

  InsertItemAt (LayoutName As String, ID As Long, Position As Int) As Boolean

  InsertItemInSection (ID As Long, SectionName As String, RelativeIndex As Int) As Boolean

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsDragStarted As Boolean

  IsExpanded (ParentID As Long) As Boolean

  IsInCache (ID As String) As Int

  IsInitialized As Boolean

  IsSelected (Position As Int) As Boolean

  IsUniqueID (IDtoCheck As Long) As Boolean

  JumpTo (Position As Int, Smoothly As Boolean)

  JumpToSection (SectionName As String, Smoothly As Boolean)

  LayoutExists (Name As String) As Boolean

  Left As Int

  LoadImageAsync (ImgView As Object, Location As String, ImgID As String, Gravity As Int)

  LoadState (ListName As String, RestoreLayouts As Boolean) As Boolean

  LoadTextAsync (TextView As ConcreteViewWrapper, TextID As String, StoreInCache As Boolean)

  LogStatsCache

  MinimumDistanceForSwipe As Int

  MoveItem (StartPosition As Int, EndPosition As Int) As Boolean

  NumberOfAsyncLoaders As Int

  NumberOfItems As Int

  NumberOfItemsInSection (SectionName As String) As Int

  NumberOfLayouts As Int

  NumberOfSections As Int

  OverscrollMaximum As Int

  PlaceItemFromTop (Position As Int, Y As Int)

  PressedDrawable As android.graphics.drawable.Drawable

  QualityForCache As Boolean

  RefreshContent

  RemoveBitmapFromCache (ID As String)

  RemoveDataFromCache (ID As String)

  RemoveItemAt (Position As Int) As Boolean

  RemoveLayout (Name As String) As Boolean

  RemoveSection (SectionName As String) As Boolean

  RemoveView

  ReopenDiskCache

  ReplaceItemLayoutAt (NewLayoutName As String, Position As Int) As Boolean

  ReplaceLayout (Name As String, LayoutCallback As String, ContentCallback As String, Height As Int, IsSelectable As Boolean) As Boolean

  ReplaceRowLayout (Name As String, LayoutCallback As String, ContentCallback As String, Height As Int, NbOfCells As Byte, CellWidths() As Int, DividerWidth As Int, BackgroundColor As Int, IsSelectable As Boolean) As Boolean

  RequestFocus As Boolean

  RetrieveBitmapFromCache (ID As String) As Object

  RetrieveDataFromCache (ID As String) As Object

  SaveState (ListName As String) As Boolean

  SCROLLBAR_INSIDE_INSET As Int

  SCROLLBAR_INSIDE_OVERLAY As Int

  SCROLLBAR_INVISIBLE As Int

  SCROLLBAR_OUTSIDE_INSET As Int

  SCROLLBAR_OUTSIDE_OVERLAY As Int

  ScrollingSpeedWhenDragged As Int

  SCROLLSTATE_END As Int

  SCROLLSTATE_FLING As Int

  SCROLLSTATE_IDLE As Int

  SCROLLSTATE_START As Int

  SectionHasFooter (SectionName As String) As Boolean

  SectionHasHeader (SectionName As String) As Boolean

  SELECTION_MULTIPLE As Int

  SELECTION_NONE As Int

  SELECTION_SINGLE As Int

  SelectionMode As Int

  SelectWithClick As Boolean

  SendToBack

  SetBackgroundImage (Bitmap As BitmapWrapper, Gravity As Int)

  SetChildren (ParentID As Long, ChildrenIDs As List, ChildrenLayoutName As String) As Boolean

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLoadImageCallbacks (PreLoadCallback As String, CustomLoadCallback As String, PostLoadCallback As String, LoadingErrorCallback As String)

  SetLoadTextCallback (LoadCallback As String)

  SetPadding (LeftPadding As Int, TopPadding As Int, RightPadding As Int, BottomPadding As Int)

  SetScrollbarStyle (NewStyle As Int)

  SetSectionFooter (ID As Long, SectionName As String) As Boolean

  SetSectionHeader (ID As Long, SectionName As String) As Boolean

  SetSelected (Position As Int, Selected As Boolean)

  SetStyle (NewStyle As Byte)

  SetSwipeDirection (Position As Int, Direction As Byte)

  StackFromBottom (Enabled As Boolean)

  StartDrag (InitialPosition As Int, Internal As Boolean, DropViews() As ConcreteViewWrapper)

  StopAsyncLoading

  StopScrolling

  STYLE_DEFAULT As Byte

  STYLE_HOLO_DARK As Byte

  STYLE_HOLO_LIGHT As Byte

  STYLE_HOLO_TRANSLUCENT As Byte

  SWIPE_DIRECTION_BOTH As Byte

  SWIPE_DIRECTION_LEFT As Byte

  SWIPE_DIRECTION_NONE As Byte

  SWIPE_DIRECTION_RIGHT As Byte

  SWIPE_MODE_ITEM As Byte

  SWIPE_MODE_LIST_DIR_ALL As Byte

  SWIPE_MODE_LIST_DIR_BOTH As Byte

  SWIPE_MODE_LIST_DIR_LEFT As Byte

  SWIPE_MODE_LIST_DIR_RIGHT As Byte

  SWIPE_MODE_NONE As Byte

  SwipeMode As Byte

  Tag As Object

  Top As Int

  TRANSCRIPT_ALWAYS_SCROLL As Int

  TRANSCRIPT_DISABLED As Int

  TRANSCRIPT_NORMAL As Int

  TranscriptMode As Int

  VERSION As Float

  Visible As Boolean

  Width As Int

Members description:

AddItem (LayoutName As String, ID As Long) As Boolean
Adds an item to the UltimateListView. If you are using sections, you should instead call AddItemToSection.
Returns True if the operation succeeded.
LayoutName = name of the layout used to display the item.
ID = an unique identifier for the item.
AddItemToSection (ID As Long, SectionName As String) As Boolean
Adds an item to the given section.
Returns True if the operation succeeded.
ID = an unique identifier for the item.
AddLayout (Name As String, LayoutCallback As String, ContentCallback As String, Height As Int, IsSelectable As Boolean)
Adds a new layout to the layout store.
Name = an unique name for your layout.
LayoutCallback = name of the callback function creating the layout.
The LayoutCallback function must be declared like this: myItem_LayoutCreator(LayoutName As String, LayoutPanel As Panel)
ContentCallback = name of the callback function filling the content.
The ContentCallback function must be declared like this: myItem_ContentFiller(ItemID As Long, LayoutName As String, LayoutPanel As Panel, Position As Int)
Height = height of the layout.
IsSelectable = indicates whether the item with this layout reacts to a touch, a click or a long click, and can be selected.
AddRowLayout (Name As String, LayoutCallback As String, ContentCallback As String, Height As Int, NbOfCells As Byte, CellWidths() As Int, DividerWidth As Int, BackgroundColor As Int, IsSelectable As Boolean)
Adds a new row layout to the layout store.
Name = an unique name for your layout.
LayoutCallback = name of the callback function creating the layout.
The LayoutCallback function must be declared like this: myItem_RowLayoutCreator(LayoutName As String, CellPanel As Panel, CellIndex As Byte)
ContentCallback = name of the callback function filling the content.
The ContentCallback function must be declared like this: myItem_RowContentFiller(RowID As Long, LayoutName As String, CellPanel As Panel, CellIndex As Byte, Position As Int)
Height = height of the layout.
NbOfCells = number of cells in the row.
CellWidths = array containing the width of each cell (example: Array As Int(70dip, 100dip, 150dip)).
DividerWidth = width of the divider between cells.
BackgroundColor = color of the row background (used as the divider color).
IsSelectable = indicates whether the row with this layout reacts to a touch, a click or a long click, and can be selected.
AddSection (SectionName As String, HeaderLayoutName As String, ItemLayoutName As String, FooterLayoutName As String) As Boolean
Adds an empty section. It won't be visible until you fill it with a header (SetSectionHeader), an item (AddItemToSection) or a footer (SetSectionFooter).
SectionName = an unique name for this section.
HeaderLayoutName = the layout name of the header.
ItemLayoutName = the layout name of the section items.
FooterLayoutName = the layout name of the footer.
AnimationCleaner As Boolean
Gets or sets whether the animation cleaner is enabled. When True, all animations on a view being reused or scrapped will be stopped.
The cleaner works only with the standard Android animations created with the Animation or AnimationPlus libraries.
As it slows down the processing of items, the option is set to False by default.
AtLeastOneSelection As Boolean
Gets or sets whether the last and only selection can be undone. If True, there must always be at least one selection.
Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
BulkAddItems (Qty As Int, LayoutName As String, FirstID As Int) As Boolean
Adds massively a given number of items with the same layout. If you are using sections, you should instead call BulkAddItemsToSection.
Returns True if the operation succeeded.
Qty = number of items to add.
LayoutName = name of the layout used to display the items.
FirstID = an unique identifier for the first item (the ID of the following items is automatically incremented).
BulkAddItemsToSection (SectionName As String, Qty As Int, FirstID As Long) As Boolean
Adds massively a given number of items in the same section.
Returns True if the operation succeeded.
SectionName = name of the section where to add the items.
Qty = number of items to add.
FirstID = an unique identifier for the first item (the ID of the following items is automatically incremented).
CancelDrag
Cancels the current drag & drop operation.
CancelSwipe
Stops handling the current swipe motion.
ClearAllLayouts
Removes all layouts from the layout store.
ClearContent
Deletes all items and clears the memory cache.
ClearMemoryCache
Removes all bitmaps from the memory cache.
ClearSelection
Clears any selection previously set. Call RefreshContent after this to visually update the list.
CloseCache (DeleteFiles As Boolean)
Closes the disk cache.
DeleteFiles = if True, the cache content is deleted.
CollapseChildren (ParentID As Long) As Boolean
Removes the children items from the list if they are visible.
ParentID = unique identifier of the parent item.
Returns false if the parent was not found.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
DeleteStateFiles (ListName As String) As Boolean
Deletes the files used to save the list state.
Returns True if the operation was successful.
DividerDrawable As android.graphics.drawable.Drawable
Gets/sets the drawable that will be drawn between each item.
DividerHeight As Int
Gets/sets the divider height.
Enabled As Boolean
When the list is disabled, it cannot scroll or raise click events.
EnsureVisibility (Position As Int)
Ensures that the item at the given position is fully visible.
ExpandChildren (ParentID As Long) As Boolean
Creates and inserts the children items under the current parent position.
ParentID = unique identifier of the parent item.
Returns false if the parent was not found.
FadingEdges (Enabled As Boolean)
Defines whether the edges should be faded when this view is scrolled.
They are faded by default.
FASTSCRL_STATE_DRAGGING As Int
FASTSCRL_STATE_ERROR As Int
FASTSCRL_STATE_INVISIBLE As Int
FASTSCRL_STATE_VISIBLE As Int
FastScroller (Enabled As Boolean)
Enables/disables the fast scroller.
FastScrollerState As Int [read only]
Returns the state of the fast scroller.
Returns FASTSCRL_STATE_ERROR if the fast scroller is not enabled.
FeedDiskCacheWithBitmap (Bmp As BitmapWrapper, ImgID As String, Async As Boolean)
Stores the given bitmap in the disk cache.
Bmp = the bitmap to store.
ImgID = an unique identifier for the bitmap.
Async = if True, the operation is done in a separate thread.
FeedDiskCacheWithData (Data As Object, ID As String, Async As Boolean)
Stores the given data in the disk cache.
Data = the data to store (any type).
ID = an unique identifier for the data.
Async = if True, the operation is done in a separate thread.
FeedDiskCacheWithFile (Dir As String, FileName As String, ID As String, DeleteAfter As Boolean)
Copies the content of the given file into the disk cache.
Dir, FileName = location of the file to copy.
ID = an unique identifier for the cached data.
DeleteAfter = if True, the file is deleted after the copy.
FeedMemoryCacheWithBitmap (Bmp As BitmapWrapper, ImgID As String)
Stores the given bitmap in the memory cache.
Bmp = the bitmap to store.
ImgID = an unique identifier for the bitmap.
FindIDInVisibleItems (Sender As android.view.View) As Long
Searches the given view within the visible items tree and returns the item ID of its parent.
Returns -1 if not found.
This function should only be used when there is no other way to know the ID.
GetChildrenIDs (ParentID As Long) As List
Returns the list of children IDs for the given parent.
ParentID = unique identifier of the parent item.
Returns null if the parent was not found.
GetChildrenLayoutName (ParentID As Long) As String
Returns the layout name of children for the given parent.
ParentID = unique identifier of the parent item.
Returns an empty string if the parent was not found.
GetDiskCacheList As Map
Returns a list of the current contents of the disk cache, unordered.
Map structure: key=filename, value=object array (0=time of the last modification, 1=size in bytes)
GetFirstItemPositionOfSection (SectionName As String) As Int
Returns the first position of the given section (excluding the header and the footer).
Returns -1 if the section was not found or the section has no items.
GetFirstVisiblePosition As Int
Returns the position of the first visible item.
GetFooterPositionOfSection (SectionName As String) As Int
Returns the position of the footer of the given section.
Returns -1 if the section was not found or the section has no footer.
GetHeaderPositionOfSection (SectionName As String) As Int
Returns the position of the header of the given section.
Returns -1 if the section was not found or the section has no header.
GetItemID (Position As Int) As Long
Gets the ID of the item at the given position.
Returns -1 if the position is invalid.
GetItemLayoutName (Position As Int) As String
Gets the name of the item layout at the given position. The name is returned in uppercase.
Returns an empty string if the position is invalid.
GetItemSectionName (Position As Int) As String
Returns the section name of the item at the given position.
Returns an empty string if the position is invalid or the item does not belong to a section.
GetLastVisiblePosition As Int
Returns the position of the last visible item.
GetLayoutProperties (Name As String) As Map
Returns a map with the following properties of the given layout: "height", "nbofcells", "cellwidths", "isselectable".
Returns null if the layout was not found.
GetParentID (ChildID As Long) As Long
Returns the parent's ID for the given child.
ChildID = unique identifier of the child item.
Returns -1 if the child was not found or has no parent.
GetPositionForID (ID As Long, OnlyInVisibleItems As Boolean) As Int
Gets the position of the item with the given ID.
Returns -1 if the ID was not found.
OnlyInVisibleItems = if True, the search is done only within the visible items.
GetRelativeIndexForID (ID As Long) As Int
Returns the relative position of the given ID in its section (excluding the header, so 0 is always the first position in the section).
Returns -1 if the ID was not found or the item is not in a section.
GetSectionFooterID (SectionName As String) As Long
Gets the ID of the footer of the given section.
Returns -1 if the section was not found or there is no footer.
GetSectionHeaderID (SectionName As String) As Long
Gets the ID of the header of the given section.
Returns -1 if the section was not found or there is no header.
GetSectionsMap As Map
Returns a map containing all sections (key) with their position (value).
The sections are sorted by position in ascending order. The sections with no header, no items and no footer have a position = -1.
GetSelectedIDs As List
Returns a list of the IDs of the selected items.
GetStateFilesVersion (ListName As String) As Float
Gets the version of the state files. Returns -1 if no version information was found.
GetSwipeDirection (Position As Int) As Byte
Gets the direction of the swipe gesture to be detected at the given position.
Direction = one of the SWIPE_DIRECTION constants.
GetVisiblePanels As UltimateLVPanel()
Returns the panels of all visible items. The views of these special panels cannot be retrieved or modified.
GetVisibleTop (Index As Int) As Int
Returns the top position of a visible item (in pixels).
Index = Position of the item in the visible area (e.g. 0 for the first visible item).
Throws an exception if the index is out of bounds.
Height As Int
Gets or sets the view's height.
Initialize (MemoryCacheSize As Byte, DiskCacheSize As Int, DiskCacheLocation As String, EventPrefix As String)
Initializes the UltimateListView.
MemoryCacheSize = percentage of free memory used to store bitmaps in the memory cache.
DiskCacheSize = number of megabytes used to store data in the disk cache.
DiskCacheLocation = working folder for the disk cache. If empty, the default cache folder of the application is used.
EventPrefix = prefix of events.
InsertItemAt (LayoutName As String, ID As Long, Position As Int) As Boolean
Inserts an item at the given position. If you are using sections, you should instead call InsertItemInSection.
Returns True if the operation succeeded.
Position = from 0 (before the first item) to NumberOfItems (after the last item).
InsertItemInSection (ID As Long, SectionName As String, RelativeIndex As Int) As Boolean
Inserts an item at the specified relative position in a section.
Returns True if the operation succeeded.
RelativeIndex = position inside the given section. 0 is the first position (the header position is not taken into account).
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsDragStarted As Boolean
Returns whether a drag & drop operation is in progress.
IsExpanded (ParentID As Long) As Boolean
Gets whether the children items are expanded under their parent.
ParentID = unique identifier of the parent item.
IsInCache (ID As String) As Int
Checks whether the given ID is in cache.
Returns:
0: not found in cache
1: in memory cache only
2: in disk cache only
3: in both caches
IsInitialized As Boolean
IsSelected (Position As Int) As Boolean
Gets whether the given item is selected.
IsUniqueID (IDtoCheck As Long) As Boolean
Checks whether the given ID is not already associated to an item.
Returns True if the ID was not found.
JumpTo (Position As Int, Smoothly As Boolean)
Scrolls to the given position.
JumpToSection (SectionName As String, Smoothly As Boolean)
Scrolls to the beginning of the given section.
LayoutExists (Name As String) As Boolean
Checks whether the given layout is in the layout store.
Left As Int
Gets or sets the view's left.
LoadImageAsync (ImgView As Object, Location As String, ImgID As String, Gravity As Int)
Loads an image asynchronously.
ImgView = the ImageView waiting for the image to load.
Location = the image location on internet (e.g. http://my.images.com/b4a.png) or on the device storage media (e.g. /mnt/sdcard/media/b4a.png). If the location starts with "custom:", the function calls the custom loader defined with SetLoadImageCallbacks.
ImgID = an unique identifier for the image.
Gravity = the gravity used to position/stretch the image within its bounds. This setting will affect also the placeholder image if this image is a BitmapDrawable.
This function modifies the Tag property of the ImageView, so don't use this property.
LoadState (ListName As String, RestoreLayouts As Boolean) As Boolean
Restores the saved list state (the layout store, the sections list, the items list, the selected items list, and the scroll position).
Returns True if the state files were found and loaded. Throws an IOException if an error occurs.
RestoreLayouts = if True, the layouts are restored. If False, the current layouts are used.
LoadTextAsync (TextView As ConcreteViewWrapper, TextID As String, StoreInCache As Boolean)
Loads a text asynchronously.
TextView = the view waiting for the text to load.
TextID = an unique identifier for the text.
StoreInCache = specifies whether the loaded text will be stored in the disk cache.
This function modifies the Tag property of the view, so don't use this property.
LogStatsCache
Writes the cache statistics in the B4A log.
MinimumDistanceForSwipe As Int
Gets or sets the minimum distance of horizontal movement before a gesture is considered a swipe.
MoveItem (StartPosition As Int, EndPosition As Int) As Boolean
Moves an item from StartPosition to EndPosition.
Both parameters range from 0 (the first item) to NumberOfItems-1 (the last item).
If you are using sections, note that the item cannot be moved outside its current section.
This function returns True if the operation succeeded.
NumberOfAsyncLoaders As Int
Gets/sets the number of concurrent loaders for LoadImageAsync and LoadTextAsync.
The default value is 2.
NumberOfItems As Int
Returns the number of items.
NumberOfItemsInSection (SectionName As String) As Int
Returns the number of items for the given section (excluding the header and the footer).
Returns -1 if the section was not found.
NumberOfLayouts As Int
Returns the number of layouts.
NumberOfSections As Int
Returns the number of sections.
OverscrollMaximum As Int
Gets or sets the maximum value returned by the Overscrolled event.
This value is always positive.
PlaceItemFromTop (Position As Int, Y As Int)
Scrolls to the given position, then places the item Y pixels from the top edge of the ULV.
PressedDrawable As android.graphics.drawable.Drawable
Gets/sets the drawable for the pressed state.
QualityForCache As Boolean
Gets/sets the format and quality used to save bitmaps in the disk cache.
If True, the bitmap is saved into a PNG file with maximum quality. If False (default), it is saved into a JPG file with a quality of 75. This setting is ignored if the image is not opaque (the PNG format is used to keep the alpha channel).
RefreshContent
Refreshes the content of the visible items.
This function should be added to Activity_Resume if you make calls to LoadImageAsync as it restarts the asynchronous loader after a pause.
RemoveBitmapFromCache (ID As String)
Removes the bitmap with the given ID from the cache (memory and disk).
RemoveDataFromCache (ID As String)
Removes the data with the given ID from the disk cache.
RemoveItemAt (Position As Int) As Boolean
Removes an item at the given position.
Returns True if the operation succeeded.
RemoveLayout (Name As String) As Boolean
Removes the given layout from the layout store.
Returns True if the layout was found and removed.
RemoveSection (SectionName As String) As Boolean
Removes the specified section (including the header and the footer).
Returns True if the operation succeeded.
RemoveView
Removes this view from its parent.
ReopenDiskCache
Reopens a closed disk cache.
ReplaceItemLayoutAt (NewLayoutName As String, Position As Int) As Boolean
Replaces the layout of the item at the given position.
Returns True if the operation succeeded.
ReplaceLayout (Name As String, LayoutCallback As String, ContentCallback As String, Height As Int, IsSelectable As Boolean) As Boolean
Replaces the given layout in the layout store.
Returns True if the layout was found and replaced.
Name = name of the layout to replace.
LayoutCallback = name of the callback function creating the layout.
ContentCallback = name of the callback function filling the content.
Height = height of the layout.
IsSelectable = indicates whether the item with this layout reacts to a touch, a click or a long click, and can be selected.
ReplaceRowLayout (Name As String, LayoutCallback As String, ContentCallback As String, Height As Int, NbOfCells As Byte, CellWidths() As Int, DividerWidth As Int, BackgroundColor As Int, IsSelectable As Boolean) As Boolean
Replaces the given row layout in the layout store.
Returns True if the layout was found and replaced.
Name = name of the layout to replace.
LayoutCallback = name of the callback function creating the layout.
ContentCallback = name of the callback function filling the content.
Height = height of the layout.
NbOfCells = number of cells in the row.
CellWidths = array containing the width of each cell (example: Array As Int(70dip, 100dip, 150dip)).
DividerWidth = width of the divider between cells.
BackgroundColor = color of the row background (used as the divider color).
IsSelectable = indicates whether the row with this layout reacts to a touch, a click or a long click, and can be selected.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
RetrieveBitmapFromCache (ID As String) As Object
Retrieves the bitmap with the given ID from the cache (memory or disk).
ID = an unique identifier for the bitmap.
RetrieveDataFromCache (ID As String) As Object
Retrieves the data with the given ID from the disk cache.
ID = an unique identifier for the data.
SaveState (ListName As String) As Boolean
Saves the current list state (the layout store, the sections list, the items list, the selected items list, and the scroll position).
Returns True if the operation was successful.
SCROLLBAR_INSIDE_INSET As Int
SCROLLBAR_INSIDE_OVERLAY As Int
SCROLLBAR_INVISIBLE As Int
SCROLLBAR_OUTSIDE_INSET As Int
SCROLLBAR_OUTSIDE_OVERLAY As Int
ScrollingSpeedWhenDragged As Int
Gets or sets the scrolling speed when an item is dragged to the top or to the bottom during an internal drag & drop operation.
Minimum value = 1, Default value = 6.
SCROLLSTATE_END As Int
SCROLLSTATE_FLING As Int
SCROLLSTATE_IDLE As Int
SCROLLSTATE_START As Int
SectionHasFooter (SectionName As String) As Boolean
Returns whether the given section has a footer.
SectionHasHeader (SectionName As String) As Boolean
Returns whether the given section has a header.
SELECTION_MULTIPLE As Int
SELECTION_NONE As Int
SELECTION_SINGLE As Int
SelectionMode As Int
Gets or sets the selection mode (None by default).
If set to Single, only one item can be selected.
If set to Multiple, several items can be selected.
SelectWithClick As Boolean
Gets or sets whether the items are automatically selected with a click (default value) when the selection mode is set to SINGLE or MULTIPLE.
If False, the items have to be selected with the SetSelected function.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As BitmapWrapper, Gravity As Int)
SetChildren (ParentID As Long, ChildrenIDs As List, ChildrenLayoutName As String) As Boolean
Sets the children IDs (long values) and the children layout name for the given parent.
The children items stay uncreated (and thus invisible) until they are expanded by the ExpandChildren function.
ParentID = unique identifier of the parent item.
Returns false if the parent was not found.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLoadImageCallbacks (PreLoadCallback As String, CustomLoadCallback As String, PostLoadCallback As String, LoadingErrorCallback As String)
Defines the functions to call if the bitmap was not found in cache with LoadImageAsync.
PreLoadCB should be used to put a placeholder image in the ImageView before the loading takes place. This image is not put in cache.
CustomLoadCB should be used to load the image with your own loader (needed if the image is stored in a database). To trigger it, the image location must start with "custom:".
PostLoadCB should be used to transform the image (to add a frame, resize, crop, etc.) before it is stored in cache.
LoadingErrorCB should be used to display an error symbol in the ImageView. This image is not put in cache.
PreLoadCallback = name of the callback function executed before the bitmap is loaded in a separate thread.
The PreLoadCallback function must be declared like this: my_PreLoad(ImageViewWidth As Int, ImageViewHeight As Int) As Object
The returned object must be a Drawable.
CustomLoadCallback = name of the callback function loading the bitmap.
The CustomLoadCallback function must be declared like this: my_CustomLoad(Location As String, ImgID As String, ImageViewWidth As Int, ImageViewHeight As Int) As Bitmap
The returned object must be a Bitmap.
PostLoadCallback = name of the callback function executed after the bitmap is loaded, but before it is displayed or stored in cache.
The PostLoadCallback function must be declared like this: my_PostLoad(Bmp As Bitmap, ImgID As String, ImageViewWidth As Int, ImageViewHeight As Int) As Bitmap
The returned object must be a Bitmap.
LoadingErrorCallback = name of the callback function executed if the bitmap wasn't loaded successfully.
The LoadingErrorCallback function must be declared like this: my_LoadingError(ImgID As String, ImageViewWidth As Int, ImageViewHeight As Int) As Bitmap
The returned object must be a Bitmap or Null.
SetLoadTextCallback (LoadCallback As String)
Defines the function to call if the text was not found in cache with LoadTextAsync.
LoadCallback = name of the callback function loading the text.
The LoadCallback function must be declared like this: my_LoadText(TextID As String) As String
SetPadding (LeftPadding As Int, TopPadding As Int, RightPadding As Int, BottomPadding As Int)
Sets the padding for each side.
SetScrollbarStyle (NewStyle As Int)
Sets the scrollbar style and visibility.
The scrollbar is visible by default, with the "Outside_Overlay" style.
For further details on styles: http://developer.android.com/reference/android/view/View.html#attr_android:scrollbarStyle
SetSectionFooter (ID As Long, SectionName As String) As Boolean
Sets the footer of the given section. If there's already one, it is replaced.
Returns True if the operation succeeded.
ID = an unique identifier for the item.
SetSectionHeader (ID As Long, SectionName As String) As Boolean
Sets the header of the given section. If there's already one, it is replaced.
Returns True if the operation succeeded.
ID = an unique identifier for the item.
SetSelected (Position As Int, Selected As Boolean)
Changes the selected state of the item at the given position.
SetStyle (NewStyle As Byte)
Changes the style of the list.
The Holo styles are not available before API 11 (Android v3 Honeycomb).
SetSwipeDirection (Position As Int, Direction As Byte)
Sets the direction of the swipe gesture to be detected at the given position.
Direction = one of the SWIPE_DIRECTION constants.
StackFromBottom (Enabled As Boolean)
If enabled, stacks the contents from the bottom.
It is disabled by default.
StartDrag (InitialPosition As Int, Internal As Boolean, DropViews() As ConcreteViewWrapper)
Starts a drag & drop operation.
InitialPosition = the starting position of the item to drag.
Internal = if True, the dragged item is limited to the bounds of the list (for a reordering of the list items).
Otherwise, the item can be dragged anywhere in the panel containing the list.
DropViews = if Null, the item being dragged can only be dropped on the list.
Otherwise, it may be dropped on any of the given views. These views must have the same parent as the list.
When the item is moved over a DropView, the EnterDropZone event is fired. When it leaves this area, the LeaveDropZone event is fired.
If Internal is True, DropViews are ignored.
StopAsyncLoading
Stops all asynchronous loadings initiated with LoadImageAsync or LoadTextAsync.
StopScrolling
Stops a scrolling initiated by a gesture.
STYLE_DEFAULT As Byte
STYLE_HOLO_DARK As Byte
STYLE_HOLO_LIGHT As Byte
STYLE_HOLO_TRANSLUCENT As Byte
SWIPE_DIRECTION_BOTH As Byte
SWIPE_DIRECTION_LEFT As Byte
SWIPE_DIRECTION_NONE As Byte
SWIPE_DIRECTION_RIGHT As Byte
SWIPE_MODE_ITEM As Byte
SWIPE_MODE_LIST_DIR_ALL As Byte
SWIPE_MODE_LIST_DIR_BOTH As Byte
SWIPE_MODE_LIST_DIR_LEFT As Byte
SWIPE_MODE_LIST_DIR_RIGHT As Byte
SWIPE_MODE_NONE As Byte
SwipeMode As Byte
Gets or sets whether a swipe gesture is handled at the item level or at the list level.
If set to MODE_ITEM (default), the swipe gesture is handled at the item level and SetSwipeDirection has to be called for each item.
If set to MODE_LIST_DIR_*, the swipe gesture is handled at the list level.
If set to MODE_LIST_DIR_ALL, the list can also scroll vertically during the swipe motion.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Top As Int
Gets or sets the view's top.
TRANSCRIPT_ALWAYS_SCROLL As Int
TRANSCRIPT_DISABLED As Int
TRANSCRIPT_NORMAL As Int
TranscriptMode As Int
Gets or sets the transcript mode (disabled by default).
When this mode is enabled, the list scrolls to the bottom to make new items visible when they are added.
If set to NORMAL, the list scrolls to the bottom only if the last item is already visible on screen.
If set to ALWAYS_SCROLL, the list always scrolls to the bottom, no matter what items are currently visible.
The transcript mode has to be disabled if you want to perform a drag & drop operation.
VERSION As Float
Visible As Boolean
Width As Int
Gets or sets the view's width.

UltimateLVAnimator


Events:

Before(Position As Int, PanelToRecycle As Panel, PanelTop As Int, Action As Byte)
Confirm(FirstVisiblePosition As Int, LastVisiblePosition As Int) As Boolean
Changed(Position As Int, Index As Int, PanelToAnim As Panel, PanelTop As Int, Action As Byte)
Scrolled(Position As Int, Index As Int, PanelToAnim As Panel, PanelTop As Int, ScrollDirection As Byte)
After(FirstVisiblePosition As Int, LastVisiblePosition As Int)

Members:


  ACTION_ADD As Byte

  ACTION_INSERT As Byte

  ACTION_REMOVE As Byte

  ACTION_REPLACELAYOUT As Byte

  ACTION_USER As Byte

  AnimateOnFling As Boolean

  Initialize (Source As UltimateListView, EventPrefix As String)

  IsInitialized As Boolean [read only]

  SCROLL_DOWN As Byte

  SCROLL_UP As Byte

  WaitDraw

Members description:

ACTION_ADD As Byte
ACTION_INSERT As Byte
ACTION_REMOVE As Byte
ACTION_REPLACELAYOUT As Byte
ACTION_USER As Byte
AnimateOnFling As Boolean
Gets or sets whether the Scrolled event is raised during a fling motion.
Default = true.
Initialize (Source As UltimateListView, EventPrefix As String)
Creates an animator to use with UltimateListView.
It will trigger an event whenever one of these actions is performed on the list: scroll, add, insert, remove, replace a layout.
Events:
Before is raised before the action is performed.
Confirm is raised after the action is performed, but before the drawing occurs and before the Changed or Scrolled events. If True is returned or if this event is not handled, the following events will be raised; otherwise, they will be skipped.
Changed and Scrolled are raised after the action is performed, but before the drawing occurs. Changed is raised for each visible item. Scrolled is raised for each item that becomes visible.
After is raised after the action is performed and after all other events.
IsInitialized As Boolean [read only]
SCROLL_DOWN As Byte
SCROLL_UP As Byte
WaitDraw
Waits until the UltimateListView is about to be drawn.
Call this when you want to trigger the Changed event for any drawing reason, before the drawing occurs.

UltimateLVPanel


Events:

None

Members:


  ACTION_DOWN As Int

  ACTION_MOVE As Int

  ACTION_UP As Int

  Background As android.graphics.drawable.Drawable

  BringToFront

  Color As Int [write only]

  Enabled As Boolean

  Height As Int

  Invalidate

  Invalidate2 (arg0 As android.graphics.Rect)

  Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)

  IsInitialized As Boolean

  Left As Int [read only]

  NumberOfViews As Int [read only]

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (arg0 As android.graphics.Bitmap)

  SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)

  SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)

  SetVisibleAnimated (arg0 As Int, arg1 As Boolean)

  Tag As Object

  Top As Int [read only]

  Visible As Boolean

  Width As Int [read only]

Members description:

ACTION_DOWN As Int
ACTION_MOVE As Int
ACTION_UP As Int
Background As android.graphics.drawable.Drawable
BringToFront
Color As Int [write only]
Enabled As Boolean
Height As Int
Invalidate
Invalidate2 (arg0 As android.graphics.Rect)
Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
IsInitialized As Boolean
Left As Int [read only]
NumberOfViews As Int [read only]
RequestFocus As Boolean
SendToBack
SetBackgroundImage (arg0 As android.graphics.Bitmap)
SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
Tag As Object
Top As Int [read only]
Visible As Boolean
Width As Int [read only]

Top