Skip to content

Commit

Permalink
Version 1.35 published
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Aug 8, 2016
1 parent 005d4bb commit ebeb07e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 7 deletions.
51 changes: 46 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
- Jackson customization
- RetroFit Error parsing in body
- Lightweight Promise<T> instead of Call<T>
- 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 {
Expand All @@ -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{
Expand All @@ -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<Result>(){
Expand All @@ -58,3 +59,43 @@ Service Usage
}
});

## Promise Usage

Promise<Bitmap> promise =
TaskPromise.runAsync(inputFile, new IFunction<File,Bitmap>(){

@override
public Bitmap run(File input){
return BitmapFactory.loadFrom(input);
}

});

promise.onResult(new IResultListener<Bitmap>(){
void onResult(Promise<Bitmap> 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<String> 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

4 changes: 2 additions & 2 deletions hypercube/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionCode 34
versionName "1.34"
versionCode 35
versionName "1.35"
}
buildTypes {
release {
Expand Down

0 comments on commit ebeb07e

Please sign in to comment.