Просмотр исходного кода

添加回复详情界面(还差发表回复功能)

zengjiebin лет назад: 7
Родитель
Сommit
c313c83345
30 измененных файлов с 1188 добавлено и 102 удалено
  1. 3 0
      app/src/main/AndroidManifest.xml
  2. 38 0
      app/src/main/java/com/sheep/gamegroup/absBase/BaseContainerActivity.java
  3. 16 2
      app/src/main/java/com/sheep/gamegroup/absBase/BaseListActivity2.java
  4. 29 0
      app/src/main/java/com/sheep/gamegroup/model/entity/UserCommentDetail.java
  5. 132 0
      app/src/main/java/com/sheep/gamegroup/model/entity/UserCommentReply.java
  6. 30 0
      app/src/main/java/com/sheep/gamegroup/model/entity/UserCommentUserData.java
  7. 16 5
      app/src/main/java/com/sheep/gamegroup/util/ApiJSONUtil.java
  8. 38 6
      app/src/main/java/com/sheep/gamegroup/util/DataUtil.java
  9. 11 0
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  10. 6 2
      app/src/main/java/com/sheep/gamegroup/util/TextViewUtil.java
  11. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/ActAudit.java
  12. 0 10
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGiftCenter.java
  13. 24 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActUserCommentDetail.java
  14. 4 18
      app/src/main/java/com/sheep/gamegroup/view/activity/PersonalCenterAct.java
  15. 5 5
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGcGameAppComment.java
  16. 60 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpUserCommentReply.java
  17. 24 4
      app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment3.java
  18. 4 2
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGcGameAppComment.java
  19. 234 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtUserCommentDetail.java
  20. 0 0
      app/src/main/res/drawable/shape_f5_solid_rectangle_15.xml
  21. 6 0
      app/src/main/res/drawable/shape_f5_solid_rectangle_5.xml
  22. 55 32
      app/src/main/res/layout/activity_main.xml
  23. 44 0
      app/src/main/res/layout/bottom_user_comment_detail.xml
  24. 1 2
      app/src/main/res/layout/common_container.xml
  25. 25 0
      app/src/main/res/layout/footer_user_comment_detail.xml
  26. 207 0
      app/src/main/res/layout/header_user_comment_detail.xml
  27. 130 0
      app/src/main/res/layout/item_user_comment_reply.xml
  28. 44 0
      app/src/main/res/layout/net_empty_smart_refresh_rv.xml
  29. 0 12
      app/src/main/res/layout/personalcenter_act_layout.xml
  30. 1 1
      app/src/main/res/layout/title_search.xml

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

@@ -679,6 +679,9 @@
             android:name="com.sheep.gamegroup.view.activity.ActCommentGameApp"
             android:screenOrientation="portrait" />
         <activity
+            android:name="com.sheep.gamegroup.view.activity.ActUserCommentDetail"
+            android:screenOrientation="portrait" />
+        <activity
             android:name="com.sheep.gamegroup.view.activity.ActPlayGameDetail"
             android:screenOrientation="portrait" />
         <activity

+ 38 - 0
app/src/main/java/com/sheep/gamegroup/absBase/BaseContainerActivity.java

@@ -0,0 +1,38 @@
+package com.sheep.gamegroup.absBase;
+
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentTransaction;
+
+import com.sheep.jiuyan.samllsheep.R;
+
+/**
+ * Created by realicing on 2018/11/2.
+ * realicing@sina.com
+ */
+public abstract class BaseContainerActivity extends BaseActivity {
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.common_container;
+    }
+
+    protected Fragment fragment;
+
+    @Override
+    public void initView() {
+
+        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
+        fragment = getSupportFragmentManager().findFragmentByTag("tag");
+        if (fragment == null) {
+            fragment = initFragment();
+            transaction.add(R.id.frame_container, fragment, "tag");
+            transaction.commitAllowingStateLoss();
+        } else {
+            transaction.replace(R.id.frame_container, fragment);
+            transaction.commitAllowingStateLoss();
+        }
+
+    }
+
+    protected abstract Fragment initFragment();
+}

+ 16 - 2
app/src/main/java/com/sheep/gamegroup/absBase/BaseListActivity2.java

@@ -9,6 +9,7 @@ import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.Conversion;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.SysAppUtil;
@@ -115,11 +116,18 @@ public abstract class BaseListActivity2<T> extends BaseActivity implements IRefr
         return true;
     }
 
