Code example for ListView

Methods: getFirstVisiblePosition

0
    public static ListViewPosition getCurrentListPosition(ListView listView) {
        int index = 0;
        int top = 0;
 
        if (listView != null) {
            index = listView.getFirstVisiblePosition();
            View v = listView.getChildAt(0);
            top = (v == null) ? 0 : v.getTop();
        } 
 
        ListViewPosition position = new ListViewPosition(index, top);
        return position;
    } 
 
    public static void unbindDrawables(View view) {
        if (view.getBackground() != null) {
            view.getBackground().setCallback(null);
            view.setBackgroundDrawable(null);
        } 
        if (view instanceof ImageView) {
            ImageView imageView = (ImageView) view;