瀏覽代碼

游戏详情子界面--评价界面基本完成

zengjiebin 7 年之前
父節點
當前提交
b7614e3a39
共有 20 個文件被更改,包括 793 次插入149 次删除
  1. 1 0
      .idea/gradle.xml
  2. 11 0
      app/src/main/java/com/sheep/gamegroup/absBase/ICanShowAll.java
  3. 169 9
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  4. 121 0
      app/src/main/java/com/sheep/gamegroup/model/entity/AppScoreDetail.java
  5. 0 17
      app/src/main/java/com/sheep/gamegroup/model/entity/GameAppComment.java
  6. 11 2
      app/src/main/java/com/sheep/gamegroup/model/entity/GameAppScore.java
  7. 31 0
      app/src/main/java/com/sheep/gamegroup/model/entity/ShowAll.java
  8. 191 0
      app/src/main/java/com/sheep/gamegroup/model/entity/UserComment.java
  9. 47 0
      app/src/main/java/com/sheep/gamegroup/util/ApiJSONUtil.java
  10. 1 1
      app/src/main/java/com/sheep/gamegroup/util/RefreshUtil.java
  11. 15 3
      app/src/main/java/com/sheep/gamegroup/util/TextViewUtil.java
  12. 38 7
      app/src/main/java/com/sheep/gamegroup/view/activity/ActCommentGameApp.java
  13. 57 39
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGcGameAppDetail.java
  14. 22 8
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGcGameAppComment.java
  15. 3 5
      app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment3.java
  16. 48 43
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGcGameAppComment.java
  17. 4 3
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGcGameAppDetail.java
  18. 1 1
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java
  19. 1 1
      app/src/main/res/layout/act_comment_game_app.xml
  20. 21 10
      app/src/main/res/layout/item_gc_game_app_comment.xml

+ 1 - 0
.idea/gradle.xml

@@ -8,6 +8,7 @@
         <option name="modules">
           <set>
             <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/WaterWaveProgress" />
             <option value="$PROJECT_DIR$/app" />
             <option value="$PROJECT_DIR$/ucrop" />
             <option value="$PROJECT_DIR$/view" />

+ 11 - 0
app/src/main/java/com/sheep/gamegroup/absBase/ICanShowAll.java

@@ -0,0 +1,11 @@
+package com.sheep.gamegroup.absBase;
+
+import com.sheep.gamegroup.model.entity.ShowAll;
+
+/**
+ * Created by realicing on 2018/11/2.
+ * realicing@sina.com
+ */
+public interface ICanShowAll {
+    ShowAll getShowAll();
+}

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

