|
|
@@ -17,15 +17,13 @@ import com.arialyy.aria.core.download.DownloadTask;
|
|
|
import com.kfzs.android.view.tag.FlowLayout;
|
|
|
import com.kfzs.android.view.tag.TagAdapter;
|
|
|
import com.kfzs.android.view.tag.TagFlowLayout;
|
|
|
-import com.sheep.gamegroup.util.DownloadUtil;
|
|
|
import com.sheep.gamegroup.model.api.ApiService;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.FindApp;
|
|
|
import com.sheep.gamegroup.model.entity.FindItem;
|
|
|
import com.sheep.gamegroup.model.entity.FindTag;
|
|
|
-import com.sheep.gamegroup.model.entity.HomeListEntity;
|
|
|
-import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
+import com.sheep.gamegroup.util.DownloadUtil;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.ListUtil;
|
|
|
import com.sheep.gamegroup.util.ViewHolder;
|
|
|
@@ -33,7 +31,6 @@ import com.sheep.gamegroup.util.ViewUtil;
|
|
|
import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
-import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
|
|
|
|
|
|
import org.afinal.simplecache.ApiKey;
|
|
|
@@ -45,12 +42,9 @@ import java.util.Locale;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import rx.Observable;
|
|
|
-import rx.android.schedulers.AndroidSchedulers;
|
|
|
-import rx.schedulers.Schedulers;
|
|
|
|
|
|
import static android.content.Intent.ACTION_PACKAGE_ADDED;
|
|
|
import static android.content.Intent.ACTION_PACKAGE_REMOVED;
|
|
|
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.FIND_ITEM;
|
|
|
|
|
|
/**
|
|
|
* Created by realicing on 2018/9/7.
|
|
|
@@ -166,81 +160,7 @@ public class FgtFindChild extends BaseListFragment2<FindItem> {
|
|
|
*/
|
|
|
private void onClickItem(FindItem item) {
|
|
|
if(item != null){
|
|
|
- switch (item.getType()){//类型 1:游戏 2:咨询 3:转跳 4:任务 5:栏目
|
|
|
- case 1:
|
|
|
- Jump2View.getInstance().goFindGame(activity, item);
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- Jump2View.getInstance().goFindInformation(activity, item);
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- openLink(item);
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- Jump2View.getInstance().goTaskDetailView(activity, item.getRelease_task_id());
|
|
|
- break;
|
|
|
- case 5:
|
|
|
- openHomeListItem(item);
|
|
|
- break;
|
|
|
- }
|
|
|
- FIND_ITEM.onEvent("find_id", item.getId());
|
|
|
- SheepApp.getInstance().getNetComponent().getApiService().getFindItemAddClicks(item.getId())
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
- @Override
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 打开一个homelist项
|
|
|
- * @param item
|
|
|
- */
|
|
|
- private void openHomeListItem(FindItem item) {
|
|
|
- SheepApp.getInstance().getNetComponent().getApiService().getHomeListItem(item.getHome_list_id())
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
- @Override
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
- HomeListEntity homeListEntity = baseMessage.getData(HomeListEntity.class);
|
|
|
- if(homeListEntity == null){
|
|
|
- G.showToast(R.string.error_data);
|
|
|
- return;
|
|
|
- }
|
|
|
- CommonUtil.getInstance().goWhere(activity, homeListEntity, "发现");
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
- G.showToast(baseMessage);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 打开一个链接
|
|
|
- * @param item
|
|
|
- */
|
|
|
- private void openLink(FindItem item) {
|
|
|
- if(TextUtils.isEmpty(item.getUrl())){
|
|
|
- G.showToast(R.string.error_link);
|
|
|
- return;
|
|
|
- }
|
|
|
- switch (item.getIs_in_url()){//是否外部链接 1:是 0:不是
|
|
|
- case 1:
|
|
|
- Jump2View.getInstance().goWeb(activity, item.getUrl());
|
|
|
- break;
|
|
|
- default:
|
|
|
- Jump2View.getInstance().goWeb(activity, item.getUrl(), item.getTitle());
|
|
|
- break;
|
|
|
+ Jump2View.getInstance().goFindItem(activity, item);
|
|
|
}
|
|
|
}
|
|
|
|