Skip to content

RaphetS/LoadMoreListView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

31f8de8 · Oct 14, 2016

History

8 Commits
Oct 14, 2016
Oct 14, 2016
Oct 14, 2016
Oct 14, 2016
Oct 14, 2016
Oct 14, 2016
Oct 14, 2016
Oct 14, 2016
Oct 14, 2016
Oct 14, 2016
Oct 14, 2016

Repository files navigation

#支持加载更多的ListView image

#使用方法 布局文件

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

 <org.raphets.demoloadmorelistview.LoadMoreListView
     android:id="@+id/listview"
     android:layout_width="match_parent"
     android:layout_height="200dp">
 </org.raphets.demoloadmorelistview.LoadMoreListView>
</RelativeLayout>

Activity中使用

mListView.setONLoadMoreListener(new LoadMoreListView.OnLoadMoreListener() {
            @Override
            public void onloadMore() {
                loadMore();
            }
        });
    }

    private void loadMore() {
        new Thread(){
            @Override
            public void run() {
                super.run();
                mData.add("atate");
                mData.add("546646");
                mData.add("546646");
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        adapter.notifyDataSetChanged();
                        mListView.setLoading(false);
                    }
                });
            }
        }.start();
    }

加载完成,记得调用setLoadCompleted();

About

支持加载更多的ListView

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages