public abstract class

SegmentedAdapter

extends Object
java.lang.Object
   ↳ greendroid.widget.SegmentedAdapter

Class Overview

A SegmentedAdapter is a data source of a SegmentedHost/SegmentedHost.

Summary

Public Constructors
SegmentedAdapter()
Public Methods
abstract int getCount()
How many segments have to be displayed
abstract String getSegmentTitle(int position)
Get the title for the segment at position position
abstract View getView(int position, ViewGroup parent)
Get the View associated to the segment at position position
void notifyDataSetChanged()
Notifies the attached View that the underlying data has changed and should refresh itself.
void registerDataSetObserver(DataSetObserver observer)
Register an observer that is called when changes happen to the data used by this adapter.
void unregisterDataSetObserver(DataSetObserver observer)
Unregister an observer that has previously been registered with this adapter via unregisterDataSetObserver(DataSetObserver)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public SegmentedAdapter ()

Public Methods

public abstract int getCount ()

How many segments have to be displayed

Returns
  • The number of segment displayed by the underlying SegmentedBar

public abstract String getSegmentTitle (int position)

Get the title for the segment at position position

Parameters
position The position of the segment in the SegmentedBar
Returns
  • A title for the segment at the given position.

public abstract View getView (int position, ViewGroup parent)

Get the View associated to the segment at position position

Parameters
position The position of the item in the SegmentedAdapter
parent The parent that this view will eventually be attached to
Returns
  • A View corresponding to the segment at the given position

public void notifyDataSetChanged ()

Notifies the attached View that the underlying data has changed and should refresh itself.

public void registerDataSetObserver (DataSetObserver observer)

Register an observer that is called when changes happen to the data used by this adapter.

Parameters
observer The object that gets notified when the data set changes.

public void unregisterDataSetObserver (DataSetObserver observer)

Unregister an observer that has previously been registered with this adapter via unregisterDataSetObserver(DataSetObserver)

Parameters
observer The object to unregister