zengjiebin лет назад: 7
Родитель
Сommit
ae146017c2
19 измененных файлов с 445 добавлено и 12 удалено
  1. 4 0
      app/src/main/AndroidManifest.xml
  2. 1 1
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  3. 7 1
      app/src/main/java/com/sheep/gamegroup/model/entity/GameEntity.java
  4. 1 1
      app/src/main/java/com/sheep/gamegroup/module/game/activity/ActGameCenterType.java
  5. 1 1
      app/src/main/java/com/sheep/gamegroup/module/game/activity/ActGameRank.java
  6. 241 0
      app/src/main/java/com/sheep/gamegroup/module/game/activity/ActSearchGameGroup.java
  7. 70 0
      app/src/main/java/com/sheep/gamegroup/module/game/adapter/AdpSearchResp.java
  8. 2 1
      app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtDownloadManager.java
  9. 1 1
      app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtGameCenter.java
  10. 2 0
      app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtPlayGame.java
  11. 66 0
      app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtSearchGameGroup.java
  12. 8 1
      app/src/main/java/com/sheep/gamegroup/module/game/model/GameCenterType.java
  13. 15 0
      app/src/main/java/com/sheep/gamegroup/module/game/model/SearchResp.java
  14. 12 3
      app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java
  15. 9 0
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  16. 1 1
      app/src/main/java/com/sheep/gamegroup/view/adapter/PlayGameItemAdapter.java
  17. 1 1
      app/src/main/java/com/sheep/gamegroup/view/adapter/PlayGameListAdapter.java
  18. 2 0
      app/src/main/java/org/afinal/simplecache/ApiKey.java
  19. 1 0
      app/src/main/res/values/strings.xml

+ 4 - 0
app/src/main/AndroidManifest.xml

@@ -951,6 +951,10 @@
             android:name="com.sheep.gamegroup.module.game.activity.ActGameRank"
             android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
