RxLoader

General

Category
Free
Tag
FRP
License
Apache License, Version 2.0
Min SDK
16 (Android 4.1 Jelly Bean)
Registered
Oct 22, 2016
Favorites
3
Link
https://github.com/L4Digital/RxLoader
See also
RxJava
RxT4A
ixjava
Reduks
Intro to RxJava

Additional

Language
Java
Version
2.1.0 (Nov 10, 2017)
Created
Sep 14, 2016
Updated
Apr 25, 2018 (Retired)
Owner
L4 Digital (L4Digital)
Contributor
Randy Webster (randr0id)
1
Activity
Badge
Generate
Download
Source code

RxLoader

An Android Loader that wraps an RxJava Observable.

RxLoader caches the data emitted by your Observable across orientation changes by utilizing an Android Loader, while also providing the results from an Observable preserving the RxJava pattern.

Download

Gradle:

dependencies {
    compile 'com.l4digital.rxloader:rxloader:2.1.0'
}

Maven:

<dependency>
  <groupId>com.l4digital.rxloader</groupId>
  <artifactId>rxloader</artifactId>
  <version>2.1.0</version>
</dependency>

Usage

import com.l4digital.rxloader.RxLoader;
import com.l4digital.rxloader.RxLoaderCallbacks;

...

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    RxLoader<DataType> loader = new RxLoader<>(this, getObservable());
    RxLoaderCallbacks<DataType> callbacks = new RxLoaderCallbacks<>(loader);

    callbacks.getFlowable().subscribe(this);

    getLoaderManager().initLoader(loaderId, Bundle.EMPTY, callbacks);
}

RxLoader can also be used with the Android Support Library:

import com.l4digital.support.rxloader.RxLoader;
import com.l4digital.support.rxloader.RxLoaderCallbacks;

...

getSupportLoaderManager().initLoader(loaderId, Bundle.EMPTY, callbacks);

License

Copyright 2016 L4 Digital LLC. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.