+    //将baseMessage转化为list<T>
+    private Conversion<BaseMessage, List<T>> conversion = new Conversion<BaseMessage, List<T>>() {
+        @Override
+        public List<T> convert(BaseMessage baseMessage, int position) {
+            return resolveData(baseMessage, position);
+        }
+    };
     public void mInitData() {
         final String urlKey = getKey(page, per_page);
         if (isFirstGetACache()) {
             //先尝试获取缓存数据
-            lastCacheList = DataUtil.getInstance().getCacheList(urlKey, getTClass());
+            lastCacheList = DataUtil.getInstance().getCacheList(urlKey, getTClass(), conversion);
             loadList(lastCacheList);
         }
         SysAppUtil.checkNet(new Action1<Integer>() {
@@ -145,7 +153,8 @@ public abstract class BaseListActivity2<T> extends BaseActivity implements IRefr
                         if (isNewData || !isFirstGetACache()) {
                             if (isFirstGetACache())
                                 ListUtil.removeAll(list, lastCacheList);
-                            List<T> newList = baseMessage.getDatas(getTClass());
+
+                            List<T> newList = conversion.convert(baseMessage, page);
                             loadList(newList);
                         } else {
                             notifyDataSetChanged();
@@ -159,6 +168,11 @@ public abstract class BaseListActivity2<T> extends BaseActivity implements IRefr
                 });
     }
 
+    //解析数据
+    protected List<T> resolveData(BaseMessage baseMessage, int page) {
+        return baseMessage.getDatas(getTClass());
+    }
+
     public Action1<String> getNoMoreCallBack() {
         return null;
     }

+ 29 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/UserCommentDetail.java

@@ -0,0 +1,29 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by realicing on 2018/11/2.
+ * realicing@sina.com
+ * user_comment:	UserComment{...}
+ * user_comment_reply:	UserCommentUserData{...}
+ * 用户详情
+ */
+public class UserCommentDetail {
+    private UserComment user_comment;
+    private UserCommentUserData user_comment_reply;
+
+    public UserComment getUser_comment() {
+        return user_comment;
+    }
+
+    public void setUser_comment(UserComment user_comment) {
+        this.user_comment = user_comment;
+    }
+
+    public UserCommentUserData getUser_comment_reply() {
+        return user_comment_reply;
+    }
+
+    public void setUser_comment_reply(UserCommentUserData user_comment_reply) {
+        this.user_comment_reply = user_comment_reply;
+    }
+}

+ 132 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/UserCommentReply.java

@@ -0,0 +1,132 @@
+package com.sheep.gamegroup.model.entity;
+
+import com.sheep.gamegroup.absBase.ICanShowAll;
+
+/**
+ * Created by realicing on 2018/11/2.
+ * realicing@sina.com
+ * update_time:	integer ($int64)
+ * reply:	string
+ * 回复内容
+ * nickname:	string
+ * 昵称
+ * user_id:	integer ($int64)
+ * 用户id
+ * user_comment_id:	integer ($int64)
+ * 评论id
+ * create_time:	integer ($int64)
+ * status:	integer ($int32)
+ * 审核状态 1:通过 2:未通过
+ * like:	integer ($int64)
+ * 点赞数
+ * content:	string
+ * 评论内容
+ * avatar:	string
+ * 头像
+ * id:	integer ($int64)
+ * <p>
+ * description:用户评论信息
+ */
+public class UserCommentReply implements ICanShowAll {
+    private int id;
+
+    private int user_comment_id;
+
+    private int user_id;
+
+    private String nickname;
+
+    private String avatar;
+
+    private int like;
+
+    private int status;
+
+    private String content;
+
+    private String reply;
+
+    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_comment_id(int user_comment_id){
+        this.user_comment_id = user_comment_id;
+    }
+    public int getUser_comment_id(){
+        return this.user_comment_id;
+    }
+    public void setUser_id(int user_id){
+        this.user_id = user_id;
+    }
+    public int getUser_id(){
+        return this.user_id;
+    }
+    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 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 setReply(String reply){
+        this.reply = reply;
+    }
+    public String getReply(){
+        return this.reply;
+    }
+    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;
+    }
+}

+ 30 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/UserCommentUserData.java

@@ -0,0 +1,30 @@
+package com.sheep.gamegroup.model.entity;
+
+import java.util.List;
+
+/**
+ * Created by realicing on 2018/11/2.
+ * realicing@sina.com
+ * reply_list:	[...]
+ * total:	integer ($int64)
+ */
+public class UserCommentUserData {
+    private List<UserCommentReply> reply_list;
+    private int total;
+
+    public List<UserCommentReply> getReply_list() {
+        return reply_list;
+    }
+
+    public void setReply_list(List<UserCommentReply> reply_list) {
+        this.reply_list = reply_list;
+    }
+
+    public int getTotal() {
+        return total;
+    }
+
+    public void setTotal(int total) {
+        this.total = total;
+    }
+}

+ 16 - 5
app/src/main/java/com/sheep/gamegroup/util/ApiJSONUtil.java

@@ -29,11 +29,6 @@ public class ApiJSONUtil {
      * 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();
@@ -44,4 +39,20 @@ public class ApiJSONUtil {
         return SheepApp.getInstance().getNetComponent().getApiService().postGameUserUserGameComment(jsonObject);
     }
 
+    /**
+     * 用户评论用户
+     * UserCommentReq{
+     * content:	string  评论内容
+     * expression:	boolean 是否有表情
+     * user_comment_id:	integer ($int64) 评论id
+     * }
+     */
+    public static Observable<BaseMessage> postGameUserUserComment(int user_comment_id, boolean expression, 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);
+    }
+
 }

+ 38 - 6
app/src/main/java/com/sheep/gamegroup/util/DataUtil.java

@@ -243,6 +243,38 @@ public class DataUtil {
             return ListUtil.emptyList();
         }
     }
