-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Abdullah M. Alhazmy
committed
Sep 27, 2016
1 parent
75de8ed
commit 4540bfd
Showing
2 changed files
with
35 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 17 additions & 19 deletions
36
template/ActivityCleanArchitecture/root/src/app_package/SimpleRetrofitImpl.java.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,31 @@ | ||
package ${packageName}.model; | ||
package ${packageName}.model; | ||
|
||
|
||
import rx.Observable; | ||
import rx.functions.Func1; | ||
import ${packageName}.data.${repositoryInterface}; | ||
import ${packageName}.data.${serviceClass}; | ||
|
||
public class ${mockImplClass} implements ${repositoryInterface} { | ||
public class ${repositoryImplClass} implements ${repositoryInterface} { | ||
|
||
private ${serviceClass} mRetrofitService; | ||
|
||
public ${mockImplClass}() { | ||
|
||
public ${repositoryImplClass}(${serviceClass} retrofitService) { | ||
this.mRetrofitService = retrofitService; | ||
} | ||
|
||
// @Override | ||
// public Observable<${modelClass}> methodeFromRepo() { | ||
// ${modelClass} model = new ${modelClass}(); | ||
// return Observable.create(new Observable.OnSubscribe<${modelClass}>() { | ||
// @Override | ||
// public void call(Subscriber<? super ${modelClass}> subscriber) { | ||
// if (model == null) | ||
// throw new RuntimeException(""); | ||
// else | ||
// subscriber.onNext(model); | ||
// } | ||
// }); | ||
// | ||
// | ||
// } | ||
|
||
// @Override | ||
//public Observable<${modelClass}> methodeFromRepo() { | ||
// return mRetrofitService.methodeFromRetrofit().map(new Func1<Response<${modelClass}>, ${modelClass}>() { | ||
// @Override | ||
// public ${modelClass} call(Response<${modelClass}> response) { | ||
// if (response.isSuccess()) | ||
// return response.body(); | ||
// else | ||
// throw new RuntimeException(response.body().getResultMessage()); | ||
// } | ||
//}); | ||
// } | ||
|
||
} |