InboxBackgroundScrollView & InboxLayoutListView - xiaobailong24/JitPack GitHub Wiki

Usage

Layout(XML)

<me.xiaobailong24.library.View.InboxBackgroundScrollView
            android:id="@+id/scroll"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:overScrollMode="always"
            android:scrollbars="none">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

            </LinearLayout>

</me.xiaobailong24.library.View.InboxBackgroundScrollView>
<me.xiaobailong24.library.View.InboxLayoutListView
    android:id="@+id/inboxlayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="invisible"/>

Activity (Java)

inboxLayoutListView.setBackgroundScrollView(inboxBackgroundScrollView);//绑定scrollview
inboxLayoutListView.setCloseDistance(10);
inboxLayoutListView.setAdapter(new BaseAdapter() {
    @Override
    public int getCount() {
        return 20;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater = getActivity().getLayoutInflater();
        View view = inflater.inflate(R.layout.fragment_list_item, null);
        return view;
    }
});