+    /**
+     * 获取缓存的数据列表,为空代表没有获取过,为空字符串代表之前获取数据为空列表
+     *
+     * @param key
+     * @param classT
+     * @param <T>
+     * @return
+     */
+    public <T> List<T> getCacheList(String key, Class<T> classT, Conversion<BaseMessage, List<T>> conversion) {
+        String cacheData = aCache.getAsString(SheepApp.getInstance().getConnectAddress().getAppUrl() + "v1/" + key);
+        if (cacheData == null) {
+            return null;
+        } else if (cacheData.isEmpty()) {
+            return ListUtil.emptyList();
+        }
+        if (BuildConfig.XXTEA_ENCRYPT) {
+            cacheData = BaseMessageConverter.decrypt(cacheData);
+        }
+        try {
+            BaseMessage baseMessage = JSON.parseObject(cacheData, BaseMessage.class);
+            if(baseMessage != null) {
+                if (conversion != null) {
+                    return conversion.convert(baseMessage, 0);
+                } else {
+                    return baseMessage.getDataList(classT);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return ListUtil.emptyList();
+    }
 
 
     /**
@@ -509,22 +541,22 @@ public class DataUtil {
 
     /**
      * 设置数据到bundle中,注意,其key是类名,所以同一个类只支持一条
+     * @param <T>
      * @param intent
      * @param t
-     * @param <T>
      */
-    public static <T> void putObject(Intent intent, T t) {
-        intent.putExtra(t.getClass().getSimpleName(), JSONObject.toJSONString(t));
+    public static <T> Intent putObject(Intent intent, T t) {
+        return intent.putExtra(t.getClass().getSimpleName(), JSONObject.toJSONString(t));
     }
     /**
      * 设置数据到bundle中
+     * @param <T>
      * @param intent
      * @param t
-     * @param <T>
      * @param key
      */
-    public static <T> void putObject(Intent intent, T t, String key) {
-        intent.putExtra(key, JSONObject.toJSONString(t));
+    public static <T> Intent putObject(Intent intent, T t, String key) {
+        return intent.putExtra(key, JSONObject.toJSONString(t));
     }
 
 

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

@@ -34,6 +34,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.UserComment;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.entity.VersionInfo;
 import com.sheep.gamegroup.model.entity.WebviewEntity;
@@ -79,6 +80,7 @@ import com.sheep.gamegroup.view.activity.ActSignCard;
 import com.sheep.gamegroup.view.activity.ActSignCardRecord;
 import com.sheep.gamegroup.view.activity.ActSysNfDetail;
 import com.sheep.gamegroup.view.activity.ActUnderstandSheep;
+import com.sheep.gamegroup.view.activity.ActUserCommentDetail;
 import com.sheep.gamegroup.view.activity.ActUserLabelList;
 import com.sheep.gamegroup.view.activity.ActWeb;
 import com.sheep.gamegroup.view.activity.ActXiaomiGame;
@@ -2097,4 +2099,13 @@ public class Jump2View {
     public void goActCommentGameApp(Activity activity, int game_id) {
         activity.startActivity(new Intent(activity, ActCommentGameApp.class).putExtra("game_id", game_id));
     }
+
+    /**
+     * 跳转游戏评论详情界面
+     * @param activity
+     * @param user_comment_id
+     */
+    public void goActAppCommentDetail(Activity activity, int user_comment_id ) {
+        activity.startActivity(DataUtil.putObject(new Intent(activity, ActUserCommentDetail.class), user_comment_id));
+    }
 }

+ 6 - 2
app/src/main/java/com/sheep/gamegroup/util/TextViewUtil.java

@@ -34,6 +34,10 @@ public class TextViewUtil {
     }
     //初始化文本介绍,必须有 intro_content 和 intro_show_all
     public static void initIntroView(View itemView, final ShowAll showAll) {
+        initIntroView(itemView, showAll, "显示全部");
+    }
+    //初始化文本介绍,必须有 intro_content 和 intro_show_all
+    public static void initIntroView(View itemView, final ShowAll showAll, final String showAllText) {
         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);
@@ -42,7 +46,7 @@ public class TextViewUtil {
             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 ? "显示全部" : "收起");
+            intro_show_all.setText(canShowAll ? "收起" : showAllText);
         }
         TextViewUtil.listenEllipsizeChange(intro_content, new Action1<Integer>() {
             @Override
@@ -61,7 +65,7 @@ public class TextViewUtil {
                 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 ? "显示全部" : "收起");
+                intro_show_all.setText(canShowAll ? "收起" : showAllText);
                 showAll.setYes(!showAll.isYes());
             }
         });

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/ActAudit.java

@@ -19,7 +19,7 @@ public class ActAudit extends BaseActivity {
 
     @Override
     protected int getLayoutId() {
-        return R.layout.personalcenter_act_layout;
+        return R.layout.common_container;
     }
 
     @Override

+ 0 - 10
app/src/main/java/com/sheep/gamegroup/view/activity/ActGiftCenter.java

@@ -43,14 +43,4 @@ public class ActGiftCenter extends BaseActivity {
         }
 
     }
-
-    @Override
-    public void initListener() {
-
-    }
-
-    @Override
-    public void initData() {
-
-    }
 }

+ 24 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActUserCommentDetail.java

@@ -0,0 +1,24 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.support.v4.app.Fragment;
+
+import com.sheep.gamegroup.absBase.BaseContainerActivity;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.view.fragment.FgtUserCommentDetail;
+
+/**
+ * Created by realicing on 2018/11/2.
+ * realicing@sina.com
+ * 用户评论详情界面
+ */
+public class ActUserCommentDetail extends BaseContainerActivity {
+
+    @Override
+    protected Fragment initFragment() {
+        Integer user_comment_id = DataUtil.getObject(getIntent(), Integer.class);
+        FgtUserCommentDetail fgt = new FgtUserCommentDetail();
+        fgt.setUser_comment_id(user_comment_id);
+        return fgt;
+    }
+
+}

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

@@ -1,12 +1,11 @@
 package com.sheep.gamegroup.view.activity;
 
-import android.app.Activity;
 import android.os.Bundle;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentTransaction;
 
-import com.sheep.gamegroup.view.fragment.FgtPersonalCenter;
 import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.view.fragment.FgtPersonalCenter;
 import com.sheep.jiuyan.samllsheep.R;
 
 /**
@@ -16,42 +15,29 @@ import com.sheep.jiuyan.samllsheep.R;
 
 public class PersonalCenterAct extends BaseActivity {
 
-    Activity activity;
 
     @Override
     protected int getLayoutId() {
-        return R.layout.personalcenter_act_layout;
+        return R.layout.common_container;
     }
 
     @Override
     public void initView() {
-        activity = this;
 
         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
         Bundle bundle = new Bundle();
         Fragment fragment = getSupportFragmentManager().findFragmentByTag("tag");
-        if(fragment == null){
+        if (fragment == null) {
             fragment = new FgtPersonalCenter();
             fragment.setArguments(bundle);
             transaction.add(R.id.frame_container, fragment, "tag");
             transaction.commitAllowingStateLoss();
-        }else {
+        } else {
             fragment.setArguments(bundle);
             transaction.replace(R.id.frame_container, fragment);
             transaction.commitAllowingStateLoss();
         }
 
-
-    }
-
-    @Override
-    public void initListener() {
-
-    }
-
-    @Override
-    public void initData() {
-
     }
 
 }

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

@@ -8,11 +8,11 @@ import android.widget.TextView;
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.BaseViewHolder;
 import com.sheep.gamegroup.model.entity.UserComment;
+import com.sheep.gamegroup.util.ActivityManager;
+import com.sheep.gamegroup.util.Jump2View;
 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;
 
@@ -27,7 +27,7 @@ public class AdpGcGameAppComment extends BaseQuickAdapter<UserComment, BaseViewH
     }
 
     @Override
-    protected void convert(BaseViewHolder helper, UserComment item) {
+    protected void convert(BaseViewHolder helper, final 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);
@@ -53,8 +53,8 @@ public class AdpGcGameAppComment extends BaseQuickAdapter<UserComment, BaseViewH
         game_app_comment_num1.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
-                //TODO 跳转游戏评论详情界面
-                G.showToast(R.string.coming_soon);
+                //跳转游戏评论详情界面
+                Jump2View.getInstance().goActAppCommentDetail(ActivityManager.getInstance().currentActivity(), item.getId());
             }
         });
     }

+ 60 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpUserCommentReply.java

@@ -0,0 +1,60 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.sheep.gamegroup.model.entity.UserComment;
+import com.sheep.gamegroup.model.entity.UserCommentReply;
+import com.sheep.gamegroup.util.TextViewUtil;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Created by realicing on 2018/11/2.
+ * realicing@sina.com
+ * 用户评论详情中的评论 adapter
+ */
+public class AdpUserCommentReply extends BaseQuickAdapter<UserCommentReply, BaseViewHolder> {
+    public AdpUserCommentReply(List<UserCommentReply> list) {
+        super(R.layout.item_user_comment_reply, list);
+    }
+    private UserComment userComment;
+
+    public void setUserComment(UserComment userComment) {
+        this.userComment = userComment;
+    }
+
+    @Override
+    protected void convert(BaseViewHolder helper, final UserCommentReply 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);
+        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);
+        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);
+        ViewUtil.setVisibility(game_app_comment_line_top, position != 0);
+        if(item == null)
+            return;
+        //自己回复自己的评论
+        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.getReply());
+        ViewUtil.setText(game_app_comment_num2, item.getLike());
+        ViewUtil.setVisibility(game_app_comment_line_bottom, false);
+        ViewUtil.setVisibility(user_comment_reply_content, false);
+        TextViewUtil.initIntroView(helper.itemView, item.getShowAll());
+    }
+}

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