+        <activity
+            android:name="com.sheep.gamegroup.module.game.activity.ActSearchGameGroup"
+            android:theme="@style/AppActionTheme"
+            android:screenOrientation="portrait" />
     </application>
 
 </manifest>

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -1676,7 +1676,7 @@ public interface ApiService {
      * name * string (query) 搜索关键字
      * 返回 SearchResp 列表
      */
-    @GET("app/game_group/search")
+    @GET(ApiKey.getGameGroupSearch)
     Observable<BaseMessage> getGameGroupSearch(@Query("name") String name);
     /**
      * 获取游戏组列表

+ 7 - 1
app/src/main/java/com/sheep/gamegroup/model/entity/GameEntity.java

@@ -3,6 +3,7 @@ package com.sheep.gamegroup.model.entity;
 import android.text.TextUtils;
 
 import com.kfzs.duanduan.utils.NumberFormatUtils;
+import com.sheep.gamegroup.absBase.ISearchRecord;
 import com.sheep.gamegroup.helper.DownloadHelper;
 import com.sheep.gamegroup.model.api.IDownload;
 
@@ -13,7 +14,7 @@ import java.util.List;
  * Created by ljy on 2018/9/4.
  */
 
-public class GameEntity implements Serializable {
+public class GameEntity implements Serializable, ISearchRecord {
     private int accepted_task_id;//integer($int64)领取福利时使用
 
     private Applications app;
@@ -226,4 +227,9 @@ public class GameEntity implements Serializable {
         }
         return "";
     }
+
+    @Override
+    public String getInput() {
+        return getDownload() != null ? getDownload().getTask_name() : "";
+    }
 }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/module/game/activity/ActGameCenterType.java

@@ -30,7 +30,7 @@ public class ActGameCenterType extends BaseContainerActivity {
                 .setShowOrHide(this, true)
                 .setTitle(this, gameCenterType.getName())
                 .setRightImgBotton(this, R.drawable.index_download, view -> Jump2View.getInstance().goActDownloadManager(this))
-                .setRightSecondBtn(this, R.drawable.search_black_img, view -> Jump2View.getInstance().goAppSearch(this, null))
+                .setRightSecondBtn(this, R.drawable.search_black_img, view -> Jump2View.getInstance().goActpSearchGameGroup(this))
                 .setTitleFinish(this);
     }
 

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/module/game/activity/ActGameRank.java

@@ -26,7 +26,7 @@ public class ActGameRank extends BaseContainerActivity {
                 .setShowOrHide(this, true)
                 .setTitle(this, gameCenterType.getName())
                 .setRightImgBotton(this, R.drawable.index_download, view -> Jump2View.getInstance().goActDownloadManager(this))
-                .setRightSecondBtn(this, R.drawable.search_black_img, view -> Jump2View.getInstance().goAppSearch(this, null))
+                .setRightSecondBtn(this, R.drawable.search_black_img, view -> Jump2View.getInstance().goActpSearchGameGroup(this))
                 .setTitleFinish(this);
     }
 

+ 241 - 0
app/src/main/java/com/sheep/gamegroup/module/game/activity/ActSearchGameGroup.java

@@ -0,0 +1,241 @@
+package com.sheep.gamegroup.module.game.activity;
+
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
+import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
+import com.sheep.gamegroup.absBase.BaseContainerActivity;
+import com.sheep.gamegroup.absBase.IHomePageSearch;
+import com.sheep.gamegroup.absBase.ISearchRecord;
+import com.sheep.gamegroup.greendao.DDProviderHelper;
+import com.sheep.gamegroup.greendao.download.SearchRecord;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.GameEntity;
+import com.sheep.gamegroup.model.entity.TitleInfoList;
+import com.sheep.gamegroup.model.entity.TopSearchStatistics;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.module.game.fragment.FgtSearchGameGroup;
+import com.sheep.gamegroup.util.ApiUtil;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.adapter.AdpTitleInfoList;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import org.afinal.simplecache.ApiKey;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import butterknife.BindView;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
+/**
+ * Created by realicing on 2019/1/21.
+ * realicing@sina.com
+ * 小绵羊3.4.10新增 -- 搜索游戏组
+ */
+public class ActSearchGameGroup extends BaseContainerActivity {
+    @BindView(R.id.search_app_list)
+    RecyclerView recyclerView;
+    @BindView(R.id.frame_container)
+    View frame_container;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_search_app_or_task;
+    }
+
+    private FgtSearchGameGroup fgtSearchGameGroup;
+
+    @Override
+    public void initView() {
+        super.initView();
+        if (fgtSearchGameGroup == null && fragment instanceof FgtSearchGameGroup)
+            fgtSearchGameGroup = (FgtSearchGameGroup) fragment;
+    }
+
+    @Override
+    protected Fragment initFragment() {
+        return new FgtSearchGameGroup();
+    }
+
+    private List<TitleInfoList> titleInfoListList = new ArrayList<>();
+
+    @Override
+    public void initListener() {
+        TitleBarUtils.getInstance()
+                .setShowOrHide(this, true)
+                .setTitleFinish(this)
+                .setSearchBox(this, getString(R.string.search_game_name),
+                        (v, actionId, event) -> {
+                            if (actionId == EditorInfo.IME_ACTION_SEARCH) {
+                                toSearchApp();
+                            }
+                            return false;
+                        },
+                        (text) -> {
+                            frame_container.removeCallbacks(autoSearchRunnable);
+                            if (text.isEmpty() && !isTitleInfoListEmpty()) {//输入框内容为空且有搜索记录时显示搜索记录
+                                recyclerView.setVisibility(View.VISIBLE);
+                                frame_container.setVisibility(View.INVISIBLE);
+                            } else {
+                                long delay = textByClick ? 1L : 1000L;
+                                frame_container.postDelayed(autoSearchRunnable, delay);//1秒后自动搜索
+                            }
+                        })
+                .setRightBtn(this, "搜索", 0,
+                        v -> toSearchApp());
+
+        recyclerView.setHasFixedSize(true);
+        recyclerView.setNestedScrollingEnabled(false);
+        recyclerView.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
+        AdpTitleInfoList adpTitleInfoList = new AdpTitleInfoList(titleInfoListList);
+        adpTitleInfoList.bindToRecyclerView(recyclerView);
+    }
+
+    private Runnable autoSearchRunnable = this::toSearchApp;
+
+    public static final int MAX_SHOW_SEARCH_RECORD_COUNT = 10;//最多展示的搜索历史的个数
+    public static final int SORT_TOP_SEARCH = 1;//热门推荐 的排序
+    public static final int SORT_SEARCH_RECORD = 2;//搜索历史 的排序
+    List<ISearchRecord> topSearchList = new ArrayList<>();
+
+    public static final String TOP_SEARCH_NAME = "热门搜索";
+    @Override
+    public void initData() {
+        //尝试获取缓存数据
+        List<GameEntity> newList = DataUtil.getInstance().getCacheList(ApiKey.getFindUserLike, GameEntity.class);
+        if (!ListUtil.isEmpty(newList)) {
+            topSearchList.addAll(newList);
+            addListData(TOP_SEARCH_NAME, topSearchList, SORT_TOP_SEARCH);
+        }
+
+        //初始化搜索历史
+        List<SearchRecord> newSgrList = DDProviderHelper.getInstance().getSearchRecordList(MAX_SHOW_SEARCH_RECORD_COUNT);
+        if (!ListUtil.isEmpty(newSgrList)) {
+            searchRecordList.addAll(newSgrList);
+            addListData("搜索历史", searchRecordList, SORT_SEARCH_RECORD);
+        }
+        notifyDataSetChangedTitleInfoList();
+        SheepApp.getInstance().getNetComponent().getApiService().getFindUserLike()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.top_search_statistics);
+                        if (isNewData) {
+                            List<TopSearchStatistics> newList = baseMessage.getDatas(TopSearchStatistics.class);
+                            topSearchList.clear();
+                            topSearchList.addAll(newList);
+                            if (ListUtil.getItem(titleInfoListList, titleInfoList -> titleInfoList.getSort() == SORT_TOP_SEARCH) == null) {
+                                addListData(TOP_SEARCH_NAME, topSearchList, SORT_TOP_SEARCH);
+                            }
+                            notifyDataSetChangedTitleInfoList();
+                        }
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                    }
+                });
+
+    }
+
+    //排序与刷新
+    private void notifyDataSetChangedTitleInfoList() {
+        //排序
+        Collections.sort(titleInfoListList);
+        //刷新
+        ViewUtil.notifyDataSetChanged(recyclerView);
+        if (isTitleInfoListEmpty()) {
+            frame_container.setVisibility(View.VISIBLE);
+            recyclerView.setVisibility(View.INVISIBLE);
+        } else {
+            frame_container.setVisibility(View.INVISIBLE);
+            recyclerView.setVisibility(View.VISIBLE);
+        }
+    }
+
+    //添加列表数据到总的列表中
+    private void addListData(String title, final List<ISearchRecord> list, int sort) {
+        titleInfoListList.add(new TitleInfoList(title, new RecyclerViewAdapter<ISearchRecord>(SheepApp.getInstance(), R.layout.item_i_serach_record, list) {
+            @Override
+            public void convert(ViewHolder viewHolder, final ISearchRecord item, int position) {
+                View view = viewHolder.itemView;
+                TextView item_search_record_name = view.findViewById(R.id.item_search_record_name);
+                ImageView item_search_record_x = view.findViewById(R.id.item_search_record_x);
+                ViewUtil.setText(item_search_record_name, item.getInput());
+                if (item instanceof SearchRecord) {
+                    //点击一条搜索历史后面的xx
+                    item_search_record_x.setOnClickListener(view12 -> {
+                        list.remove(item);
+                        ViewUtil.notifyDataSetChanged(recyclerView);
+                        DDProviderHelper.getInstance().deleteSearchRecord((SearchRecord) item);
+                        if (isTitleInfoListEmpty()) {
+                            frame_container.setVisibility(View.VISIBLE);
+                            recyclerView.setVisibility(View.INVISIBLE);
+                        }
+                    });
+                } else {
+                    ViewUtil.setVisibility(item_search_record_x, false);
+                }
+                //点击一条搜索历史
+                view.setOnClickListener(view1 -> {
+                    textByClick = true;
+                    TitleBarUtils.getInstance().setSearchText(ActSearchGameGroup.this, item.getInput());
+                    if (item instanceof IHomePageSearch)
+                        ApiUtil.postTopSearchStatisticsClickTopSearch((IHomePageSearch) item);
+                });
+            }
+        }).setSort(sort));
+    }
+    private boolean textByClick = false;//通过点击搜索历史或者热门推荐来搜索,应该立即执行
+
+    //搜索历史中没有数据且没有获取到服务器的热门搜索列表
+    private boolean isTitleInfoListEmpty() {
+        return searchRecordList.isEmpty() && topSearchList.isEmpty();
+    }
+
+    List<ISearchRecord> searchRecordList = new ArrayList<>();
+
+    //尝试搜索游戏
+    private void toSearchApp() {
+        textByClick = false;//重置
+        if(fgtSearchGameGroup == null){
+            return;
+        }
+        if(fgtSearchGameGroup.isLoadingData()){
+            return;
+        }
+        recyclerView.setVisibility(View.INVISIBLE);
+        frame_container.setVisibility(View.VISIBLE);
+        String inputText = TitleBarUtils.getInstance().getSearchText(this);
+        if (!TextUtils.isEmpty(inputText)) {
+            //保存搜索到数据库
+            SearchRecord searchRecord = new SearchRecord();
+            searchRecord.setInput(inputText);
+            searchRecord.setLast_time(System.currentTimeMillis());
+            searchRecord.setCount(1);
+            DDProviderHelper.getInstance().addOrUpdateSearchRecord(searchRecord, item -> {
+                if(item == null) {
+                    searchRecordList.add(searchRecord);
+                    ViewUtil.notifyDataSetChanged(recyclerView);
+                }
+            });
+        }
+        fgtSearchGameGroup.toSearch(inputText);
+    }
+}

