Skip to content

naseemakhtar994/RxAssetManager

 
 

Repository files navigation

Rx AssetManager

JCenter Maven Central Travis Android Arsenal

An RxJava2 implementation of the Android AssetManager.

Inspired by the blog post RxRecipes: Wrap your way to Rx by Scott Meschke.

Any help or contribution is welcome.

Download

Gradle

  repositories {
    jcenter()
    //OR
    mavenCentral()
  }

  dependencies {
    implementation "com.github.jonathanmerritt.rxassetmanager:core OR* core-ext:x.y.z"
  }

Maven

<dependencies>
 <dependency>
   <groupId>com.github.jonathanmerritt.rxassetmanager</groupId>
   <artifactId>core OR* core-ext</artifactId>
   <version>x.y.z</version>
   <type>pom</type>
 </dependency>
</dependencies>

*core-ext will include core automatically.

Usage

This example will either open or list and open any files as InputStreams.

Check the sample apps for more detailed examples.

Core

public class SomeActivity extends Activity {
  private Disposable openPath() { return new RxAssetManager(this).open("Asset").subscribe(is -> {}); }
}

Core-Ext

public class SomeActivity extends Activity { 
  private Disposable listOpenPath() { return new RxAssetManager(this).listOpen("Assets").subscribe(is -> {}); }
}

TODO

  • Add javadoc.
  • ...

License

Apache-2.0

Copyright 2018 Jonathan Merritt 11R00TT00R11@GMAIL.COM

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.