public interface

LoadOnDemandAdapter

implements Adapter OnRefreshListener
com.droidux.pack.list.adapters.LoadOnDemandAdapter

Class Overview

Extends Adapter to provide data "on-demand" when used with widgets that supports it, such as the DuxListView.

See Also

Summary

[Expand]
Inherited Constants
From interface android.widget.Adapter
Public Methods
abstract View getLoadingView(int lastPosition, View convertView, boolean autoLoad)
Gets the loading view to be displayed while the adapter is refreshed in the background.
abstract boolean hasMore(int lastPosition)
Returns true when the adapter has more data after the last position
abstract boolean shouldAutoload(int lastPosition)
Decides whether the adapter should be automatically refreshed in the background or will be manually refreshed, for example after the user tap a button.
[Expand]
Inherited Methods
From interface android.widget.Adapter
From interface com.droidux.pack.list.interfaces.OnRefreshListener

Public Methods

public abstract View getLoadingView (int lastPosition, View convertView, boolean autoLoad)

Since: API Level 2.5

Gets the loading view to be displayed while the adapter is refreshed in the background.

Parameters
lastPosition The position of the currently last data in the adapter.
convertView The old view to reuse, if possible. Note: You should check that this view is non-null and of an appropriate type before using.
autoLoad A flag to indicate whether the adapter is automatically refreshed.
Returns
  • The loading view.

public abstract boolean hasMore (int lastPosition)

Since: API Level 2.5

Returns true when the adapter has more data after the last position

Parameters
lastPosition The position of the currently last data in the adapter.
Returns
  • If true, the host widget will refresh the adapter's data in the background.

public abstract boolean shouldAutoload (int lastPosition)

Since: API Level 2.5

Decides whether the adapter should be automatically refreshed in the background or will be manually refreshed, for example after the user tap a button.

Parameters
lastPosition The position of the currently last data in the adapter.
Returns
  • If true, the adapter will be automatically refreshed.