Giter Club home page Giter Club logo

pulltorefresh's Introduction

PullLaunchRocket

中文文档

Twitter License Travis Android Arsenal

Thanks to Yalantis for creating a great logic of PullToRefresh. And that's logic is the fundation of PullLaunchRocket also.

Give me a Star please :D And welcome to contact me or make a PR if you have any good style, we make it better together.

  • style one: launch rocket

rocket

  • style two: sun raise

rocket

Usage

You can have a look at Sample Project sample for better use.

  • Add it in your root build.gradle at the end of repositories:
allprojects {
		repositories {
			...
			maven { url "https://jitpack.io" }
		}
	}
  • Add the dependency in your module-level build.gradle
dependencies {
    compile 'com.github.lubeast:PullToRefresh:1.0.1'
}
  • PullToRefreshView widget in your layout.xml
<lumenghz.com.pullrefresh.PullToRefreshView
        android:id="@+id/pull_to_refresh"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:lrefresh="rocket"
        >

        <ListView
            android:id="@+id/list_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:divider="@null"
            android:dividerHeight="0dp"
            android:fadingEdge="none"
            />

</lumenghz.com.pullrefresh.PullToRefreshView>
  • Initial the PullToRefreshView and setup OnRefreshListener in your onCreate method
mPullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() {
    @Override
    public void onRefresh() {
        mPullToRefreshView.postDelayed(new Runnable() {
            @Override
            public void run() {
                mPullToRefreshView.setRefreshing(false);
            }
        }, REFRESH_DELAY);
    }
 });
  • You can change refresh state through call
mPullToRefreshView.setRefreshing(boolean isRefreshing)

pulltorefresh's People

Contributors

lumenghz avatar

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.