You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
997 B
31 lines
997 B
package com.community.pocket.ui.main.ui.garbage;
|
|
|
|
import androidx.lifecycle.MutableLiveData;
|
|
|
|
import com.community.pocket.data.main.garbage.GarbageSortingRequest;
|
|
import com.community.pocket.ui.main.ui.share.BaseViewModel;
|
|
import com.community.pocket.ui.main.ui.share.SearchViewModel;
|
|
|
|
/**
|
|
* 垃圾分类数据管理
|
|
*/
|
|
public class GarbageSortingViewModel extends BaseViewModel<GarbageSortingRequest> implements SearchViewModel {
|
|
|
|
//垃圾分类信息请求状态
|
|
private MutableLiveData<GarbageSortingResponse> garbageSortingResponse = new MutableLiveData<>();
|
|
|
|
MutableLiveData<GarbageSortingResponse> getGarbageSortingResponse() {
|
|
return garbageSortingResponse;
|
|
}
|
|
|
|
@Override
|
|
protected GarbageSortingRequest getRequest() {
|
|
return GarbageSortingRequest.getInstance();
|
|
}
|
|
|
|
@Override
|
|
public void search(String content) {
|
|
GarbageSortingResponse response = getRequest().search();
|
|
garbageSortingResponse.setValue(response);
|
|
}
|
|
}
|
|
|