Giter Site home page Giter Site logo

andrewgeorge / zrclistview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from it-rico/zrclistview

0.0 2.0 0.0 1.25 MB

一个顺滑又漂亮的Android下拉刷新与加载更多列表组件。

Home Page: https://github.com/zarics/ZrcListView

License: MIT License

zrclistview's Introduction

ZrcListView

一个顺滑又漂亮的Android下拉刷新与加载更多列表组件。

根据系统自带ListView源码改造而来:

1.增加下拉刷新及滚动到底部自动加载的功能;
2.增加越界回弹效果;
2.增加自定义列表项动画的功能;

与其他下拉刷新列表组件的不同

1.其他下拉刷新组件的实现基本是通过动态更改Header的大小来实现的,而ZrcListView是修改了Listview的边界判断;
2.其他下拉刷新组件很容易在下拉刷新时变得卡顿,这是动态更改子View引起的,而ZrcListView的下拉刷新部分与滑动内容一样顺滑;
3.可以设置默认列表头偏移量,这使得实现透明ActionBar与ListView叠加变得很容易。

ZrcListView使用示例

设置ZrcListView相关属性

// 设置下拉刷新的样式
SimpleHeader header = new SimpleHeader(this);
header.setTextColor(0xff0066aa);
header.setCircleColor(0xff33bbee);
listView.setHeadable(header);

// 设置加载更多的样式
SimpleFooter footer = new SimpleFooter(this);
footer.setCircleColor(0xff33bbee);
listView.setFootable(footer);

// 设置列表项出现动画
listView.setItemAnimForTopIn(R.anim.topitem_in);
listView.setItemAnimForBottomIn(R.anim.bottomitem_in);

// 下拉刷新事件回调
listView.setOnRefreshStartListener(new OnStartListener() {
    @Override
    public void onStart() {
        refresh();
    }
});

// 加载更多事件回调
listView.setOnLoadMoreStartListener(new OnStartListener() {
    @Override
    public void onStart() {
        loadMore();
    }
});

##Screenshots Screenshot 0

Screenshot 1

Screenshot 2

Screenshot 3

zrclistview's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.