@@ -9,6 +9,7 @@ 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;
@@ -94,11 +95,13 @@ public interface ApiService {
      */
     @GET("app/find/commend_app")
     Observable<BaseMessage> getCommendApp(@Query("game_id") String game_id, @Query("order") int order);
+
     /**
      * 查询用户是否可以弹窗推荐应用
      */
     @GET("app/find/can/commend_app")
     Observable<BaseMessage> canGetCommendApp(@Query("game_id") String game_id);
+
     /**
      * @return ,
      * 主页抢任务
@@ -179,6 +182,7 @@ public interface ApiService {
      */
     @POST("app/accepted_task/auto_check/")
     Observable<BaseMessage> commitAutoTask(@Body JSONObject param);
+
     /**
      * 获取未查看的任务成功或失败的记录
      */
@@ -267,6 +271,7 @@ public interface ApiService {
 
     /**
      * 新手红包
+     *
      * @return .
      */
     @POST("app/newbie_task/login_red_packet")
@@ -523,6 +528,7 @@ public interface ApiService {
      */
     @GET("app/punch/all_punch_log")
     Observable<BaseMessage> getAllPunchLog(@Query("page") int page, @Query("per_page") int per_page);
+
     /**
      * 获取连续打卡记录
      */
@@ -577,6 +583,7 @@ public interface ApiService {
      */
     @GET("app/punch/punch_and_sign_count")
     Observable<BaseMessage> getPunchAndSignCount();
+
     /**
      * 获取今日之星数据
      */
@@ -888,7 +895,7 @@ public interface ApiService {
      * 获取邀请用户排名
      */
     @GET("app/user/invitation_top")
-    Observable<BaseMessage> getInvitationTop(@Query("top") int top,@Query("start_time") long start_time,@Query("end_time") long end_time);//top默认为5,可以不传
+    Observable<BaseMessage> getInvitationTop(@Query("top") int top, @Query("start_time") long start_time, @Query("end_time") long end_time);//top默认为5,可以不传
 
     /**
      * 获取邀请用户进两月礼物发放记录
@@ -921,6 +928,7 @@ public interface ApiService {
      */
     @GET("app/awaken/article")
     Observable<BaseMessage> awakenApparticle(@Query("page") int page, @Query("per_page") int per_page);
+
     /**
      * 唤醒业务APP
      */
@@ -950,6 +958,7 @@ public interface ApiService {
      */
     @PUT("app/gift_bag/receive/{id}")
     Observable<BaseMessage> receiveGiftBag(@Path("id") int id);
+
     /**
      * 获取热门福利
      */
@@ -979,22 +988,26 @@ public interface ApiService {
      */
     @PUT("app/user/bind_third")
     Observable<BaseMessage> bindThird(@Body JSONObject jsonObject);
+
     /**
      * 换绑qq或微信
      */
     @PUT("app/user/modify_third")
     Observable<BaseMessage> modifyThird(@Body JSONObject jsonObject);
+
     /**
      * 发送/校验换绑验证码
      */
     @POST("app/user/modify_third_sms")
     Observable<BaseMessage> modifyThirdSms(@Body JSONObject jsonObject);
+
     /**
      * 检查是否需要输入邀请码
      */
     @GET("app/auth/need_code")
     Observable<BaseMessage> needCode(@Query("mobile") String mobile);
 //---------------------------start 玩转游戏------------------------------
+
     /**
      * 玩转游戏——每日必玩
      * 玩转游戏——近期最热
@@ -1010,6 +1023,7 @@ public interface ApiService {
      */
     @GET("app/find/recommend/user_like")
     Observable<BaseMessage> getUserLikeList();
+
     /**
      * 玩转游戏-获取主页游戏数据 1:天天更新 2:重点推荐
      * display_type
@@ -1019,6 +1033,7 @@ public interface ApiService {
      */
     @GET("app/find/recommend")
     Observable<BaseMessage> getRecommendList(@Query("display_type") int display_type);
+
     /**
      * 玩转游戏-获取主页游戏数据 1:天天更新 2:重点推荐 更多
      * display_type
@@ -1028,6 +1043,7 @@ public interface ApiService {
      */
     @GET("app/find/recommend/list")
     Observable<BaseMessage> getRecommendListMore(@Query("display_type") int display_type);
+
     /**
      * 玩转游戏-获取主页 获取标签列表
      */
@@ -1047,14 +1063,139 @@ public interface ApiService {
      */
     @GET("app/find/detail/hot_games")
     Observable<BaseMessage> getDetailHotGames(@Query("app_id") int app_id);
+
+
+    //---------------------------start game_user------------------------------
+
     /**
-     *
+     * 查询应用评论列表
+     * CommentType       int8    `description:"评论类型 1:游戏 2:资讯" json:"comment_type"`
+     * app_id * integer (query)	应用id
+     * page_no  integer (query) 页码
+     * page_size  integer (query) 每页显示条数默认10条
      */
-    @GET("")
-    Observable<BaseMessage> get(@Query("app_id") int app_id);
-//---------------------------start 玩转游戏------------------------------
+    @GET("app/game_user/app_comment_list")
+    Observable<BaseMessage> getGameUserAppCommentList(@Query("page_no") int page_no, @Query("page_size") int page_size, @Query("app_id") int app_id, @Query("comment_type") int comment_type);
+
+    /**
+     * 查询应用评分详情
+     * app_id * integer (query)	应用id
+     */
+    @GET("app/game_user/app_score_detail")
+    Observable<BaseMessage> getGameUserAppScoreDetail(@Query("app_id") int app_id);
+
+    /**
+     * 查询用户主页评论列表
+     * focus_user_id  integer (query) 关注用户id
+     * page_no  integer (query) 页码
+     * page_size  integer (query) 每页显示条数默认10条
+     */
+    @GET("app/game_user/comment_list")
+    Observable<BaseMessage> getGameUserCommentList(@Query("page_no") int page_no, @Query("page_size") int page_size, @Query("focus_user_id") int focus_user_id);
+
+    /**
+     * 查询用户主页详情
+     * focus_user_id * integer (query)	关注用户id
+     */
+    @GET("app/game_user/detail")
+    Observable<BaseMessage> getGameUserDetail(@Query("focus_user_id") int focus_user_id);
+
+    /**
+     * 关注游戏
+     * focus_game_id  * integer (query)	关注应用id
+     */
+    @POST("app/game_user/focus_game")
+    Observable<BaseMessage> postGameUserFocusGame(@Query("focus_game_id ") int focus_game_id);
+
+    /**
+     * 关注用户
+     * focus_user_id * integer (query)	关注用户id
+     */
+    @POST("app/game_user/focus_user")
+    Observable<BaseMessage> postGameUserFocusUser(@Query("focus_user_id") int focus_user_id);
+
+    /**
+     * 查询最近在玩以及同类型游戏
+     * focus_user_id * integer (query)	关注用户id
+     */
+    @GET("app/game_user/lately_game")
+    Observable<BaseMessage> getGameUserLatelyGame(@Query("focus_user_id") int focus_user_id);
+
+    /**
+     * 用户主页点赞
+     * focus_user_id * integer (query)	关注用户id
+     */
+    @POST("app/game_user/like")
+    Observable<BaseMessage> postGameUserLike(@Query("focus_user_id") int focus_user_id);
+
+    /**
+     * 回复用户评论
+     * ReplyUserCommentReq{
+     * content:	string  评论内容
+     * user_comment_reply_id:	integer ($int64) 回复id
+     * }
+     */
+    @POST("app/game_user/")
+    Observable<BaseMessage> postGameUserReplyComment(@Body JSONObject jsonObject);
+
+    /**
+     * 查询用户主页回复列表
+     * focus_user_id  integer (query) 关注用户id
+     * page_no  integer (query) 页码
+     * page_size  integer (query) 每页显示条数默认10条
+     */
+    @GET("app/game_user/reply_list")
+    Observable<BaseMessage> getGameUserReplyList(@Query("page_no") int page_no, @Query("page_size") int page_size, @Query("focus_user_id") int focus_user_id);
+
+    /**
+     * 用户评论用户
+     * UserCommentReq{
+     * content:	string  评论内容
+     * expression:	boolean 是否有表情
+     * user_comment_id:	integer ($int64) 评论id
+     * }
+     */
+    @POST("app/game_user/user_comment")
+    Observable<BaseMessage> postGameUserUserComment(@Body JSONObject jsonObject);
+
+    /**
+     * 查询用户评论详情
+     * user_comment_id  integer (query) 评论id
+     * page_no  integer (query) 页码
+     * page_size  integer (query) 每页显示条数默认10条
+     */
+    @GET("app/game_user/user_comment_detail")
+    Observable<BaseMessage> getGameUserUserCommentDetail(@Query("page_no") int page_no, @Query("page_size") int page_size, @Query("user_comment_id") int user_comment_id);
+
+    /**
+     * 用户评论用户点赞
+     * user_comment_reply_id * integer (query) 回复id
+     */
+    @POST("app/game_user/user_comment_like")
+    Observable<BaseMessage> postGameUserUserCommentLike(@Query("user_comment_reply_id") int user_comment_reply_id);
+
+    /**
+     * 用户游戏评论
+     * GameCommentReq{
+     * CommentType       int8    `description:"评论类型 1:游戏 2:资讯" json:"comment_type"`
+     * app_id:	integer ($int64) 应用id
+     * content:	string 评论内容
+     * score:	integer ($int32) 评分 1-10
+     * }
+     */
+    @POST("app/game_user/user_game_comment")
+    Observable<BaseMessage> postGameUserUserGameComment(@Body JSONObject jsonObject);
+
+    /**
+     * 用户游戏评论点赞
+     * user_comment_id * integer (query) 评论id
+     */
+    @POST("app/game_user/user_game_comment_like")
+    Observable<BaseMessage> postGameUserUserGameCommentLike(@Query("user_comment_id") int user_comment_id);
+    //---------------------------end game_user------------------------------
+//---------------------------end 玩转游戏------------------------------
+
     /**
-     *
      * type: 1002:快发出包 1003:腾讯出包 1004:小米出包
      */
     @GET("app/find")
@@ -1062,30 +1203,38 @@ public interface ApiService {
 
     /**
      * platform 平台 1:andriod 2:ios
+     *
      * @return
      */
     @GET("app/game_banner")
     Observable<BaseMessage> gameBanner(@Query("platform") int platform);
+
     /**
      * platform 平台 1:andriod 2:ios
      * 获取游戏中心主页活动数据
      */
     @GET("app/game_banner/activity?platform=1")
     Observable<BaseMessage> gameBannerAct();
+
     /**
      * platform 平台 1:andriod 2:ios
+     *
      * @return
      */
     @GET("app/find/{id}")
     Observable<BaseMessage> playGameDetail(@Path("id") int id);
+
     /**
      * 判断是否是第一次运行的设备
+     *
      * @return
      */
     @GET("app/event_tracking/check_user_first")
     Observable<BaseMessage> checkUserFirst();
+
     /**
      * 查询用户截图加密开关
+     *
      * @return
      */
     @GET("app/common_config/need_shot_screen")
@@ -1095,47 +1244,56 @@ public interface ApiService {
 //    http://10.8.220.237:8010/v1/app/mobile_point/score    获取用户积分 post
 //    http://10.8.220.237:8010/v1/app/mobile_point/sms      获取短信验证码 post
 //    http://10.8.220.237:8010/v1/app/mobile_point/recharge 兑换积分 post
+
     /**
      * 获取商品列表
+     *
      * @return
      */
     @GET("app/mobile_point/goods")
     Observable<BaseMessage> getCMCCGoods();
+
     /**
      * 获取用户积分
+     *
      * @return
      */
     @POST("app/mobile_point/score")
     Observable<BaseMessage> getCMCCScore(@Body JSONObject jsonObject);
+
     /**
      * 获取短信验证码
+     *
      * @return
      */
     @POST("app/mobile_point/sms")
     Observable<BaseMessage> smsCMCC(@Body JSONObject jsonObject);
+
     /**
      * 兑换积分
+     *
      * @return
      */
     @POST("app/mobile_point/recharge")
     Observable<BaseMessage> rechargeCMCC(@Body JSONObject jsonObject);
 
 
-
-
-
 //---------------------------start 游戏sdk相关接口-------------------------------------
+
     /**
      * 请求授权
+     *
      * @return
      */
     @GET("app/sdk/{game_key}")
     Observable<BaseMessage> verificationAuth(@Header("Authorization") String token, @Path("game_key") String game_key);
+
     /**
      * 绵羊币支付订单查询接口
      */
     @GET("app/sdk/find/order")
     Observable<BaseMessage> sdkFindOrder(@Header("Authorization") String token, @Query("order_no") String order_no);
+
     /**
      * 绵羊币支付sdk订单
      */
@@ -1144,8 +1302,10 @@ public interface ApiService {
 //---------------------------end 游戏sdk相关接口-------------------------------------
 
 //---------------------------start 有米科技相关接口-------------------------------------
+
     /**
      * 获取有米积分余额
+     *
      * @return
      */
     @GET("youmi/youmi_total_price")

+ 121 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/AppScoreDetail.java

@@ -0,0 +1,121 @@
+package com.sheep.gamegroup.model.entity;
+
+import com.sheep.gamegroup.util.ListUtil;
+
+import java.util.List;
+
+/**
+ * Created by realicing on 2018/11/2.
+ * realicing@sina.com
+ * level_1:	integer ($int32)
+ * 评分等级1
+ * level_2:	integer ($int32)
+ * 评分等级2
+ * level_3:	integer ($int32)
+ * 评分等级3
+ * level_4:	integer ($int32)
+ * 评分等级4
+ * level_5:	integer ($int32)
+ * 评分等级5
+ * score:	number ($float)
+ * 评分
+ * score_count:	integer ($int64)
+ * 评分人数
+ * 游戏评分详情
+ */
+public class AppScoreDetail {
+    private int level_1;
+    private int level_2;
+    private int level_3;
+    private int level_4;
+    private int level_5;
+    private int score;
+    private int score_count;
+
+    public int getLevel_1() {
+        return level_1;
+    }
+
+    public void setLevel_1(int level_1) {
+        this.level_1 = level_1;
+    }
+
+    public int getLevel_2() {
+        return level_2;
+    }
+
+    public void setLevel_2(int level_2) {
+        this.level_2 = level_2;
+    }
+
+    public int getLevel_3() {
+        return level_3;
+    }
+
+    public void setLevel_3(int level_3) {
+        this.level_3 = level_3;
+    }
+
+    public int getLevel_4() {
+        return level_4;
+    }
+
+    public void setLevel_4(int level_4) {
+        this.level_4 = level_4;
+    }
+
+    public int getLevel_5() {
+        return level_5;
+    }
+
+    public void setLevel_5(int level_5) {
+        this.level_5 = level_5;
+    }
+
+    public int getScore() {
+        return score;
+    }
+
+    public void setScore(int score) {
+        this.score = score;
+    }
+
+    public int getScore_count() {
+        return score_count;
+    }
+
+    public void setScore_count(int score_count) {
+        this.score_count = score_count;
+    }
+
+
+    public List<GameAppScore> toGameAppScoreList(){
+        List<GameAppScore> list = ListUtil.emptyList();
+        GameAppScore gameAppScore1 = new GameAppScore();
+        gameAppScore1.setNum(level_1);
+        gameAppScore1.setStar(1);
+        gameAppScore1.setMax(score_count);
+        list.add(gameAppScore1);
+        GameAppScore gameAppScore2 = new GameAppScore();
+        gameAppScore2.setNum(level_2);
+        gameAppScore2.setStar(2);
+        gameAppScore2.setMax(score_count);
+        list.add(gameAppScore2);
+        GameAppScore gameAppScore3 = new GameAppScore();
+        gameAppScore3.setNum(level_3);
+        gameAppScore3.setStar(3);
+        gameAppScore3.setMax(score_count);
+        list.add(gameAppScore3);
+        GameAppScore gameAppScore4 = new GameAppScore();
+        gameAppScore4.setNum(level_4);
+        gameAppScore4.setStar(4);
+        gameAppScore4.setMax(score_count);
+        list.add(gameAppScore4);
+        GameAppScore gameAppScore5 = new GameAppScore();
+        gameAppScore5.setNum(level_5);
+        gameAppScore5.setStar(5);
+        gameAppScore5.setMax(score_count);
+        list.add(gameAppScore5);
+        return list;
+    }
+}

+ 0 - 17
app/src/main/java/com/sheep/gamegroup/model/entity/GameAppComment.java

@@ -1,17 +0,0 @@
-package com.sheep.gamegroup.model.entity;
-
-import com.sheep.gamegroup.util.ViewUtil;
-
-/**
- * Created by realicing on 2018/11/1.
- * realicing@sina.com
- */
-public class GameAppComment {
-    public String getContent() {
-        return "dsafasdkl;fnjasdkfjas'dfka;lsdfkasdfasd";
-    }
-
-    public String getAvatar() {
-        return ViewUtil.getNetImgByName("icon_phone");
-    }
-}

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

@@ -5,8 +5,9 @@ package com.sheep.gamegroup.model.entity;
  * realicing@sina.com
  */
 public class GameAppScore {
-    private int star;
-    private int num;
+    private int star;//几个星
+    private int num;//有多少人评
+    private int max;//总共有多少人评
 
     public int getStar() {
         return star;
@@ -23,4 +24,12 @@ public class GameAppScore {
     public void setNum(int num) {
         this.num = num;
     }
+
+    public int getMax() {
+        return max;
+    }
+
+    public void setMax(int max) {
+        this.max = max;
+    }
 }

+ 31 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/ShowAll.java

@@ -0,0 +1,31 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by realicing on 2018/11/2.
+ * realicing@sina.com
+ */
+public class ShowAll {
+
+    public ShowAll(String content) {
+        this.content = content;
+    }
+
+    private boolean yes;
+    private String content;
+
+    public boolean isYes() {
+        return yes;
+    }
+
+    public void setYes(boolean yes) {
+        this.yes = yes;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+}

+ 191 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/UserComment.java

@@ -0,0 +1,191 @@
+package com.sheep.gamegroup.model.entity;
+
+
+import com.sheep.gamegroup.absBase.ICanShowAll;
+
+/**
+ * Created by realicing on 2018/11/1.
+ * realicing@sina.com
+ * update_time:	integer ($int64)
+ * level:	integer ($int32)
+ * 评分等级 1-5
+ * app_name:	string
+ * 应用名称
+ * nickname:	string
+ * 昵称
+ * user_id:	integer ($int64)
+ * 用户id
+ * create_time:	integer ($int64)
+ * score:	integer ($int32)
+ * 评分 1-10
+ * status:	integer ($int32)
+ * 审核状态 1:通过 2:未通过
+ * like:	integer ($int64)
+ * 点赞数
+ * app_icon:	string
+ * 应用图标
+ * expression:	integer ($int64)
+ * 表情数
+ * app_type:	integer ($int32)
+ * 评论类型 1:游戏
+ * content:	string
+ * 评论内容
+ * avatar:	string
+ * 头像
+ * app_id:	integer ($int64)
+ * 评论应用id
+ * id:	integer ($int64)
+ * comment:	integer ($int64)
+ * 评论数
+ *
+ * 用户评论
+ */
+public class UserComment implements ICanShowAll {
+
+    private int id;
+
+    private int user_id;
+
+    private int app_id;
+
+    private String app_name;
+
+    private String app_icon;
+
+    private int app_type;
+
+    private String nickname;
+
+    private String avatar;
+
+    private int like;
+
+    private int expression;
+
+    private int comment;
+
+    private int score;
+
+    private int level;
+
+    private int status;
+
+    private String content;
+
+    private int create_time;
+
+    private int update_time;
+
+    public void setId(int id){
+        this.id = id;
+    }
+    public int getId(){
+        return this.id;
+    }
+    public void setUser_id(int user_id){
+        this.user_id = user_id;
+    }
+    public int getUser_id(){
+        return this.user_id;
+    }
+    public void setApp_id(int app_id){
+        this.app_id = app_id;
+    }
+    public int getApp_id(){
+        return this.app_id;
+    }
+    public void setApp_name(String app_name){
+        this.app_name = app_name;
+    }
+    public String getApp_name(){
+        return this.app_name;
+    }
+    public void setApp_icon(String app_icon){
+        this.app_icon = app_icon;
+    }
+    public String getApp_icon(){
+        return this.app_icon;
+    }
+    public void setApp_type(int app_type){
+        this.app_type = app_type;
+    }
+    public int getApp_type(){
+        return this.app_type;
+    }
+    public void setNickname(String nickname){
+        this.nickname = nickname;
+    }
+    public String getNickname(){
+        return this.nickname;
+    }
+    public void setAvatar(String avatar){
+        this.avatar = avatar;
+    }
+    public String getAvatar(){
+        return this.avatar;
+    }
+    public void setLike(int like){
+        this.like = like;
+    }
+    public int getLike(){
+        return this.like;
+    }
+    public void setExpression(int expression){
+        this.expression = expression;
+    }
+    public int getExpression(){
+        return this.expression;
+    }
+    public void setComment(int comment){
+        this.comment = comment;
+    }
+    public int getComment(){
+        return this.comment;
+    }
+    public void setScore(int score){
+        this.score = score;
+    }
+    public int getScore(){
+        return this.score;
+    }
+    public void setLevel(int level){
+        this.level = level;
+    }
+    public int getLevel(){
+        return this.level;
+    }
+    public void setStatus(int status){
+        this.status = status;
+    }
+    public int getStatus(){
+        return this.status;
+    }
+    public void setContent(String content){
+        this.content = content;
+    }
+    public String getContent(){
+        return this.content;
+    }
+    public void setCreate_time(int create_time){
+        this.create_time = create_time;
+    }
+    public int getCreate_time(){
+        return this.create_time;
+    }
+    public void setUpdate_time(int update_time){
+        this.update_time = update_time;
+    }
+    public int getUpdate_time(){
+        return this.update_time;
+    }
+
+
+
+    private ShowAll showAll;
+    @Override
+    public ShowAll getShowAll() {
+        if(showAll == null)
+            showAll = new ShowAll(content);
+        return showAll;
+    }
+}

+ 47 - 0
app/src/main/java/com/sheep/gamegroup/util/ApiJSONUtil.java

@@ -0,0 +1,47 @@
+package com.sheep.gamegroup.util;
+
+
+import android.support.annotation.IntDef;
+import android.support.annotation.StringDef;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import rx.Observable;
+
+/**
+ * Created by realicing on 2018/11/2.
+ * realicing@sina.com
+ */
+public class ApiJSONUtil {
+    public static final int COMMENT_TYPE_GAME = 1;
+    public static final int COMMENT_TYPE_INFORMATION = 2;
+    @IntDef({COMMENT_TYPE_GAME, COMMENT_TYPE_INFORMATION})
+    @Retention(RetentionPolicy.SOURCE)
+    public @interface COMMENT_TYPE {
+    }
+    /**
+     * CommentType       int8    `description:"评论类型 1:游戏 2:资讯" json:"comment_type"`
+     * app_id:	integer ($int64) 应用id
+     * content:	string 评论内容
+     * score:	integer ($int32) 评分 1-10
+     * @param comment_type
+     * @param app_id
+     * @param content
+     * @param score
+     * @return
+     */
+    public static Observable<BaseMessage> postGameUserUserGameComment(@COMMENT_TYPE int comment_type, int app_id, String content, int score) {
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("comment_type", comment_type);
+        jsonObject.put("app_id", app_id);
+        jsonObject.put("content", content);
+        jsonObject.put("score", score);
+        return SheepApp.getInstance().getNetComponent().getApiService().postGameUserUserGameComment(jsonObject);
+    }
+
+}

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/util/RefreshUtil.java

@@ -37,7 +37,7 @@ public class RefreshUtil {
     /**
      * public parameter
      */
-    public void publicParameterRefresh(SmartRefreshLayout refreshLayout, Context context){
+    public void publicParameterLoadMore(SmartRefreshLayout refreshLayout, Context context){
         refreshLayout.setEnableRefresh(true);//是否启用下拉刷新功能
         refreshLayout.setEnableLoadMore(true);//是否启用上拉加载功能
         //设置 Header 为 贝塞尔雷达 样式

+ 15 - 3
app/src/main/java/com/sheep/gamegroup/util/TextViewUtil.java

@@ -6,6 +6,8 @@ import android.view.View;
 import android.view.ViewTreeObserver;
 import android.widget.TextView;
 
+import com.sheep.gamegroup.absBase.ICanShowAll;
+import com.sheep.gamegroup.model.entity.ShowAll;
 import com.sheep.jiuyan.samllsheep.R;
 
 import rx.functions.Action1;
@@ -31,14 +33,22 @@ public class TextViewUtil {
 
     }
     //初始化文本介绍,必须有 intro_content 和 intro_show_all
-    public static void initIntroView(View itemView, String text) {
+    public static void initIntroView(View itemView, final ShowAll showAll) {
+        String text = showAll.getContent();
         final TextView intro_content = itemView.findViewById(R.id.intro_content);
         final TextView intro_show_all = itemView.findViewById(R.id.intro_show_all);
         final View intro_show_all_no = itemView.findViewById(R.id.intro_show_all_no);
+        {
+            boolean canShowAll = showAll.isYes();
+            intro_content.setMaxLines(canShowAll ? Integer.MAX_VALUE : 3);
+            intro_content.setEllipsize(canShowAll ? null : TextUtils.TruncateAt.END);
+            intro_show_all.setText(canShowAll ? "显示全部" : "收起");
+        }
         TextViewUtil.listenEllipsizeChange(intro_content, new Action1<Integer>() {
             @Override
             public void call(Integer integer) {
-                if (integer > 0) {
+                showAll.setYes(integer > 0);
+                if (showAll.isYes()) {
                     ViewUtil.setVisibility(intro_show_all, true);
                     ViewUtil.setVisibility(intro_show_all_no, false);
                 }
@@ -47,10 +57,12 @@ public class TextViewUtil {
         intro_show_all.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
-                boolean canShowAll = intro_content.getMaxLines() == 3;
+//                boolean canShowAll = intro_content.getMaxLines() == 3;
+                boolean canShowAll = showAll.isYes();
                 intro_content.setMaxLines(canShowAll ? Integer.MAX_VALUE : 3);
                 intro_content.setEllipsize(canShowAll ? null : TextUtils.TruncateAt.END);
                 intro_show_all.setText(canShowAll ? "显示全部" : "收起");
+                showAll.setYes(!showAll.isYes());
             }
         });
         ViewUtil.setText(intro_content, text);

+ 38 - 7
app/src/main/java/com/sheep/gamegroup/view/activity/ActCommentGameApp.java

@@ -1,16 +1,24 @@
 package com.sheep.gamegroup.view.activity;
 
+import android.text.TextUtils;
 import android.view.View;
 import android.widget.EditText;
 import android.widget.RatingBar;
 
 import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.ApiJSONUtil;
+import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 import butterknife.BindView;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
 
 /**
  * Created by realicing on 2018/11/1.
@@ -34,16 +42,36 @@ public class ActCommentGameApp extends BaseActivity {
                 .setEndTv(this, "发表", 0xFF2EBEF2, new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {
-                        //TODO 发表评价
-                        if (game_id == 0){
-                            G.showToast(R.string.loading_data);
-                            return;
-                        }
-                        G.showToast(R.string.coming_soon);
+                        int progress = act_comment_game_app_score.getProgress();
+                        String content = act_comment_game_app_input_comment.getText().toString();
+                        commitUserGameComment(progress, content);
                     }
                 })
                 .setTitleFinish(this);
     }
+    //评论游戏
+    private void commitUserGameComment(int score, String content) {
+        if(TestUtil.isDev()) G.showToast(score + " " + content);
+        if(TextUtils.isEmpty(content)){
+            G.showToast("亲,您还没有填写你的观点呢");
+            return;
+        }
+        ApiJSONUtil.postGameUserUserGameComment(ApiJSONUtil.COMMENT_TYPE_GAME, game_id, content, score)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        G.showToast(baseMessage);
+                        finish();
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast(baseMessage);
+                    }
+                });
+    }
 
 
     private int game_id;
@@ -52,8 +80,11 @@ public class ActCommentGameApp extends BaseActivity {
     public void initData() {
         game_id = getIntent().getIntExtra("game_id", 0);
         if (game_id > 0) {
-            G.showToast("game_id为" + game_id);
+            if(TestUtil.isDev()) G.showToast("game_id为" + game_id);
             act_comment_game_app_score.setIsIndicator(false);
+        } else {
+            G.showToast(R.string.error_data);
+            finish();
         }
     }
 

+ 57 - 39
app/src/main/java/com/sheep/gamegroup/view/activity/ActGcGameAppDetail.java

@@ -1,7 +1,9 @@
 package com.sheep.gamegroup.view.activity;
 
 import android.content.Intent;
+import android.os.Bundle;
 import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
 import android.support.design.widget.TabLayout;
 import android.support.v4.app.Fragment;
 import android.support.v4.view.ViewPager;
@@ -11,10 +13,14 @@ import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import com.kfzs.duanduan.utils.StatusBarUtils;
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
 import com.scwang.smartrefresh.layout.api.RefreshLayout;
 import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
+import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
 import com.sheep.gamegroup.absBase.AbsGetDownloadListener;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.absBase.ILoadMore;
 import com.sheep.gamegroup.absBase.IRefresh;
 import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.helper.DownloadHelper;
@@ -34,7 +40,6 @@ import com.sheep.gamegroup.view.fragment.FgtGcGameAppDetail;
 import com.sheep.gamegroup.view.fragment.FgtGcGameAppWelfare;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.ui.base.BaseActivity;
 import com.sheep.jiuyan.samllsheep.utils.G;
 
 import org.afinal.simplecache.ApiKey;
@@ -54,6 +59,17 @@ import rx.schedulers.Schedulers;
  * 新的游戏详情界面
  */
 public class ActGcGameAppDetail extends BaseActivity {
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        StatusBarUtils.setTranslucent(this);
+        super.onCreate(savedInstanceState);
+    }
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_gc_game_app_detail;
+    }
+
     @BindView(R.id.refresh)
     SmartRefreshLayout refresh;
     @BindView(R.id.tabLayout)
@@ -71,25 +87,15 @@ public class ActGcGameAppDetail extends BaseActivity {
     @BindView(R.id.gc_game_app_detail_tag_list)
     RecyclerView recyclerView;
 
-    @Override
-    protected int onLayout() {
-        return R.layout.act_gc_game_app_detail;
-    }
-
-    private int id;
-
-    @Override
-    protected void onObject() {
-        id = getIntent().getIntExtra("id", 0);
-    }
-
     private TitleFragmentListAdapter mAdapter;
     private FgtGcGameAppDetail fgtGcPlayGameDetail;
     private FgtGcGameAppComment fgtGcGameAppComment;
     private FgtGcGameAppWelfare fgtGcGameAppWelfare;
 
+    private int id;
     @Override
-    protected void onView() {
+    public void initView() {
+        id = getIntent().getIntExtra("id", 0);
         EventBus.getDefault().register(this);
         //tagList
         TagListUtil.setTagList(recyclerView, tagList);
@@ -107,28 +113,24 @@ public class ActGcGameAppDetail extends BaseActivity {
         tabLayout.setupWithViewPager(viewPager);
         CommonUtil.getInstance().reflex(tabLayout, this);
         //refresh
-        refresh.setOnRefreshListener(new OnRefreshListener() {
+        refresh.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
 
             @Override
             public void onRefresh(@NonNull RefreshLayout refreshLayout) {
-                initData();
+                refreshData();
+            }
+
+            @Override
+            public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
+                loadMoreData();
             }
         });
-        RefreshUtil.newInstance().publicParameter(refresh, this);
+        fgtGcGameAppComment.setSmartRefreshLayout(refresh);
+        RefreshUtil.newInstance().publicParameterLoadMore(refresh, this);
     }
 
     private List<String> tagList = ListUtil.emptyList();
 
-    @Override
-    protected void onData() {
-        GameEntity gameEntity = DataUtil.getInstance().getCacheResult(ApiKey.playGameDetail(id), GameEntity.class);
-        checkData(gameEntity);
-        initDetailFromNet();
-        if (refresh != null) {
-            refresh.autoRefresh();
-        }
-    }
-
     //重置view
     private void resetView() {
         ViewUtil.setDefaultText(gc_game_app_detail_name);
@@ -162,7 +164,6 @@ public class ActGcGameAppDetail extends BaseActivity {
         CommonUtil.getInstance().palyGameDetailBtnValue(this, gameEntity, gc_game_app_detail_bt2, 0);
         //初始化详情界面
         fgtGcPlayGameDetail.loadData(gameEntity);
-        fgtGcGameAppComment.loadData(gameEntity);
         fgtGcGameAppWelfare.loadData(gameEntity);
     }
 
@@ -189,22 +190,44 @@ public class ActGcGameAppDetail extends BaseActivity {
                 });
     }
 
-    private int initDataCount = 0;
-
-    private void initData() {
-        if (initDataCount != 0) {
+    private int refreshDataCount = 0;
+    @Override
+    public void initData() {
+        GameEntity gameEntity = DataUtil.getInstance().getCacheResult(ApiKey.playGameDetail(id), GameEntity.class);
+        checkData(gameEntity);
+        initDetailFromNet();
+        if (refresh != null) {
+            refresh.autoRefresh();
+        }
+    }
+    //刷新数据
+    public void refreshData(){
+        boolean isRefresh = false;
+        if (refreshDataCount != 0) {
             Fragment item = mAdapter.getItem(viewPager.getCurrentItem());
             if (item instanceof IRefresh) {//可刷新,就调用当前fragment刷新数据
                 ((IRefresh) item).refreshData();
+                isRefresh = true;
             }
         }
-        initDataCount++;
-        notifyDataSetChanged();
+        refreshDataCount++;
+        if(!isRefresh)
+            notifyDataSetChanged();
+    }
+    //加载更多数据
+    private void loadMoreData() {
+        Fragment item = mAdapter.getItem(viewPager.getCurrentItem());
+        if (item instanceof ILoadMore) {//可加载更多,就调用当前fragment刷新数据
+            ((ILoadMore) item).loadMoreData();
+        } else {
+            notifyDataSetChanged();
+        }
     }
 
     private void notifyDataSetChanged() {
         if (refresh != null) {
             refresh.finishRefresh();
+            refresh.finishLoadMore();
         }
     }
 
@@ -257,11 +280,6 @@ public class ActGcGameAppDetail extends BaseActivity {
 
     @Subscribe
     public void onEventMainThread(BigEvent event) {
-        switch (event.getEventTypes()) {
-            case REFRESH_XIAOMI_GAME_LIST:
-                initData();
-                break;
-        }
         absGetDownloadListener.onEventMainThread(event);
     }
 

+ 22 - 8
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGcGameAppComment.java

@@ -1,6 +1,5 @@
 package com.sheep.gamegroup.view.adapter;
 
-import android.content.Context;
 import android.support.v7.widget.AppCompatRatingBar;
 import android.view.View;
 import android.widget.ImageView;
@@ -8,26 +7,27 @@ import android.widget.TextView;
 
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.BaseViewHolder;
-import com.sheep.gamegroup.model.entity.GameAppComment;
+import com.sheep.gamegroup.model.entity.UserComment;
 import com.sheep.gamegroup.util.TextViewUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
 
 import java.util.List;
-import java.util.Locale;
 
 /**
  * Created by realicing on 2018/11/1.
  * realicing@sina.com
  * 游戏评论adapter
  */
-public class AdpGcGameAppComment extends BaseQuickAdapter<GameAppComment, BaseViewHolder> {
-    public AdpGcGameAppComment(List<GameAppComment> list) {
+public class AdpGcGameAppComment extends BaseQuickAdapter<UserComment, BaseViewHolder> {
+    public AdpGcGameAppComment(List<UserComment> list) {
         super(R.layout.item_gc_game_app_comment, list);
     }
 
     @Override
-    protected void convert(BaseViewHolder helper, GameAppComment item) {
+    protected void convert(BaseViewHolder helper, UserComment item) {
         int position = helper.getAdapterPosition() - getHeaderLayoutCount();
         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);
@@ -41,7 +41,21 @@ public class AdpGcGameAppComment extends BaseQuickAdapter<GameAppComment, BaseVi
             return;
         }
         ViewUtil.setAvatar(game_app_comment_user_avatar, item.getAvatar());
-        ViewUtil.setText(game_app_comment_user_name, String.format(Locale.CHINA, "%d %d %d %d", position, helper.getAdapterPosition(), helper.getLayoutPosition(), helper.getOldPosition()));
-        TextViewUtil.initIntroView(helper.itemView, item.getContent());
+        ViewUtil.setText(game_app_comment_num1, item.getComment());
+        ViewUtil.setText(game_app_comment_num2, item.getLike());
+        ViewUtil.setText(game_app_comment_num3, item.getExpression());
+        game_app_comment_score.setProgress(item.getScore());
+        game_app_comment_score.setMax(10);
+        ViewUtil.setText(game_app_comment_user_name, item.getNickname());
+        //String.format(Locale.CHINA, "%d %d %d %d", position, helper.getAdapterPosition(), helper.getLayoutPosition(), helper.getOldPosition()));
+        TextViewUtil.initIntroView(helper.itemView, item.getShowAll());
+
+        game_app_comment_num1.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                //TODO 跳转游戏评论详情界面
+                G.showToast(R.string.coming_soon);
+            }
+        });
     }
 }

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

@@ -89,6 +89,7 @@ public abstract class BaseListFragment3<T> extends BaseFragment implements IRefr
             initData();
         } else {
             setNoMore(true);
+            refreshOrLoadMoreComplete();
         }
     }
 
@@ -103,11 +104,8 @@ public abstract class BaseListFragment3<T> extends BaseFragment implements IRefr
     //加载完成时更新header或footer
     protected void refreshOrLoadMoreComplete() {
         if (smartRefreshLayout != null && getUserVisibleHint()) {
-            if (page == 1) {
-                smartRefreshLayout.finishRefresh();
-            } else {
-                smartRefreshLayout.finishLoadMore();
-            }
+            smartRefreshLayout.finishRefresh();
+            smartRefreshLayout.finishLoadMore();
         }
     }
 

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

@@ -1,6 +1,5 @@
 package com.sheep.gamegroup.view.fragment;
 
-import android.support.annotation.NonNull;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.view.LayoutInflater;
@@ -12,22 +11,20 @@ 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.api.ApiService;
+import com.sheep.gamegroup.model.entity.AppScoreDetail;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.GameAppScore;
 import com.sheep.gamegroup.model.entity.GameApp;
-import com.sheep.gamegroup.model.entity.GameAppComment;
+import com.sheep.gamegroup.model.entity.UserComment;
+import com.sheep.gamegroup.model.entity.GameAppScore;
 import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.ApiJSONUtil;
 import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.adapter.AdpGcGameAppComment;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.utils.G;
-
-import org.afinal.simplecache.ApiKey;
 
 import java.text.DecimalFormat;
 import java.util.Collections;
@@ -45,21 +42,16 @@ import rx.schedulers.Schedulers;
  * realicing@sina.com
  * 玩转游戏 评价
  */
-public class FgtGcGameAppComment extends BaseListFragment3<GameAppComment> {
+public class FgtGcGameAppComment extends BaseListFragment3<UserComment> {
 
 
     public static FgtGcGameAppComment newInstance(int appId) {
         FgtGcGameAppComment fgt = new FgtGcGameAppComment();
-        fgt.appId = appId;
+        fgt.app_id = appId;
         return fgt;
     }
 
-//    @Override
-//    public int refreshDataType() {
-//        return REFRESH_ON_YOURSELF;
-//    }
-
-    private int appId;
+    private int app_id;
 
     private List<GameAppScore> scoreList = ListUtil.emptyList();
     //头部view
@@ -67,8 +59,10 @@ public class FgtGcGameAppComment extends BaseListFragment3<GameAppComment> {
     private WaterWaveProgress circularProgressView;
     private RatingBar header_gc_game_app_comment_score;
     private RecyclerView header_gc_game_app_comment_xin_list;
+
     @Override
     protected RecyclerView.Adapter getAdapter() {
+        //评论列表
         AdpGcGameAppComment adapter = new AdpGcGameAppComment(list);
         headerView = LayoutInflater.from(SheepApp.getInstance()).inflate(R.layout.header_gc_game_app_comment, null);
         circularProgressView = headerView.findViewById(R.id.header_gc_game_app_comment_score_progress);
@@ -87,6 +81,7 @@ public class FgtGcGameAppComment extends BaseListFragment3<GameAppComment> {
                 ProgressBar item_xin_progress = viewHolder.itemView.findViewById(R.id.item_xin_progress);
                 ViewUtil.setText(item_xin_progress_tv, item.getStar());
                 item_xin_progress.setProgress(item.getNum());
+                item_xin_progress.setMax(item.getMax());
             }
         });
         adapter.addHeaderView(headerView);
@@ -96,33 +91,42 @@ public class FgtGcGameAppComment extends BaseListFragment3<GameAppComment> {
 
     @Override
     protected String getKey(int page, int per_page) {
-        return String.format(Locale.CHINA, "app/find?page=%d&per_page=%d&name=%s&type=%d", page, per_page, "", 0);
+        return String.format(Locale.CHINA, "app/game_user/app_comment_list?page_no=%d&page_size=%d&app_id=%d", page, per_page, app_id);
     }
 
     @Override
     protected Observable<BaseMessage> getApi(ApiService apiService) {
-        return apiService.searchApp(page, per_page, "", 0);
+        return apiService.getGameUserAppCommentList(page, per_page, app_id, ApiJSONUtil.COMMENT_TYPE_GAME);
     }
 
     @Override
-    protected Class<GameAppComment> getTClass() {
-        return GameAppComment.class;
+    protected Class<UserComment> getTClass() {
+        return UserComment.class;
     }
 
+    //不会用到了,因为评分系统重新做了一套,以前的没用了
     public void loadData(GameEntity gameEntity) {
         GameApp gameApp;
-        if((gameApp = gameEntity.getApp()) != null) {
-            int progress = (int) (gameApp.getScore() * 10);
-            //显示评分
-            if (circularProgressView != null) {
-                circularProgressView.setProgress(progress);
-                circularProgressView.setText(new DecimalFormat("0.0").format(gameApp.getScore()));
-            }
-            if (header_gc_game_app_comment_score != null) {
-                header_gc_game_app_comment_score.setProgress(progress);
-            }
+        if ((gameApp = gameEntity.getApp()) != null) {
+            updateScore(gameApp.getScore());
         }
     }
+
+    //更新评分
+    public void updateScore(float score) {
+        int progress = (int) score;
+        //显示评分
+        if (circularProgressView != null) {
+            circularProgressView.setMaxProgress(10);
+            circularProgressView.setProgress(progress);
+            circularProgressView.setText(new DecimalFormat("0.0").format(score));
+        }
+        if (header_gc_game_app_comment_score != null) {
+            header_gc_game_app_comment_score.setMax(10);
+            header_gc_game_app_comment_score.setProgress(progress);
+        }
+    }
+
     //评分排序方法
     private Comparator<GameAppScore> scoreComparable = new Comparator<GameAppScore>() {
         @Override
@@ -130,28 +134,28 @@ public class FgtGcGameAppComment extends BaseListFragment3<GameAppComment> {
             return item2.getStar() - item1.getStar();
         }
     };
+
     //加载评分列表
     private void initAppScoreNum() {
         scoreList.clear();
-        List<GameAppScore> aCacheScoreList = DataUtil.getInstance().getCacheList(ApiKey.score_num(appId), GameAppScore.class);
-        if (!ListUtil.isEmpty(aCacheScoreList)) {
-            scoreList.addAll(aCacheScoreList);
-            Collections.sort(scoreList, scoreComparable);
-        }
         notifyHeaderDataSetChanged();
-        SheepApp.getInstance().getNetComponent().getApiService().getAppScoreNum(appId)
+        SheepApp.getInstance().getNetComponent().getApiService().getGameUserAppScoreDetail(app_id)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
                         scoreList.clear();
-                        List<GameAppScore> newScoreList = baseMessage.getDataList(GameAppScore.class);
-                        if (ListUtil.isEmpty(newScoreList))
-                            resetGameAppScoreNum();
-                        else {
-                            scoreList.addAll(newScoreList);
-                            Collections.sort(scoreList, scoreComparable);
+                        AppScoreDetail appScoreDetail = baseMessage.getData(AppScoreDetail.class);
+                        if (appScoreDetail != null) {
+                            updateScore(appScoreDetail.getScore());
+                            List<GameAppScore> newScoreList = appScoreDetail.toGameAppScoreList();
+                            if (ListUtil.isEmpty(newScoreList))
+                                resetGameAppScoreNum();
+                            else {
+                                scoreList.addAll(newScoreList);
+                                Collections.sort(scoreList, scoreComparable);
+                            }
                         }
                         notifyHeaderDataSetChanged();
                     }
@@ -163,12 +167,13 @@ public class FgtGcGameAppComment extends BaseListFragment3<GameAppComment> {
                     }
                 });
     }
+
     //刷新头部view
     private void notifyHeaderDataSetChanged() {
-        if(header_gc_game_app_comment_xin_list != null)
+        if (header_gc_game_app_comment_xin_list != null)
             header_gc_game_app_comment_xin_list.getAdapter().notifyDataSetChanged();
 
-        if(empty_view != null) {
+        if (empty_view != null) {
             empty_view.postDelayed(new Runnable() {
                 @Override
                 public void run() {

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

@@ -16,6 +16,7 @@ import com.sheep.gamegroup.model.entity.Entry;
 import com.sheep.gamegroup.model.entity.GameApp;
 import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.entity.GameInfoList;
+import com.sheep.gamegroup.model.entity.ShowAll;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.ListUtil;
@@ -92,10 +93,10 @@ public class FgtGcGameAppDetail extends BaseFragment {
         }
         String intro = gameApp.getIntro();
         if (!TextUtils.isEmpty(intro)) {
-            gameInfoListArrayList.add(new GameInfoList("游戏介绍", new RecyclerViewAdapter<String>(SheepApp.getInstance(), R.layout.item_gc_game_app_intro, ListUtil.asList(intro)) {
+            gameInfoListArrayList.add(new GameInfoList("游戏介绍", new RecyclerViewAdapter<ShowAll>(SheepApp.getInstance(), R.layout.item_gc_game_app_intro, ListUtil.asList(new ShowAll(intro))) {
                 @Override
-                public void convert(ViewHolder viewHolder, String text, int position) {
-                    TextViewUtil.initIntroView(viewHolder.itemView, text);
+                public void convert(ViewHolder viewHolder, ShowAll showAll, int position) {
+                    TextViewUtil.initIntroView(viewHolder.itemView, showAll);
                 }
             }));
         }

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

@@ -794,7 +794,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
                 refreshData();
             }
         });
-        RefreshUtil.newInstance().publicParameterRefresh(refresh, activity);
+        RefreshUtil.newInstance().publicParameterLoadMore(refresh, activity);
     }
 
     private void notifyDataSetChanged() {

+ 1 - 1
app/src/main/res/layout/act_comment_game_app.xml

@@ -75,7 +75,7 @@
         <ImageView
             android:layout_width="50dp"
             android:layout_height="wrap_content"
-            android:layout_alignBottom="@+id/act_comment_game_app_input_comment"
+            android:layout_alignBottom="@id/act_comment_game_app_input_comment"
             android:layout_alignParentEnd="true"
             android:layout_marginEnd="2dp"
             android:onClick="onClickXInput"

+ 21 - 10
app/src/main/res/layout/item_gc_game_app_comment.xml

@@ -80,40 +80,51 @@
         android:id="@+id/game_app_comment_num1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginTop="14dp"
-        android:layout_marginBottom="20dp"
-        android:layout_marginEnd="27dp"
+        android:paddingTop="14dp"
+        android:paddingBottom="14dp"
+        android:paddingStart="8dp"
+        android:paddingEnd="8dp"
+        android:layout_marginEnd="10dp"
+        android:layout_marginBottom="6dp"
         android:drawableStart="@drawable/ic_but_speak"
-        android:drawablePadding="4dp"
+        android:drawablePadding="6dp"
         android:text="54"
         android:textColor="#ff666666"
         android:textSize="11sp"
+        app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/intro_show_all"
-        app:layout_constraintBottom_toBottomOf="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="17dp"
+        android:paddingTop="14dp"
+        android:paddingBottom="14dp"
+        android:paddingStart="8dp"
+        android:paddingEnd="8dp"
         android:drawableStart="@drawable/ic_but_up"
+        android:drawablePadding="6dp"
         android:text="54"
         android:textColor="#ff666666"
         android:textSize="11sp"
         app:layout_constraintEnd_toStartOf="@id/game_app_comment_num1"
-        app:layout_constraintTop_toTopOf="@+id/game_app_comment_num1" />
+        app:layout_constraintTop_toTopOf="@id/game_app_comment_num1" />
 
     <TextView
         android:id="@+id/game_app_comment_num3"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginEnd="17dp"
+        android:paddingTop="14dp"
+        android:paddingBottom="14dp"
+        android:paddingStart="8dp"
+        android:paddingEnd="8dp"
         android:drawableStart="@drawable/ic_image_xiao"
+        android:drawablePadding="6dp"
         android:text="54"
         android:textColor="#ff666666"
         android:textSize="11sp"
         app:layout_constraintEnd_toStartOf="@id/game_app_comment_num2"
-        app:layout_constraintTop_toTopOf="@+id/game_app_comment_num1" />
+        app:layout_constraintTop_toTopOf="@id/game_app_comment_num1" />
 
 </android.support.constraint.ConstraintLayout>