Giter Club home page Giter Club logo

ez-loaders's Introduction

EzLoaders: Making loaders quick and easy

EzLoaders borrows heavily from these posts written by Alex Lockwood If you are not familiar with Loaders please read the four posts Alex has written on them

Support

EzLoaders is compatible with Android 1.6 - 4.1 thanks to the Android Compatibility Library.

Usage

Adding the code

EzLoaders is available in source form and as a JAR in the downloads section. Simply place the JAR in your Android projects libs folder or import the source and add your target version of Android as an external JAR for the project.

Using the code

When you want to make use of a Loader, your Activity or Fragment should implement LoaderManager.LoaderCallbacks and EzLoaderInterface.

@Override
public Loader<T> onCreateLoader(int arg0, Bundle args) {
	return new EzLoader<T>(this, "com.lukekorth.REFRESH", this);
}

@Override
public void onLoadFinished(Loader<T> loader, T data) {
	mAdapter.setData(data);
}

@Override
public void onLoaderReset(Loader<T> loader) {
	mAdapter.setData(null);
}

@Override
public T loadInBackground() {
	//fetch and return your data here, this will be passed to your adapter
}

@Override
public void onReleaseResources(List<Thread> t) {
	//release any resources you may have used to query data in loadInBackground()
}

Dependencies

This project depends on the Android Compatibility Library (android-support-v4.jar)

Demo

Coming soon!

License

The code in this project is licensed under the Apache Software License 2.0, for details see the included LICENSE file.

Issues

If you have encountered a bug, please post an issue.

ez-loaders's People

Contributors

lkorth 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.