@@ -12,6 +12,7 @@ import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.Conversion;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.SysAppUtil;
@@ -56,6 +57,8 @@ public abstract class BaseListFragment3<T> extends BaseFragment implements IRefr
                 notifyDataSetChanged();
                 break;
         }
+        if(!useSelfEmpty() && empty_view != null)
+            empty_view.setVisibility(View.GONE);
     }
 
     @BindView(R.id.title)
@@ -117,12 +120,19 @@ public abstract class BaseListFragment3<T> extends BaseFragment implements IRefr
         return true;
     }
 
+    //将baseMessage转化为list<T>
+    private Conversion<BaseMessage, List<T>> conversion = new Conversion<BaseMessage, List<T>>() {
+        @Override
+        public List<T> convert(BaseMessage baseMessage, int position) {
+            return resolveData(baseMessage, position);
+        }
+    };
     //加载数据
     public void initData() {
         final String urlKey = getKey(page, per_page);
         if (isFirstGetACache()) {
             //先尝试获取缓存数据
-            lastCacheList = DataUtil.getInstance().getCacheList(urlKey, getTClass());
+            lastCacheList = DataUtil.getInstance().getCacheList(urlKey, getTClass(), conversion);
             loadList(lastCacheList);
         }
         SysAppUtil.checkNet(new Action1<Integer>() {
@@ -148,7 +158,7 @@ public abstract class BaseListFragment3<T> extends BaseFragment implements IRefr
                         if (isNewData || !isFirstGetACache()) {
                             if (isFirstGetACache())
                                 ListUtil.removeAll(list, lastCacheList);
-                            List<T> newList = baseMessage.getDatas(getTClass());
+                            List<T> newList = conversion.convert(baseMessage, page);
                             loadList(newList);
                         } else {
                             notifyDataSetChanged();
@@ -163,6 +173,10 @@ public abstract class BaseListFragment3<T> extends BaseFragment implements IRefr
     }
 
 
+    //解析数据
+    protected List<T> resolveData(BaseMessage baseMessage, int page) {
+        return baseMessage.getDatas(getTClass());
+    }
     @Override
     public void onResume() {
         super.onResume();
@@ -170,6 +184,10 @@ public abstract class BaseListFragment3<T> extends BaseFragment implements IRefr
             refreshData();
         }
     }
+    //使用布局中自带的无数据空view
+    public boolean useSelfEmpty(){
+        return true;
+    }
 
     public static final int REFRESH_ON_CREATE = 0;
     public static final int REFRESH_ON_RESUME = 1;
@@ -187,7 +205,8 @@ public abstract class BaseListFragment3<T> extends BaseFragment implements IRefr
     public void clear() {
         lastMessage = null;
         setNoMore(false);
-        if (empty_view != null)
+
+        if (useSelfEmpty() && empty_view != null)
             empty_view.setVisibility(View.INVISIBLE);
         list.clear();
         page = 1;
@@ -229,7 +248,8 @@ public abstract class BaseListFragment3<T> extends BaseFragment implements IRefr
 
     //是否显示无数据占位图
     protected void updateEmptyView() {
-        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
+        if(useSelfEmpty())
+            CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
     }
 
     protected boolean noMore = false;

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

@@ -62,8 +62,7 @@ public class FgtGcGameAppComment extends BaseListFragment3<UserComment> {
 
     @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);
         header_gc_game_app_comment_score = headerView.findViewById(R.id.header_gc_game_app_comment_score);
@@ -84,6 +83,9 @@ public class FgtGcGameAppComment extends BaseListFragment3<UserComment> {
                 item_xin_progress.setMax(item.getMax());
             }
         });
+
+        //评论列表
+        AdpGcGameAppComment adapter = new AdpGcGameAppComment(list);
         adapter.addHeaderView(headerView);
         initAppScoreNum();
         return adapter;

+ 234 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtUserCommentDetail.java

@@ -0,0 +1,234 @@
+package com.sheep.gamegroup.view.fragment;
+
+import android.support.annotation.NonNull;
+import android.support.v7.widget.AppCompatRatingBar;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.scwang.smartrefresh.layout.SmartRefreshLayout;
+import com.scwang.smartrefresh.layout.api.RefreshLayout;
+import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
+import com.sheep.gamegroup.absBase.BaseListActivity2;
+import com.sheep.gamegroup.dateview.DateUtil;
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.UserComment;
+import com.sheep.gamegroup.model.entity.UserCommentDetail;
+import com.sheep.gamegroup.model.entity.UserCommentReply;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.ApiJSONUtil;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.RefreshUtil;
+import com.sheep.gamegroup.util.TestUtil;
+import com.sheep.gamegroup.util.TextViewUtil;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.adapter.AdpUserCommentReply;
+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 java.util.List;
+import java.util.Locale;
+
+import butterknife.BindView;
+import rx.Observable;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by realicing on 2018/11/2.
+ * realicing@sina.com
+ * 用户评论详情界面
+ */
+public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.net_empty_smart_refresh_rv;
+    }
+
+    @BindView(R.id.refresh)
+    SmartRefreshLayout refresh;
+    @BindView(R.id.bottom)
+    RelativeLayout bottom;
+    @Override
+    public void initView() {
+        TitleBarUtils.getInstance().setTitle(mView, "回复详情")
+                .setTitleFinish(mView, activity);
+        smartRefreshLayout = refresh;
+        refresh.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
+            @Override
+            public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
+                loadMoreData();
+            }
+
+            @Override
+            public void onRefresh(@NonNull RefreshLayout refreshLayout) {
+                refreshData();
+            }
+        });
+        RefreshUtil.newInstance().publicParameterLoadMore(refresh, activity);
+
+        //头部view
+        initHeaderView();
+
+        //尾部,在无数据时显示
+        footerView = LayoutInflater.from(SheepApp.getInstance()).inflate(R.layout.footer_user_comment_detail, null);
+        //底部可发表评论
+        LayoutInflater.from(SheepApp.getInstance()).inflate(R.layout.bottom_user_comment_detail, bottom);
+        bottom_user_comment_detail_input = bottom.findViewById(R.id.bottom_user_comment_detail_input);
+        bottom.findViewById(R.id.bottom_user_comment_detail_commit).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                String content = bottom_user_comment_detail_input.getText().toString();
+                commitContent(content);
+            }
+        });
+
+    }
+//    ------------------------------start header------------------------------------
+    private LinearLayout user_comment_detail_game_ll;
+    private TextView user_comment_detail_game_name;
+    private ImageView user_comment_detail_user_avatar;
+    private TextView user_comment_detail_user_name;
+    private TextView user_comment_detail_user_publish_time;
+    private AppCompatRatingBar user_comment_detail_user_publish_score;
+    private TextView user_comment_detail_num1;
+    private TextView user_comment_detail_num2;
+    private TextView user_comment_detail_num3;
+    //初始化headerView
+    private void initHeaderView() {
+        headerView = LayoutInflater.from(SheepApp.getInstance()).inflate(R.layout.header_user_comment_detail, null);
+
+        user_comment_detail_game_ll = headerView.findViewById(R.id.user_comment_detail_game_ll);
+        user_comment_detail_game_name = headerView.findViewById(R.id.user_comment_detail_game_name);
+        user_comment_detail_user_avatar = headerView.findViewById(R.id.user_comment_detail_user_avatar);
+        user_comment_detail_user_name = headerView.findViewById(R.id.user_comment_detail_user_name);
+        user_comment_detail_user_publish_time = headerView.findViewById(R.id.user_comment_detail_user_publish_time);
+        user_comment_detail_user_publish_score = headerView.findViewById(R.id.user_comment_detail_user_publish_score);
+        user_comment_detail_num1 = headerView.findViewById(R.id.user_comment_detail_num1);
+        user_comment_detail_num2 = headerView.findViewById(R.id.user_comment_detail_num2);
+        user_comment_detail_num3 = headerView.findViewById(R.id.user_comment_detail_num3);
+    }
+    //加载数据
+    private void loadHeaderViewData(final UserComment user_comment){
+        user_comment_detail_game_ll.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                //点击游戏
+                if(user_comment != null)
+                    Jump2View.getInstance().goPlayGameDetail(activity, user_comment.getApp_id());
+                else
+                    G.showToast(R.string.loading_data);
+            }
+        });
+        user_comment_detail_user_publish_score.setMax(10);
+        user_comment_detail_user_publish_score.setProgress(user_comment.getScore());
+        ViewUtil.setText(user_comment_detail_num1, user_comment.getComment());
+        ViewUtil.setText(user_comment_detail_num2, user_comment.getLike());
+        ViewUtil.setText(user_comment_detail_num3, user_comment.getExpression());
+        ViewUtil.setText(user_comment_detail_game_name, user_comment.getApp_name());
+        ViewUtil.setText(user_comment_detail_user_name, user_comment.getNickname());
+        user_comment_detail_user_publish_time.setText(DateUtil.getTimeText(user_comment.getCreate_time()));
+        ViewUtil.setAvatar(user_comment_detail_user_avatar, user_comment.getAvatar());
+        TextViewUtil.initIntroView(headerView, user_comment.getShowAll(), "全文");
+    }
+
+//    ------------------------------end header------------------------------------
+    //用户评论一个用户对游戏的评论
+    private void commitContent(String content) {
+        if(TestUtil.isDev()) G.showToast("评论内容:" + content);
+        if(content.isEmpty()){
+            G.showToast("评论内容不能为空");
+            return;
+        }
+        // 发表评论
+        ApiJSONUtil.postGameUserUserComment(user_comment_id, false, content)
+                        .subscribeOn(Schedulers.io())
+                        .observeOn(AndroidSchedulers.mainThread())
+                        .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                            @Override
+                            public void onNext(BaseMessage baseMessage) {
+                                G.showToast(baseMessage);
+                            }
+
+                            @Override
+                            public void onError(BaseMessage baseMessage) {
+                                G.showToast(baseMessage);
+                            }
+                        });
+    }
+    //输入框
+    private EditText bottom_user_comment_detail_input;
+
+    private View headerView;
+    private View footerView;
+
+    private int user_comment_id;
+    public void setUser_comment_id(int user_comment_id) {
+        this.user_comment_id = user_comment_id;
+    }
+
+    @Override
+    public boolean useSelfEmpty() {
+        return false;
+    }
+
+    private AdpUserCommentReply adapter;
+    @Override
+    protected RecyclerView.Adapter getAdapter() {
+        //用户评论的回复列表
+        adapter = new AdpUserCommentReply(list);
+        adapter.addHeaderView(headerView);
+        return adapter;
+    }
+
+    @Override
+    protected String getKey(int page, int per_page) {
+        return String.format(Locale.CHINA, "app/game_user/user_comment_detail?page_no=%d&page_size=%d&user_comment_id=%d", page, per_page, user_comment_id);
+    }
+
+    @Override
+    protected Observable<BaseMessage> getApi(ApiService apiService) {
+        return apiService.getGameUserUserCommentDetail(page, per_page, user_comment_id);
+    }
+
+    @Override
+    protected List<UserCommentReply> resolveData(BaseMessage baseMessage, int page) {
+        UserCommentDetail userCommentDetail = baseMessage.getData(UserCommentDetail.class);
+        if(page == 0){
+            adapter.setUserComment(userCommentDetail.getUser_comment());
+            loadHeaderViewData(userCommentDetail.getUser_comment());
+        }
+        if(userCommentDetail != null && userCommentDetail.getUser_comment_reply() != null && userCommentDetail.getUser_comment_reply().getReply_list() != null)
+            return userCommentDetail.getUser_comment_reply().getReply_list();
+        return ListUtil.emptyList();
+    }
+
+    @Override
+    protected Class<UserCommentReply> getTClass() {
+        return UserCommentReply.class;
+    }
+
+    @Override
+    protected void updateEmptyView() {
+        if(adapter != null){
+            if(list.isEmpty()) {
+                if(footerView.getParent() == null)//未添加尾部view
+                    adapter.addFooterView(footerView);
+            } else {
+                if(footerView.getParent() != null)//已经添加尾部view
+                    adapter.removeFooterView(footerView);
+            }
+        }
+    }
+}

