-
Notifications
You must be signed in to change notification settings - Fork 121
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
1 parent
76441f0
commit dc6de20
Showing
12 changed files
with
95 additions
and
65 deletions.
There are no files selected for viewing
20 changes: 6 additions & 14 deletions
20
domain/src/main/java/com/rxweather/domain/usercase/ListUseCase.java
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,30 +1,22 @@ | ||
package com.rxweather.domain.usercase; | ||
|
||
import com.joker.rxweather.model.entities.AddressEntity; | ||
import com.joker.rxweather.model.entities.MainEntity; | ||
import com.joker.rxweather.model.entities.RequestCitiesEntity; | ||
import com.joker.rxweather.model.request.ListRequest; | ||
import com.joker.rxweather.model.service.ServiceRest; | ||
import java.util.List; | ||
import rx.Observable; | ||
|
||
/** | ||
* Created by Joker on 2015/10/31. | ||
*/ | ||
public class ListUseCase extends UseCase<List<MainEntity>> { | ||
public class ListUseCase extends UseCase<List<MainEntity>, ListRequest> { | ||
|
||
private ServiceRest serviceRest; | ||
private AddressEntity addressEntity; | ||
private List<RequestCitiesEntity.RequestCity> requestCities; | ||
|
||
public ListUseCase(AddressEntity addressEntity, | ||
List<RequestCitiesEntity.RequestCity> requestCities) { | ||
this.addressEntity = addressEntity; | ||
this.requestCities = requestCities; | ||
this.serviceRest = ServiceRest.getInstance(); | ||
public ListUseCase() { | ||
} | ||
|
||
@Override protected Observable<List<MainEntity>> interactor() { | ||
@Override protected Observable<List<MainEntity>> interactor(ListRequest listRequest) { | ||
|
||
return serviceRest.getWeatherByCityOrCityId(addressEntity, requestCities); | ||
return ServiceRest.getInstance() | ||
.getWeatherByCityOrCityId(listRequest.addressEntity, listRequest.requestCityList); | ||
} | ||
} |
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
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
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
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
20 changes: 20 additions & 0 deletions
20
model/src/main/java/com/joker/rxweather/model/request/ListRequest.java
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.joker.rxweather.model.request; | ||
|
||
import com.joker.rxweather.model.entities.AddressEntity; | ||
import com.joker.rxweather.model.entities.RequestCitiesEntity; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by Joker on 2015/11/18. | ||
*/ | ||
public class ListRequest { | ||
|
||
public AddressEntity addressEntity; | ||
public List<RequestCitiesEntity.RequestCity> requestCityList; | ||
|
||
public ListRequest(AddressEntity addressEntity, | ||
List<RequestCitiesEntity.RequestCity> requestCityList) { | ||
this.addressEntity = addressEntity; | ||
this.requestCityList = requestCityList; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
model/src/main/java/com/joker/rxweather/model/request/PrepareRequest.java
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.joker.rxweather.model.request; | ||
|
||
import android.content.res.AssetManager; | ||
import android.location.LocationManager; | ||
|
||
/** | ||
* Created by Joker on 2015/11/18. | ||
*/ | ||
public class PrepareRequest { | ||
|
||
public LocationManager locationManager; | ||
public AssetManager assetManager; | ||
|
||
public PrepareRequest(LocationManager locationManager, AssetManager assetManager) { | ||
this.locationManager = locationManager; | ||
this.assetManager = assetManager; | ||
} | ||
} |
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
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
9 changes: 9 additions & 0 deletions
9
presentation/src/main/java/com/joker/rxweather/views/ContentView.java
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.joker.rxweather.views; | ||
|
||
/** | ||
* Created by Joker on 2015/11/18. | ||
*/ | ||
public interface ContentView { | ||
|
||
boolean isContent(); | ||
} |
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
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