ListView overview

ListView is used to display multiple entries of vertical scrolling list view.Entry data come from the ListAdapter associated with this class. IWOP platform has three ListView:

 
AmazingListView:
 
Basic ListView.Each entry to occupy the control a third of the height, the rest of the logic and the Android native ListView.
 
AmazingFocusListView:
 
To locate the ListView.On the basis of AmazingListView increased the function positioning, every time after the sliding must be parked at the top of the one item.
 
AmazingSwipeListView:
 
Can delete item of ListView.On the basis of AmazingFocusListView increased left slide to delete that entry function.

You can choose according to your specific needs to use a ListView.

ListView介绍

AmazingListView

IWOP most basic ListView, use way and the Android native ListView.

AmazingFocusListView

To locate the ListView。

 
setFocusMode(int):
 
You can call this method to set positioning model.Optional modes are: FOCUS_MODE_NORMAL, normal mode, sliding stop automatic positioning;FOCUS_MODE_CLICK, click on the model, in addition to sliding orientation, click on each item, also can locate the entry to the con
 
setFocusType(int)
 
You can call this method to set location type.Optional parameters: FOCUS_TYPE_NONE, without type;FOCUS_TYPE_CKECKED, checked type, when the entry location to the control center, the id for android. R.i d.i con View set to checked attribute;FOCUS_TYPE_SELECTED, selected type, when the entry location to the control center, the id for android. R.i d.i con View Settings for the selected attributes;FOCUS_TYPE_BOTH, at the same time with the above two types.
 
setFocusPosition(int)
 
You can call this method take the initiative to locate the entry to the control center.
 
OnFocusChangedListener:
 
Locate items change listener, can listen to the current positioning of the entries change events.

AmazingSwipeListView

On the basis of AmazingFocusListView extension ListView scroll left delete functions.

 
setOnItemDeleteListener(OnItemDeleteListener listener);
 
You can set the Item sliding remove listener, used to delete the Item data from the adapter and remove specific background data (such as cleaning records of database to store information, etc.)。

The typical usage of ListView

AmazingListView

IWOP most basic ListView, use way and the Android native ListView.

AmazingFocusListView

AmazingFocuseListView typical usage is as follows:


public class ListViewActivity implements OnFocusChangedListener {
    private AmazingFocusListView mListView;

    @Override
    public final void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mListView = (AmazingFocusListView) findViewById(R.id.list);
        ...
        mListView.setOnFocusChangedListener(this);
    }

    @Override
    public void onFocusChanged(AmazingFocusListView view, int focus, int oldFocus) {
        //TODO On Focuse Changed
    }
}

AmazingSwipeListView

AmazingSwipeListView typical usage is as follows:


public class ListViewActivity implements OnItemDeleteListener {
    private AmazingSwipeListView mListView;

    @Override
    public final void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mListView = (AmazingSwipeListView) findViewById(R.id.list);
        ...
        mListView.setOnItemDeleteListener(this);
    }

    @Override
    public void onDelete(View view, int position) {
        //TODO On Delete Item
    }
}