app/src/main/res/drawable/shape_f5_solid_rectangle.xml → app/src/main/res/drawable/shape_f5_solid_rectangle_15.xml


+ 6 - 0
app/src/main/res/drawable/shape_f5_solid_rectangle_5.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners android:radius="5dp" />
+    <solid android:color="#f5f5f5" />
+</shape>

+ 55 - 32
app/src/main/res/layout/activity_main.xml

@@ -4,7 +4,12 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
-    <include layout="@layout/common_container"/>
+    <FrameLayout
+        android:id="@+id/frame_container"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginBottom="@dimen/bottom_height" />
+
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
@@ -16,7 +21,7 @@
             android:id="@+id/view_pager_container"
             android:layout_width="match_parent"
             android:layout_height="0dp"
-            android:layout_weight="1"/>
+            android:layout_weight="1" />
 
     </LinearLayout>
 
@@ -25,7 +30,8 @@
         android:layout_width="match_parent"
         android:layout_height="@dimen/app_nav_toolbar_height"
         android:layout_alignParentTop="true"
-        android:visibility="gone"/>
+        android:visibility="gone" />
+
     <RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
@@ -36,71 +42,88 @@
             android:id="@+id/tab_container"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:paddingTop="4dp"
-            android:orientation="horizontal">
-            <View android:layout_weight="1"
+            android:orientation="horizontal"
+            android:paddingTop="4dp">
+
+            <View
                 android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"/>
