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.
42 lines
1.2 KiB
42 lines
1.2 KiB
package com.community.pocket.ui.main.ui.garbage.waste;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import androidx.lifecycle.MutableLiveData;
|
|
|
|
import com.community.pocket.data.main.garbage.GarbageWasteRequest;
|
|
import com.community.pocket.ui.main.ui.share.BaseViewModel;
|
|
import com.community.pocket.ui.main.ui.share.SearchViewModel;
|
|
|
|
//废品信息UI管理
|
|
public class GarbageWasteViewModel extends BaseViewModel<GarbageWasteRequest> implements SearchViewModel {
|
|
|
|
//检索默认废品信息
|
|
private MutableLiveData<GarbageWasteResponse> defaultList = new MutableLiveData<>();
|
|
//检索废品信息
|
|
private MutableLiveData<GarbageWasteResponse> searchList = new MutableLiveData<>();
|
|
|
|
MutableLiveData<GarbageWasteResponse> getDefaultList() {
|
|
return defaultList;
|
|
}
|
|
|
|
MutableLiveData<GarbageWasteResponse> getSearchList() {
|
|
return searchList;
|
|
}
|
|
|
|
@Override
|
|
protected GarbageWasteRequest getRequest() {
|
|
return GarbageWasteRequest.getInstance();
|
|
}
|
|
|
|
//检索默认废品请求状态
|
|
void searchDefault() {
|
|
getRequest().searchDefault(defaultList);
|
|
}
|
|
|
|
//检索废品请求状态
|
|
@Override
|
|
public void search(String content, Bundle data) {
|
|
getRequest().search(searchList, content);
|
|
}
|
|
}
|
|
|