Ver código fonte

添加游戏搜索功能,显示界面未完成

zengjiebin 7 anos atrás
pai
commit
fac5414754
68 arquivos alterados com 1425 adições e 375 exclusões
  1. 1 1
      app/build.gradle
  2. 27 0
      app/src/main/java/com/sheep/gamegroup/absBase/IHomePageSearch.java
  3. 9 0
      app/src/main/java/com/sheep/gamegroup/absBase/ISearch.java
  4. 9 0
      app/src/main/java/com/sheep/gamegroup/absBase/ISearchRecord.java
  5. 82 2
      app/src/main/java/com/sheep/gamegroup/greendao/DDProviderHelper.java
  6. 5 2
      app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java
  7. 14 0
      app/src/main/java/com/sheep/gamegroup/greendao/download/DaoSession.java
  8. 81 0
      app/src/main/java/com/sheep/gamegroup/greendao/download/SearchRecord.java
  9. 145 0
      app/src/main/java/com/sheep/gamegroup/greendao/download/SearchRecordDao.java
  10. 6 6
      app/src/main/java/com/sheep/gamegroup/helper/FindAppHelper.java
  11. 6 6
      app/src/main/java/com/sheep/gamegroup/helper/TaskHelper.java
  12. 34 8
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  13. 1 1
      app/src/main/java/com/sheep/gamegroup/model/entity/GameApp.java
  14. 3 3
      app/src/main/java/com/sheep/gamegroup/model/entity/Article.java
  15. 6 6
      app/src/main/java/com/sheep/gamegroup/model/entity/CommendApp.java
  16. 3 3
      app/src/main/java/com/sheep/gamegroup/model/entity/CreditCardProgressQuery.java
  17. 3 3
      app/src/main/java/com/sheep/gamegroup/model/entity/FindAppReservation.java
  18. 6 6
      app/src/main/java/com/sheep/gamegroup/model/entity/GameEntity.java
  19. 3 3
      app/src/main/java/com/sheep/gamegroup/model/entity/GiftBagApp.java
  20. 56 0
      app/src/main/java/com/sheep/gamegroup/model/entity/HomePageSearch.java
  21. 6 6
      app/src/main/java/com/sheep/gamegroup/model/entity/LatelyGame.java
  22. 2 2
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskReleaseEty.java
  23. 3 3
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskAcceptedEty.java
  24. 99 0
      app/src/main/java/com/sheep/gamegroup/model/entity/TitleInfoList.java
  25. 131 0
      app/src/main/java/com/sheep/gamegroup/model/entity/TopSearchStatistics.java
  26. 14 3
      app/src/main/java/com/sheep/gamegroup/util/ApiJSONUtil.java
  27. 18 0
      app/src/main/java/com/sheep/gamegroup/util/ApiUtil.java
  28. 11 11
      app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java
  29. 20 2
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  30. 5 5
      app/src/main/java/com/sheep/gamegroup/view/activity/ActArticle.java
  31. 2 2
      app/src/main/java/com/sheep/gamegroup/view/activity/ActPlayGameDetail.java
  32. 6 6
      app/src/main/java/com/sheep/gamegroup/view/activity/ActReservation.java
  33. 149 105
      app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchAppOrTask.java
  34. 9 9
      app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchGame.java
  35. 4 4
      app/src/main/java/com/sheep/gamegroup/view/activity/ActUserAppHome.java
  36. 4 4
      app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAct.java
  37. 3 3
      app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailCreditCardAct.java
  38. 4 5
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGcGameAppList.java
  39. 43 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpTitleInfoList.java
  40. 31 12
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpUserCommentReply.java
  41. 2 2
      app/src/main/java/com/sheep/gamegroup/view/adapter/CreditCardProgressQueryAdp.java
  42. 4 4
      app/src/main/java/com/sheep/gamegroup/view/adapter/CreditCardTaskAdp.java
  43. 2 2
      app/src/main/java/com/sheep/gamegroup/view/adapter/GiftCenterAdapter.java
  44. 26 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/HomePageSearchAdapter.java
  45. 3 3
      app/src/main/java/com/sheep/gamegroup/view/adapter/TaskdetailSonListviewAdp.java
  46. 9 9
      app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java
  47. 5 5
      app/src/main/java/com/sheep/gamegroup/view/adapter/WelfareAdapter.java
  48. 4 4
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtCreditCardTaskList.java
  49. 4 4
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtDownloadWelfareList.java
  50. 7 7
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtFindChild.java
  51. 3 3
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGameAgencyRecharge.java
  52. 2 2
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGcGameAppComment.java
  53. 3 4
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGcGameAppDetail.java
  54. 9 16
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtHomeTaskReleaseList.java
  55. 4 4
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPlaGameGift.java
  56. 71 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSearchAppOrTask.java
  57. 4 4
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java
  58. 9 12
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtTryMakeMoney.java
  59. 24 5
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtUserCommentDetail.java
  60. 7 9
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWelfareCenter.java
  61. 2 2
      app/src/main/java/com/sheep/jiuyan/samllsheep/service/DownloadService.java
  62. 6 0
      app/src/main/java/org/afinal/simplecache/ApiKey.java
  63. 23 0
      app/src/main/res/layout/act_search_app_or_task.xml
  64. 61 40
      app/src/main/res/layout/include_input_comment_exp.xml
  65. 46 0
      app/src/main/res/layout/item_i_serach_record.xml
  66. 1 0
      app/src/main/res/layout/item_title_info_list.xml
  67. 19 2
      app/src/main/res/layout/item_user_comment_reply.xml
  68. 1 0
      app/src/main/res/values/strings.xml

+ 1 - 1
app/build.gradle

@@ -23,7 +23,7 @@ android {
         flavorDimensions "versionCode"
     }
     greendao {
-        schemaVersion 13
+        schemaVersion 14
         targetGenDir 'src/main/java'
     }
 //    compileOptions{

+ 27 - 0
app/src/main/java/com/sheep/gamegroup/absBase/IHomePageSearch.java

@@ -0,0 +1,27 @@
+package com.sheep.gamegroup.absBase;
+
+import android.support.annotation.IntDef;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Created by realicing on 2018/11/8.
+ * realicing@sina.com
+ * 搜索结果类型
+ */
+public interface IHomePageSearch {
+    //    link_type:	integer ($int64)
+// * 关联类型 1任务(release_task)2游戏(applications)
+    public static final int LINK_TYPE_RELEASE_TASK = 1;
+    public static final int LINK_TYPE_APPLICATIONS = 2;
+
+    @IntDef({LINK_TYPE_RELEASE_TASK, LINK_TYPE_APPLICATIONS})
+    @Retention(RetentionPolicy.SOURCE)
+    public @interface LINK_TYPE {
+
+    }
+    int getLink_id();
+
+    int getLink_type();
+}

+ 9 - 0
app/src/main/java/com/sheep/gamegroup/absBase/ISearch.java

@@ -0,0 +1,9 @@
+package com.sheep.gamegroup.absBase;
+
+/**
+ * Created by realicing on 2018/11/8.
+ * realicing@sina.com
+ */
+public interface ISearch {
+    void toSearch(String name);
+}

+ 9 - 0
app/src/main/java/com/sheep/gamegroup/absBase/ISearchRecord.java

@@ -0,0 +1,9 @@
+package com.sheep.gamegroup.absBase;
+
+/**
+ * Created by realicing on 2018/11/8.
+ * realicing@sina.com
+ */
+public interface ISearchRecord {
+    String getInput();
+}

+ 82 - 2
app/src/main/java/com/sheep/gamegroup/greendao/DDProviderHelper.java

@@ -14,6 +14,8 @@ import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
 import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
 import com.sheep.gamegroup.greendao.download.SdkLoginUser;
 import com.sheep.gamegroup.greendao.download.SdkLoginUserDao;
+import com.sheep.gamegroup.greendao.download.SearchRecord;
+import com.sheep.gamegroup.greendao.download.SearchRecordDao;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.DownloadUtil;
 import com.sheep.jiuyan.samllsheep.service.AutoCheckService;