+                android:layout_height="@dimen/tab_height"
+                android:layout_weight="1" />
+
             <TextView
                 android:layout_width="wrap_content"
-                android:minWidth="@dimen/tab_width"
                 android:layout_height="@dimen/tab_height"
                 android:drawableTop="@drawable/drawable_selector_task"
-                android:textSize="10sp"
                 android:gravity="center"
+                android:minWidth="@dimen/tab_width"
+                android:text="@string/tab_viewpager_gamestore"
                 android:textColor="@color/selector_color_main_tab"
-                android:text="@string/tab_viewpager_gamestore"/>
-            <View android:layout_weight="2"
+                android:textSize="10sp" />
+
+            <View
                 android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"/>
+                android:layout_height="@dimen/tab_height"
+                android:layout_weight="2" />
+
             <TextView
                 android:layout_width="wrap_content"
-                android:minWidth="@dimen/tab_width"
                 android:layout_height="@dimen/tab_height"
                 android:drawableTop="@drawable/drawable_selector_task"
-                android:textSize="10sp"
                 android:gravity="center"
+                android:minWidth="@dimen/tab_width"
+                android:text="@string/tab_viewpager_classification"
                 android:textColor="@color/selector_color_main_tab"
-                android:text="@string/tab_viewpager_classification"/>
-            <View android:layout_weight="2"
+                android:textSize="10sp" />
+
+            <View
                 android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"/>
+                android:layout_height="@dimen/tab_height"
+                android:layout_weight="2" />
+
             <TextView
                 android:layout_width="wrap_content"
-                android:minWidth="@dimen/tab_width"
                 android:layout_height="@dimen/tab_height"
                 android:drawableTop="@drawable/drawable_selector_task"
-                android:textSize="10sp"
                 android:gravity="center"
+                android:minWidth="@dimen/tab_width"
+                android:text="@string/mine_hoggerel"
                 android:textColor="@color/selector_color_main_tab"
-                android:text="@string/mine_hoggerel"/>
-            <View android:layout_weight="2"
+                android:textSize="10sp" />
+
+            <View
                 android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"/>
+                android:layout_height="@dimen/tab_height"
+                android:layout_weight="2" />
+
             <TextView
                 android:layout_width="wrap_content"
-                android:minWidth="@dimen/tab_width"
                 android:layout_height="@dimen/tab_height"
                 android:drawableTop="@drawable/drawable_selector_task"
-                android:textSize="10sp"
                 android:gravity="center"
+                android:minWidth="@dimen/tab_width"
+                android:text="@string/tab_viewpager_borrowplay"
                 android:textColor="@color/selector_color_main_tab"
-                android:text="@string/tab_viewpager_borrowplay"/>
-            <View android:layout_weight="2"
+                android:textSize="10sp" />
+
+            <View
                 android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"/>
+                android:layout_height="@dimen/tab_height"
+                android:layout_weight="2" />
+
             <TextView
                 android:layout_width="wrap_content"
-                android:minWidth="@dimen/tab_width"
                 android:layout_height="@dimen/tab_height"
                 android:drawableTop="@drawable/drawable_selector_task"
-                android:textSize="10sp"
                 android:gravity="center"
+                android:minWidth="@dimen/tab_width"
+                android:text="@string/tab_viewpager_borrowplay"
                 android:textColor="@color/selector_color_main_tab"
-                android:text="@string/tab_viewpager_borrowplay"/>
-            <View android:layout_weight="1"
+                android:textSize="10sp" />
+
+            <View
                 android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"/>
+                android:layout_height="@dimen/tab_height"
+                android:layout_weight="1" />
         </LinearLayout>
 
         <View

+ 44 - 0
app/src/main/res/layout/bottom_user_comment_detail.xml

