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)
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.
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.
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.
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.
AnimationCleanerAsBoolean
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.
AtLeastOneSelectionAsBoolean
Gets or sets whether the last and only selection can be undone. If True, there must always be at least one selection.
BackgroundAsandroid.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
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).
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 (DeleteFilesAsBoolean)
Closes the disk cache. DeleteFiles = if True, the cache content is deleted.
CollapseChildren (ParentIDAsLong) AsBoolean
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.
ColorAsInt [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 (ListNameAsString) AsBoolean
Deletes the files used to save the list state. Returns True if the operation was successful.
Gets/sets the drawable that will be drawn between each item.
DividerHeightAsInt
Gets/sets the divider height.
EnabledAsBoolean
When the list is disabled, it cannot scroll or raise click events.
EnsureVisibility (PositionAsInt)
Ensures that the item at the given position is fully visible.
ExpandChildren (ParentIDAsLong) AsBoolean
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 (EnabledAsBoolean)
Defines whether the edges should be faded when this view is scrolled. They are faded by default.
FASTSCRL_STATE_DRAGGINGAsInt
FASTSCRL_STATE_ERRORAsInt
FASTSCRL_STATE_INVISIBLEAsInt
FASTSCRL_STATE_VISIBLEAsInt
FastScroller (EnabledAsBoolean)
Enables/disables the fast scroller.
FastScrollerStateAsInt [read only]
Returns the state of the fast scroller. Returns FASTSCRL_STATE_ERROR if the fast scroller is not enabled.
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.
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.
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.
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 (ParentIDAsLong) AsList
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 (ParentIDAsLong) AsString
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.
GetDiskCacheListAsMap
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)
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.
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 (PositionAsInt) AsLong
Gets the ID of the item at the given position. Returns -1 if the position is invalid.
GetItemLayoutName (PositionAsInt) AsString
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 (PositionAsInt) AsString
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.
GetLastVisiblePositionAsInt
Returns the position of the last visible item.
GetLayoutProperties (NameAsString) AsMap
Returns a map with the following properties of the given layout: "height", "nbofcells", "cellwidths", "isselectable". Returns null if the layout was not found.
GetParentID (ChildIDAsLong) AsLong
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.
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 (IDAsLong) AsInt
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 (SectionNameAsString) AsLong
Gets the ID of the footer of the given section. Returns -1 if the section was not found or there is no footer.
GetSectionHeaderID (SectionNameAsString) AsLong
Gets the ID of the header of the given section. Returns -1 if the section was not found or there is no header.
GetSectionsMapAsMap
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.
GetSelectedIDsAsList
Returns a list of the IDs of the selected items.
GetStateFilesVersion (ListNameAsString) AsFloat
Gets the version of the state files. Returns -1 if no version information was found.
GetSwipeDirection (PositionAsInt) AsByte
Gets the direction of the swipe gesture to be detected at the given position. Direction = one of the SWIPE_DIRECTION constants.
GetVisiblePanelsAsUltimateLVPanel()
Returns the panels of all visible items. The views of these special panels cannot be retrieved or modified.
GetVisibleTop (IndexAsInt) AsInt
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.
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.
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).
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 (RectAsandroid.graphics.Rect)
Invalidates the given rectangle. Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
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.
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.
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.
MinimumDistanceForSwipeAsInt
Gets or sets the minimum distance of horizontal movement before a gesture is considered a swipe.
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.
NumberOfAsyncLoadersAsInt
Gets/sets the number of concurrent loaders for LoadImageAsync and LoadTextAsync. The default value is 2.
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 (IDAsString)
Removes the bitmap with the given ID from the cache (memory and disk).
RemoveDataFromCache (IDAsString)
Removes the data with the given ID from the disk cache.
RemoveItemAt (PositionAsInt) AsBoolean
Removes an item at the given position. Returns True if the operation succeeded.
RemoveLayout (NameAsString) AsBoolean
Removes the given layout from the layout store. Returns True if the layout was found and removed.
RemoveSection (SectionNameAsString) AsBoolean
Removes the specified section (including the header and the footer). Returns True if the operation succeeded.
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.
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.
RequestFocusAsBoolean
Tries to set the focus to this view. Returns True if the focus was set.
RetrieveBitmapFromCache (IDAsString) AsObject
Retrieves the bitmap with the given ID from the cache (memory or disk). ID = an unique identifier for the bitmap.
RetrieveDataFromCache (IDAsString) AsObject
Retrieves the data with the given ID from the disk cache. ID = an unique identifier for the data.
SaveState (ListNameAsString) AsBoolean
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_INSETAsInt
SCROLLBAR_INSIDE_OVERLAYAsInt
SCROLLBAR_INVISIBLEAsInt
SCROLLBAR_OUTSIDE_INSETAsInt
SCROLLBAR_OUTSIDE_OVERLAYAsInt
ScrollingSpeedWhenDraggedAsInt
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_ENDAsInt
SCROLLSTATE_FLINGAsInt
SCROLLSTATE_IDLEAsInt
SCROLLSTATE_STARTAsInt
SectionHasFooter (SectionNameAsString) AsBoolean
Returns whether the given section has a footer.
SectionHasHeader (SectionNameAsString) AsBoolean
Returns whether the given section has a header.
SELECTION_MULTIPLEAsInt
SELECTION_NONEAsInt
SELECTION_SINGLEAsInt
SelectionModeAsInt
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.
SelectWithClickAsBoolean
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.
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.
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 (LoadCallbackAsString)
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
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
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.
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 (PositionAsInt, SelectedAsBoolean)
Changes the selected state of the item at the given position.
SetStyle (NewStyleAsByte)
Changes the style of the list. The Holo styles are not available before API 11 (Android v3 Honeycomb).
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_DEFAULTAsByte
STYLE_HOLO_DARKAsByte
STYLE_HOLO_LIGHTAsByte
STYLE_HOLO_TRANSLUCENTAsByte
SWIPE_DIRECTION_BOTHAsByte
SWIPE_DIRECTION_LEFTAsByte
SWIPE_DIRECTION_NONEAsByte
SWIPE_DIRECTION_RIGHTAsByte
SWIPE_MODE_ITEMAsByte
SWIPE_MODE_LIST_DIR_ALLAsByte
SWIPE_MODE_LIST_DIR_BOTHAsByte
SWIPE_MODE_LIST_DIR_LEFTAsByte
SWIPE_MODE_LIST_DIR_RIGHTAsByte
SWIPE_MODE_NONEAsByte
SwipeModeAsByte
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.
TagAsObject
Gets or sets the Tag value. This is a place holder which can used to store additional data.
TopAsInt
Gets or sets the view's top.
TRANSCRIPT_ALWAYS_SCROLLAsInt
TRANSCRIPT_DISABLEDAsInt
TRANSCRIPT_NORMALAsInt
TranscriptModeAsInt
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.
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)
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.
IsInitializedAsBoolean [read only]
SCROLL_DOWNAsByte
SCROLL_UPAsByte
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.