@@ -523,8 +525,8 @@ public class DDProviderHelper {
     }
 
     /**
-     * 添加或更新记录
-     * 添加成功返回true
+     * 删除sdkLoginUser记录
+     * 删除成功返回true
      *
      * @param context
      * @param oldInfo
@@ -552,4 +554,82 @@ public class DDProviderHelper {
         }
         return false;
     }
+    /**
+     * 添加或更新搜索记录
+     * 添加成功返回true
+     *
+     * @param context
+     * @param newInfo
+     */
+    public boolean addOrUpdateSearchRecord(Context context, SearchRecord newInfo, Action1<SearchRecord> action1) {
+        SearchRecordDao infoDao = getDaossion(context).getSearchRecordDao();
+        SearchRecord lastInfo = infoDao
+                .queryBuilder()
+                .where(SearchRecordDao.Properties.Input.eq(newInfo.getInput()))
+                .build()
+                .unique();
+        try {
+            if (action1 != null)
+                action1.call(lastInfo);
+            if (lastInfo == null) {
+                newInfo.setFirst_time(newInfo.getLast_time());
+                infoDao.insert(newInfo);
+                return true;
+            } else {
+                newInfo.setId(lastInfo.getId());
+                newInfo.setFirst_time(lastInfo.getLast_time());
+                newInfo.setCount(lastInfo.getCount() + newInfo.getCount());
+                infoDao.update(newInfo);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
+    /**
+     * 获取搜索历史(根据搜索次数来排序)
+     *
+     * @param ctx
+     */
+    public List<SearchRecord> getSearchRecordList(Context ctx, int limit) {
+        return getDaossion(ctx)
+                .getSearchRecordDao()
+                .queryBuilder()
+                .limit(limit)
+                .orderAsc(SearchRecordDao.Properties.Count)
+                .build()
+                .list();
+    }
+
+    /**
+     * 删除搜索记录
+     * 删除成功返回true
+     *
+     * @param context
+     * @param oldInfo
+     */
+    public boolean deleteSearchRecord(Context context, SearchRecord oldInfo) {
+        if (oldInfo != null) {
+            SearchRecordDao loadInfoDao = getDaossion(context).getSearchRecordDao();
+            try {
+                loadInfoDao.delete(oldInfo);
+                return true;
+            } catch (Exception e) {
+                e.printStackTrace();
+                try {
+                    SearchRecord loadInfo = loadInfoDao.queryBuilder()
+                            .where(SearchRecordDao.Properties.Input.eq(oldInfo.getInput()))
+                            .build()
+                            .unique();
+                    if(loadInfo != null)
+                        loadInfoDao.delete(loadInfo);
+                    return true;
+                } catch (Exception e2) {
+                    e2.printStackTrace();
+                }
+                return false;
+            }
+        }
+        return false;
+    }
 }

+ 5 - 2
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java

@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 /**
- * Master of DAO (schema version 13): knows all DAOs.
+ * Master of DAO (schema version 14): knows all DAOs.
  */
 public class DaoMaster extends AbstractDaoMaster {
-    public static final int SCHEMA_VERSION = 13;
+    public static final int SCHEMA_VERSION = 14;
 
     /** Creates underlying database table using DAOs. */
     public static void createAllTables(Database db, boolean ifNotExists) {
@@ -27,6 +27,7 @@ public class DaoMaster extends AbstractDaoMaster {
         ProcessRecordDao.createTable(db, ifNotExists);
         ScreenShotRecordDao.createTable(db, ifNotExists);
         SdkLoginUserDao.createTable(db, ifNotExists);
+        SearchRecordDao.createTable(db, ifNotExists);
     }
 
     /** Drops underlying database table using DAOs. */
@@ -37,6 +38,7 @@ public class DaoMaster extends AbstractDaoMaster {
         ProcessRecordDao.dropTable(db, ifExists);
         ScreenShotRecordDao.dropTable(db, ifExists);
         SdkLoginUserDao.dropTable(db, ifExists);
+        SearchRecordDao.dropTable(db, ifExists);
     }
 
     /**
@@ -61,6 +63,7 @@ public class DaoMaster extends AbstractDaoMaster {
         registerDaoClass(ProcessRecordDao.class);
         registerDaoClass(ScreenShotRecordDao.class);
         registerDaoClass(SdkLoginUserDao.class);
+        registerDaoClass(SearchRecordDao.class);
     }
 
     public DaoSession newSession() {

+ 14 - 0
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoSession.java

@@ -14,6 +14,7 @@ import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.greendao.download.ProcessRecord;
 import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
 import com.sheep.gamegroup.greendao.download.SdkLoginUser;
+import com.sheep.gamegroup.greendao.download.SearchRecord;
 
 import com.sheep.gamegroup.greendao.download.AcceptTaskRecordDao;
 import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
@@ -21,6 +22,7 @@ import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
 import com.sheep.gamegroup.greendao.download.ProcessRecordDao;
 import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
 import com.sheep.gamegroup.greendao.download.SdkLoginUserDao;
+import com.sheep.gamegroup.greendao.download.SearchRecordDao;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 
@@ -37,6 +39,7 @@ public class DaoSession extends AbstractDaoSession {
     private final DaoConfig processRecordDaoConfig;
     private final DaoConfig screenShotRecordDaoConfig;
     private final DaoConfig sdkLoginUserDaoConfig;
+    private final DaoConfig searchRecordDaoConfig;
 
     private final AcceptTaskRecordDao acceptTaskRecordDao;
     private final AppdownloadBeanDao appdownloadBeanDao;
@@ -44,6 +47,7 @@ public class DaoSession extends AbstractDaoSession {
     private final ProcessRecordDao processRecordDao;
     private final ScreenShotRecordDao screenShotRecordDao;
     private final SdkLoginUserDao sdkLoginUserDao;
+    private final SearchRecordDao searchRecordDao;
 
     public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
             daoConfigMap) {
@@ -67,12 +71,16 @@ public class DaoSession extends AbstractDaoSession {
         sdkLoginUserDaoConfig = daoConfigMap.get(SdkLoginUserDao.class).clone();
         sdkLoginUserDaoConfig.initIdentityScope(type);
 
+        searchRecordDaoConfig = daoConfigMap.get(SearchRecordDao.class).clone();
+        searchRecordDaoConfig.initIdentityScope(type);
+
         acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
         appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
         downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);
         processRecordDao = new ProcessRecordDao(processRecordDaoConfig, this);
         screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
         sdkLoginUserDao = new SdkLoginUserDao(sdkLoginUserDaoConfig, this);
+        searchRecordDao = new SearchRecordDao(searchRecordDaoConfig, this);
 
         registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
         registerDao(AppdownloadBean.class, appdownloadBeanDao);
@@ -80,6 +88,7 @@ public class DaoSession extends AbstractDaoSession {
         registerDao(ProcessRecord.class, processRecordDao);
         registerDao(ScreenShotRecord.class, screenShotRecordDao);
         registerDao(SdkLoginUser.class, sdkLoginUserDao);
+        registerDao(SearchRecord.class, searchRecordDao);
     }
     
     public void clear() {
@@ -89,6 +98,7 @@ public class DaoSession extends AbstractDaoSession {
         processRecordDaoConfig.clearIdentityScope();
         screenShotRecordDaoConfig.clearIdentityScope();
         sdkLoginUserDaoConfig.clearIdentityScope();
+        searchRecordDaoConfig.clearIdentityScope();
     }
 
     public AcceptTaskRecordDao getAcceptTaskRecordDao() {
@@ -115,4 +125,8 @@ public class DaoSession extends AbstractDaoSession {
         return sdkLoginUserDao;
     }
 
+    public SearchRecordDao getSearchRecordDao() {
+        return searchRecordDao;
+    }
+
 }

+ 81 - 0
app/src/main/java/com/sheep/gamegroup/greendao/download/SearchRecord.java

@@ -0,0 +1,81 @@
+package com.sheep.gamegroup.greendao.download;
+
+import com.sheep.gamegroup.absBase.ISearchRecord;
+
+import org.greenrobot.greendao.annotation.Entity;
+import org.greenrobot.greendao.annotation.Id;
+import org.greenrobot.greendao.annotation.Property;
+import org.greenrobot.greendao.annotation.Generated;
+
+/**
+ * Created by realicing on 2018/11/8.
+ * realicing@sina.com
+ * 搜索历史
+ */
+@Entity
+public class SearchRecord implements ISearchRecord {
+    /**
+     * id,
+     */
+    @Id(autoincrement = true)
+    private Long id;
+    /**
+     * 关键字
+     */
+    @Property(nameInDb = "input")
+    private String input;
+    /**
+     * 第一次搜索时间
+     */
+    @Property(nameInDb = "first_time")
+    private long first_time;
+    /**
+     * 最后一次搜索时间
+     */
+    @Property(nameInDb = "last_time")
+    private long last_time;
+    @Property(nameInDb = "count")//搜索次数
+    private int count;
+    public int getCount() {
+        return this.count;
+    }
+    public void setCount(int count) {
+        this.count = count;
+    }
+    public long getLast_time() {
+        return this.last_time;
+    }
+    public void setLast_time(long last_time) {
+        this.last_time = last_time;
+    }
+    public long getFirst_time() {
+        return this.first_time;
+    }
+    public void setFirst_time(long first_time) {
+        this.first_time = first_time;
+    }
+    public String getInput() {
+        return this.input;
+    }
+    public void setInput(String input) {
+        this.input = input;
+    }
+    public Long getId() {
+        return this.id;
+    }
+    public void setId(Long id) {
+        this.id = id;
+    }
+    @Generated(hash = 2088438352)
+    public SearchRecord(Long id, String input, long first_time, long last_time,
+            int count) {
+        this.id = id;
+        this.input = input;
+        this.first_time = first_time;
+        this.last_time = last_time;
+        this.count = count;
+    }
+    @Generated(hash = 839789598)
+    public SearchRecord() {
+    }
+}

+ 145 - 0
app/src/main/java/com/sheep/gamegroup/greendao/download/SearchRecordDao.java

@@ -0,0 +1,145 @@
+package com.sheep.gamegroup.greendao.download;
+
+import android.database.Cursor;
+import android.database.sqlite.SQLiteStatement;
+
+import org.greenrobot.greendao.AbstractDao;
+import org.greenrobot.greendao.Property;
+import org.greenrobot.greendao.internal.DaoConfig;
+import org.greenrobot.greendao.database.Database;
+import org.greenrobot.greendao.database.DatabaseStatement;
+
+// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
+/** 
+ * DAO for table "SEARCH_RECORD".
+*/
+public class SearchRecordDao extends AbstractDao<SearchRecord, Long> {
+
+    public static final String TABLENAME = "SEARCH_RECORD";
+
+    /**
+     * Properties of entity SearchRecord.<br/>
+     * Can be used for QueryBuilder and for referencing column names.
+     */
+    public static class Properties {
+        public final static Property Id = new Property(0, Long.class, "id", true, "_id");
+        public final static Property Input = new Property(1, String.class, "input", false, "input");
+        public final static Property First_time = new Property(2, long.class, "first_time", false, "first_time");
+        public final static Property Last_time = new Property(3, long.class, "last_time", false, "last_time");
+        public final static Property Count = new Property(4, int.class, "count", false, "count");
+    }
+
+
+    public SearchRecordDao(DaoConfig config) {
+        super(config);
+    }
+    
+    public SearchRecordDao(DaoConfig config, DaoSession daoSession) {
+        super(config, daoSession);
+    }
+
+    /** Creates the underlying database table. */
+    public static void createTable(Database db, boolean ifNotExists) {
+        String constraint = ifNotExists? "IF NOT EXISTS ": "";
+        db.execSQL("CREATE TABLE " + constraint + "\"SEARCH_RECORD\" (" + //
+                "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
+                "\"input\" TEXT," + // 1: input
+                "\"first_time\" INTEGER NOT NULL ," + // 2: first_time
+                "\"last_time\" INTEGER NOT NULL ," + // 3: last_time
+                "\"count\" INTEGER NOT NULL );"); // 4: count
+    }
+
+    /** Drops the underlying database table. */
+    public static void dropTable(Database db, boolean ifExists) {
+        String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"SEARCH_RECORD\"";
+        db.execSQL(sql);
+    }
+
+    @Override
+    protected final void bindValues(DatabaseStatement stmt, SearchRecord entity) {
+        stmt.clearBindings();
+ 
+        Long id = entity.getId();
+        if (id != null) {
+            stmt.bindLong(1, id);
+        }
+ 
+        String input = entity.getInput();
+        if (input != null) {
+            stmt.bindString(2, input);
+        }
+        stmt.bindLong(3, entity.getFirst_time());
+        stmt.bindLong(4, entity.getLast_time());
+        stmt.bindLong(5, entity.getCount());
+    }
+
+    @Override
+    protected final void bindValues(SQLiteStatement stmt, SearchRecord entity) {
+        stmt.clearBindings();
+ 
+        Long id = entity.getId();
+        if (id != null) {
+            stmt.bindLong(1, id);
+        }
+ 
+        String input = entity.getInput();
+        if (input != null) {
+            stmt.bindString(2, input);
+        }
+        stmt.bindLong(3, entity.getFirst_time());
+        stmt.bindLong(4, entity.getLast_time());
+        stmt.bindLong(5, entity.getCount());
+    }
+
+    @Override
+    public Long readKey(Cursor cursor, int offset) {
+        return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
+    }    
+
+    @Override
+    public SearchRecord readEntity(Cursor cursor, int offset) {
+        SearchRecord entity = new SearchRecord( //
+            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
+            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // input
+            cursor.getLong(offset + 2), // first_time
+            cursor.getLong(offset + 3), // last_time
+            cursor.getInt(offset + 4) // count
+        );
+        return entity;
+    }
+     
+    @Override
+    public void readEntity(Cursor cursor, SearchRecord entity, int offset) {
+        entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
+        entity.setInput(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
+        entity.setFirst_time(cursor.getLong(offset + 2));
+        entity.setLast_time(cursor.getLong(offset + 3));
+        entity.setCount(cursor.getInt(offset + 4));
+     }
+    
+    @Override
+    protected final Long updateKeyAfterInsert(SearchRecord entity, long rowId) {
+        entity.setId(rowId);
+        return rowId;
+    }
+    
+    @Override
+    public Long getKey(SearchRecord entity) {
+        if(entity != null) {
+            return entity.getId();
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public boolean hasKey(SearchRecord entity) {
+        return entity.getId() != null;
+    }
+
+    @Override
+    protected final boolean isEntityUpdateable() {
+        return true;
+    }
+    
+}

+ 6 - 6
app/src/main/java/com/sheep/gamegroup/helper/FindAppHelper.java

@@ -8,7 +8,7 @@ import android.widget.TextView;
 import com.sheep.gamegroup.model.api.IDownload;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.DialogConfig;
-import com.sheep.gamegroup.model.entity.GameApp;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.DownloadTextUtl;
 import com.sheep.gamegroup.util.DownloadUtil;
@@ -51,8 +51,8 @@ public class FindAppHelper {
                 boolean installed = object instanceof Integer && DownloadUtil.STATUS_INIT != (int) object;//-1 点击下载按钮的回调;其它状态直接回调不需要点击按钮
                 boolean downloadLinkError = object instanceof Boolean && !(boolean) object;//false 下载地址错误会传false过来
                 if (installed || downloadLinkError) {
-                    if (iTask instanceof GameApp) {
-                        GameApp findApp = (GameApp) iTask;
+                    if (iTask instanceof Applications) {
+                        Applications findApp = (Applications) iTask;
                         recordAppDownloads(activity, findApp, null);
                         FIND_APP.onEvent("application_id", findApp.getId(), "action", down_tv.getText());
                     }
@@ -68,7 +68,7 @@ public class FindAppHelper {
      * @param findApp
      * @param reservation_tv
      */
-    public void updateReservationView(final Activity activity, final GameApp findApp, final TextView reservation_tv) {
+    public void updateReservationView(final Activity activity, final Applications findApp, final TextView reservation_tv) {
         final boolean showSimpleText = reservation_tv.getText().length() < 4;
         if (findApp.isCanRecord()) {
             reservation_tv.setEnabled(true);
@@ -87,7 +87,7 @@ public class FindAppHelper {
         }
     }
 
-    public void updateReservationView(final Activity activity, final GameApp gameApp, final TextView reservation_tv, int type) {
+    public void updateReservationView(final Activity activity, final Applications gameApp, final TextView reservation_tv, int type) {
         final boolean showSimpleText = reservation_tv.getText().length() < 4;
         if (gameApp.isCanRecord()) {
             reservation_tv.setEnabled(true);
@@ -115,7 +115,7 @@ public class FindAppHelper {
      *
      * @param findApp
      */
-    private void recordAppDownloads(final Activity activity, final GameApp findApp, final TextView textView) {
+    private void recordAppDownloads(final Activity activity, final Applications findApp, final TextView textView) {
         SheepApp.getInstance().getNetComponent().getApiService().recordAppDownloads(findApp.getId())
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())

+ 6 - 6
app/src/main/java/com/sheep/gamegroup/helper/TaskHelper.java

@@ -14,7 +14,7 @@ import com.sheep.gamegroup.model.entity.OrienteeringDetail;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
 import com.sheep.gamegroup.model.entity.TaskChild;
 import com.sheep.gamegroup.model.entity.TaskEty;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.GlideImageLoader;
@@ -81,7 +81,7 @@ public class TaskHelper {
                 });
     }
 
-    private TaskReleaseEty taskReleaseEty;
+    private Release_task taskReleaseEty;
 
     private void initTask(int release_task_id) {
         SheepApp.getInstance().getNetComponent().getApiService().taskDesc(release_task_id)
@@ -90,7 +90,7 @@ public class TaskHelper {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        taskReleaseEty = baseMessage.getData(TaskReleaseEty.class);
+                        taskReleaseEty = baseMessage.getData(Release_task.class);
                         if (action1 != null)
                             action1.call(1);//刷新界面
 
@@ -388,7 +388,7 @@ public class TaskHelper {
      * @param textView
      * @param taskReleaseEty
      */
-    public static void setNumText(TextView textView, TaskReleaseEty taskReleaseEty) {
+    public static void setNumText(TextView textView, Release_task taskReleaseEty) {
         textView.setVisibility(View.VISIBLE);
         ViewUtil.setText(textView, String.format(Locale.CHINA, "剩余%s份", taskReleaseEty.getLast_num()));
     }
@@ -399,7 +399,7 @@ public class TaskHelper {
      * @param textView
      * @param taskReleaseEty
      */
-    public static void setTaskTypeText(TextView textView, TaskReleaseEty taskReleaseEty) {
+    public static void setTaskTypeText(TextView textView, Release_task taskReleaseEty) {
         textView.setVisibility(View.VISIBLE);
         String[] textColor = getTaskTypeTextColor(taskReleaseEty.getTask());
         ViewUtil.setColorMapText(textView, String.format(Locale.CHINA, "%s", textColor[0]), textColor[0], textColor[1]);
@@ -415,7 +415,7 @@ public class TaskHelper {
      * @param textView
      * @param taskReleaseEty
      */
-    public static void setTaskTagText(TextView textView, TaskReleaseEty taskReleaseEty) {
+    public static void setTaskTagText(TextView textView, Release_task taskReleaseEty) {
         textView.setVisibility(View.VISIBLE);
         ViewUtil.setColorMapText(textView, String.format(Locale.CHINA, "%s", taskReleaseEty.getCashOrWelfare()), taskReleaseEty.getCashOrWelfare(), "#FD2D54");
         textView.setBackgroundResource(R.drawable.shape_red_stroke_rectangle_no_lb);

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

@@ -2,16 +2,16 @@ package com.sheep.gamegroup.model.api;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.absBase.IHomePageSearch;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.jiuyan.samllsheep.bean.UserCenterModule;
 
-import java.util.List;
+import org.afinal.simplecache.ApiKey;
+
 import java.util.Map;
 
 import retrofit2.Call;
 import retrofit2.http.Body;
 import retrofit2.http.DELETE;
-import retrofit2.http.Field;
 import retrofit2.http.FieldMap;
 import retrofit2.http.FormUrlEncoded;
 import retrofit2.http.GET;
@@ -1065,12 +1065,14 @@ public interface ApiService {
      */
     @GET("app/find/detail/hot_games")
     Observable<BaseMessage> getDetailHotGames(@Query("app_id") int app_id);
+
     /**
      * 玩转游戏-游戏详情 活动推荐
      * app_id 应用的id
      */
     @GET("app/find/detail/activity_recommend")
     Observable<BaseMessage> getDetailActivityRecommend(@Query("app_id") int app_id);
+
     /**
      * 玩转游戏-游戏详情 文章推荐
      * app_id 应用的id
@@ -1148,7 +1150,7 @@ public interface ApiService {
      * user_comment_reply_id:	integer ($int64) 回复id
      * }
      */
-    @POST("app/game_user/")
+    @POST("app/game_user/reply_comment")
     Observable<BaseMessage> postGameUserReplyComment(@Body JSONObject jsonObject);
 
     /**
@@ -1164,7 +1166,6 @@ public interface ApiService {
      * 用户评论用户
      * UserCommentReq{
      * content:	string  评论内容
-     * expression:	boolean 是否有表情
      * user_comment_id:	integer ($int64) 评论id
      * }
      */
@@ -1205,6 +1206,7 @@ public interface ApiService {
      */
     @POST("app/game_user/user_game_comment_expression_like")
     Observable<BaseMessage> postGameUserUserGameCommentExpressionLike(@Query("user_comment_id") int user_comment_id);
+
     /**
      * 用户游戏评论点赞
      * user_comment_id * integer (query) 评论id
@@ -1290,20 +1292,44 @@ public interface ApiService {
 
     /**
      * 兑换积分
-     *
-     * @return
      */
     @POST("app/mobile_point/recharge")
     Observable<BaseMessage> rechargeCMCC(@Body JSONObject jsonObject);
 //---------------------------start 个人中心-------------------------------------
+
     /**
      * 用户中心模块获取
      */
-    @GET("/v1/app/user_module/")
+    @GET("app/user_module")
     Observable<BaseMessage> userModule();
 
 
 //---------------------------end 个人中心-------------------------------------
+//---------------------------start 搜索相关-------------------------------------
+
+    /**
+     * 获取搜索相关热门推荐
+     * platform * integer (query) 平台 0全 1android 2ios
+     */
+    @GET(ApiKey.top_search_statistics)
+    Observable<BaseMessage> getTopSearchStatistics();
+
+    /**
+     * 点击热门搜索后,统计点击次数
+     * link_id * integer (query) 关联id
+     * link_type * integer (query) 关联类型 1任务 2游戏
+     */
+    @POST("app/top_search_statistics/click_top_search")
+    Observable<BaseMessage> postTopSearchStatisticsClickTopSearch(@Query("link_id") int link_id, @IHomePageSearch.LINK_TYPE @Query("link_type") int link_type);
+    /**
+     * 根据任务名(游戏名)模糊搜索
+     * search_content * string (query) 任务名(游戏名)
+     */
+    @GET("app/top_search_statistics/home_page_search")
+    Observable<BaseMessage> getTopSearchStatisticsHomePageSearch(@Query("search_content") String search_content);
+
+
+//---------------------------end 搜索相关-------------------------------------
 //---------------------------start 游戏sdk相关接口-------------------------------------
 
     /**

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

@@ -14,7 +14,7 @@ import java.util.ArrayList;
  * Created by realicing on 2018/6/28.
  * realicing@sina.com
  */
-public class GameApp implements IDownload, Serializable {
+public class Applications implements IDownload, Serializable {
     private int updated_at;
 
     private float score;//评分

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/model/entity/Article.java

@@ -52,7 +52,7 @@ public class Article {
 
     private int type;//类型 1:游戏 2:咨询 3:转跳 4:任务 5:栏目
 
-    private GameApp application;
+    private Applications application;
 
     public void setUpdated_at(int updated_at){
         this.updated_at = updated_at;
@@ -169,11 +169,11 @@ public class Article {
         return this.type;
     }
 
-    public GameApp getApplication() {
+    public Applications getApplication() {
         return application;
     }
 
-    public void setApplication(GameApp application) {
+    public void setApplication(Applications application) {
         this.application = application;
     }
 

+ 6 - 6
app/src/main/java/com/sheep/gamegroup/model/entity/CommendApp.java

@@ -14,13 +14,13 @@ import java.util.List;
  */
 public class CommendApp {
 
-    private GameApp app;
+    private Applications app;
 
     private int order;
 
     private boolean need;
 
-    private TaskReleaseEty release_task;
+    private Release_task release_task;
 
     private int accepted_task_id;
 
@@ -30,11 +30,11 @@ public class CommendApp {
 
     private List<GiftBagApp> has_gift_bag;
 
-    public void setApp(GameApp app) {
+    public void setApp(Applications app) {
         this.app = app;
     }
 
-    public GameApp getApp() {
+    public Applications getApp() {
         return this.app;
     }
 
@@ -54,11 +54,11 @@ public class CommendApp {
         return this.need;
     }
 
-    public void setRelease_task(TaskReleaseEty release_task) {
+    public void setRelease_task(Release_task release_task) {
         this.release_task = release_task;
     }
 
-    public TaskReleaseEty getRelease_task() {
+    public Release_task getRelease_task() {
         return this.release_task;
     }
 

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/model/entity/CreditCardProgressQuery.java

@@ -24,7 +24,7 @@ public class CreditCardProgressQuery {
     private int update_time;
 
     private int create_time;
-    private TaskReleaseEty release_task;
+    private Release_task release_task;
 
     public void setRemarks(String remarks){
         this.remarks = remarks;
@@ -87,11 +87,11 @@ public class CreditCardProgressQuery {
         return this.create_time;
     }
 
-    public TaskReleaseEty getRelease_task() {
+    public Release_task getRelease_task() {
         return release_task;
     }
 
-    public void setRelease_task(TaskReleaseEty release_task) {
+    public void setRelease_task(Release_task release_task) {
         this.release_task = release_task;
     }
 }

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/model/entity/FindAppReservation.java

@@ -13,7 +13,7 @@ public class FindAppReservation {
 
     private int ApplicationId;
 
-    private GameApp application;
+    private Applications application;
 
     private int Id;
 
@@ -45,10 +45,10 @@ public class FindAppReservation {
     public int getApplicationId(){
         return this.ApplicationId;
     }
-    public void setApplication(GameApp application){
+    public void setApplication(Applications application){
         this.application = application;
     }
-    public GameApp getApplication(){
+    public Applications getApplication(){
         return this.application;
     }
     public void setId(int Id){

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

@@ -16,7 +16,7 @@ import java.util.List;
 public class GameEntity implements Serializable {
     private int accepted_task_id;//integer($int64)领取福利时使用
 
-    private GameApp app;
+    private Applications app;
     private boolean can_download;//boolean
     private int is_reservation;//integer($int64)0 不是 1是预约
 
@@ -26,18 +26,18 @@ public class GameEntity implements Serializable {
 
     private int status;//integer($int64)福利任务时使用,和任务记录一样
 
-    private TaskReleaseEty release_task;
+    private Release_task release_task;
 
     private List<GiftBagApp> has_gift_bag;
 
     //    IsFocusGame bool                `json:"is_focus_game" description:"是否关注游戏"`
     private boolean is_focus_game;//是否已经关注了游戏
 
-    public TaskReleaseEty getRelease_task() {
+    public Release_task getRelease_task() {
         return release_task;
     }
 
-    public void setRelease_task(TaskReleaseEty release_task) {
+    public void setRelease_task(Release_task release_task) {
         this.release_task = release_task;
     }
 
@@ -57,11 +57,11 @@ public class GameEntity implements Serializable {
         this.accepted_task_id = accepted_task_id;
     }
 
-    public GameApp getApp() {
+    public Applications getApp() {
         return app;
     }
 
-    public void setApp(GameApp app) {
+    public void setApp(Applications app) {
         this.app = app;
     }
 

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/model/entity/GiftBagApp.java

@@ -8,7 +8,7 @@ public class GiftBagApp {
 
     private GiftBag gift_bag;
 
-    private GameApp app;
+    private Applications app;
 
     private String code;
 
@@ -28,10 +28,10 @@ public class GiftBagApp {
     public GiftBag getGift_bag(){
         return this.gift_bag;
     }
-    public void setApp(GameApp app){
+    public void setApp(Applications app){
         this.app = app;
     }
-    public GameApp getApp(){
+    public Applications getApp(){
         return this.app;
     }
     public void setCode(String code){

+ 56 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/HomePageSearch.java

@@ -0,0 +1,56 @@
+package com.sheep.gamegroup.model.entity;
+
+import com.sheep.gamegroup.absBase.IHomePageSearch;
+
+/**
+ * Created by realicing on 2018/11/8.
+ * realicing@sina.com
+ * 搜索结果
+ * <p>
+ * content:	string
+ * 内容
+ * link_id:	integer ($int64)
+ * 关联id
+ * link_type:	integer ($int64)
+ * 关联类型 1任务 2游戏
+ * title:	string
+ * 标题
+ */
+public class HomePageSearch implements IHomePageSearch {
+    private String content;
+    private String title;
+    private int link_id;
+    private int link_type;
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getLink_id() {
+        return link_id;
+    }
+
+    public void setLink_id(int link_id) {
+        this.link_id = link_id;
+    }
+
+    public int getLink_type() {
+        return link_type;
+    }
+
+    public void setLink_type(int link_type) {
+        this.link_type = link_type;
+    }
+}

+ 6 - 6
app/src/main/java/com/sheep/gamegroup/model/entity/LatelyGame.java

@@ -7,22 +7,22 @@ import java.util.List;
  * realicing@sina.com
  */
 public class LatelyGame {
-    private List<GameApp> lately;
-    private List<GameApp> same;
+    private List<Applications> lately;
+    private List<Applications> same;
 
-    public List<GameApp> getLately() {
+    public List<Applications> getLately() {
         return lately;
     }
 
-    public void setLately(List<GameApp> lately) {
+    public void setLately(List<Applications> lately) {
         this.lately = lately;
     }
 
-    public List<GameApp> getSame() {
+    public List<Applications> getSame() {
         return same;
     }
 
-    public void setSame(List<GameApp> same) {
+    public void setSame(List<Applications> same) {
         this.same = same;
     }
 }

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/model/entity/TaskReleaseEty.java

@@ -14,7 +14,7 @@ import java.util.Locale;
  * Created by ljy on 2018/3/20.
  */
 
-public class TaskReleaseEty implements Serializable{
+public class Release_task implements Serializable{
     private float bonus;// 0,
     private String create_time;// 0,
     private String deadline;// 0,
@@ -283,7 +283,7 @@ public class TaskReleaseEty implements Serializable{
 
     @Override
     public boolean equals(Object obj) {
-        return obj instanceof TaskReleaseEty && ((TaskReleaseEty) obj).getId() == id;
+        return obj instanceof Release_task && ((Release_task) obj).getId() == id;
     }
 
 

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/model/entity/TaskAcceptedEty.java

@@ -22,7 +22,7 @@ public class TaskAcceptedEty implements Serializable{
 
     private long end_time;
 
-    private TaskReleaseEty release_task;
+    private Release_task release_task;
     private int child_task_id;//0 1开始子任务  2完成第二个子任务
     private int task_child_id;
     private int allowSubmit;//失败或者下线后,是否可以再次提交截图 2 不可以 1 可以
@@ -115,11 +115,11 @@ public class TaskAcceptedEty implements Serializable{
         this.update_time = update_time;
     }
 
-    public TaskReleaseEty getRelease_task() {
+    public Release_task getRelease_task() {
         return release_task;
     }
 
-    public void setRelease_task(TaskReleaseEty release_task) {
+    public void setRelease_task(Release_task release_task) {
         this.release_task = release_task;
     }
 

+ 99 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/TitleInfoList.java

@@ -0,0 +1,99 @@
+package com.sheep.gamegroup.model.entity;
+
+import android.support.annotation.NonNull;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.TextView;
+
+import com.sheep.jiuyan.samllsheep.SheepApp;
+
+/**
+ * Created by realicing on 2018/11/8.
+ * realicing@sina.com
+ * 包含标题的list--搜索中的热门搜索与搜索历史用到
+ */
+public class TitleInfoList implements Comparable<TitleInfoList> {
+    public TitleInfoList(String name, RecyclerView.Adapter adapter) {
+        this.name = name;
+        this.adapter = adapter;
+    }
+
+    private int sort;
+
+    public int getSort() {
+        return sort;
+    }
+
+    public TitleInfoList setSort(int sort) {
+        this.sort = sort;
+        return this;
+    }
+
+    private String name;
+    private RecyclerView.Adapter adapter;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+
+    public RecyclerView.Adapter getAdapter() {
+        return adapter;
+    }
+
+    //水平
+    public static final int LAYOUT_MANAGER_STYLE_VERTICAL = 0;
+    //垂直
+    public static final int LAYOUT_MANAGER_STYLE_HORIZONTAL = 1;
+    private int layoutManagerStyle = LAYOUT_MANAGER_STYLE_VERTICAL;
+    //设置水平滑动
+    public TitleInfoList setHorizontal() {
+        layoutManagerStyle = LAYOUT_MANAGER_STYLE_HORIZONTAL;
+        return this;
+    }
+
+    public void setAdapter(RecyclerView.Adapter adapter) {
+        this.adapter = adapter;
+    }
+
+    public RecyclerView.LayoutManager getLayoutManager() {
+        switch (layoutManagerStyle){
+            case LAYOUT_MANAGER_STYLE_HORIZONTAL:
+                return new LinearLayoutManager(SheepApp.getInstance(), LinearLayoutManager.HORIZONTAL, false);
+            case LAYOUT_MANAGER_STYLE_VERTICAL:
+            default:
+                return new LinearLayoutManager(SheepApp.getInstance());
+        }
+    }
+    private boolean showTopLine = true;//默认显示上面的线
+
+    public boolean isShowTopLine() {
+        return showTopLine;
+    }
+
+    public TitleInfoList setShowTopLine(boolean showTopLine) {
+        this.showTopLine = showTopLine;
+        return this;
+    }
+
+    private boolean showBottomLine;
+
+    public boolean isShowBottomLine() {
+        return showBottomLine;
+    }
+
+    public TitleInfoList setShowBottomLine(boolean showBottomLine) {
+        this.showBottomLine = showBottomLine;
+        return this;
+    }
+
+    @Override
+    public int compareTo(@NonNull TitleInfoList item) {
+        return sort - item.getSort();
+    }
+}

+ 131 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/TopSearchStatistics.java

@@ -0,0 +1,131 @@
+package com.sheep.gamegroup.model.entity;
+
+import com.sheep.gamegroup.absBase.IHomePageSearch;
+import com.sheep.gamegroup.absBase.ISearchRecord;
+
+/**
+ * Created by realicing on 2018/11/8.
+ * realicing@sina.com
+ * 热门搜索历史
+ * <p>
+ * link_id:	integer ($int64)
+ * 关联其他表的主键id(具体是哪张表由type决定)
+ * update_time:	integer ($int64)
+ * 修改时间(最后一次搜索时间)
+ * applications:	Applications{...}
+ * search_num:	integer ($int64)
+ * (首页热门)搜索次数
+ * create_time:	integer ($int64)
+ * 创建时间
+ * platform:	integer ($int64)
+ * 平台 0全 1android 2ios(该平台值从关联表(link_type决定)中获取)
+ * id:	integer ($int64)
+ * ID
+ * release_task:	ReleaseTask{...}
+ * link_type:	integer ($int64)
+ * 关联类型 1任务(release_task)2游戏(applications)
+ */
+public class TopSearchStatistics implements ISearchRecord, IHomePageSearch {
+    private Applications applications;
+
+    private int create_time;
+
+    private int id;
+
+    private int link_id;
+
+    private int link_type;
+
+    private int platform;
+
+    private Release_task release_task;
+
+    private int search_num;
+
+    private int update_time;
+
+    public void setApplications(Applications applications) {
+        this.applications = applications;
+    }
+
+    public Applications getApplications() {
+        return this.applications;
+    }
+
+    public void setCreate_time(int create_time) {
+        this.create_time = create_time;
+    }
+
+    public int getCreate_time() {
+        return this.create_time;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getId() {
+        return this.id;
+    }
+
+    public void setLink_id(int link_id) {
+        this.link_id = link_id;
+    }
+
+    public int getLink_id() {
+        return this.link_id;
+    }
+
+    public void setLink_type(int link_type) {
+        this.link_type = link_type;
+    }
+
+    public int getLink_type() {
+        return this.link_type;
+    }
+
+    public void setPlatform(int platform) {
+        this.platform = platform;
+    }
+
+    public int getPlatform() {
+        return this.platform;
+    }
+
+    public void setRelease_task(Release_task release_task) {
+        this.release_task = release_task;
+    }
+
+    public Release_task getRelease_task() {
+        return this.release_task;
+    }
+
+    public void setSearch_num(int search_num) {
+        this.search_num = search_num;
+    }
+
+    public int getSearch_num() {
+        return this.search_num;
+    }
+
+    public void setUpdate_time(int update_time) {
+        this.update_time = update_time;
+    }
+
+    public int getUpdate_time() {
+        return this.update_time;
+    }
+
+
+
+    @Override
+    public String getInput() {
+        if (release_task != null) {
+            return release_task.getName();
+        }
+        if (applications != null) {
+            return applications.getName();
+        }
+        return "";
+    }
+}

+ 14 - 3
app/src/main/java/com/sheep/gamegroup/util/ApiJSONUtil.java

@@ -47,16 +47,27 @@ public class ApiJSONUtil {
      * 用户评论用户
      * UserCommentReq{
      * content:	string  评论内容
-     * expression:	boolean 是否有表情
      * user_comment_id:	integer ($int64) 评论id
      * }
      */
-    public static Observable<BaseMessage> postGameUserUserComment(int user_comment_id, boolean expression, String content) {
+    public static Observable<BaseMessage> postGameUserUserComment(int user_comment_id, String content) {
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("user_comment_id", user_comment_id);
-        jsonObject.put("expression", expression);
         jsonObject.put("content", content);
         return SheepApp.getInstance().getNetComponent().getApiService().postGameUserUserComment(jsonObject);
     }
+    /**
+     * 在自己的评论详情中,自己去回复 用户对自己的评论
+     * UserCommentReq{
+     * content:	string  评论内容
+     * user_comment_id:	integer ($int64) 评论id
+     * }
+     */
+    public static Observable<BaseMessage> postGameUserReplyComment(int user_comment_reply_id, String content) {
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("user_comment_reply_id", user_comment_reply_id);
+        jsonObject.put("content", content);
+        return SheepApp.getInstance().getNetComponent().getApiService().postGameUserReplyComment(jsonObject);
+    }
 
 }

+ 18 - 0
app/src/main/java/com/sheep/gamegroup/util/ApiUtil.java

@@ -1,7 +1,9 @@
 package com.sheep.gamegroup.util;
 
+import android.support.annotation.Nullable;
 import android.text.TextUtils;
 
+import com.sheep.gamegroup.absBase.IHomePageSearch;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.NewAboutUs;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
@@ -104,4 +106,20 @@ public class ApiUtil {
                             }
                         });
     }
+    //点击热门搜索后,统计点击次数
+    public static void postTopSearchStatisticsClickTopSearch(@Nullable IHomePageSearch item) {
+        if(item != null)
+            SheepApp.getInstance().getNetComponent().getApiService().postTopSearchStatisticsClickTopSearch(item.getLink_id(), item.getLink_type())
+                        .subscribeOn(Schedulers.io())
+                        .observeOn(AndroidSchedulers.mainThread())
+                        .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                            @Override
+                            public void onNext(BaseMessage baseMessage) {
+                            }
+
+                            @Override
+                            public void onError(BaseMessage baseMessage) {
+                            }
+                        });
+    }
 }

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

@@ -46,7 +46,7 @@ import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.Ext;
 import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
 import com.sheep.gamegroup.model.entity.GameAccountEntity;
-import com.sheep.gamegroup.model.entity.GameApp;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
@@ -57,7 +57,7 @@ import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
 import com.sheep.gamegroup.model.entity.TaskChild;
 import com.sheep.gamegroup.model.entity.TaskDescEntity;
 import com.sheep.gamegroup.model.entity.TaskEty;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.entity.WithdrawalEty;
 import com.sheep.gamegroup.model.entity.XiaomiGameEntity;
@@ -695,7 +695,7 @@ public class CommonUtil {
         if (AutoCheckService.IS_USE_THIS_SERVICE && !ListUtil.isEmpty(list)) {
             ArrayList<String> packageNameList = ListUtil.emptyList();
             for (TaskAcceptedEty item : list) {
-                TaskReleaseEty taskReleaseEty;
+                Release_task taskReleaseEty;
                 TaskEty taskEty;
                 if ((taskReleaseEty = item.getRelease_task()) != null && (taskEty = taskReleaseEty.getTask()) != null
                         && taskEty.isAppAutoCommitTask() && !TextUtils.isEmpty(taskEty.getPackage_names()))
@@ -1403,7 +1403,7 @@ public class CommonUtil {
 
 
     //对---游戏任务中的预约任务----进行---预约操作
-    public void reservationGameTask(final Context context, final TaskReleaseEty taskReleaseEty, final Action1<Integer> action1) {
+    public void reservationGameTask(final Context context, final Release_task taskReleaseEty, final Action1<Integer> action1) {
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("device_id", DeviceUtil.getDeviceId(context));
         jsonObject.put("release_task_id", taskReleaseEty.getId());
@@ -1518,7 +1518,7 @@ public class CommonUtil {
                 });
     }
 
-    private void giveUpTask(final Context context, final TaskReleaseEty taskReleaseEty, final Action1<Integer> action1) {
+    private void giveUpTask(final Context context, final Release_task taskReleaseEty, final Action1<Integer> action1) {
         SheepApp.getInstance().getNetComponent().getApiService().giveUpTask(taskReleaseEty.getAccepted_task_id())
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
@@ -1535,7 +1535,7 @@ public class CommonUtil {
                 });
     }
 
-    public void tryGiveUpTask(final Context context, final TaskReleaseEty taskReleaseEty, final Action1<Integer> action1) {
+    public void tryGiveUpTask(final Context context, final Release_task taskReleaseEty, final Action1<Integer> action1) {
         ViewUtil.showMsgDialog(context, new DialogConfig().setTitle("提示")
                 .setMsg("是否放弃正在运行中的任务").setBtnRightText("否")
                 .setBtnLeftText("是").setBtnLeftOnClickListener(new View.OnClickListener() {
@@ -2020,8 +2020,8 @@ public class CommonUtil {
                 if (item instanceof XiaomiGameEntity) {
 
                     jsonObject.put("id", ((XiaomiGameEntity) item).getId());
-                } else if (item instanceof GameApp) {
-                    jsonObject.put("id", ((GameApp) item).getId());
+                } else if (item instanceof Applications) {
+                    jsonObject.put("id", ((Applications) item).getId());
                 }
 
                 ViewUtil.newInstance().showProgress(activity);
@@ -2284,7 +2284,7 @@ public class CommonUtil {
      * @param textView
      * @param taskReleaseEty
      */
-    public void setTaskTagText(TextView textView, TaskReleaseEty taskReleaseEty) {
+    public void setTaskTagText(TextView textView, Release_task taskReleaseEty) {
         textView.setVisibility(View.VISIBLE);
         ViewUtil.setColorMapText(textView, String.format(Locale.CHINA, "%s", taskReleaseEty.getCashOrWelfare()), taskReleaseEty.getCashOrWelfare(), "#FD2D54");
         textView.setBackgroundResource(R.drawable.shape_red_stroke_rectangle_no_lb);
@@ -2482,7 +2482,7 @@ public class CommonUtil {
         if (detail_task_tv_center == null)
             return;
         final boolean showSimpleText = detail_task_tv_center.getText().length() < 4;
-        final TaskReleaseEty releaseEty = gameEntity.getRelease_task();
+        final Release_task releaseEty = gameEntity.getRelease_task();
         final TaskEty taskEty = releaseEty != null ? releaseEty.getTask() : null;
         if (releaseEty != null && taskEty != null) {//游戏任务
 
@@ -2670,7 +2670,7 @@ public class CommonUtil {
     /**
      * 给任务设置标签
      */
-    public void setTaskTag(Context context, View itemView, TaskReleaseEty taskReleaseEty, String show_type) {
+    public void setTaskTag(Context context, View itemView, Release_task taskReleaseEty, String show_type) {
         if (!TextUtils.isEmpty(show_type)) {
             switch (show_type) {
                 case TASK_AUDIT:

+ 20 - 2
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -13,6 +13,7 @@ import android.view.Gravity;
 import android.view.View;
 
 import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.absBase.IHomePageSearch;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.model.entity.Advertising;
 import com.sheep.gamegroup.model.entity.Agreement;
@@ -24,9 +25,10 @@ import com.sheep.gamegroup.model.entity.Container;
 import com.sheep.gamegroup.model.entity.CreditCard;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.DialogEntity;
-import com.sheep.gamegroup.model.entity.GameApp;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.GameListType;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
+import com.sheep.gamegroup.model.entity.HomePageSearch;
 import com.sheep.gamegroup.model.entity.LoginEntity;
 import com.sheep.gamegroup.model.entity.NewbieTask;
 import com.sheep.gamegroup.model.entity.NewbieTaskRecord;
@@ -34,6 +36,7 @@ import com.sheep.gamegroup.model.entity.RouserArticlesEntity;
 import com.sheep.gamegroup.model.entity.SystemNotification;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
 import com.sheep.gamegroup.model.entity.TaskEty;
+import com.sheep.gamegroup.model.entity.TopSearchStatistics;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.entity.VersionInfo;
 import com.sheep.gamegroup.model.entity.WebviewEntity;
@@ -1588,7 +1591,7 @@ public class Jump2View {
      * @param activity
      * @param findApp
      */
-    public void goFindGame(Activity activity, GameApp findApp) {
+    public void goFindGame(Activity activity, Applications findApp) {
         Intent intent = new Intent(activity, ActGcGameAppDetail.class);
         intent.putExtra("id", findApp.getId());
         activity.startActivity(intent);
@@ -2172,4 +2175,19 @@ public class Jump2View {
     public void goActGuideNewUser(Activity activity) {
         activity.startActivity(new Intent(activity, UserNavActivity.class));
     }
+
+    /**
+     * 跳转到游戏详情或者任务详情界面
+     */
+    public void goTaskOrAppDetail(IHomePageSearch item) {
+        Activity activity = ActivityManager.getInstance().currentActivity();
+        switch (item.getLink_type()){
+            case IHomePageSearch.LINK_TYPE_RELEASE_TASK:
+                goTaskDetailView(activity, item.getLink_id());
+                break;
+            case IHomePageSearch.LINK_TYPE_APPLICATIONS:
+                goPlayGameDetail(activity, item.getLink_id());
+                break;
+        }
+    }
 }

+ 5 - 5
app/src/main/java/com/sheep/gamegroup/view/activity/ActArticle.java

@@ -33,7 +33,7 @@ import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.helper.TaskHelper;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.GameApp;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.Article;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
@@ -472,10 +472,10 @@ public class ActArticle extends BaseActivity implements Action1<Integer> {
         }
     }
 
-    private GameApp findApp;
+    private Applications findApp;
 
     private void initFindApp(int application_id) {
-        GameApp cacheResult = DataUtil.getInstance().getCacheResult(ApiKey.applications(id), GameApp.class);
+        Applications cacheResult = DataUtil.getInstance().getCacheResult(ApiKey.applications(id), Applications.class);
         if (cacheResult != null) {
             findApp = cacheResult;
             notifyDataSetChanged();
@@ -488,7 +488,7 @@ public class ActArticle extends BaseActivity implements Action1<Integer> {
                     public void onNext(BaseMessage baseMessage) {
                         boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.applications(id));
                         if (isNewData) {
-                            findApp = baseMessage.getData(GameApp.class);
+                            findApp = baseMessage.getData(Applications.class);
                             notifyDataSetChanged();
                         } else {
                             refresh.setRefreshing(false);
@@ -529,7 +529,7 @@ public class ActArticle extends BaseActivity implements Action1<Integer> {
     }
 
     //更新按钮状态与添加点击事件
-    private void updateView(Activity activity, GameApp findApp, TextView textView) {
+    private void updateView(Activity activity, Applications findApp, TextView textView) {
         if (findApp.isCanDownload()) {//可下载
             downLoadTextViewMap.put(findApp.getDownload_link(), textView);
             downLoadTextViewMap.put(findApp.getPackage_name(), textView);

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/ActPlayGameDetail.java

@@ -18,7 +18,7 @@ import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.GameApp;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
@@ -97,7 +97,7 @@ public class ActPlayGameDetail extends BaseActivity implements Action1<Integer>
     private boolean mIsExpanded = false;//是否是折叠状态
 
     private GameEntity gameEntity;
-    private GameApp gameApp;
+    private Applications gameApp;
     private boolean isNeedReservation = false;
 
     private TitleFragmentListAdapter mAdapter;

+ 6 - 6
app/src/main/java/com/sheep/gamegroup/view/activity/ActReservation.java

@@ -13,7 +13,7 @@ import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.GameApp;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.FindAppReservation;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
@@ -123,7 +123,7 @@ public class ActReservation extends BaseActivity {
         final TextView find_information_game_bt2 = (TextView) itemView.findViewById(R.id.find_information_game_bt2);
 
         if (item != null && item.getApplication() != null) {
-            final GameApp findApp = item.getApplication();
+            final Applications findApp = item.getApplication();
 
             ViewUtil.setImage(find_information_game_icon, findApp.getIcon());
             ViewUtil.setText(find_information_game_name, findApp.getName());
@@ -266,10 +266,10 @@ public class ActReservation extends BaseActivity {
         view_list.getAdapter().notifyDataSetChanged();
     }
 
-    private Map<String, GameApp> findAppMap = new HashMap<>();
+    private Map<String, Applications> findAppMap = new HashMap<>();
 
     //获取任务对应的findApp
-    private GameApp getFindAppByKey(String key) {
+    private Applications getFindAppByKey(String key) {
         if (findAppMap.containsKey(key))
             return findAppMap.get(key);
         return null;
@@ -344,7 +344,7 @@ public class ActReservation extends BaseActivity {
         if (textView != null) {
             textView.setText(CommonUtil.START_INSTALL);
         }
-        GameApp findApp = getFindAppByKey(task.getMDownloadUrl());
+        Applications findApp = getFindAppByKey(task.getMDownloadUrl());
         if (findApp != null) {
             findApp.updateState(DownloadUtil.STATUS_FINISH);
         }
@@ -379,7 +379,7 @@ public class ActReservation extends BaseActivity {
         if (intent != null && intent.getAction() != null && intent.getDataString() != null && intent.getDataString().contains("package:")) {
             String packageName = intent.getDataString().replace("package:", "");
 
-            GameApp findApp = getFindAppByKey(packageName);
+            Applications findApp = getFindAppByKey(packageName);
             TextView textView = getTextViewByKey(packageName);
             if (findApp != null) {
                 switch (intent.getAction()) {

+ 149 - 105
app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchAppOrTask.java

@@ -1,50 +1,60 @@
 package com.sheep.gamegroup.view.activity;
 
-import android.os.Bundle;
 import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentTransaction;
 import android.support.v7.widget.AppCompatAutoCompleteTextView;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
 import android.text.Editable;
 import android.text.TextUtils;
 import android.text.TextWatcher;
 import android.view.KeyEvent;
 import android.view.View;
-import android.view.ViewGroup;
 import android.view.inputmethod.EditorInfo;
-import android.widget.AdapterView;
 import android.widget.ImageView;
-import android.widget.ListView;
 import android.widget.TextView;
 
-import com.sheep.gamegroup.absBase.BaseActivity;
-import com.sheep.gamegroup.model.entity.SearchAppRecord;
+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.ISearch;
+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.Applications;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+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.util.ApiUtil;
+import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.ListUtil;
-import com.sheep.gamegroup.util.MyDbManager;
 import com.sheep.gamegroup.util.ViewUtil;
-import com.sheep.gamegroup.view.adapter.ArrayAdapter;
-import com.sheep.gamegroup.view.fragment.FgtSearchApp;
+import com.sheep.gamegroup.view.adapter.AdpTitleInfoList;
+import com.sheep.gamegroup.view.fragment.FgtSearchAppOrTask;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 
+import org.afinal.simplecache.ApiKey;
+
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import butterknife.BindView;
 import butterknife.OnClick;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
 
 /**
  * Created by realicing on 2018/9/13.
  * realicing@sina.com
  */
-public class ActSearchAppOrTask extends BaseActivity {
+public class ActSearchAppOrTask extends BaseContainerActivity {
     @BindView(R.id.title_search_input)
     AppCompatAutoCompleteTextView title_search_input;
     @BindView(R.id.search_app_list)
-    ListView search_app_list;
+    RecyclerView recyclerView;
     @BindView(R.id.frame_container)
     View frame_container;
     @BindView(R.id.title_search_commit)
@@ -52,69 +62,25 @@ public class ActSearchAppOrTask extends BaseActivity {
 
     @Override
     protected int getLayoutId() {
-        return R.layout.act_search_app;
+        return R.layout.act_search_app_or_task;
     }
 
-    private FgtSearchApp fgtSearchApp;
 
     @Override
-    public void initView() {
-        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
-        Bundle bundle = new Bundle();
-        Fragment fragment = getSupportFragmentManager().findFragmentByTag("tag");
-        if (fragment == null) {
-            fragment = new FgtSearchApp();
-            fragment.setArguments(bundle);
-            transaction.add(R.id.frame_container, fragment, "tag");
-            transaction.commitAllowingStateLoss();
-        } else {
-            fragment.setArguments(bundle);
-            transaction.replace(R.id.frame_container, fragment);
-            transaction.commitAllowingStateLoss();
-        }
-        if (fgtSearchApp == null && fragment instanceof FgtSearchApp)
-            fgtSearchApp = (FgtSearchApp) fragment;
-        inputAdapter = new ArrayAdapter<SearchAppRecord>(SheepApp.getInstance(), R.layout.item_serach_record, searchRecordList){
-            @Override
-            public boolean convert(int position, View view, ViewGroup parent, final SearchAppRecord item) {
-                TextView item_search_record_name = (TextView)view.findViewById(R.id.item_search_record_name);
-                ImageView item_search_record_x = (ImageView)view.findViewById(R.id.item_search_record_x);
-                ViewUtil.setText(item_search_record_name, item.getInput());
-                item_search_record_x.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View view) {
-                        searchRecordMap.remove(item.getInput());
-                        allSearchRecordList.remove(item);
-                        searchRecordList.clear();
-                        ListUtil.addAll(searchRecordList, allSearchRecordList, 10);
-                        inputAdapter.notifyDataSetChanged();
-                        MyDbManager.getInstance().hideSearchApp(item);
-                        if(searchRecordList.isEmpty()){
-                            frame_container.setVisibility(View.VISIBLE);
-                            search_app_list.setVisibility(View.INVISIBLE);
-                        }
-                    }
-                });
-                return true;
-            }
-        };
-        search_app_list.setAdapter(inputAdapter);
+    protected Fragment initFragment() {
+        return new FgtSearchAppOrTask();
     }
 
-    private ArrayAdapter<SearchAppRecord> inputAdapter;
+    private List<TitleInfoList> titleInfoListList = new ArrayList<>();
 
     @Override
     public void initListener() {
-        search_app_list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
-            @Override
-            public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
-                SearchAppRecord item = ListUtil.getItem(searchRecordList, position);
-                if(item != null){
-                    title_search_input.setText(item.getInput());
-                    title_search_input.setSelection(item.getInput().length());
-                }
-            }
-        });
+        recyclerView.setHasFixedSize(true);
+        recyclerView.setNestedScrollingEnabled(false);
+        recyclerView.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
+        AdpTitleInfoList adpTitleInfoList = new AdpTitleInfoList(titleInfoListList);
+        adpTitleInfoList.bindToRecyclerView(recyclerView);
+
         title_search_input.setOnEditorActionListener(new TextView.OnEditorActionListener() {
             @Override
             public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
@@ -137,8 +103,8 @@ public class ActSearchAppOrTask extends BaseActivity {
             @Override
             public void afterTextChanged(Editable editable) {
                 title_search_input.removeCallbacks(autoSearchRunnable);
-                if(editable.toString().isEmpty() && !searchRecordList.isEmpty()){//输入框内容为空且有搜索记录时显示搜索记录
-                    search_app_list.setVisibility(View.VISIBLE);
+                if (editable.toString().isEmpty() && !isTitleInfoListEmpty()) {//输入框内容为空且有搜索记录时显示搜索记录
+                    recyclerView.setVisibility(View.VISIBLE);
                     frame_container.setVisibility(View.INVISIBLE);
                 } else {
                     title_search_input.postDelayed(autoSearchRunnable, 1000L);//1秒后自动搜索
@@ -150,36 +116,120 @@ public class ActSearchAppOrTask extends BaseActivity {
     private Runnable autoSearchRunnable = new Runnable() {
         @Override
         public void run() {
-            if(title_search_commit != null)
+            if (title_search_commit != null)
                 title_search_commit.performClick();
         }
     };
-    private Comparator<SearchAppRecord> comparator = new Comparator<SearchAppRecord>() {
-        @Override
-        public int compare(SearchAppRecord item1, SearchAppRecord item2) {
-            return item2.getCount() - item1.getCount();
-        }
-    };
+
+    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> topSearchStatisticsList = new ArrayList<>();
     @Override
     public void initData() {
+        //尝试获取缓存数据
+        List<TopSearchStatistics> newList = DataUtil.getInstance().getCacheList(ApiKey.top_search_statistics, TopSearchStatistics.class);
+        if (!ListUtil.isEmpty(newList)) {
+            topSearchStatisticsList.addAll(newList);
+            addListData("热门推荐", topSearchStatisticsList, SORT_TOP_SEARCH);
+        }
+
         //初始化搜索历史
-        List<SearchAppRecord> newSgrList = MyDbManager.getInstance().getAllSearchAppRecord();
-        ListUtil.addAll(allSearchRecordList, newSgrList);
-        Collections.sort(allSearchRecordList, comparator);
-        ListUtil.addAll(searchRecordList, allSearchRecordList, 10);
-        for (SearchAppRecord item : allSearchRecordList) {
-            searchRecordMap.put(item.getInput(), item);
+        List<SearchRecord> newSgrList = DDProviderHelper.getInstance().getSearchRecordList(SheepApp.getInstance(), MAX_SHOW_SEARCH_RECORD_COUNT);
+        if (!ListUtil.isEmpty(newSgrList)) {
+            searchRecordList.addAll(newSgrList);
+            addListData("搜索历史", searchRecordList, SORT_SEARCH_RECORD);
         }
-        inputAdapter.notifyDataSetChanged();
-        if(searchRecordList.isEmpty()) {
+        notifyDataSetChangedTitleInfoList();
+        SheepApp.getInstance().getNetComponent().getApiService().getTopSearchStatistics()
+                        .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);
+                                    topSearchStatisticsList.clear();
+                                    topSearchStatisticsList.addAll(newList);
+                                    if(ListUtil.getItem(titleInfoListList, new ListUtil.CallBack<TitleInfoList, Boolean>() {
+                                        @Override
+                                        public Boolean call(TitleInfoList titleInfoList) {
+                                            return titleInfoList.getSort() == SORT_TOP_SEARCH;
+                                        }
+                                    }) == null){
+                                        addListData("热门推荐", topSearchStatisticsList, SORT_TOP_SEARCH);
+                                    }
+                                    notifyDataSetChangedTitleInfoList();
+                                }
+                            }
+
+                            @Override
+                            public void onError(BaseMessage baseMessage) {
+                            }
+                        });
+
+    }
+    //排序与刷新
+    private void notifyDataSetChangedTitleInfoList() {
+        //排序
+        Collections.sort(titleInfoListList);
+        //刷新
+        recyclerView.getAdapter().notifyDataSetChanged();
+        if (isTitleInfoListEmpty()) {
             frame_container.setVisibility(View.VISIBLE);
-            search_app_list.setVisibility(View.INVISIBLE);
+            recyclerView.setVisibility(View.INVISIBLE);
         } else {
             frame_container.setVisibility(View.INVISIBLE);
-            search_app_list.setVisibility(View.VISIBLE);
+            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(new View.OnClickListener() {
+                        @Override
+                        public void onClick(View view) {
+                            list.remove(item);
+                            recyclerView.getAdapter().notifyDataSetChanged();
+                            DDProviderHelper.getInstance().deleteSearchRecord(SheepApp.getInstance(), (SearchRecord) item);
+                            if (isTitleInfoListEmpty()) {
+                                frame_container.setVisibility(View.VISIBLE);
+                                recyclerView.setVisibility(View.INVISIBLE);
+                            }
+                        }
+                    });
+                } else {
+                    ViewUtil.setVisibility(item_search_record_x, false);
+                }
+                //点击一条搜索历史
+                view.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        title_search_input.setText(item.getInput());
+                        title_search_input.setSelection(item.getInput().length());
+                        if(item instanceof IHomePageSearch)
+                            ApiUtil.postTopSearchStatisticsClickTopSearch((IHomePageSearch) item);
+                    }
+                });
+            }
+        }).setSort(sort));
+    }
+
+    //搜索历史中没有数据且没有获取到服务器的热门搜索列表
+    private boolean isTitleInfoListEmpty() {
+        return searchRecordList.isEmpty() && topSearchStatisticsList.isEmpty() ;
+    }
+
     @OnClick({R.id.title_search_commit, R.id.title_img_back})
     public void onViewClicked(View view) {
         switch (view.getId()) {
@@ -192,30 +242,24 @@ public class ActSearchAppOrTask extends BaseActivity {
         }
     }
 
-    List<SearchAppRecord> searchRecordList = new ArrayList<>();
-    List<SearchAppRecord> allSearchRecordList = new ArrayList<>();
-    Map<String, SearchAppRecord> searchRecordMap = new HashMap<>();
+    List<ISearchRecord> searchRecordList = new ArrayList<>();
 
     //尝试搜索游戏
     private void toSearchApp() {
-        search_app_list.setVisibility(View.INVISIBLE);
+        recyclerView.setVisibility(View.INVISIBLE);
         frame_container.setVisibility(View.VISIBLE);
         String inputText = title_search_input.getText().toString();
         if (!TextUtils.isEmpty(inputText)) {
             //保存搜索到数据库
-            SearchAppRecord searchRecord = searchRecordMap.get(inputText);
-            if(searchRecord == null) {
-                searchRecord = new SearchAppRecord();
-                searchRecord.setInput(inputText);
-                searchRecordList.add(searchRecord);
-                allSearchRecordList.add(searchRecord);
-                searchRecordMap.put(inputText, searchRecord);
-            }
-            searchRecord.setTime(System.currentTimeMillis());
-            searchRecord.addCount();
-            MyDbManager.getInstance().saveOrUpdate(searchRecord);
-            inputAdapter.notifyDataSetChanged();
+            SearchRecord searchRecord  = new SearchRecord();
+            searchRecord.setInput(inputText);
+            searchRecord.setLast_time(System.currentTimeMillis());
+            searchRecord.setCount(1);
+            searchRecordList.add(searchRecord);
+            DDProviderHelper.getInstance().addOrUpdateSearchRecord(SheepApp.getInstance(), searchRecord, null);
+            recyclerView.getAdapter().notifyDataSetChanged();
         }
-        fgtSearchApp.toSearch(inputText);
+        if (fragment instanceof ISearch)
+            ((ISearch) fragment).toSearch(inputText);
     }
 }

+ 9 - 9
app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchGame.java

@@ -22,7 +22,7 @@ import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 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.entity.Release_task;
 import com.sheep.gamegroup.model.entity.XiaomiGameEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
@@ -139,8 +139,8 @@ public class ActSearchGame extends BaseActivity {
                 TextView find_information_game_task_top = (TextView) itemView.findViewById(R.id.find_information_game_task_top);
                 TextView find_information_game_task_center = (TextView) itemView.findViewById(R.id.find_information_game_task_center);
 
-                if(item instanceof TaskReleaseEty){
-                    final TaskReleaseEty  items = (TaskReleaseEty) item;
+                if(item instanceof Release_task){
+                    final Release_task items = (Release_task) item;
                     final TaskEty taskEty;
                     if ((taskEty = items.getTask()) == null) {
                         return;
@@ -185,11 +185,11 @@ public class ActSearchGame extends BaseActivity {
         search_game_list.setAdapter(adapter);
     }
 
-    private ArrayAdapter<TaskReleaseEty> hotAdapter;
+    private ArrayAdapter<Release_task> hotAdapter;
     private void initHotList() {
-        hotAdapter = new ArrayAdapter<TaskReleaseEty>(activity, R.layout.item_search_game_hot, hotList) {
+        hotAdapter = new ArrayAdapter<Release_task>(activity, R.layout.item_search_game_hot, hotList) {
             @Override
-            public boolean convert(int position, View convertView, ViewGroup parent, final TaskReleaseEty item) {
+            public boolean convert(int position, View convertView, ViewGroup parent, final Release_task item) {
                 if (convertView instanceof TextView) {
                     ((TextView) convertView).setText(item.getName());
                 }
@@ -248,7 +248,7 @@ public class ActSearchGame extends BaseActivity {
     }
 
     List<SearchGameRecord> searchGameRecordList = new ArrayList<>();
-    List<TaskReleaseEty> hotList = new ArrayList<>();
+    List<Release_task> hotList = new ArrayList<>();
     List<Object> list = new ArrayList<>();
 
     @Override
@@ -278,7 +278,7 @@ public class ActSearchGame extends BaseActivity {
 
                         @Override
                         public void onNext(BaseMessage baseMessage) {
-                            List<TaskReleaseEty> newList = baseMessage.getDatas(TaskReleaseEty.class);
+                            List<Release_task> newList = baseMessage.getDatas(Release_task.class);
                             ListUtil.addAll(hotList, newList);
                             hotAdapter.notifyDataSetChanged();
                         }
@@ -353,7 +353,7 @@ public class ActSearchGame extends BaseActivity {
                                     list.clear();
                                     notifyDataSetChanged();
                                 }else {
-                                    List<TaskReleaseEty> newList = baseMessage.getDatas(TaskReleaseEty.class);
+                                    List<Release_task> newList = baseMessage.getDatas(Release_task.class);
                                     list.clear();
                                     ListUtil.addAll(list, newList);
                                     notifyDataSetChanged();

+ 4 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/ActUserAppHome.java

@@ -21,7 +21,7 @@ import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.absBase.ILoadMore;
 import com.sheep.gamegroup.absBase.IRefresh;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.GameApp;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.GameInfoList;
 import com.sheep.gamegroup.model.entity.LatelyGame;
 import com.sheep.gamegroup.model.entity.UserFocus;
@@ -208,8 +208,8 @@ public class ActUserAppHome extends BaseActivity {
         }
     }
 
-    private List<GameApp> latelyGameList = ListUtil.emptyList();
-    private List<GameApp> sameGameList = ListUtil.emptyList();
+    private List<Applications> latelyGameList = ListUtil.emptyList();
+    private List<Applications> sameGameList = ListUtil.emptyList();
     public static final String NAME_LATELY = "在玩的游戏";
     public static final String NAME_SAME = "同类游戏";
 
@@ -221,7 +221,7 @@ public class ActUserAppHome extends BaseActivity {
     }
 
     //重新加载列表
-    private void reloadList(List<GameApp> list, List<GameApp> addList, final String name) {
+    private void reloadList(List<Applications> list, List<Applications> addList, final String name) {
         list.clear();
         if (!ListUtil.isEmpty(addList)) {
             list.addAll(addList);

+ 4 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAct.java

@@ -38,7 +38,7 @@ import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
 import com.sheep.gamegroup.model.entity.TaskChild;
 import com.sheep.gamegroup.model.entity.TaskDescEntity;
 import com.sheep.gamegroup.model.entity.TaskEty;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.model.util.EntityUtils;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.presenter.TaskDetailContract;
@@ -207,7 +207,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
     private TaskEty taskEty;
 
     //通过task_id找
-    private TaskReleaseEty taskReleaseEty;
+    private Release_task taskReleaseEty;
     //接口获取
     private TaskAcceptedEty gettaskAcceptedEty;
 
@@ -1258,7 +1258,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
     public void taskDescSuccess(BaseMessage baseMessage) {
         hideProgress();
         empty_view.setVisibility(View.GONE);
-        taskReleaseEty = baseMessage.getData(TaskReleaseEty.class);
+        taskReleaseEty = baseMessage.getData(Release_task.class);
         loadData();
     }
 
@@ -1620,7 +1620,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
     }
 
     private void initTaskReleaseEty() {
-        taskReleaseEty = DataUtil.getInstance().getCacheResult(ApiKey.releaseTaskDesc(releaseTaskId), TaskReleaseEty.class);
+        taskReleaseEty = DataUtil.getInstance().getCacheResult(ApiKey.releaseTaskDesc(releaseTaskId), Release_task.class);
         hideProgress();
         if (taskReleaseEty != null) {
             if (empty_view == null) {

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailCreditCardAct.java

@@ -15,7 +15,7 @@ import com.bumptech.glide.request.RequestOptions;
 import com.sheep.gamegroup.absBase.AbsChooseImageActivity;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.TaskEty;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.model.util.EntityUtils;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.DeviceUtil;
@@ -83,7 +83,7 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
     private Activity activity;
 
     private TaskEty taskEty;
-    private TaskReleaseEty taskReleaseEty;
+    private Release_task taskReleaseEty;
 
     @Override
     protected int getLayoutId() {
@@ -184,7 +184,7 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(activity) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        taskReleaseEty = baseMessage.getData(TaskReleaseEty.class);
+                        taskReleaseEty = baseMessage.getData(Release_task.class);
                         if(taskReleaseEty == null){
                             baseMessage.setMsg("暂无数据");
                             onError(baseMessage);

+ 4 - 5
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGcGameAppList.java

@@ -7,8 +7,7 @@ import android.widget.TextView;
 
 import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
 import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
-import com.sheep.gamegroup.model.entity.GameApp;
-import com.sheep.gamegroup.util.ActivityManager;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ViewUtil;
@@ -20,14 +19,14 @@ import java.util.List;
  * Created by realicing on 2018/11/5.
  * realicing@sina.com
  */
-public class AdpGcGameAppList extends RecyclerViewAdapter<GameApp> {
+public class AdpGcGameAppList extends RecyclerViewAdapter<Applications> {
 
-    public AdpGcGameAppList(Context context, int layoutId, List<GameApp> datas) {
+    public AdpGcGameAppList(Context context, int layoutId, List<Applications> datas) {
         super(context, layoutId, datas);
     }
 
     @Override
-    public void convert(ViewHolder viewHolder, final GameApp item, int position) {
+    public void convert(ViewHolder viewHolder, final Applications item, int position) {
         ImageView item_gc_game_app_iv = viewHolder.itemView.findViewById(R.id.item_gc_game_app_iv);
         TextView item_gc_game_app_tv = viewHolder.itemView.findViewById(R.id.item_gc_game_app_tv);
         if (item == null) {

+ 43 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpTitleInfoList.java

@@ -0,0 +1,43 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.TextView;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.sheep.gamegroup.model.entity.GameInfoList;
+import com.sheep.gamegroup.model.entity.TitleInfoList;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.List;
+
+
+/**
+ * Created by realicing on 2018/11/1.
+ * realicing@sina.com
+ * 搜索游戏中的热门搜索与搜索历史
+ */
+public class AdpTitleInfoList extends BaseQuickAdapter<TitleInfoList, BaseViewHolder> {
+    public AdpTitleInfoList(List<TitleInfoList> list) {
+        super(R.layout.item_title_info_list, list);
+    }
+
+    @Override
+    public void convert(BaseViewHolder viewHolder, final TitleInfoList itemList) {
+        View item_title_info_list_top = viewHolder.itemView.findViewById(R.id.item_title_info_list_top);
+        View item_title_info_list_bottom = viewHolder.itemView.findViewById(R.id.item_title_info_list_bottom);
+        TextView item_title_info_list_tv = viewHolder.itemView.findViewById(R.id.item_title_info_list_tv);
+        RecyclerView recyclerView = viewHolder.itemView.findViewById(R.id.item_title_info_list_rv);
+
+        ViewUtil.setVisibility(item_title_info_list_top, itemList.isShowTopLine());
+        ViewUtil.setVisibility(item_title_info_list_bottom, itemList.isShowBottomLine());
+        ViewUtil.setText(item_title_info_list_tv, itemList.getName());
+
+        recyclerView.setHasFixedSize(true);
+        recyclerView.setNestedScrollingEnabled(false);
+        recyclerView.setLayoutManager(itemList.getLayoutManager());
+        recyclerView.setAdapter(itemList.getAdapter());
+    }
+}

+ 31 - 12
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpUserCommentReply.java

@@ -1,5 +1,6 @@
 package com.sheep.gamegroup.view.adapter;
 
+import android.text.TextUtils;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
@@ -12,6 +13,7 @@ import com.sheep.gamegroup.model.entity.UserCommentReply;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.ActivityManager;
 import com.sheep.gamegroup.util.ApiUtil;
+import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.TextViewUtil;
 import com.sheep.gamegroup.util.ViewUtil;
@@ -22,6 +24,8 @@ import com.sheep.jiuyan.samllsheep.utils.G;
 import java.util.List;
 import java.util.Locale;
 
+import rx.functions.Action1;
+
 /**
  * Created by realicing on 2018/11/2.
  * realicing@sina.com
@@ -32,9 +36,20 @@ public class AdpUserCommentReply extends BaseQuickAdapter<UserCommentReply, Base
         super(R.layout.item_user_comment_reply, list);
     }
     private UserComment userComment;
+    private boolean isMe;//是否是我的评论详情,我的评论详情中,列表里面显示回复图标,并可点击进行回复
+
 
     public void setUserComment(UserComment userComment) {
         this.userComment = userComment;
+        if(userComment != null){
+            isMe = TextUtils.equals(String.valueOf(userComment.getUser_id()), DataUtil.getInstance().getUserId());
+        }
+    }
+    //点击回复图标的回调
+    private Action1<UserCommentReply> action1;
+
+    public void setAction1(Action1<UserCommentReply> action1) {
+        this.action1 = action1;
     }
 
     @Override
@@ -43,7 +58,7 @@ public class AdpUserCommentReply extends BaseQuickAdapter<UserCommentReply, Base
         ImageView game_app_comment_user_avatar = helper.itemView.findViewById(R.id.game_app_comment_user_avatar);
         TextView game_app_comment_user_name = helper.itemView.findViewById(R.id.game_app_comment_user_name);
         final TextView game_app_comment_num1 = helper.itemView.findViewById(R.id.game_app_comment_num1);
-//        TextView game_app_comment_num2 = helper.itemView.findViewById(R.id.game_app_comment_num2);
+        final TextView game_app_comment_num2 = helper.itemView.findViewById(R.id.game_app_comment_num2);
         View game_app_comment_line_bottom = helper.itemView.findViewById(R.id.game_app_comment_line_bottom);
         TextView user_comment_reply_content = helper.itemView.findViewById(R.id.user_comment_reply_content);
         View game_app_comment_line_top = helper.itemView.findViewById(R.id.game_app_comment_line_top);
@@ -51,38 +66,42 @@ public class AdpUserCommentReply extends BaseQuickAdapter<UserCommentReply, Base
         if(item == null)
             return;
         //自己回复自己的评论
-        boolean replyUserIsCommentUser = userComment == null || userComment.getUser_id() ==item.getUser_id();
+        boolean replyUserIsCommentUser = userComment == null || userComment.getUser_id() == item.getUser_id();
         if(replyUserIsCommentUser){
             ViewUtil.setText(game_app_comment_user_name, item.getNickname());
         } else {
             ViewUtil.setText(game_app_comment_user_name, String.format(Locale.CHINA, "%s 回复 %s", item.getNickname(), userComment.getNickname()));
         }
         ViewUtil.setAvatar(game_app_comment_user_avatar, item.getAvatar());
-        ViewUtil.setText(game_app_comment_num1, item.getLike());
+        ViewUtil.setText(game_app_comment_num2, item.getLike());
+        ViewUtil.setVisibility(game_app_comment_num1, isMe && !replyUserIsCommentUser);//自己在自己的评论详情中,别人的评论下才显示回复图标
         ViewUtil.setVisibility(game_app_comment_line_bottom, false);
         ViewUtil.setVisibility(user_comment_reply_content, false);
         TextViewUtil.initIntroView(helper.itemView, item.getShowAll());
-
         game_app_comment_num1.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
-                game_app_comment_num1.setEnabled(false);
+                if(action1 != null)
+                    action1.call(item);
+            }
+        });
+        game_app_comment_num2.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                game_app_comment_num2.setEnabled(false);
                 ApiUtil.postGameUserUserCommentLike(item.getId(), new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
 
                     @Override
                     public void onNext(BaseMessage baseMessage) {
                         G.showToast("操作成功");
-                        if(game_app_comment_num1 != null) {
-                            item.setLike(item.getLike() + 1);
-                            ViewUtil.setText(game_app_comment_num1, item.getLike());
-                            game_app_comment_num1.setEnabled(true);
-                        }
+                        item.setLike(item.getLike() + 1);
+                        ViewUtil.setText(game_app_comment_num2, item.getLike());
+                        game_app_comment_num2.setEnabled(true);
                     }
                     @Override
                     public void onError(BaseMessage baseMessage) {
                         G.showToast("操作失败");
-                        if(game_app_comment_num1 != null)
-                            game_app_comment_num1.setEnabled(true);
+                        game_app_comment_num2.setEnabled(true);
                     }
                 });
             }

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/adapter/CreditCardProgressQueryAdp.java

@@ -10,7 +10,7 @@ import android.widget.TextView;
 
 import com.bumptech.glide.Glide;
 import com.sheep.gamegroup.model.entity.CreditCardProgressQuery;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.model.util.EntityUtils;
 import com.sheep.gamegroup.util.BtStatusUtil;
 import com.sheep.gamegroup.util.Jump2View;
@@ -66,7 +66,7 @@ public class CreditCardProgressQueryAdp extends BaseAdapter {
         }
 
         final CreditCardProgressQuery creditCardProgressQuery = (CreditCardProgressQuery) getItem(position);
-        final TaskReleaseEty ety = creditCardProgressQuery.getRelease_task();
+        final Release_task ety = creditCardProgressQuery.getRelease_task();
         try {
             Glide.with(context).load(ety.getTask().getIcon())
                     .into(holder.credit_card_task_iv);

+ 4 - 4
app/src/main/java/com/sheep/gamegroup/view/adapter/CreditCardTaskAdp.java

@@ -10,7 +10,7 @@ import android.widget.ImageView;
 import android.widget.TextView;
 
 import com.bumptech.glide.Glide;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.jiuyan.samllsheep.R;
 
 import java.util.List;
@@ -21,9 +21,9 @@ import java.util.List;
 
 public class CreditCardTaskAdp extends BaseAdapter {
     private Context context;
-    private List<TaskReleaseEty> etyList;
+    private List<Release_task> etyList;
 
-    public CreditCardTaskAdp(Context context, List<TaskReleaseEty> etyList) {
+    public CreditCardTaskAdp(Context context, List<Release_task> etyList) {
         this.context = context;
         this.etyList = etyList;
     }
@@ -59,7 +59,7 @@ public class CreditCardTaskAdp extends BaseAdapter {
             convertView.setTag(holder);
         }
 
-        final TaskReleaseEty ety = (TaskReleaseEty) getItem(position);
+        final Release_task ety = (Release_task) getItem(position);
         if(ety != null) {
             holder.credit_card_task_tv.setText("+");
             holder.credit_card_task_tv.append(ety.getBonusText());

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/adapter/GiftCenterAdapter.java

@@ -10,7 +10,7 @@ import android.widget.TextView;
 
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.DialogConfig;
-import com.sheep.gamegroup.model.entity.GameApp;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.GiftBag;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
@@ -82,7 +82,7 @@ public class GiftCenterAdapter extends AdbCommonRecycler<GiftBagApp> {
             item_download_welfare_iv2.setVisibility(View.GONE);
             item_download_welfare_tip_iv.setVisibility(View.GONE);
         } else if(context instanceof Activity){
-            final GameApp itemApp = item.getApp();
+            final Applications itemApp = item.getApp();
             final GiftBag itemGiftBag = item.getGift_bag();
             if(itemApp == null || itemGiftBag == null){
                 return;

+ 26 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/HomePageSearchAdapter.java

@@ -0,0 +1,26 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.support.annotation.Nullable;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.sheep.gamegroup.model.entity.HomePageSearch;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.List;
+
+/**
+ * Created by realicing on 2018/11/8.
+ * realicing@sina.com
+ */
+public class HomePageSearchAdapter extends BaseQuickAdapter<HomePageSearch, BaseViewHolder> {
+
+    public HomePageSearchAdapter(@Nullable List<HomePageSearch> data) {
+        super(R.layout.play_game_vertical_list_item, data);
+    }
+
+    @Override
+    protected void convert(BaseViewHolder helper, HomePageSearch item) {
+
+    }
+}

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/view/adapter/TaskdetailSonListviewAdp.java

@@ -19,7 +19,7 @@ import com.google.zxing.Result;
 import com.sheep.gamegroup.model.entity.ScreenshotsEntity;
 import com.sheep.gamegroup.model.entity.TaskChild;
 import com.sheep.gamegroup.model.entity.TaskDescEntity;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.Jump2View;
@@ -45,7 +45,7 @@ import static com.sheep.gamegroup.util.UMConfigUtils.Event.TASK_SAVE_QR;
 public class TaskdetailSonListviewAdp extends BaseAdapter {
     private List<TaskChild> descEntityArrayList;
     private Context context;
-    private TaskReleaseEty taskReleaseEty;
+    private Release_task taskReleaseEty;
     int with;
 
     public TaskdetailSonListviewAdp(List<TaskChild> descEntityArrayList, Context context) {
@@ -54,7 +54,7 @@ public class TaskdetailSonListviewAdp extends BaseAdapter {
         with = G.WIDTH > G.HEIGHT ? G.HEIGHT / 3 - 50 : G.WIDTH / 3 - 50;
     }
 
-    public void addTaskEntity(TaskReleaseEty taskReleaseEty) {
+    public void addTaskEntity(Release_task taskReleaseEty) {
         this.taskReleaseEty = taskReleaseEty;
     }
 

+ 9 - 9
app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java

@@ -27,7 +27,7 @@ import com.sheep.gamegroup.model.entity.RecyleObj;
 import com.sheep.gamegroup.model.entity.RecyleType;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
 import com.sheep.gamegroup.model.entity.TaskEty;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DownloadUtil;
@@ -108,13 +108,13 @@ public class TryMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
     public void convert(ViewHolder holder, RecyleObj recyleObj) {
         switch (recyleObj.getRecyleType()){
             case RELEASE_TASK:
-                bindReleaseTask(holder, (List<TaskReleaseEty>) recyleObj.getDataObj(), 0);
+                bindReleaseTask(holder, (List<Release_task>) recyleObj.getDataObj(), 0);
                 break;
             case RUN_TASK:
                 bindRunTask(holder, (List<TaskAcceptedEty>) recyleObj.getDataObj());
                 break;
             case BEGIN_TASK://即将开始
-                bindReleaseTask(holder, (List<TaskReleaseEty>) recyleObj.getDataObj(), 1);
+                bindReleaseTask(holder, (List<Release_task>) recyleObj.getDataObj(), 1);
                 break;
             case GAME_TASK://我的游戏
                 bindGameTask(holder, (List<OrienteeringDetail>) recyleObj.getDataObj());
@@ -123,7 +123,7 @@ public class TryMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
                 bindGamePlotForm(holder, (List<GameAgencyRechargePlatformEntity>) recyleObj.getDataObj());
                 break;
             case GAME_AGENCY_PAYMENT:
-                bindGameReleaseTask(holder, (List<TaskReleaseEty>) recyleObj.getDataObj(), 0);
+                bindGameReleaseTask(holder, (List<Release_task>) recyleObj.getDataObj(), 0);
                 break;
         }
 
@@ -428,7 +428,7 @@ public class TryMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
     /**
      * 游戏代充
      */
-    private void bindGameReleaseTask(ViewHolder holder, final List<TaskReleaseEty> etyList, final int isBegin){
+    private void bindGameReleaseTask(ViewHolder holder, final List<Release_task> etyList, final int isBegin){
         RecyclerView recyclerView = holder.getView(R.id.release_task_listview, RecyclerView.class);
         recyclerView.setHasFixedSize(true);
         recyclerView.setLayoutManager(new LinearLayoutManager(context));
@@ -449,7 +449,7 @@ public class TryMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
 
             @Override
             public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, final int i) {
-                final TaskReleaseEty taskReleaseEty = ListUtil.getItem(etyList, i);
+                final Release_task taskReleaseEty = ListUtil.getItem(etyList, i);
                 final TaskEty taskEty;
                 if (taskReleaseEty == null || (taskEty = taskReleaseEty.getTask()) == null) {
                     return;
@@ -536,7 +536,7 @@ public class TryMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
     /**
      * 获取已发布的
      */
-    private void bindReleaseTask(ViewHolder holder, final List<TaskReleaseEty> etyList, final int isBegin){
+    private void bindReleaseTask(ViewHolder holder, final List<Release_task> etyList, final int isBegin){
         RecyclerView recyclerView = holder.getView(R.id.release_task_listview, RecyclerView.class);
         recyclerView.setHasFixedSize(true);
         recyclerView.setLayoutManager(new LinearLayoutManager(context));
@@ -557,7 +557,7 @@ public class TryMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
 
             @Override
             public void onBindViewHolder(final RecyclerView.ViewHolder viewHolder, final int i) {
-                final TaskReleaseEty taskReleaseEty = ListUtil.getItem(etyList, i);
+                final Release_task taskReleaseEty = ListUtil.getItem(etyList, i);
                 final TaskEty taskEty;
                 if (taskReleaseEty == null || (taskEty = taskReleaseEty.getTask()) == null) {
                     return;
@@ -723,7 +723,7 @@ public class TryMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
             @Override
             public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, final int i) {
                 final TaskAcceptedEty taskAcceptedEty;
-                final TaskReleaseEty taskReleaseEty;
+                final Release_task taskReleaseEty;
                 final TaskEty taskEty;
                 if((taskAcceptedEty = ListUtil.getItem(etyList, i)) == null
                         || (taskReleaseEty = taskAcceptedEty.getRelease_task()) == null

+ 5 - 5
app/src/main/java/com/sheep/gamegroup/view/adapter/WelfareAdapter.java

@@ -10,7 +10,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.util.DownloadUtil;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.TaskEty;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DeviceUtil;
@@ -38,9 +38,9 @@ import static com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp.PUBLIC_TAG_PREFIX
  * Created by realicing on 2018/8/28.
  * realicing@sina.com
  */
-public class WelfareAdapter extends AdbCommonRecycler<TaskReleaseEty>{
+public class WelfareAdapter extends AdbCommonRecycler<Release_task>{
     private Action1<Integer> action1;
-    public WelfareAdapter(Context context, List<TaskReleaseEty> list, Action1<Integer> action1) {
+    public WelfareAdapter(Context context, List<Release_task> list, Action1<Integer> action1) {
         super(context, list);
         this.action1 = action1;
     }
@@ -52,7 +52,7 @@ public class WelfareAdapter extends AdbCommonRecycler<TaskReleaseEty>{
     }
 
     @Override
-    public void convert(ViewHolder holder, final TaskReleaseEty item) {
+    public void convert(ViewHolder holder, final Release_task item) {
         ImageView item_download_welfare_iv = (ImageView)holder.getView(R.id.item_download_welfare_iv);
         ImageView item_download_welfare_iv2 = (ImageView)holder.getView(R.id.item_download_welfare_iv2);
         TextView item_download_welfare_name_tv = (TextView)holder.getView(R.id.item_download_welfare_name_tv);
@@ -195,7 +195,7 @@ public class WelfareAdapter extends AdbCommonRecycler<TaskReleaseEty>{
     /**
      * 领取奖励
      */
-    private void acceptedReceiveAward(TaskReleaseEty item) {
+    private void acceptedReceiveAward(Release_task item) {
         RECEIVE_AWARD_GAME_TASK.onEvent();
         SheepApp.getInstance()
                 .getNetComponent()

+ 4 - 4
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtCreditCardTaskList.java

@@ -6,7 +6,7 @@ import android.widget.AdapterView;
 import android.widget.ListView;
 
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.Jump2View;
@@ -40,7 +40,7 @@ public class FgtCreditCardTaskList extends BaseFragment {
         return R.layout.fgt_credit_card_task_list;
     }
 
-    private List<TaskReleaseEty> list = new ArrayList<>();
+    private List<Release_task> list = new ArrayList<>();
     private CreditCardTaskAdp adapter;
     private Activity activity;
     @Override
@@ -68,7 +68,7 @@ public class FgtCreditCardTaskList extends BaseFragment {
         initData();
     }
 
-    private void onItemClickTask(TaskReleaseEty taskReleaseEty) {
+    private void onItemClickTask(Release_task taskReleaseEty) {
         taskReleaseEty.getTask().setBonus(taskReleaseEty.getBonusText());
         taskReleaseEty.getTask().setName(taskReleaseEty.getName());
         Jump2View.getInstance().goCreditCardTaskDetail(activity, taskReleaseEty.getId());
@@ -84,7 +84,7 @@ public class FgtCreditCardTaskList extends BaseFragment {
                         .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                             @Override
                             public void onNext(BaseMessage baseMessage) {
-                                List<TaskReleaseEty> newList = baseMessage.getDatas(TaskReleaseEty.class);
+                                List<Release_task> newList = baseMessage.getDatas(Release_task.class);
                                 list.addAll(newList);
                                 notifyDataSetChanged();
                             }

+ 4 - 4
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtDownloadWelfareList.java

@@ -7,7 +7,7 @@ import android.support.v7.widget.RecyclerView;
 import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.view.adapter.WelfareAdapter;
 
@@ -23,7 +23,7 @@ import rx.functions.Action1;
  * Created by realicing on 2018/9/3.
  * realicing@sina.com
  */
-public class FgtDownloadWelfareList extends BaseListFragment2<TaskReleaseEty> implements Action1<Integer> {
+public class FgtDownloadWelfareList extends BaseListFragment2<Release_task> implements Action1<Integer> {
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -63,7 +63,7 @@ public class FgtDownloadWelfareList extends BaseListFragment2<TaskReleaseEty> im
     }
 
     @Override
-    protected Class<TaskReleaseEty> getTClass() {
-        return TaskReleaseEty.class;
+    protected Class<Release_task> getTClass() {
+        return Release_task.class;
     }
 }

+ 7 - 7
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtFindChild.java

@@ -18,7 +18,7 @@ import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.GameApp;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.Article;
 import com.sheep.gamegroup.model.entity.ArticleTag;
 import com.sheep.gamegroup.util.CommonUtil;
@@ -85,7 +85,7 @@ public class FgtFindChild extends BaseListFragment2<Article> {
 
                 if (item.isGame()) {
                     find_item_download.setVisibility(View.VISIBLE);
-                    GameApp findApp = item.getApplication();
+                    Applications findApp = item.getApplication();
 //                    find_item_pf_label.setVisibility(View.VISIBLE);
 //                    find_item_pf_label.setText(Html.fromHtml(String.format(Locale.CHINA, "评分:<font color='%s'>%.1f</font>分", "#29d6fd", findApp.getScore())));
                     updateView(activity, findApp, find_item_download);
@@ -168,10 +168,10 @@ public class FgtFindChild extends BaseListFragment2<Article> {
     }
 
 
-    private Map<String, GameApp> findAppMap = new HashMap<>();
+    private Map<String, Applications> findAppMap = new HashMap<>();
 
     //获取任务对应的findApp
-    private GameApp getFindAppByKey(String key) {
+    private Applications getFindAppByKey(String key) {
         if (findAppMap.containsKey(key))
             return findAppMap.get(key);
         return null;
@@ -191,7 +191,7 @@ public class FgtFindChild extends BaseListFragment2<Article> {
     }
 
     //更新按钮状态与添加点击事件
-    private void updateView(Activity activity, GameApp findApp, TextView textView) {
+    private void updateView(Activity activity, Applications findApp, TextView textView) {
         if (findApp.isCanDownload()) {//可下载
             downLoadTextViewMap.put(findApp.getDownload_link(), textView);
             downLoadTextViewMap.put(findApp.getPackage_name(), textView);
@@ -259,7 +259,7 @@ public class FgtFindChild extends BaseListFragment2<Article> {
         if (textView != null) {
             textView.setText(CommonUtil.START_INSTALL);
         }
-        GameApp findApp = getFindAppByKey(task.getMDownloadUrl());
+        Applications findApp = getFindAppByKey(task.getMDownloadUrl());
         if (findApp != null) {
             findApp.updateState(DownloadUtil.STATUS_FINISH);
         }
@@ -315,7 +315,7 @@ public class FgtFindChild extends BaseListFragment2<Article> {
         if (intent != null && intent.getAction() != null && intent.getDataString() != null && intent.getDataString().contains("package:")) {
             String packageName = intent.getDataString().replace("package:", "");
 
-            GameApp findApp = getFindAppByKey(packageName);
+            Applications findApp = getFindAppByKey(packageName);
             TextView textView = getTextViewByKey(packageName);
             if (findApp != null) {
                 switch (intent.getAction()) {

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGameAgencyRecharge.java

@@ -17,7 +17,7 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GameAgencyRechargePlatformEntity;
 import com.sheep.gamegroup.model.entity.RecyleObj;
 import com.sheep.gamegroup.model.entity.RecyleType;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.SysAppUtil;
@@ -95,7 +95,7 @@ public class FgtGameAgencyRecharge extends BaseFragment {
 
     private TryMakeMoneyAdp tryMakeMoneyAdp;
     private List<GameAgencyRechargePlatformEntity> platformList = ListUtil.emptyList();//平台充值
-    private List<TaskReleaseEty> releaseEtyLists = new ArrayList<>();//游戏代充
+    private List<Release_task> releaseEtyLists = new ArrayList<>();//游戏代充
 
     private String task_type;
 
@@ -203,7 +203,7 @@ public class FgtGameAgencyRecharge extends BaseFragment {
                         @Override
                         public void call(BaseMessage baseMessage) {
                             try {
-                                List<TaskReleaseEty> releaseEtyList = JSONArray.parseArray(JSONArray.toJSONString(baseMessage.getData()), TaskReleaseEty.class);
+                                List<Release_task> releaseEtyList = JSONArray.parseArray(JSONArray.toJSONString(baseMessage.getData()), Release_task.class);
                                 if (releaseEtyList != null) {
                                     releaseEtyLists.clear();
                                     releaseEtyLists.addAll(releaseEtyList);

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGcGameAppComment.java

@@ -13,7 +13,7 @@ import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.AppScoreDetail;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.GameApp;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.UserComment;
 import com.sheep.gamegroup.model.entity.GameAppScore;
 import com.sheep.gamegroup.model.entity.GameEntity;
@@ -121,7 +121,7 @@ public class FgtGcGameAppComment extends BaseListFragment3<UserComment> {
 
     //不会用到了,因为评分系统重新做了一套,以前的没用了
     public void loadData(GameEntity gameEntity) {
-        GameApp gameApp;
+        Applications gameApp;
         if ((gameApp = gameEntity.getApp()) != null) {
             updateScore(gameApp.getScore());
         }

+ 3 - 4
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGcGameAppDetail.java

@@ -13,7 +13,7 @@ import com.sheep.gamegroup.absBase.BaseRefreshLoadMoreFragment;
 import com.sheep.gamegroup.helper.ImageListHelper;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.Entry;
-import com.sheep.gamegroup.model.entity.GameApp;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.entity.GameInfoList;
 import com.sheep.gamegroup.model.entity.ShowAll;
@@ -28,7 +28,6 @@ import com.sheep.gamegroup.view.adapter.AdpGcGameAppInfoList;
 import com.sheep.gamegroup.view.adapter.AdpGcGameAppList;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.utils.G;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -94,7 +93,7 @@ public class FgtGcGameAppDetail extends BaseRefreshLoadMoreFragment implements A
                     });
             return;
         }
-        GameApp gameApp;
+        Applications gameApp;
         if (gameEntity == null || (gameApp = gameEntity.getApp()) == null)
             return;
         ListUtil.removeItem(gameInfoListArrayList, new ListUtil.CallBack<GameInfoList, Boolean>() {
@@ -153,7 +152,7 @@ public class FgtGcGameAppDetail extends BaseRefreshLoadMoreFragment implements A
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        ArrayList<GameApp> newList = baseMessage.getDataList(GameApp.class);
+                        ArrayList<Applications> newList = baseMessage.getDataList(Applications.class);
                         if (!ListUtil.isEmpty(newList)) {
                             gameInfoListArrayList.add(new GameInfoList(name, new AdpGcGameAppList(SheepApp.getInstance(), R.layout.item_gc_game_app_63, newList)).setHorizontal().setSort(sort));
                             Collections.sort(gameInfoListArrayList);

+ 9 - 16
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtHomeTaskReleaseList.java

@@ -9,27 +9,21 @@ import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
-import android.widget.TextView;
 
-import com.jcodecraeer.xrecyclerview.XRecyclerView;
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
 import com.sheep.gamegroup.di.components.DaggerFgtTryMakeMoneyComponent;
 import com.sheep.gamegroup.di.modules.TryMakeMoneyModule;
-import com.sheep.gamegroup.event.BigEvent;
-import com.sheep.gamegroup.event.EventTypes;
 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.RequestParamEty;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
 import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.ListUtil;
-import com.sheep.gamegroup.util.LogUtil;
-import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.activity.GamemakeMoneyAct;
 import com.sheep.gamegroup.view.activity.TryMakeMoneyact;
 import com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp;
@@ -48,7 +42,6 @@ import java.util.List;
 import javax.inject.Inject;
 
 import butterknife.BindView;
-import rx.functions.Action1;
 
 /**
  * Created by realicing on 2018/10/10.
@@ -68,10 +61,10 @@ public class FgtHomeTaskReleaseList extends BaseFragment implements TryMakeMoney
     private Activity activity;
     private TryMakeMoneyAdp tryMakeMoneyAdp;
     private List<TaskAcceptedEty> acceptedEtyList = new ArrayList<>();
-    private List<TaskReleaseEty> releaseEtyLists = new ArrayList<>();
-    private List<TaskReleaseEty> releaseEtyListsBegin = new ArrayList<>();
-    private List<TaskReleaseEty> lastCacheReleaseEtyLists = new ArrayList<>();
-    private List<TaskReleaseEty> lastCacheReleaseEtyListsBegin = new ArrayList<>();
+    private List<Release_task> releaseEtyLists = new ArrayList<>();
+    private List<Release_task> releaseEtyListsBegin = new ArrayList<>();
+    private List<Release_task> lastCacheReleaseEtyLists = new ArrayList<>();
+    private List<Release_task> lastCacheReleaseEtyListsBegin = new ArrayList<>();
     private int about_to_begin = 0;
     private String show_type;//有值代表来自主页
     private boolean isFromHome = false;//来自主页
@@ -80,9 +73,9 @@ public class FgtHomeTaskReleaseList extends BaseFragment implements TryMakeMoney
 
     private static final int LIST_COUNT = 3;//tryMakeMoneyAdp 总共有3条数据
     private static final RecyleObj NULL = RecyleObj.make(RecyleType.NONE, null);//空数据
-    private Comparator<TaskReleaseEty> comparator = new Comparator<TaskReleaseEty>() {
+    private Comparator<Release_task> comparator = new Comparator<Release_task>() {
         @Override
-        public int compare(TaskReleaseEty item1, TaskReleaseEty item2) {
+        public int compare(Release_task item1, Release_task item2) {
             return item2.getLastNum1Or0() - item1.getLastNum1Or0();
         }
     };
@@ -407,7 +400,7 @@ public class FgtHomeTaskReleaseList extends BaseFragment implements TryMakeMoney
     public void releaseTaskTaskUpdateView(BaseMessage baseMessage, int about_to_begin) {
         boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.release_task(about_to_begin == 0 ? releasePage : releaseBeginPage, per_page, about_to_begin, task_type, getIs_succession()));
         if (isNewData) {
-            List<TaskReleaseEty> releaseEtyList = baseMessage.getDataList(TaskReleaseEty.class);
+            List<Release_task> releaseEtyList = baseMessage.getDataList(Release_task.class);
             switch (about_to_begin) {
                 case 0:
                     ListUtil.removeAll(releaseEtyLists, lastCacheReleaseEtyLists);
@@ -449,7 +442,7 @@ public class FgtHomeTaskReleaseList extends BaseFragment implements TryMakeMoney
     //从ACache获取发布的任务列表
     private void getReleaseFromACache(int about_to_begin) {
         try {
-            List<TaskReleaseEty> cacheTaskReleaseEtyList = DataUtil.getInstance().getCacheList(ApiKey.release_task(about_to_begin == 0 ? releasePage : releaseBeginPage, per_page, about_to_begin, task_type, getIs_succession()), TaskReleaseEty.class);
+            List<Release_task> cacheTaskReleaseEtyList = DataUtil.getInstance().getCacheList(ApiKey.release_task(about_to_begin == 0 ? releasePage : releaseBeginPage, per_page, about_to_begin, task_type, getIs_succession()), Release_task.class);
             switch (about_to_begin) {
                 case 0:
                     lastCacheReleaseEtyLists = cacheTaskReleaseEtyList;

+ 4 - 4
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPlaGameGift.java

@@ -12,7 +12,7 @@ import android.widget.TextView;
 
 import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.ViewHolder;
@@ -79,8 +79,8 @@ public class FgtPlaGameGift extends BaseFragment {
             public void convert(ViewHolder holder, final Object giftBagApp) {
                 if (giftBagApp instanceof GiftBagApp){
                     bindGfitData(holder, (GiftBagApp) giftBagApp);
-                }else if(giftBagApp instanceof TaskReleaseEty){
-                    bindReleaseData(holder, (TaskReleaseEty) giftBagApp);
+                }else if(giftBagApp instanceof Release_task){
+                    bindReleaseData(holder, (Release_task) giftBagApp);
                 }
             }
 
@@ -123,7 +123,7 @@ public class FgtPlaGameGift extends BaseFragment {
                 holder.getView(R.id.line_tv).setVisibility(holder.getAdapterPosition() + 1 == getItemCount() ? View.GONE : View.VISIBLE);
             }
 
-            private void bindReleaseData(ViewHolder holder, final TaskReleaseEty giftBagApp){
+            private void bindReleaseData(ViewHolder holder, final Release_task giftBagApp){
 
                 View view = holder.itemView;
                 ViewUtil.setText((TextView) holder.getView(R.id.name_tv), giftBagApp.getName());

+ 71 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSearchAppOrTask.java

@@ -0,0 +1,71 @@
+package com.sheep.gamegroup.view.fragment;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.sheep.gamegroup.absBase.ISearch;
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.HomePageSearch;
+import com.sheep.gamegroup.util.ApiUtil;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.view.adapter.HomePageSearchAdapter;
+
+import java.util.Locale;
+
+import rx.Observable;
+
+/**
+ * Created by realicing on 2018/9/13.
+ * realicing@sina.com
+ */
+public class FgtSearchAppOrTask extends BaseListFragment3<HomePageSearch> implements ISearch, BaseQuickAdapter.OnItemClickListener {
+
+    @Override
+    public int refreshDataType() {
+        return -1;
+    }
+
+    private String search_content;
+
+    @Override
+    protected RecyclerView.Adapter getAdapter() {
+        HomePageSearchAdapter adapter = new HomePageSearchAdapter(list);
+        adapter.setOnItemClickListener(this);
+        return adapter;
+    }
+
+    @Override
+    protected String getKey(int page, int per_page) {
+        return String.format(Locale.CHINA, "app/top_search_statistics/home_page_search?search_content=%s", search_content);
+    }
+
+    @Override
+    protected Observable<BaseMessage> getApi(ApiService apiService) {
+        return apiService.getTopSearchStatisticsHomePageSearch(search_content);
+    }
+
+    @Override
+    protected Class<HomePageSearch> getTClass() {
+        return HomePageSearch.class;
+    }
+
+    public void clear() {
+        list.clear();
+    }
+
+    @Override
+    public void toSearch(String name) {
+        this.search_content = name;
+        refreshData();
+    }
+
+    @Override
+    public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+        HomePageSearch item = ListUtil.getItem(list, position);
+        ApiUtil.postTopSearchStatisticsClickTopSearch(item);
+        Jump2View.getInstance().goTaskOrAppDetail(item);
+    }
+}

+ 4 - 4
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java

@@ -63,7 +63,7 @@ import com.sheep.gamegroup.model.entity.RequestParamEty;
 import com.sheep.gamegroup.model.entity.RobTask;
 import com.sheep.gamegroup.model.entity.SlideshowEty;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.presenter.SmallSheepContract;
@@ -215,7 +215,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
     //recyclerview
     private TryMakeMoneyAdp tryMakeMoneyAdp;
     private List<TaskAcceptedEty> allTaskAcceptedTaskList = ListUtil.emptyList();
-    private List<TaskReleaseEty> releaseEtyLists = new ArrayList<>();
+    private List<Release_task> releaseEtyLists = new ArrayList<>();
     private List<SlideshowEty> slideshowEtyLists = new ArrayList<>();
     private List<String> slideshowTitleList = new ArrayList<>();
     private List<BulletinEnty> bulletinEntyLists = new ArrayList<>();
@@ -226,7 +226,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
     private List<HomeListEntity> homeListEntitysListview = new ArrayList<>();
     private AdpHomeListGrideview adpHomeListGrideview;
     private AdpHomeListListview adpHomeListListview;
-    private TaskReleaseEty taskEty;
+    private Release_task taskEty;
     private AdpTryMakemoney mAdapter;
 
     private static final int LIST_COUNT = 2;//tryMakeMoneyAdp 总共有2条数据
@@ -1156,7 +1156,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
     public void releaseTaskTaskUpdateView(BaseMessage baseMessage, int about_to_begin) {
         boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.release_task);
         if (isNewData) {
-            List<TaskReleaseEty> releaseEtyList = baseMessage.getDataList(TaskReleaseEty.class);
+            List<Release_task> releaseEtyList = baseMessage.getDataList(Release_task.class);
             if (releaseEtyList != null) {
                 releaseEtyLists = releaseEtyList;
                 mHandler.sendEmptyMessage(WHAT_LOAD_RUN_TASK);

+ 9 - 12
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtTryMakeMoney.java

@@ -19,13 +19,12 @@ import com.sheep.gamegroup.model.entity.RecyleObj;
 import com.sheep.gamegroup.model.entity.RecyleType;
 import com.sheep.gamegroup.model.entity.RequestParamEty;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
 import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.ListUtil;
-import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.activity.GamemakeMoneyAct;
 import com.sheep.gamegroup.view.activity.TryMakeMoneyact;
@@ -46,8 +45,6 @@ import java.util.List;
 import javax.inject.Inject;
 
 import butterknife.BindView;
-import butterknife.ButterKnife;
-import butterknife.Unbinder;
 import rx.functions.Action1;
 
 
@@ -67,10 +64,10 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
     private Activity activity;
     private TryMakeMoneyAdp tryMakeMoneyAdp;
     private List<TaskAcceptedEty> acceptedEtyList = new ArrayList<>();
-    private List<TaskReleaseEty> releaseEtyLists = new ArrayList<>();
-    private List<TaskReleaseEty> releaseEtyListsBegin = new ArrayList<>();
-    private List<TaskReleaseEty> lastCacheReleaseEtyLists = new ArrayList<>();
-    private List<TaskReleaseEty> lastCacheReleaseEtyListsBegin = new ArrayList<>();
+    private List<Release_task> releaseEtyLists = new ArrayList<>();
+    private List<Release_task> releaseEtyListsBegin = new ArrayList<>();
+    private List<Release_task> lastCacheReleaseEtyLists = new ArrayList<>();
+    private List<Release_task> lastCacheReleaseEtyListsBegin = new ArrayList<>();
     private int about_to_begin = 0;
     private String show_type;//有值代表来自主页
     private boolean isFromHome = false;//来自主页
@@ -79,9 +76,9 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
 
     private static final int LIST_COUNT = 3;//tryMakeMoneyAdp 总共有3条数据
     private static final RecyleObj NULL = RecyleObj.make(RecyleType.NONE, null);//空数据
-    private Comparator<TaskReleaseEty> comparator = new Comparator<TaskReleaseEty>() {
+    private Comparator<Release_task> comparator = new Comparator<Release_task>() {
         @Override
-        public int compare(TaskReleaseEty item1, TaskReleaseEty item2) {
+        public int compare(Release_task item1, Release_task item2) {
             return item2.getLastNum1Or0() - item1.getLastNum1Or0();
         }
     };
@@ -466,7 +463,7 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
     public void releaseTaskTaskUpdateView(BaseMessage baseMessage, int about_to_begin) {
         boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.release_task(about_to_begin == 0 ? releasePage : releaseBeginPage, per_page, about_to_begin, task_type, getIs_succession()));
         if (isNewData) {
-            List<TaskReleaseEty> releaseEtyList = baseMessage.getDataList(TaskReleaseEty.class);
+            List<Release_task> releaseEtyList = baseMessage.getDataList(Release_task.class);
             switch (about_to_begin) {
                 case 0:
                     ListUtil.removeAll(releaseEtyLists, lastCacheReleaseEtyLists);
@@ -508,7 +505,7 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
     //从ACache获取发布的任务列表
     private void getReleaseFromACache(int about_to_begin) {
         try {
-            List<TaskReleaseEty> cacheTaskReleaseEtyList = DataUtil.getInstance().getCacheList(ApiKey.release_task(about_to_begin == 0 ? releasePage : releaseBeginPage, per_page, about_to_begin, task_type, getIs_succession()), TaskReleaseEty.class);
+            List<Release_task> cacheTaskReleaseEtyList = DataUtil.getInstance().getCacheList(ApiKey.release_task(about_to_begin == 0 ? releasePage : releaseBeginPage, per_page, about_to_begin, task_type, getIs_succession()), Release_task.class);
             switch (about_to_begin) {
                 case 0:
                     lastCacheReleaseEtyLists = cacheTaskReleaseEtyList;

+ 24 - 5
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtUserCommentDetail.java

@@ -44,6 +44,7 @@ import java.util.Locale;
 import butterknife.BindView;
 import rx.Observable;
 import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
 /**
@@ -51,7 +52,7 @@ import rx.schedulers.Schedulers;
  * realicing@sina.com
  * 用户评论详情界面
  */
-public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
+public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> implements Action1<UserCommentReply> {
 
     @Override
     public int getLayoutId() {
@@ -66,6 +67,8 @@ public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
     RelativeLayout rlContent;
     @BindView(R.id.elEmotion)
     EmotionLayout elEmotion;
+
+    private TextView input_comment_reply;
     //输入框
     private EditText input_comment_input;
     private ImageView input_comment_exp;
@@ -105,6 +108,7 @@ public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
         footerView = LayoutInflater.from(SheepApp.getInstance()).inflate(R.layout.footer_user_comment_detail, null);
         //底部可发表评论
         LayoutInflater.from(SheepApp.getInstance()).inflate(R.layout.include_input_comment_exp, bottom);
+        input_comment_reply = bottom.findViewById(R.id.input_comment_reply);
         input_comment_input = bottom.findViewById(R.id.input_comment_input);
         input_comment_exp = bottom.findViewById(R.id.input_comment_exp);
         bottom.findViewById(R.id.input_comment_commit).setOnClickListener(new View.OnClickListener() {
@@ -112,7 +116,7 @@ public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
             @Override
             public void onClick(View view) {
                 String content = input_comment_input.getText().toString();
-                commitContent(content, EmotionLayout.hasExp(content));
+                commitContent(content);
             }
         });
         //初始化 表情键盘协调工具
@@ -122,15 +126,15 @@ public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
     }
 
     //用户评论一个用户对游戏的评论
-    private void commitContent(String content, boolean expression) {
+    private void commitContent(String content) {
         if (TestUtil.isDev()) G.showToast("评论内容:" + content);
         if (content.isEmpty()) {
             G.showToast("评论内容不能为空");
             return;
         }
         // 发表评论
-        ApiJSONUtil.postGameUserUserComment(user_comment_id, expression, content)
-                .subscribeOn(Schedulers.io())
+        Observable<BaseMessage> observable = userCommentReply == null ? ApiJSONUtil.postGameUserUserComment(user_comment_id, content) : ApiJSONUtil.postGameUserReplyComment(userCommentReply.getId(), content);
+        observable.subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
@@ -197,6 +201,7 @@ public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
         //用户评论的回复列表
         adapter = new AdpUserCommentReply(list);
         adapter.addHeaderView(headerViewHelper.getRootView());
+        adapter.setAction1(this);
         return adapter;
     }
 
@@ -278,4 +283,18 @@ public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
         }
         return false;
     }
+
+    private UserCommentReply userCommentReply;
+    //当前用户在自己的评论详情 点击别人的评论中的图标进行回复
+    @Override
+    public void call(UserCommentReply userCommentReply) {
+        if(this.userCommentReply == userCommentReply){
+            this.userCommentReply = null;
+            ViewUtil.setVisibility(input_comment_reply, false);
+        } else {
+            this.userCommentReply = userCommentReply;
+            ViewUtil.setText(input_comment_reply, userCommentReply.getNickname());
+            ViewUtil.setVisibility(input_comment_reply, true);
+        }
+    }
 }

+ 7 - 9
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWelfareCenter.java

@@ -7,9 +7,7 @@ import android.support.annotation.Nullable;
 import android.support.v4.widget.SwipeRefreshLayout;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
-import android.view.LayoutInflater;
 import android.view.View;
-import android.view.ViewGroup;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
@@ -17,7 +15,7 @@ import android.widget.TextView;
 import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.GlideImageLoader;
@@ -79,8 +77,8 @@ public class FgtWelfareCenter extends BaseFragment{
     public int getLayoutId() {
         return R.layout.fgt_welfare_center;
     }
-    private List<TaskReleaseEty> hotWelfareList = ListUtil.emptyList();
-    private List<TaskReleaseEty> downloadWelfareList = ListUtil.emptyList();
+    private List<Release_task> hotWelfareList = ListUtil.emptyList();
+    private List<Release_task> downloadWelfareList = ListUtil.emptyList();
     private List<GiftBagApp> giftCenterList = ListUtil.emptyList();
     private Activity activity;
     @Override
@@ -92,14 +90,14 @@ public class FgtWelfareCenter extends BaseFragment{
         wcHotWelfareList.setHasFixedSize(true);
         wcHotWelfareList.setNestedScrollingEnabled(false);
         wcHotWelfareList.setLayoutManager(hotLayoutManager);
-        wcHotWelfareList.setAdapter(new AdbCommonRecycler<TaskReleaseEty>(context, hotWelfareList) {
+        wcHotWelfareList.setAdapter(new AdbCommonRecycler<Release_task>(context, hotWelfareList) {
             @Override
             public int getViewIdByType(int type) {
                 return R.layout.item_hot_welfare;
             }
 
             @Override
-            public void convert(ViewHolder holder, final TaskReleaseEty item) {
+            public void convert(ViewHolder holder, final Release_task item) {
                 ImageView item_hot_welfare_iv = holder.getView(R.id.item_hot_welfare_iv);
                 TextView item_hot_welfare_tv = holder.getView(R.id.item_hot_welfare_tv);
                 if(item == null || item.getTask() == null){
@@ -191,7 +189,7 @@ public class FgtWelfareCenter extends BaseFragment{
                         @Override
                         public void onNext(BaseMessage baseMessage) {
                             refreshHotWelfare = false;
-                            ArrayList<TaskReleaseEty> newList = baseMessage.getDataList(TaskReleaseEty.class);
+                            ArrayList<Release_task> newList = baseMessage.getDataList(Release_task.class);
                             hotWelfareList.clear();
                             ListUtil.addAll(hotWelfareList, newList);
                             if(wcHotWelfareList != null)
@@ -218,7 +216,7 @@ public class FgtWelfareCenter extends BaseFragment{
                         @Override
                         public void onNext(BaseMessage baseMessage) {
                             refreshDownloadWelfare = false;
-                            ArrayList<TaskReleaseEty> newList = baseMessage.getDataList(TaskReleaseEty.class);
+                            ArrayList<Release_task> newList = baseMessage.getDataList(Release_task.class);
                             downloadWelfareList.clear();
                             ListUtil.addAll(downloadWelfareList, newList);
                             if(wcDownloadWelfareList != null)

+ 2 - 2
app/src/main/java/com/sheep/jiuyan/samllsheep/service/DownloadService.java

@@ -27,7 +27,7 @@ import com.liulishuo.okdownload.core.listener.assist.Listener4SpeedAssistExtend;
 import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.event.EventTypes;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
-import com.sheep.gamegroup.model.entity.GameApp;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.TaskEty;
 import com.sheep.gamegroup.util.ActivityManager;
 import com.sheep.gamegroup.util.DownloadUtil;
@@ -162,7 +162,7 @@ public class DownloadService extends Service {
             setDownLoadLongClick(view, task.getDownload_link(), task.getTask_name());
     }
 
-    public static void setDownLoadLongClick(View view, final GameApp task) {
+    public static void setDownLoadLongClick(View view, final Applications task) {
         if (task != null && !TextUtils.isEmpty(task.getDownload_link()))
             setDownLoadLongClick(view, task.getDownload_link(), task.getTask_name());
     }

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

@@ -24,6 +24,8 @@ import java.util.Locale;
  * 07-23 11:59:24.634 7444-7651/com.sheep.jiuyan.samllsheep I/System.out: sheepLog aCache key = app/find/articles/list?page=1&per_page=100&tag_id=0
  */
 public class ApiKey {
+    //搜索热门推荐
+    public static final String top_search_statistics = "app/top_search_statistics?platform=1";
     //关于我们
     public static final String new_about_us = "app/about_us/new_about_us";
     //公告
@@ -125,4 +127,8 @@ public class ApiKey {
     public static String getGameUserLatelyGame(int focus_user_id) {
         return "app/game_user/lately_game?focus_user_id=" + focus_user_id;
     }
+    //根据任务名(游戏名)模糊搜索
+    public static String getTopSearchStatisticsHomePageSearch(String search_content){
+      return String.format(Locale.CHINA, "app/top_search_statistics/home_page_search?search_content=%s", search_content);
+    }
 }

+ 23 - 0
app/src/main/res/layout/act_search_app_or_task.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/white"
+    android:orientation="vertical">
+
+    <include
+        android:id="@+id/include_title"
+        layout="@layout/title_search" />
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/search_app_list"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_below="@+id/include_title" />
+
+    <FrameLayout
+        android:id="@+id/frame_container"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_below="@+id/include_title" />
+</RelativeLayout>

+ 61 - 40
app/src/main/res/layout/include_input_comment_exp.xml

@@ -4,50 +4,71 @@
     android:layout_height="wrap_content"
     android:background="@color/white">
 
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="1dp"
-        android:background="#fff2f2f2" />
-
     <TextView
-        android:id="@+id/input_comment_commit"
-        android:layout_width="60dp"
-        android:layout_height="26dp"
-        android:layout_alignParentEnd="true"
-        android:layout_centerVertical="true"
-        android:layout_marginTop="1dp"
-        android:layout_marginEnd="15dp"
-        android:background="@drawable/selector_button_full_main"
-        android:gravity="center"
-        android:text="评论"
-        android:textColor="@color/white"
-        android:textSize="13sp" />
-
-    <ImageView
-        android:id="@+id/input_comment_exp"
-        android:layout_width="45dp"
-        android:layout_height="45dp"
-        android:layout_centerVertical="true"
-        android:padding="9dp"
-        android:layout_toStartOf="@id/input_comment_commit"
-        android:src="@drawable/ic_face_image"/>
-
-    <EditText
-        android:id="@+id/input_comment_input"
-        android:layout_width="match_parent"
-        android:layout_height="30dp"
+        android:id="@+id/input_comment_reply"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
         android:layout_marginStart="15dp"
-        android:layout_marginTop="9dp"
-        android:layout_marginBottom="8dp"
-        android:layout_toStartOf="@id/input_comment_exp"
-        android:background="@drawable/shape_f5_solid_rectangle_15"
-        android:gravity="center|start"
-        android:hint="输入优质评论哦~"
-        android:maxLength="100"
         android:paddingStart="10dp"
         android:paddingEnd="10dp"
+        android:paddingTop="5dp"
+        android:paddingBottom="5dp"
+        android:text="@string/reply_x"
         android:textColor="#ff666666"
-        android:textColorHint="#aaaaaa"
-        android:textSize="14sp" />
+        android:textSize="14sp"
+        android:visibility="gone"
+        android:background="#f5f5f5"/>
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/input_comment_reply">
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:background="#fff2f2f2" />
+
+        <TextView
+            android:id="@+id/input_comment_commit"
+            android:layout_width="60dp"
+            android:layout_height="26dp"
+            android:layout_alignParentEnd="true"
+            android:layout_centerVertical="true"
+            android:layout_marginTop="1dp"
+            android:layout_marginEnd="15dp"
+            android:background="@drawable/selector_button_full_main"
+            android:gravity="center"
+            android:text="评论"
+            android:textColor="@color/white"
+            android:textSize="13sp" />
+
+        <ImageView
+            android:id="@+id/input_comment_exp"
+            android:layout_width="45dp"
+            android:layout_height="45dp"
+            android:layout_centerVertical="true"
+            android:layout_toStartOf="@id/input_comment_commit"
+            android:padding="9dp"
+            android:src="@drawable/ic_face_image" />
+
+        <EditText
+            android:id="@+id/input_comment_input"
+            android:layout_width="match_parent"
+            android:layout_height="30dp"
+            android:layout_marginStart="15dp"
+            android:layout_marginTop="9dp"
+            android:layout_marginBottom="8dp"
+            android:layout_toStartOf="@id/input_comment_exp"
+            android:background="@drawable/shape_f5_solid_rectangle_15"
+            android:gravity="center|start"
+            android:hint="输入优质评论哦~"
+            android:maxLength="100"
+            android:paddingStart="10dp"
+            android:paddingEnd="10dp"
+            android:textColor="#ff666666"
+            android:textColorHint="#aaaaaa"
+            android:textSize="14sp" />
 
+    </RelativeLayout>
 </RelativeLayout>

+ 46 - 0
app/src/main/res/layout/item_i_serach_record.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@color/white">
+
+    <View
+        android:id="@+id/item_search_record_line"
+        android:layout_width="match_parent"
+        android:layout_height="1px"
+        android:layout_marginStart="16dp"
+        android:layout_marginEnd="16dp"
+        android:background="#fff5f5f5"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <TextView
+        android:id="@+id/item_search_record_name"
+        android:layout_width="0dp"
+        android:layout_height="50dp"
+        android:gravity="center|start"
+        android:paddingStart="27dp"
+        android:paddingEnd="11dp"
+        android:text="王者荣耀"
+        android:textColor="#666666"
+        android:textSize="13sp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toStartOf="@+id/item_search_record_x"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/item_search_record_line" />
+
+    <ImageView
+        android:id="@+id/item_search_record_x"
+        android:layout_width="62dp"
+        android:layout_height="50dp"
+        android:paddingStart="25dp"
+        android:paddingTop="20dp"
+        android:paddingEnd="27dp"
+        android:paddingBottom="20dp"
+        android:src="@mipmap/x_search"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/item_search_record_name"
+        app:layout_constraintTop_toBottomOf="@id/item_search_record_line" />
+
+</android.support.constraint.ConstraintLayout>

+ 1 - 0
app/src/main/res/layout/item_title_info_list.xml

@@ -17,6 +17,7 @@
         android:paddingEnd="26dp"
         android:paddingStart="26dp"
         android:paddingTop="20dp"
+        android:paddingBottom="20dp"
         android:textColor="#ff333333"
         android:textSize="13sp"
         android:text="@string/app_name" />

+ 19 - 2
app/src/main/res/layout/item_user_comment_reply.xml

@@ -72,6 +72,23 @@
         android:layout_height="wrap_content"
         android:layout_marginEnd="10dp"
         android:layout_marginBottom="6dp"
+        android:drawableStart="@drawable/ic_but_speak"
+        android:drawablePadding="6dp"
+        android:paddingStart="8dp"
+        android:paddingTop="14dp"
+        android:paddingEnd="8dp"
+        android:paddingBottom="14dp"
+        android:textColor="#ff666666"
+        android:textSize="11sp"
+        android:visibility="gone"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/intro_show_all" />
+    <TextView
+        android:id="@+id/game_app_comment_num2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="10dp"
+        android:layout_marginBottom="6dp"
         android:drawableStart="@drawable/ic_but_up"
         android:drawablePadding="6dp"
         android:paddingStart="8dp"
@@ -81,7 +98,7 @@
         android:text="54"
         android:textColor="#ff666666"
         android:textSize="11sp"
-        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintEnd_toStartOf="@id/game_app_comment_num1"
         app:layout_constraintTop_toBottomOf="@id/intro_show_all" />
 
     <View
@@ -94,7 +111,7 @@
         android:background="#fff2f2f2"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/game_app_comment_num1" />
+        app:layout_constraintTop_toBottomOf="@id/game_app_comment_num2" />
 
     <TextView
         android:id="@+id/user_comment_reply_content"

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

@@ -130,4 +130,5 @@
     <string name="contact_kf">联系客服</string>
     <string name="total_x_comment">共%s条评论</string>
     <string name="total_x_reply">共%s条回复</string>
+    <string name="reply_x">回复:%s</string>
 </resources>