@@ -0,0 +1,44 @@
+<?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="wrap_content">
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:background="#fff2f2f2" />
+
+    <TextView
+        android:id="@+id/bottom_user_comment_detail_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" />
+
+    <EditText
+        android:id="@+id/bottom_user_comment_detail_input"
+        android:layout_width="match_parent"
+        android:layout_height="30dp"
+        android:layout_marginStart="15dp"
+        android:layout_marginTop="9dp"
+        android:layout_marginEnd="9dp"
+        android:layout_marginBottom="8dp"
+        android:maxLength="100"
+        android:layout_toStartOf="@id/bottom_user_comment_detail_commit"
+        android:background="@drawable/shape_f5_solid_rectangle_15"
+        android:gravity="center|start"
+        android:hint="输入优质评论哦~"
+        android:paddingStart="10dp"
+        android:paddingEnd="10dp"
+        android:textColor="#ff666666"
+        android:textColorHint="#aaaaaa"
+        android:textSize="14sp" />
+
+</RelativeLayout>

+ 1 - 2
app/src/main/res/layout/common_container.xml

@@ -2,5 +2,4 @@
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/frame_container"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:layout_marginBottom="@dimen/bottom_height" />
+    android:layout_height="match_parent" />

+ 25 - 0
app/src/main/res/layout/footer_user_comment_detail.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/white"
+    android:gravity="center_horizontal"
+    android:orientation="vertical">
+
+    <ImageView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="80dp"
+        android:background="@color/white"
+        android:gravity="center"
+        android:scaleType="centerInside"
+        android:src="@mipmap/wushuju"
+        android:visibility="visible" />
+
+    <TextView
+        style="@style/style_empty_text"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/content_padding_big"
+        android:text="@string/wushuju" />
+</LinearLayout>

+ 207 - 0
app/src/main/res/layout/header_user_comment_detail.xml

@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout 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:orientation="vertical">
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="10dp"
+        android:background="#f5f5f5" />
+
+    <LinearLayout
+        android:id="@+id/user_comment_detail_game_ll"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center_vertical"
+        android:orientation="horizontal"
+        android:paddingStart="16dp"
+        android:paddingTop="20dp"
+        android:paddingEnd="16dp"
+        android:paddingBottom="20dp">
+
+        <ImageView
+            android:layout_width="33dp"
+            android:layout_height="33dp"
+            android:src="@drawable/icon_lj" />
+
+        <TextView
+            android:id="@+id/user_comment_detail_game_name"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:paddingStart="8dp"
+            android:paddingEnd="8dp"
+            android:text="永恒仙域"
+            android:textColor="#ff333333"
+            android:textSize="13sp" />
+
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@mipmap/x_ic_next" />
+    </LinearLayout>
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="10dp"
+        android:background="#f5f5f5" />
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <ImageView
+            android:id="@+id/user_comment_detail_user_avatar"
+            android:layout_width="25dp"
+            android:layout_height="25dp"
+            android:layout_marginStart="16dp"
+            android:layout_marginTop="20dp"
+            android:src="@drawable/icon" />
+
+        <TextView
+            android:id="@+id/user_comment_detail_user_name"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="50dp"
+            android:layout_marginTop="18dp"
+            android:layout_marginEnd="36dp"
+            android:text="栗子的菜"
+            android:textColor="#ff333333"
+            android:textSize="13sp" />
+
+        <TextView
+            android:id="@+id/user_comment_detail_user_publish_time"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_below="@id/user_comment_detail_user_name"
+            android:layout_marginStart="50dp"
+            android:layout_marginTop="10dp"
+            android:layout_marginEnd="36dp"
+            android:text="昨天"
+            android:textColor="#ffcccccc"
+            android:textSize="10sp" />
+    </RelativeLayout>
+
+    <android.support.constraint.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dp"
+        android:layout_marginTop="17dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginBottom="20dp"
+        android:background="@drawable/shape_f5_solid_rectangle_5">
+
+        <android.support.v7.widget.AppCompatRatingBar
+            android:id="@+id/user_comment_detail_user_publish_score"
+            style="@style/style_rating_bar"
+            android:layout_width="wrap_content"
+            android:layout_marginStart="17dp"
+            android:layout_marginTop="20dp"
+            android:isIndicator="true"
+            android:numStars="5"
+            android:rating="0"
+            android:stepSize="0.5"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+
+        <TextView
+            android:id="@+id/intro_content"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:ellipsize="end"
+            android:lineSpacingMultiplier="1.3"
+            android:maxLines="3"
+            android:paddingStart="18dp"
+            android:paddingTop="20dp"
+            android:paddingEnd="50dp"
+            android:paddingBottom="10dp"
+            android:text="《永恒仙域》经典仙侠梦想,高清3DMMORPG手游,继承同类型游戏的经典游戏模式,更加酷炫的游戏画面与动作特效,精心构建出这个瑰丽的东方式仙侠世界。《永恒仙域》经典仙侠梦想,高清3DMMORPG手游,继承同类型游戏的经典游戏模式,更加酷炫的游戏画面与动作特效,精心构建出这个瑰丽的东方式仙侠世界。"
+            android:textColor="#ff666666"
+            android:textSize="12sp"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toBottomOf="@id/user_comment_detail_user_publish_score" />
+
+        <TextView
+            android:id="@+id/intro_show_all"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="10dp"
+            android:padding="10dp"
+            android:text="全文"
+            android:textColor="#ff4bc1ff"
+            android:textSize="12sp"
+            android:visibility="visible"
+            app:layout_constraintBottom_toBottomOf="@id/intro_content"
+            app:layout_constraintEnd_toEndOf="parent" />
+
+        <TextView
+            android:id="@+id/user_comment_detail_num1"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:drawableStart="@drawable/ic_but_speak"
+            android:drawablePadding="6dp"
+            android:paddingStart="8dp"
+            android:paddingTop="8dp"
+            android:paddingEnd="12dp"
+            android:paddingBottom="16dp"
+            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_content" />
+
+        <TextView
+            android:id="@+id/user_comment_detail_num2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:drawableStart="@drawable/ic_but_up"
+            android:drawablePadding="6dp"
+            android:paddingStart="8dp"
+            android:paddingTop="8dp"
+            android:paddingEnd="8dp"
+            android:paddingBottom="16dp"
+            android:text="54"
+            android:textColor="#ff666666"
+            android:textSize="11sp"
+            app:layout_constraintBottom_toBottomOf="@id/user_comment_detail_num1"
+            app:layout_constraintEnd_toStartOf="@id/user_comment_detail_num1" />
+
+        <TextView
+            android:id="@+id/user_comment_detail_num3"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:drawableStart="@drawable/ic_image_xiao"
+            android:drawablePadding="6dp"
+            android:paddingStart="8dp"
+            android:paddingTop="8dp"
+            android:paddingEnd="8dp"
+            android:paddingBottom="16dp"
+            android:text="54"
+            android:textColor="#ff666666"
+            android:textSize="11sp"
+            app:layout_constraintBottom_toBottomOf="@id/user_comment_detail_num1"
+            app:layout_constraintEnd_toStartOf="@id/user_comment_detail_num2" />
+    </android.support.constraint.ConstraintLayout>
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_marginBottom="20dp"
+        android:layout_marginStart="16dp"
+        android:layout_marginEnd="16dp"
+        android:background="#f2f2f2" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="共20条评论"
+        android:paddingStart="16dp"
+        android:paddingEnd="16dp"
+        android:textColor="#ff333333"
+        android:textSize="13sp"
+        android:textStyle="bold" />
+</LinearLayout>

