All Projects → pavlospt → Rxfile

pavlospt / Rxfile

Licence: apache-2.0
Rx methods to get a File and Image or Video thumbnails from a Document Provider on Android (Drive, Dropbox etc)

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Rxfile

Rxdocs
Rx和RxJava文档中文翻译项目
Stars: ✭ 3,825 (+746.24%)
Mutual labels:  rxjava
Rxdownload
A multi-threaded download tool written with RxJava and Kotlin
Stars: ✭ 4,035 (+792.7%)
Mutual labels:  rxjava
Ferro
Simple and powerful MVP library for Android
Stars: ✭ 441 (-2.43%)
Mutual labels:  rxjava
Cpx
A cli tool to watch and copy file globs.
Stars: ✭ 394 (-12.83%)
Mutual labels:  file
Rxbluetooth
Android reactive bluetooth
Stars: ✭ 405 (-10.4%)
Mutual labels:  rxjava
Rxjava Mvp Giphy
Showcase of RxJava used with MVP and some other popular android libraries
Stars: ✭ 429 (-5.09%)
Mutual labels:  rxjava
Filer
Node-like file system for browsers
Stars: ✭ 389 (-13.94%)
Mutual labels:  file
Gank
干货集中营 app 安卓实现,基于 RxFlux 架构使用了 RxJava、Retrofit、Glide、Koin等
Stars: ✭ 444 (-1.77%)
Mutual labels:  rxjava
Sonatamediabundle
Symfony SonataMediaBundle
Stars: ✭ 415 (-8.19%)
Mutual labels:  file
Andlinker
AndLinker is a IPC library for Android, which combines the features of AIDL and Retrofit. Allows IPC call seamlessly compose with RxJava and RxJava2 call adapters.
Stars: ✭ 440 (-2.65%)
Mutual labels:  rxjava
Animewallpaper
[Android] Konachan wallpaper downloader
Stars: ✭ 402 (-11.06%)
Mutual labels:  rxjava
Fuel
The easiest HTTP networking library for Kotlin/Android
Stars: ✭ 4,057 (+797.57%)
Mutual labels:  rxjava
Simple Http Server
Simple http server in Rust (Windows/Mac/Linux)
Stars: ✭ 428 (-5.31%)
Mutual labels:  file
Gank.io Unofficial Android Client
An unofficial gank. io android client
Stars: ✭ 394 (-12.83%)
Mutual labels:  rxjava
Roxie
Lightweight Android library for building reactive apps.
Stars: ✭ 441 (-2.43%)
Mutual labels:  rxjava
Android Mvp Interactor Architecture
Extension of the android-mvp-architecture for very large projects.
Stars: ✭ 388 (-14.16%)
Mutual labels:  rxjava
Weatherapp
5 Day Forecast app that works on Android and uses latest tools (Kotlin, Navigation, Room, LiveData, Databinding, Dagger 2)
Stars: ✭ 426 (-5.75%)
Mutual labels:  rxjava
Rxbasicskata
Practical challenges for RxJava learners
Stars: ✭ 449 (-0.66%)
Mutual labels:  rxjava
Android Mvvm
MVVM on Android using RxJava and Data Binding
Stars: ✭ 443 (-1.99%)
Mutual labels:  rxjava
Rxriddles
Riddling your way to master RxJava
Stars: ✭ 440 (-2.65%)
Mutual labels:  rxjava

Circle CI Download Android Arsenal Android_Weekly

RxFile

Rx methods to get a File and Image or Video thumbnails from any DocumentProvider on Android (Drive, Dropbox, Photos etc)

How To Install

Available on jCenter() and mavenCentral()

compile 'com.github.pavlospt:rxfile:1.8'

How To Use

It is really easy to use it, depending on your needs it returns the appropriate file or Bitmap. You can fetch a Bitmap when you are selecting an Image or a Video. The fetched Bitmap is a thumbnail of the selected Image or Video. When you choose to select a file from Dropbox or Drive, the file is being downloaded and copied to the Library's cache folder. It then returns the File object and you have complete access over it in case you need to upload it to a server or in a similar use case.

To enable logging:

RxFile.setLoggingEnabled(true);

To get a File, use: (need to change the name of the method)

Observable<File> createFileFromUri(final Context context, final Uri data);
Observable<List<File>> createFileFromUri(final Context context, final ArrayList<Uri> uris);
Observable<List<File>> createFilesFromClipData(final Context context, final ClipData clipData);

To get a thumbnail, use:

Observable<Bitmap> getThumbnail(Context context, Uri uri);
Observable<Bitmap> getThumbnail(Context context, Uri uri, int requiredWidth, int requiredHeight);
Observable<Bitmap> getThumbnail(Context context, Uri uri, int requiredWidth, int requiredHeight, int kind);

Get files from a ClipData object (applies to multiple file selection through intent):

RxFile.createFilesFromClipData(this,clipData)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Subscriber<List<File>>() {
                    @Override
                    public void onCompleted() {
                        Timber.e("onCompleted() for Files called");
                    }

                    @Override
                    public void onError(Throwable e) {
                        Timber.e("Error on files fetching:" + e.getMessage());
                    }

                    @Override
                    public void onNext(List<File> files) {
                        Timber.e("Files list size:" + files.size());
                        for(File f : files){
                            Timber.e("onNext() file called:" + f.getAbsolutePath());
                        }
                    }
                });

Get file from single Uri:

RxFile.createFileFromUri(this,uri)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Subscriber<File>() {
                    @Override
                    public void onCompleted() {
                        Timber.e("onCompleted() for File called");
                    }

                    @Override
                    public void onError(Throwable e) {
                        Timber.e("Error on file fetching:" + e.getMessage());
                    }

                    @Override
                    public void onNext(File file) {
                        Timber.e("onNext() file called:" + file.getAbsolutePath());
                    }
                });

Get Thumbnail from Uri (photo or video):

RxFile.getThumbnail(this,data)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Subscriber<Bitmap>() {
                    @Override
                    public void onCompleted() {
                        Timber.e("onCompleted() called");
                    }

                    @Override
                    public void onError(Throwable e) {
                        Timber.e("onError called with: " +  e.getMessage());
                    }

                    @Override
                    public void onNext(Bitmap bitmap) {
                        mBitmap.setImageBitmap(bitmap);
                    }
                });

For more, check the Wiki

Credits

Author : Pavlos-Petros Tournaris ([email protected])

Google+ : +Pavlos-Petros Tournaris

Facebook : Pavlos-Petros Tournaris

LinkedIn : Pavlos-Petros Tournaris

(In case you use this in your app let me know to make a list of apps that use it! )

License

Copyright 2015 Pavlos-Petros Tournaris

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].