Giter Site home page Giter Site logo

actionbar-pulltorefresh-1's Introduction

ActionBar-PullToRefresh

This ActionBar-PullToRefresh is based on ActionBar-PullToRefresh by Chris Banes (website, github, twitter, linkedin).

The original version of ActionBar-PullToRefresh is made for Gradle (and Android Studio). However, importing that project into Eclipse (Android Development Tools) is a pain-in-the-a**! So I made this one, which can be imported directly into Eclipse and used right away.


Changes to the original ActionBar-PullToRefresh

The original project allows customizing of the PullToRefresh view via an XML file (See the Customisation page for more information.). However, many times, you would want to change a really small attribute such as color of the progress bar, or color of the text. In that case, the XML file becomes an overkill (and too much work for lazy people like me!).

So I added a few more methods to the Options class. Here's how you can use it.

    ActionBarPullToRefresh.from(getActivity())
    		.insertLayoutInto(viewGroup) // We need to insert the PullToRefreshLayout into the Fragment's ViewGroup
    		.theseChildrenArePullable(scrollView) // We need to mark the ListView and it's Empty View as pullable This is because they are not direct children of the
    		// ViewGroup
    		.options(Options.create()
    				.refreshingText("Fetching A lot of Stuff...")
    				.pullText("Pull me down!")
    				.releaseText("Let go of me!!!")
    				.titleTextColor(android.R.color.black)
    				.progressBarColor(android.R.color.holo_orange_light)
    				.headerBackgroundColor(android.R.color.holo_blue_light)
    				.progressBarStyle(Options.PROGRESS_BAR_STYLE_INSIDE) // or Options.PROGRESS_BAR_STYLE_OUTSIDE
    				.build())
    		.listener(new OnRefreshListener() { // We can now complete the setup as desired
    			  // pulled to refresh
    				})
    		.setup(mPullToRefreshLayout);

Sample Apps (From Original Project)

There are two sample applications, the stock sample which uses the standard library and is therefore has a minSdkVersion of 14. There is also a sample which uses the ActionBarSherlock extra so has a minSdkVersion of 7.

Stock Sample (From Original Project)

Get it on Google Play

ActionBarSherlock Sample (From Original Project)

Get it on Google Play

Video (From Original Project)

Sample Video


Supported Views (As-is from original project)

ActionBar-PullToRefresh has in-built support for:

  • AbsListView derivatives (ListView & GridView).
  • ScrollView
  • WebView

If the View you want to use is not listed above, you can easily add support in your own code by providing a ViewDelegate. See the ViewDelegate section below for more info.


Usage and Integration (As-is from Original project)

See the Quick Start guides for more information on how to achieve a simple integration:

Then we are some advanced integration information:

  • ListFragment when integrating the library with a ListFragment.

Customisation (From Original Project)

See the Customisation page for more information.

=======================

actionbar-pulltorefresh-1's People

Contributors

rahuljiresal avatar

Watchers

James Cloos avatar iampiknik 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.