+ 130 - 0
app/src/main/res/layout/item_user_comment_reply.xml

@@ -0,0 +1,130 @@
+<?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">
+
+    <View
+        android:id="@+id/game_app_comment_line_top"
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_marginStart="15dp"
+        android:layout_marginEnd="15dp"
+        android:background="#fff2f2f2"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <ImageView
+        android:id="@+id/game_app_comment_user_avatar"
+        android:layout_width="25dp"
+        android:layout_height="25dp"
+        android:layout_marginStart="16dp"
+        android:layout_marginTop="20dp"
+        android:src="@drawable/icon"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="@id/game_app_comment_line_top" />
+
+    <TextView
+        android:id="@+id/game_app_comment_user_name"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="50dp"
+        android:layout_marginEnd="36dp"
+        android:text="栗子的菜"
+        android:textColor="#ff333333"
+        android:textSize="13sp"
+        app:layout_constraintBottom_toBottomOf="@id/game_app_comment_user_avatar"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="@id/game_app_comment_user_avatar" />
+
+    <TextView
+        android:id="@+id/intro_content"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:ellipsize="end"
+        android:lineSpacingMultiplier="1.3"
+        android:maxLines="3"
+        android:paddingStart="50dp"
+        android:paddingTop="13dp"
+        android:paddingEnd="36dp"
+        android:paddingBottom="10dp"
+        android:text="《永恒仙域》经典仙侠梦想,高清3DMMORPG手游,继承同类型游戏的经典游戏模式,更加酷炫的游戏画面与动作特效,精心构建出这个瑰丽的东方式仙侠世界。《永恒仙域》经典仙侠梦想,高清3DMMORPG手游,继承同类型游戏的经典游戏模式,更加酷炫的游戏画面与动作特效,精心构建出这个瑰丽的东方式仙侠世界。"
+        android:textColor="#ff666666"
+        android:textSize="12sp"
+        app:layout_constraintTop_toBottomOf="@id/game_app_comment_user_avatar" />
+
+    <TextView
+        android:id="@+id/intro_show_all"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="6dp"
+        android:text="显示全部"
+        android:textColor="#ff4bc1ff"
+        android:textSize="12sp"
+        android:visibility="gone"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/intro_content" />
+
+    <TextView
+        android:id="@+id/game_app_comment_num1"
+        android:layout_width="wrap_content"
+        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:text="54"
+        android:textColor="#ff666666"
+        android:textSize="11sp"
+        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:drawableStart="@drawable/ic_but_up"
+        android:drawablePadding="6dp"
+        android:paddingStart="8dp"
+        android:paddingTop="14dp"
+        android:paddingEnd="8dp"
+        android:paddingBottom="14dp"
+        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" />
+
+    <View
+        android:id="@+id/game_app_comment_line_bottom"
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_marginStart="50dp"
+        android:layout_marginTop="6dp"
+        android:layout_marginEnd="15dp"
+        android:background="#fff2f2f2"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/game_app_comment_num1" />
+
+    <TextView
+        android:id="@+id/user_comment_reply_content"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:lineSpacingMultiplier="1.3"
+        android:paddingStart="50dp"
+        android:paddingTop="13dp"
+        android:paddingEnd="36dp"
+        android:paddingBottom="10dp"
+        android:text="哇塞被人夸真好!超开心哇塞被人夸真好!超开心哇塞被人夸真好!超开心哇塞被人夸真好!超开心~"
+        android:textColor="#ff999999"
+        android:textSize="12sp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/game_app_comment_line_bottom" />
+
+</android.support.constraint.ConstraintLayout>

+ 44 - 0
app/src/main/res/layout/net_empty_smart_refresh_rv.xml

@@ -0,0 +1,44 @@
+<?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">
+
+    <include
+        android:id="@+id/title"
+        layout="@layout/title" />
+
+    <include
+        android:id="@+id/check_net_ll"
+        layout="@layout/check_net_view"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/title" />
+
+    <include
+        android:id="@+id/empty_view"
+        layout="@layout/empty_view"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_below="@+id/check_net_ll" />
+
+    <RelativeLayout
+        android:id="@+id/bottom"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true" />
+
+    <com.scwang.smartrefresh.layout.SmartRefreshLayout
+        android:id="@+id/refresh"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_above="@id/bottom"
+        android:layout_below="@+id/check_net_ll">
+
+        <android.support.v7.widget.RecyclerView
+            android:id="@+id/view_list"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:descendantFocusability="blocksDescendants" />
+    </com.scwang.smartrefresh.layout.SmartRefreshLayout>
+</RelativeLayout>

+ 0 - 12
app/src/main/res/layout/personalcenter_act_layout.xml

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical">
-
-    <FrameLayout
-        android:id="@+id/frame_container"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"/>
-
-</LinearLayout>

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

@@ -21,7 +21,7 @@
         android:layout_centerVertical="true"
         android:layout_toEndOf="@+id/title_img_back"
         android:layout_toStartOf="@+id/title_search_commit"
-        android:background="@drawable/shape_f5_solid_rectangle"
+        android:background="@drawable/shape_f5_solid_rectangle_15"
         android:drawablePadding="4dp"
         android:drawableStart="@drawable/index_search"
         android:gravity="center|start"