diff --git a/README.md b/README.md index ad52dc9..e4c7aa1 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,12 @@ - Jackson customization - RetroFit Error parsing in body - Lightweight Promise instead of Call +- Promise allows other async computation encapsulation such as bitmap conversion etc - Promise.whenAll - Display busy animation while http call is in progress -Project level gradle +## Project level gradle allprojects { repositories { @@ -17,15 +18,15 @@ Project level gradle dependencies { - compile 'com.github.neurospeech:android-hypercube:v1.23' + compile 'com.github.neurospeech:android-hypercube:v1.35' } -Initialization - In Application class +### Initialization - In Application class HypercubeApplication.init(this); -Service Example +### Service Example public class APIService : RestService{ @@ -42,7 +43,7 @@ Service Example Service is now independent of OkHttp library, so your code can stay independent of underlying implementation. It is also very easy to create a mock by simply inheriting MockService and implementing API interface. -Service Usage +### Service Usage apiService.login(...) .then(new IResultListener(){ @@ -58,3 +59,43 @@ Service Usage } }); +## Promise Usage + + Promise promise = + TaskPromise.runAsync(inputFile, new IFunction(){ + + @override + public Bitmap run(File input){ + return BitmapFactory.loadFrom(input); + } + + }); + + promise.onResult(new IResultListener(){ + void onResult(Promise p){ + if(p.getError() != null){ + // something went wrong, display error + }else{ + Bitmap bitmap = p.getResule(); + } + } + }) + +## Promise.whenAll + + Promise.whenAll(...) + .then(new IResultListener(){ + void onResult(Promise p){ + if(p.getError() != null){ + // atleast one of promise failed... + }else{ + // all promises finished successfully without any error + } + } + }); + +# HyperRecyclerView + +- Headers/Footers +- Item headers with HeaderedAdapter + diff --git a/hypercube/build.gradle b/hypercube/build.gradle index 7eac197..6c063f0 100644 --- a/hypercube/build.gradle +++ b/hypercube/build.gradle @@ -25,8 +25,8 @@ android { defaultConfig { minSdkVersion 15 targetSdkVersion 23 - versionCode 34 - versionName "1.34" + versionCode 35 + versionName "1.35" } buildTypes { release {