+ 70 - 0
app/src/main/java/com/sheep/gamegroup/module/game/adapter/AdpSearchResp.java

@@ -0,0 +1,70 @@
+package com.sheep.gamegroup.module.game.adapter;
+
+import android.app.Activity;
+import android.content.Context;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.greendao.download.DownLoadInfo;
+import com.sheep.gamegroup.model.api.IDownload;
+import com.sheep.gamegroup.model.entity.Applications;
+import com.sheep.gamegroup.model.entity.GameEntity;
+import com.sheep.gamegroup.module.game.model.SearchResp;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.DownloadUtil;
+import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.TestUtil;
+import com.sheep.gamegroup.util.ViewHolder;
+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 java.util.List;
+/**
+ * Created by realicing on 2019/1/21.
+ * realicing@sina.com
+ * 小绵羊3.4.10新增 -- 搜索结果展示
+ */
+public class AdpSearchResp extends AdbCommonRecycler<SearchResp>{
+    public AdpSearchResp(Context context, List<SearchResp> list) {
+        super(context, list);
+    }
+
+    @Override
+    public int getViewIdByType(int type) {
+        return R.layout.play_game_vertical_list_item;
+    }
+
+    @Override
+    public void convert(ViewHolder holder, final SearchResp item) {
+        Applications download = item.getDownload();
+        if(download == null)
+            return;
+        holder.itemView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+            }
+        });
+        View item_download_welfare_line = holder.itemView.findViewById(R.id.line_tv);
+        TextView detail_task_tv_center = holder.itemView.findViewById(R.id.detail_task_tv_center);
+        TextView item_name_tv = holder.itemView.findViewById(R.id.item_name_tv);
+        TextView item_date_tv = holder.itemView.findViewById(R.id.item_date_tv);
+        LinearLayout ll_game_tag = holder.itemView.findViewById(R.id.ll_game_tag);
+
+        ViewUtil.setText(item_name_tv, download.getTask_name());
+        ViewUtil.setText(item_date_tv, download.getPackage_size()+"M");
+        GlideImageLoader.setGameImage(holder.itemView.findViewById(R.id.item_icon_iv), download.getIcon());
+        ViewUtil.setText(detail_task_tv_center, "查看详情");
+
+        ViewUtil.setVisibility(item_download_welfare_line, holder.getAdapterPosition() + 1 == getItemCount() ? View.GONE : View.VISIBLE);
+
+        //tag 标签绘制
+        CommonUtil.getInstance().paintLineaLayout(download, ll_game_tag, 4,R.color.txt_bule, R.drawable.shape_blue_stroke_rectangle_no_lb);
+
+    }
+}

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtDownloadManager.java

