|
|
@@ -15,12 +15,16 @@ import android.widget.GridView;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
+import com.sheep.gamegroup.model.entity.RecyleObj;
|
|
|
+import com.sheep.gamegroup.model.entity.RecyleType;
|
|
|
import com.sheep.gamegroup.model.entity.SearchGameRecord;
|
|
|
import com.sheep.gamegroup.model.entity.TaskEty;
|
|
|
import com.sheep.gamegroup.model.entity.TaskReleaseEty;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
+import com.sheep.gamegroup.util.CommonUtil;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.ListUtil;
|
|
|
import com.sheep.gamegroup.util.MyDbManager;
|
|
|
@@ -40,6 +44,7 @@ import java.util.List;
|
|
|
import butterknife.BindView;
|
|
|
import butterknife.OnClick;
|
|
|
import rx.android.schedulers.AndroidSchedulers;
|
|
|
+import rx.functions.Action1;
|
|
|
import rx.schedulers.Schedulers;
|
|
|
|
|
|
import static com.sheep.gamegroup.util.UMConfigUtils.Event.SEARCH_GAME_COMMIT;
|
|
|
@@ -271,28 +276,26 @@ public class ActSearchGame extends BaseActivity {
|
|
|
Jump2View.getInstance().goWeb(activity, inputText, "测试内部H5");
|
|
|
return;
|
|
|
}
|
|
|
- //执行搜索
|
|
|
- SheepApp.getInstance().getNetComponent().getApiService()
|
|
|
- .releaseTask(1, 9,
|
|
|
- SheepApp.getInstance().getConnectAddress().getPlatForm(), 1,
|
|
|
- 0, 0,
|
|
|
- "1002,1003,1004", 3, inputText)
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
- @Override
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
- List<TaskReleaseEty> newList = baseMessage.getDatas(TaskReleaseEty.class);
|
|
|
- list.clear();
|
|
|
- ListUtil.addAll(list, newList);
|
|
|
- notifyDataSetChanged();
|
|
|
- }
|
|
|
|
|
|
+ CommonUtil.getInstance()
|
|
|
+ .gameTask(activity, "1002,1003,1004", inputText, new Action1<BaseMessage>() {
|
|
|
@Override
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
- G.showToast("暂无游戏");
|
|
|
- list.clear();
|
|
|
- notifyDataSetChanged();
|
|
|
+ public void call(BaseMessage baseMessage) {
|
|
|
+ try {
|
|
|
+ if(baseMessage == null){
|
|
|
+
|
|
|
+ G.showToast("暂无游戏");
|
|
|
+ list.clear();
|
|
|
+ notifyDataSetChanged();
|
|
|
+ }else {
|
|
|
+ List<TaskReleaseEty> newList = baseMessage.getDatas(TaskReleaseEty.class);
|
|
|
+ list.clear();
|
|
|
+ ListUtil.addAll(list, newList);
|
|
|
+ notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|