@@ -32,6 +32,7 @@ import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
 
+import org.afinal.simplecache.ApiKey;
 import org.greenrobot.eventbus.Subscribe;
 
 import java.text.DecimalFormat;
@@ -93,7 +94,7 @@ public class FgtDownloadManager extends BaseListFragment6<String> {
 
             @Override
             public String getKey(int page, int per_page) {
-                return null;
+                return ApiKey.getFindUserLike;
             }
 
             @Override

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtGameCenter.java

@@ -100,7 +100,7 @@ public class FgtGameCenter extends BaseFragment {
 
     @OnClick(R.id.search_btn)
     public void doSearch(View v) {
-        Jump2View.getInstance().goAppSearch(getActivity(), null);
+        Jump2View.getInstance().goActpSearchGameGroup(getActivity());
     }
 
     @OnClick(R.id.my_walfare_btn)

+ 2 - 0
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtPlayGame.java

@@ -80,6 +80,7 @@ public class FgtPlayGame extends BaseFragment {
     //绵羊新游、免费道具、绵羊推荐、排行榜
     private List<GameCenterType> gameCenterList = new ArrayList<>();
     public static final String[] GAME_CENTER_TYPE_NAME = {"绵羊新游", "免费道具", "绵羊推荐", "排行榜"};
+    public static final String[] GAME_CENTER_TYPE_ICON_NAME = {"myxy", "免费道具", "绵羊推荐", "排行榜"};
     public static final int[] GAME_CENTER_TYPE_ID = {1, 2, 3, -1};//1:绵羊新游 2:绵羊推荐 3:免费道具
     //预下载和tag列表的数据
     private List<ListTypeList<GameEntity, GameListType>> gameEntityListx = new ArrayList<>();
@@ -105,6 +106,7 @@ public class FgtPlayGame extends BaseFragment {
             GameCenterType item = new GameCenterType();
             item.setName(name);
             item.setId(GAME_CENTER_TYPE_ID[i]);
+            item.setIconName(GAME_CENTER_TYPE_ICON_NAME[i]);
             gameCenterList.add(item);
             i++;
         }

+ 66 - 0
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtSearchGameGroup.java

@@ -0,0 +1,66 @@
+package com.sheep.gamegroup.module.game.fragment;
+
+import android.support.v7.widget.RecyclerView;
+
+import com.sheep.gamegroup.absBase.ISearch;
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.module.game.adapter.AdpSearchResp;
+import com.sheep.gamegroup.module.game.model.SearchResp;
+import com.sheep.gamegroup.view.fragment.BaseListFragment3;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+
+import org.afinal.simplecache.ApiKey;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.Locale;
+
+import io.reactivex.Observable;
+
+/**
+ * Created by realicing on 2019/1/21.
+ * realicing@sina.com
+ * 小绵羊3.4.10新增 -- 搜索游戏组
+ */
+public class FgtSearchGameGroup extends BaseListFragment3<SearchResp> implements ISearch{
+
+    @Override
+    public int refreshDataType() {
+        return -1;
+    }
+
+    private String search_content;
+
+    @Override
+    protected RecyclerView.Adapter getAdapter() {
+        return new AdpSearchResp(SheepApp.getInstance(), list);
+    }
+
+    @Override
+    protected String getKey(int page, int per_page) {
+        String sc = search_content;
+        try {
+            sc = URLEncoder.encode(search_content,"utf-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        return String.format(Locale.CHINA, "%s?name=%s", ApiKey.getGameGroupSearch, sc);
+    }
+
+    @Override
+    protected Observable<BaseMessage> getApi(ApiService apiService) {
+        return apiService.getGameGroupSearch(search_content);
+    }
+
+    @Override
+    protected Class<SearchResp> getTClass() {
+        return SearchResp.class;
+    }
+
+    @Override
+    public void toSearch(String name) {
+        this.search_content = name;
+        refreshData();
+    }
+}

+ 8 - 1
app/src/main/java/com/sheep/gamegroup/module/game/model/GameCenterType.java

@@ -9,6 +9,7 @@ import com.sheep.gamegroup.util.ViewUtil;
  */
 public class GameCenterType {
     private String name;
+    private String iconName;
     private int id;
 
     public String getName() {
@@ -27,9 +28,15 @@ public class GameCenterType {
         this.id = id;
     }
 
+    public String getIconName() {
+        return iconName;
+    }
 
+    public void setIconName(String iconName) {
+        this.iconName = iconName;
+    }
 
     public String getIconUrl() {
-        return ViewUtil.getNetImgByName(name);
+        return ViewUtil.getNetImgByName(iconName);
     }
 }

+ 15 - 0
app/src/main/java/com/sheep/gamegroup/module/game/model/SearchResp.java

@@ -1,5 +1,6 @@
 package com.sheep.gamegroup.module.game.model;
 
+import com.sheep.gamegroup.model.api.IDownload;
 import com.sheep.gamegroup.model.entity.Applications;
 
 /**
@@ -40,4 +41,18 @@ public class SearchResp {
     public void setType(int type) {
         this.type = type;
     }
+
+
+
+
+
+    public Applications getDownload() {
+        if(applications != null){
+            return applications;
+        }
+        if(game_group != null){
+            return game_group.getApplications();
+        }
+        return null;
+    }
 }

+ 12 - 3
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -2288,8 +2288,17 @@ public class CommonUtil {
      *
      * @param i -1:不限制 否者限制tag 个数
      */
-    public void paintLineaLayout(Context activity, GameEntity gameEntity, LinearLayout ll_game_tag, int i, int color, int drawable) {
-        List<GameListTag> gameListTagList = gameEntity.getApp().getTags();
+    public void paintLineaLayout( GameEntity gameEntity, LinearLayout ll_game_tag, int i, int color, int drawable) {
+        paintLineaLayout(gameEntity.getApp(),ll_game_tag, i, color, drawable);
+    }
+    /**
+     * tag 标签绘制
+     * R.drawable.shape_blue_stroke_rectangle_no_lb
+     *
+     * @param i -1:不限制 否者限制tag 个数
+     */
+    public void paintLineaLayout(Applications app, LinearLayout ll_game_tag, int i, int color, int drawable) {
+        List<GameListTag> gameListTagList = app.getTags();
         if (!ListUtil.isEmpty(gameListTagList)) {
             ll_game_tag.removeAllViews();
             for (int j = 0; j < gameListTagList.size(); j++) {
@@ -2306,7 +2315,7 @@ public class CommonUtil {
                             break;
                     }
                     if (!TextUtils.isEmpty(tag)) {
-                        ll_game_tag.addView(ViewUtil.newInstance().paintView(activity, tag, color, drawable));
+                        ll_game_tag.addView(ViewUtil.newInstance().paintView(SheepApp.getInstance(), tag, color, drawable));
                     }
                 } else {
                     return;

+ 9 - 0
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -57,6 +57,7 @@ import com.sheep.gamegroup.module.game.activity.ActDownloadManager;
 import com.sheep.gamegroup.module.game.activity.ActGameCenterType;
 import com.sheep.gamegroup.module.game.activity.ActGameGroupMore;
 import com.sheep.gamegroup.module.game.activity.ActGameRank;
+import com.sheep.gamegroup.module.game.activity.ActSearchGameGroup;
 import com.sheep.gamegroup.module.game.model.GameCenterType;
 import com.sheep.gamegroup.module.login.ChangePasswordAct;
 import com.sheep.gamegroup.module.login.LoginAct;
@@ -2757,4 +2758,12 @@ public class Jump2View {
         activity.startActivity(new Intent(activity, ActDownloadManager.class));
         UMConfigUtils.onEvent(UMConfigUtils.Event.GAME_DOWNLOAD_MANAGER);
     }
+    /**
+     * 新的游戏搜索
+     */
+    public void goActpSearchGameGroup(Activity activity) {
+        Intent intent = new Intent(activity, ActSearchGameGroup.class);
+        activity.startActivity(intent);
+        SEARCH_GAME.onEvent();
+    }
 }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/adapter/PlayGameItemAdapter.java

@@ -74,7 +74,7 @@ public class PlayGameItemAdapter extends AdbCommonRecycler<GameEntity>{
         item_download_welfare_line.setVisibility(holder.getAdapterPosition() + 1 == getItemCount() ? View.GONE : View.VISIBLE);
 
         //tag 标签绘制
-        CommonUtil.getInstance().paintLineaLayout(activity, gameEntity, ll_game_tag, 4,R.color.txt_bule, R.drawable.shape_blue_stroke_rectangle_no_lb);
+        CommonUtil.getInstance().paintLineaLayout(gameEntity, ll_game_tag, 4,R.color.txt_bule, R.drawable.shape_blue_stroke_rectangle_no_lb);
 
 
     }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/adapter/PlayGameListAdapter.java

@@ -65,7 +65,7 @@ public class PlayGameListAdapter extends AdbCommonRecycler<ListTypeList<GameEnti
                 item_download_welfare_line.setVisibility(holder.getAdapterPosition() + 1 == getItemCount() ? View.GONE : View.VISIBLE);
 
                 //tag 标签绘制
-                CommonUtil.getInstance().paintLineaLayout(context, gameEntity, ll_game_tag, 4,R.color.txt_bule, R.drawable.shape_blue_stroke_rectangle_no_lb);
+                CommonUtil.getInstance().paintLineaLayout(gameEntity, ll_game_tag, 4,R.color.txt_bule, R.drawable.shape_blue_stroke_rectangle_no_lb);
             }
         });
 

+ 2 - 0
app/src/main/java/org/afinal/simplecache/ApiKey.java

@@ -88,6 +88,8 @@ public class ApiKey {
     public static final String getFindRank = "app/find/rank";
     //获取 获取游戏组列表 3.4.10新增
     public static final String getGameGroup = "app/game_group";
+    //获取 搜索游戏组列表 3.4.10新增
+    public static final String getGameGroupSearch = "app/game_group/search";
 
     public static final String getPackageVersion(String package_name, String type, int version){
         return String.format(Locale.CHINA, "%s?package_name=%s&type=%s&version=%d", getPackageVersion, package_name, type, version);

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -161,6 +161,7 @@
     <string name="task_list">奖励列表</string>
     <string name="task_center">奖励中心</string>
     <string name="search_task_or_game_name">搜索奖励名称/游戏名称</string>
+    <string name="search_game_name">搜索游戏</string>
     <string name="smallsheep_checkin_task">小绵羊打卡奖励</string>
     <string name="checkin_task">签到奖励</string>
     <string name="recommend_task">推荐奖励</string>