Преглед изворни кода

消息中心重写完成;
邀请赚钱添加刷新功能

zengjiebin пре 7 година
родитељ
комит
38a79df2ed
29 измењених фајлова са 804 додато и 447 уклоњено
  1. 2 2
      app/src/main/AndroidManifest.xml
  2. 2 2
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  3. 53 0
      app/src/main/java/com/sheep/gamegroup/model/entity/FaqMsg.java
  4. 8 0
      app/src/main/java/com/sheep/gamegroup/model/entity/MessageReplyEntity.java
  5. 10 0
      app/src/main/java/com/sheep/gamegroup/util/DataUtil.java
  6. 61 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMsg.java
  7. 15 18
      app/src/main/java/com/sheep/gamegroup/view/activity/MessageCenterDetailActivity.java
  8. 36 21
      app/src/main/java/com/sheep/gamegroup/view/activity/MessageInteractionDetailActivity.java
  9. 0 95
      app/src/main/java/com/sheep/gamegroup/view/activity/MessageReplyDetailActivity.java
  10. 80 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpMsgFaq.java
  11. 7 27
      app/src/main/java/com/sheep/gamegroup/view/adapter/MessageInteractionAdapter.java
  12. 23 20
      app/src/main/java/com/sheep/gamegroup/view/adapter/MessageLeftAdapter.java
  13. 2 4
      app/src/main/java/com/sheep/gamegroup/view/adapter/MessageRightAdapter.java
  14. 22 1
      app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment.java
  15. 39 21
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtAskgetmoney.java
  16. 69 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMsgCenter.java
  17. 63 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMsgReply.java
  18. 5 11
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPersonalCenter.java
  19. 0 11
      app/src/main/java/com/sheep/gamegroup/view/fragment/MessageCenterFragment.java
  20. 51 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java
  21. 18 56
      app/src/main/res/layout/act_invitation.xml
  22. 12 0
      app/src/main/res/layout/act_msg.xml
  23. 3 2
      app/src/main/res/layout/activity_message_interaction.xml
  24. 1 1
      app/src/main/res/layout/adapter_message_interaction.xml
  25. 1 1
      app/src/main/res/layout/ask_to_share_item.xml
  26. 55 0
      app/src/main/res/layout/include_title_tab.xml
  27. 12 7
      app/src/main/res/layout/item_image2.xml
  28. 1 0
      app/src/main/res/layout/title.xml
  29. 153 147
      app/src/main/res/layout/x_ask_getmoney_act_layout.xml

+ 2 - 2
app/src/main/AndroidManifest.xml

@@ -582,6 +582,8 @@
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.MessagesActivity"
             android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActMsg"
+            android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActGameCenter"
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActDownloadWelfareList"
@@ -590,8 +592,6 @@
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActMyWelfare"
             android:screenOrientation="portrait"/>
-        <activity android:name="com.sheep.gamegroup.view.activity.MessageReplyDetailActivity"
-            android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.MessageInteractionDetailActivity"
             android:exported="true"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActModifyThird"

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

@@ -62,14 +62,14 @@ public interface ApiService {
      * @return 回复互动详情
      */
     @GET("app/message/system_message/{id}")
-    Observable<BaseMessage> getMessageReplyItem(@Path("id") String id);
+    Observable<BaseMessage> getMessageReplyItem(@Path("id") int id);
 
     /**
      * @param id 系统消息id
      * @return 消息中心详情
      */
     @GET("app/message/system_notification/{id}")
-    Observable<BaseMessage> getMessageCenterItem(@Path("id") String id);
+    Observable<BaseMessage> getMessageCenterItem(@Path("id") int id);
 
     /**
      * @return 获取未读消息条数 返回 0 或者 未读数量 大于零则有未读

+ 53 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/FaqMsg.java

@@ -0,0 +1,53 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by realicing on 2018/9/10.
+ * realicing@sina.com
+ */
+public class FaqMsg {
+    private boolean isUser;
+    private String content;
+    private String name;
+    private String avatar;
+    private long time;
+
+    public boolean isUser() {
+        return isUser;
+    }
+
+    public void setUser(boolean user) {
+        isUser = user;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public long getTime() {
+        return time;
+    }
+
+    public void setTime(long time) {
+        this.time = time;
+    }
+}

+ 8 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/MessageReplyEntity.java

@@ -1,5 +1,7 @@
 package com.sheep.gamegroup.model.entity;
 
+import android.text.TextUtils;
+
 import java.io.Serializable;
 
 /**
@@ -123,4 +125,10 @@ public class MessageReplyEntity implements Serializable{
     public void setUser_id(int user_id) {
         this.user_id = user_id;
     }
+
+
+
+    public String getTitleText(){
+        return TextUtils.isEmpty(title) ? "官方回复" : title;
+    }
 }

+ 10 - 0
app/src/main/java/com/sheep/gamegroup/util/DataUtil.java

@@ -108,6 +108,16 @@ public class DataUtil {
             return userEntity.getId();
         return "";
     }
+    /**
+     * 获取当前用户的头像
+     *
+     * @return
+     */
+    public String getUserAvatar() {
+        if (userEntity != null && userEntity.getAvatar() != null)
+            return userEntity.getAvatar();
+        return "";
+    }
 
     /**
      * 获取当前用户的邀请人的邀请码

+ 61 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActMsg.java

@@ -0,0 +1,61 @@
+package com.sheep.gamegroup.view.activity;
+
+
+import android.support.v4.app.Fragment;
+import android.support.v4.view.ViewPager;
+import android.view.View;
+
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.view.adapter.ViewPagerFragmentAdapter;
+import com.sheep.gamegroup.view.fragment.FgtMsgCenter;
+import com.sheep.gamegroup.view.fragment.FgtMsgReply;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import butterknife.BindView;
+
+/**
+ * Created by realicing on 2018/04/.
+ * realicing@sina.com
+ * 描述:消息Activity,展示消息中心和互动消息两个模块
+ */
+public class ActMsg extends BaseActivity {
+    @BindView(R.id.act_msg_vp)
+    ViewPager act_msg_vp;
+    @BindView(R.id.title_tab_oval_0)
+    View title_tab_oval_0;
+    @BindView(R.id.title_tab_oval_1)
+    View title_tab_oval_1;
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_msg;
+    }
+
+    private List<Fragment> fragmentList = new ArrayList<>();
+    private List<View> ovalList = new ArrayList<>();
+    @Override
+    public void initView() {
+        TitleBarUtils.getInstance()
+                .setTitleFinish(this)
+                .addMsgTab(this, act_msg_vp);
+        fragmentList.add(new FgtMsgCenter());
+        fragmentList.add(new FgtMsgReply());
+        ViewPagerFragmentAdapter mViewPagerFragmentAdapter = new ViewPagerFragmentAdapter(getSupportFragmentManager(), fragmentList);
+        act_msg_vp.setAdapter(mViewPagerFragmentAdapter);
+        act_msg_vp.setCurrentItem(0, false);
+        act_msg_vp.setOffscreenPageLimit(mViewPagerFragmentAdapter.getCount());
+        ovalList.add(title_tab_oval_0);
+        ovalList.add(title_tab_oval_1);
+        for (View view : ovalList) {
+            view.setVisibility(View.INVISIBLE);
+        }
+    }
+    //设置小红点的显示与隐藏
+    public void updateMsgOval(int index, boolean hasMsgNotRead){
+        ovalList.get(index).setVisibility(hasMsgNotRead ? View.VISIBLE : View.INVISIBLE);
+    }
+}
+

+ 15 - 18
app/src/main/java/com/sheep/gamegroup/view/activity/MessageCenterDetailActivity.java

@@ -12,8 +12,10 @@ import com.sheep.gamegroup.model.entity.MessageCenterDetailEntity;
 import com.sheep.gamegroup.model.entity.MessageCenterEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.LogUtil;
+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 butterknife.BindView;
 import butterknife.ButterKnife;
@@ -26,7 +28,7 @@ import rx.schedulers.Schedulers;
  * created by: YSL
  * 描述:
  */
-public class MessageCenterDetailActivity extends AppCompatActivity{
+public class MessageCenterDetailActivity extends AppCompatActivity {
     @BindView(R.id.tv_content)
     TextView tvContent;
     @BindView(R.id.tv_title)
@@ -34,16 +36,14 @@ public class MessageCenterDetailActivity extends AppCompatActivity{
     @BindView(R.id.txt_baseactivity_title)
     TextView tvBaseTitle;
 
-    private int position;
-
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_messagesystem);
         ButterKnife.bind(this);
         tvBaseTitle.setText("消息中心");
-        position=getIntent().getIntExtra("position",-1);
-        loadData(position+"");
+        int id = getIntent().getIntExtra("id", -1);
+        loadData(id);
     }
 
     @OnClick({R.id.img_baseactivity_title})
@@ -56,10 +56,13 @@ public class MessageCenterDetailActivity extends AppCompatActivity{
 
     }
 
-    private void loadData(String id){
-        if (id.equals(-1+"")){
+    private void loadData(int id) {
+        if (id <= 0) {
+            G.showToast("消息id出错");
             return;
         }
+        ViewUtil.setDefaultText(tvContent);
+        ViewUtil.setDefaultText(tvTitle);
         SheepApp.getInstance()
                 .getNetComponent()
                 .getApiService()
@@ -69,21 +72,15 @@ public class MessageCenterDetailActivity extends AppCompatActivity{
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.logI("消息中心详细内容----"+new Gson().toJson(baseMessage));
-                        MessageCenterDetailEntity entity =baseMessage.getData(MessageCenterDetailEntity.class);
-                        tvContent.setText(entity.getContent());
-                        tvTitle.setText(entity.getTitle());
-
+                        MessageCenterDetailEntity entity = baseMessage.getData(MessageCenterDetailEntity.class);
+                        ViewUtil.setText(tvContent, entity.getContent());
+                        ViewUtil.setText(tvTitle, entity.getTitle());
                     }
+
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.logI("消息中心详细内容出错----"+new Gson().toJson(baseMessage));
+                        G.showToast(baseMessage);
                     }
                 });
     }
-    @Override
-    protected void onDestroy() {
-        super.onDestroy();
-
-    }
 }

+ 36 - 21
app/src/main/java/com/sheep/gamegroup/view/activity/MessageInteractionDetailActivity.java

@@ -7,21 +7,20 @@ import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.OrientationHelper;
 import android.support.v7.widget.RecyclerView;
 import android.view.View;
-import android.widget.ImageView;
 import android.widget.TextView;
 
-import com.google.gson.Gson;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.FaqMsg;
 import com.sheep.gamegroup.model.entity.MessageReplyDetailEntity;
-import com.sheep.gamegroup.model.entity.MessageReplyEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
-import com.sheep.gamegroup.util.LogUtil;
-import com.sheep.gamegroup.view.adapter.MessageInteractionAdapter;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.adapter.AdpMsgFaq;
+import com.sheep.gamegroup.view.adapter.AdpMsgUserFeedBack;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.utils.G;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import butterknife.BindView;
@@ -33,7 +32,7 @@ import rx.schedulers.Schedulers;
 /**
  * created on:2018/8/28 on 17:15
  * created by: YSL
- * 描述:互动消息详情Activity
+ * 描述:互动消息详情Activity------用户反馈或者faq
  */
 public class MessageInteractionDetailActivity extends AppCompatActivity {
     @BindView(R.id.txt_baseactivity_title)
@@ -42,19 +41,18 @@ public class MessageInteractionDetailActivity extends AppCompatActivity {
     RecyclerView recyclerView;
     @BindView(R.id.tv_title)
     TextView title;
-    private MessageInteractionAdapter adapter;
+    private RecyclerView.Adapter adapter;
     private MessageReplyDetailEntity entity;
-    private String id="";
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_message_interaction);
         ButterKnife.bind(this);
-        tvTitle.setText("消息互动");
+        tvTitle.setText("回复详情");
 
-        id=getIntent().getIntExtra("position",-1)+"";
-        loadData(id + "");
+        int id = getIntent().getIntExtra("id", -1);
+        loadData(id);
     }
 
     @OnClick({R.id.img_baseactivity_title})
@@ -65,10 +63,12 @@ public class MessageInteractionDetailActivity extends AppCompatActivity {
                 break;
         }
     }
-    private void loadData(String id) {
-        if (id.equals(-1 + "")) {
+
+    private void loadData(int id) {
+        if (id <= 0) {
             return;
         }
+        ViewUtil.setDefaultText(title);
         SheepApp.getInstance()
                 .getNetComponent()
                 .getApiService()
@@ -78,21 +78,36 @@ public class MessageInteractionDetailActivity extends AppCompatActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.logI("loadData-onNext----"+new Gson().toJson(baseMessage));
-                        entity=baseMessage.getData(MessageReplyDetailEntity.class);
-                        title.setText(entity.getTitle());
-                        LogUtil.logI("loadData-onNext---entity---"+new Gson().toJson(entity));
-                        adapter = new MessageInteractionAdapter(MessageInteractionDetailActivity.this, entity);
+                        entity = baseMessage.getData(MessageReplyDetailEntity.class);
+                        ViewUtil.setText(title, entity.getTitle());
                         LinearLayoutManager manager = new LinearLayoutManager(MessageInteractionDetailActivity.this);
                         manager.setOrientation(OrientationHelper.VERTICAL);
                         recyclerView.setLayoutManager(manager);
+                        if (entity.getFaq_feedback_id() > 0) {//faq
+                            List<FaqMsg> faqMsgList = ListUtil.emptyList();
+                            FaqMsg userFaqMsg = new FaqMsg();
+                            userFaqMsg.setAvatar(DataUtil.getInstance().getUserAvatar());
+                            userFaqMsg.setUser(true);
+                            userFaqMsg.setContent(entity.getUser_contet());
+                            userFaqMsg.setName("我");
+                            userFaqMsg.setTime(entity.getUser_create_time());
+                            faqMsgList.add(userFaqMsg);
+                            FaqMsg faqMsg = new FaqMsg();
+                            faqMsg.setUser(false);
+                            faqMsg.setContent(entity.getContent());
+                            faqMsg.setName("官方回复");
+                            faqMsg.setTime(entity.getCreated_at());
+                            faqMsgList.add(userFaqMsg);
+                            adapter = new AdpMsgFaq(MessageInteractionDetailActivity.this, faqMsgList);
+                        } else if (entity.getUser_feedback_id() > 0) {//用户反馈
+                            adapter = new AdpMsgUserFeedBack(MessageInteractionDetailActivity.this, entity);
+                        }
                         recyclerView.setAdapter(adapter);
 
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.logI("loadData-onError----"+new Gson().toJson(baseMessage));
                     }
                 });
     }

+ 0 - 95
app/src/main/java/com/sheep/gamegroup/view/activity/MessageReplyDetailActivity.java

@@ -1,95 +0,0 @@
-package com.sheep.gamegroup.view.activity;
-
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v7.app.AppCompatActivity;
-import android.view.View;
-import android.widget.TextView;
-
-import com.google.gson.Gson;
-import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.MessageCenterEntity;
-import com.sheep.gamegroup.model.entity.MessageReplyEntity;
-import com.sheep.gamegroup.model.entity.MessageUnReadEntity;
-import com.sheep.gamegroup.model.entity.MessageUserFeedbackEntity;
-import com.sheep.gamegroup.model.util.SheepSubscriber;
-import com.sheep.gamegroup.util.LogUtil;
-import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import butterknife.BindView;
-import butterknife.ButterKnife;
-import butterknife.OnClick;
-import rx.android.schedulers.AndroidSchedulers;
-import rx.schedulers.Schedulers;
-
-/**
- * created on:2018/8/28 on 17:55
- * created by: YSL
- * 描述:消息回复详情Activity
- */
-public class MessageReplyDetailActivity extends AppCompatActivity {
-    @BindView(R.id.tv_content)
-    TextView tvContent;
-    @BindView(R.id.tv_title)
-    TextView tvTitle;
-    @BindView(R.id.txt_baseactivity_title)
-    TextView tvBaseTitle;
-
-    private MessageUserFeedbackEntity userFeedbackEntity;
-    private MessageReplyEntity entity = null;
-    private String id = "";
-
-    @Override
-    protected void onCreate(@Nullable Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_messagesystem);
-        ButterKnife.bind(this);
-        id = getIntent().getIntExtra("position", -1) + "";
-        loadData(id + "");
-    }
-
-    @OnClick({R.id.img_baseactivity_title})
-    public void initClick(View view) {
-        switch (view.getId()) {
-            case R.id.img_baseactivity_title:
-                MessageReplyDetailActivity.this.finish();
-                break;
-        }
-
-    }
-
-    private void loadData(String id) {
-        if (id.equals(-1 + "")) {
-            return;
-        }
-        SheepApp.getInstance()
-                .getNetComponent()
-                .getApiService()
-                .getMessageReplyItem(id)
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        LogUtil.logI("loadData-onNext----" + new Gson().toJson(baseMessage));
-                        userFeedbackEntity = baseMessage.getData(MessageUserFeedbackEntity.class);
-                        tvTitle.setText(userFeedbackEntity.getTitle());
-                    }
-
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        LogUtil.logI("loadData-onError----" + new Gson().toJson(baseMessage));
-                    }
-                });
-    }
-
-    @Override
-    protected void onDestroy() {
-        super.onDestroy();
-
-    }
-}

+ 80 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpMsgFaq.java

@@ -0,0 +1,80 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.content.Context;
+import android.support.annotation.NonNull;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.model.entity.FaqMsg;
+import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.TimeUtil;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.List;
+
+/**
+ * created on:2018/8/28 on 17:26
+ * created by: YSL
+ * 描述:消息互动中item点击展开后FAQ的形式
+ */
+public class AdpMsgFaq extends RecyclerView.Adapter<AdpMsgFaq.MyHolder> {
+    private Context mContext;
+    private List<FaqMsg> list;
+
+    public AdpMsgFaq(Context mContext, List<FaqMsg> list) {
+        this.mContext = mContext;
+        this.list = list;
+    }
+
+    @NonNull
+    @Override
+    public MyHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+        View view;
+        view = LayoutInflater.from(mContext).inflate(R.layout.adapter_message_interaction, null);
+        return new MyHolder(view);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull MyHolder viewHolder, int i) {
+        FaqMsg item = ListUtil.getItem(list, i);
+        if(item != null) {
+            if(item.getAvatar() != null)
+                GlideImageLoader.setAvatar(viewHolder.ivIcon, item.getAvatar());
+            viewHolder.tvPeople.setText(item.getName());
+            viewHolder.tvTime.setText(TimeUtil.TimeStamp2Date(item.getTime(), "MM-dd HH:mm"));
+            viewHolder.tvContent.setText(item.getContent());
+        } else {
+            ViewUtil.setDefaultText(viewHolder.tvPeople);
+            ViewUtil.setDefaultText(viewHolder.tvTime);
+            ViewUtil.setDefaultText(viewHolder.tvContent);
+        }
+
+
+    }
+
+    @Override
+    public int getItemCount() {
+        return ListUtil.size(list);
+    }
+
+    class MyHolder extends RecyclerView.ViewHolder {
+        private ImageView ivIcon;//头像
+        private TextView tvPeople;//标题
+        private TextView tvTime;//谁的消息
+        private TextView tvContent;//每条消息的内容,这里最多只显示一行
+
+        public MyHolder(View view) {
+            super(view);
+            ivIcon = view.findViewById(R.id.iv_icon);
+            tvPeople = view.findViewById(R.id.tv_people);
+            tvTime = view.findViewById(R.id.tv_time);
+            tvContent = view.findViewById(R.id.tv_content);
+        }
+    }
+}

+ 7 - 27
app/src/main/java/com/sheep/gamegroup/view/adapter/MessageInteractionAdapter.java

@@ -1,40 +1,29 @@
 package com.sheep.gamegroup.view.adapter;
 
 import android.content.Context;
-import android.graphics.Color;
 import android.support.annotation.NonNull;
 import android.support.v7.widget.RecyclerView;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageView;
-import android.widget.LinearLayout;
 import android.widget.TextView;
 
-import com.google.gson.Gson;
 import com.sheep.gamegroup.model.entity.MessageReplyDetailEntity;
-import com.sheep.gamegroup.model.entity.MessageReplyEntity;
-import com.sheep.gamegroup.model.entity.UserEntity;
-import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.GlideImageLoader;
-import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.TimeUtil;
 import com.sheep.jiuyan.samllsheep.R;
 
-import java.util.List;
-
 /**
  * created on:2018/8/28 on 17:26
  * created by: YSL
- * 描述:消息互动中item点击展开后FAQ的形式
+ * 描述:消息互动中 点击一条用户反馈后进入的消息列表
  */
-public class MessageInteractionAdapter extends RecyclerView.Adapter<MessageInteractionAdapter.MyHolder> {
+public class AdpMsgUserFeedBack extends RecyclerView.Adapter<AdpMsgUserFeedBack.MyHolder> {
     private Context mContext;
     private MessageReplyDetailEntity entity;
-    private UserEntity userEntity = DataUtil.getInstance().getUserEntity();
 
-    public MessageInteractionAdapter(Context mContext, MessageReplyDetailEntity entity) {
+    public AdpMsgUserFeedBack(Context mContext, MessageReplyDetailEntity entity) {
         this.mContext = mContext;
         this.entity = entity;
     }
@@ -42,44 +31,35 @@ public class MessageInteractionAdapter extends RecyclerView.Adapter<MessageInter
     @NonNull
     @Override
     public MyHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
-        View view = null;
+        View view;
         view = LayoutInflater.from(mContext).inflate(R.layout.adapter_message_interaction, null);
         return new MyHolder(view);
     }
 
     @Override
     public void onBindViewHolder(@NonNull MyHolder viewHolder, int i) {
-
-        GlideImageLoader.setAvatar(viewHolder.ivIcon, userEntity.getAvatar(), Color.argb(128, 255, 255, 255));
-        viewHolder.tvPeople.setText(entity.getType() == 1 ? "官方回复" : "我");
-        viewHolder.tvTime.setText("" + TimeUtil.TimeStamp2Date(entity.getUser_create_time(), "yyyy-MM-dd HH:mm"));
-        viewHolder.tvContent.setText(entity.getUser_contet());
+        viewHolder.tvPeople.setText("官方回复");
+        viewHolder.tvTime.setText(TimeUtil.TimeStamp2Date(entity.getUser_create_time(), "MM-dd HH:mm"));
+        viewHolder.tvContent.setText(entity.getContent());
 
 
     }
 
     @Override
     public int getItemCount() {
-        LogUtil.logI("size------"+(entity == null ? 0 : 1));
         return entity == null ? 0 : 1;
     }
 
     class MyHolder extends RecyclerView.ViewHolder {
-        private ImageView ivIcon;//头像
         private TextView tvPeople;//标题
         private TextView tvTime;//谁的消息
         private TextView tvContent;//每条消息的内容,这里最多只显示一行
-        private View viewLine;//item之间的线条
-        private LinearLayout itemLayout;//整个item布局
 
         public MyHolder(View view) {
             super(view);
-            ivIcon = view.findViewById(R.id.iv_icon);
             tvPeople = view.findViewById(R.id.tv_people);
             tvTime = view.findViewById(R.id.tv_time);
             tvContent = view.findViewById(R.id.tv_content);
-            viewLine = view.findViewById(R.id.view_line);
-            itemLayout = view.findViewById(R.id.item_layout);
         }
     }
 }

+ 23 - 20
app/src/main/java/com/sheep/gamegroup/view/adapter/MessageLeftAdapter.java

@@ -11,12 +11,11 @@ import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import com.sheep.gamegroup.model.entity.MessageCenterEntity;
-import com.sheep.gamegroup.util.GlideImageLoader;
-import com.sheep.gamegroup.util.LogUtil;
+import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.TimeUtil;
+import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
 
-
 import java.util.List;
 
 
@@ -29,7 +28,6 @@ public class MessageLeftAdapter extends RecyclerView.Adapter<MessageLeftAdapter.
     private Context mContext;
     private List<MessageCenterEntity> mList;
     private ItemOnClickListener itemClick;
-    private int position;
 
     public MessageLeftAdapter(Context mContext, List<MessageCenterEntity> mList, ItemOnClickListener itemClick) {
         this.mContext = mContext;
@@ -41,7 +39,7 @@ public class MessageLeftAdapter extends RecyclerView.Adapter<MessageLeftAdapter.
     @NonNull
     @Override
     public Myholder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
-        View view = null;
+        View view;
         if (mList == null || mList.isEmpty()) {
             view = LayoutInflater.from(mContext).inflate(R.layout.empty_view, null);
         } else {
@@ -55,22 +53,27 @@ public class MessageLeftAdapter extends RecyclerView.Adapter<MessageLeftAdapter.
         if (i == mList.size() - 1) {
             viewHolder.viewLine.setVisibility(View.GONE);//最后一条数据隐藏线条
         }
-        //  GlideImageLoader.centerImage(viewHolder.ivIcon, "");
-        viewHolder.tvTitle.setText(mList.get(i).getTitle() + "");
-        viewHolder.tvTime.setText(TimeUtil.TimeStamp2Date(mList.get(i).getCreated_at(), "yyyy-MM-dd HH:mm"));
-        viewHolder.tvContent.setText(mList.get(i).getContent() + "");
-        if (mList.get(i).getIs_look()==1){
-            viewHolder.ivIcon.setImageResource(R.mipmap.icon_unread);//已读
-        }else {
-            viewHolder.ivIcon.setImageResource(R.mipmap.message_unread);//未读
-        }
-        position = i;
-        viewHolder.itemLayout.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
-                itemClick.itemClick(mList.get(i).getId());
+        final MessageCenterEntity item = ListUtil.getItem(mList, i);
+        if(item == null){
+            ViewUtil.setDefaultText(viewHolder.tvTitle);
+            ViewUtil.setDefaultText(viewHolder.tvTime);
+            ViewUtil.setDefaultText(viewHolder.tvContent);
+        } else {
+            ViewUtil.setText(viewHolder.tvTitle, item.getTitle());
+            viewHolder.tvTime.setText(TimeUtil.TimeStamp2Date(item.getCreated_at(), "yyyy-MM-dd HH:mm"));
+            ViewUtil.setText(viewHolder.tvContent, item.getContent());
+            if (item.getIs_look() == 1) {
+                viewHolder.ivIcon.setImageResource(R.mipmap.icon_unread);//已读
+            } else {
+                viewHolder.ivIcon.setImageResource(R.mipmap.message_unread);//未读
             }
-        });
+            viewHolder.itemLayout.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    itemClick.itemClick(item.getId());
+                }
+            });
+        }
     }
 
     @Override

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

@@ -26,7 +26,6 @@ public class MessageRightAdapter extends RecyclerView.Adapter<MessageRightAdapte
     private Context mContext;
     private List<MessageReplyEntity> mList;
     private ItemOnClickListener itemClick;
-    private int position;
 
     public MessageRightAdapter(Context mContext, List<MessageReplyEntity> mList, MessageRightAdapter.ItemOnClickListener itemClick) {
         this.mContext = mContext;
@@ -37,7 +36,7 @@ public class MessageRightAdapter extends RecyclerView.Adapter<MessageRightAdapte
     @NonNull
     @Override
     public MyHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
-        View view = null;
+        View view;
         if (mList == null || mList.isEmpty()) {
             view = LayoutInflater.from(mContext).inflate(R.layout.empty_view, null);
         } else {
@@ -53,7 +52,7 @@ public class MessageRightAdapter extends RecyclerView.Adapter<MessageRightAdapte
         }
         //GlideImageLoader.centerImage(viewHolder.ivIcon, "");
         viewHolder.ivIcon.setImageResource(R.mipmap.message_unread);
-        viewHolder.tvTitle.setText(mList.get(i).getTitle()+"");
+        viewHolder.tvTitle.setText(mList.get(i).getTitleText());
         viewHolder.tvTime.setText(TimeUtil.TimeStamp2Date(mList.get(i).getCreated_at(), "yyyy-MM-dd HH:mm"));
         viewHolder.tvContent.setText(mList.get(i).getContent());
         if (mList.get(i).getIs_look()==1){
@@ -61,7 +60,6 @@ public class MessageRightAdapter extends RecyclerView.Adapter<MessageRightAdapte
         }else {
             viewHolder.ivIcon.setImageResource(R.mipmap.message_unread);//未读
         }
-        position = i;
         viewHolder.itemLayout.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {

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

@@ -50,7 +50,8 @@ public abstract class BaseListFragment<T> extends BaseFragment {
         activity = getActivity();
         initView();
         initListener();
-        view_list.refresh();
+        if(!refreshDataAfterOnResume())
+            view_list.refresh();
 
     }
     @BindView(R.id.title)
@@ -62,6 +63,7 @@ public abstract class BaseListFragment<T> extends BaseFragment {
     @BindView(R.id.view_list)
     protected XRecyclerView view_list;
 
+    protected BaseMessage lastMessage;//最后一个网络获取的结果
     protected int page = 1;//页数
     protected int per_page = DataUtil.PER_PAGE;
 
@@ -133,6 +135,7 @@ public abstract class BaseListFragment<T> extends BaseFragment {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
+                        lastMessage = baseMessage;
                         boolean isNewData = DataUtil.getInstance().isNewData(urlKey);
                         if(isNewData || !isFirstGetACache()) {
                             List<T> newList = baseMessage.getDatas(getTClass());
@@ -152,7 +155,25 @@ public abstract class BaseListFragment<T> extends BaseFragment {
         return null;
     }
 
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        if(refreshDataAfterOnResume()){
+            view_list.refresh();
+        }
+    }
+
+    /**
+     * 每次都在onResume方法中进行更新数据
+     * @return
+     */
+    public boolean refreshDataAfterOnResume() {
+        return false;
+    }
+
     public void refreshData(){
+        lastMessage = null;
         setNoMore(false);
         empty_view.setVisibility(View.INVISIBLE);
         list.clear();

+ 39 - 21
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtAskgetmoney.java

@@ -6,6 +6,7 @@ import android.content.Intent;
 import android.os.Bundle;
 import android.support.design.widget.TabLayout;
 import android.support.v4.widget.NestedScrollView;
+import android.support.v4.widget.SwipeRefreshLayout;
 import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
@@ -53,6 +54,8 @@ import static com.sheep.gamegroup.util.UMConfigUtils.Event.QR_COPY;
  */
 
 public class FgtAskgetmoney extends BaseFragment {
+    @BindView(R.id.refresh)
+    SwipeRefreshLayout refresh;
     @BindView(R.id.tv_size)
     TextView tvSize;
     @BindView(R.id.tv_money)
@@ -80,11 +83,12 @@ public class FgtAskgetmoney extends BaseFragment {
 
     private FriendAndAwardEntity mEntity;
     Unbinder unbinder;
+
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
         // TODO: inflate a fragment view
         View rootView = super.onCreateView(inflater, container, savedInstanceState);
-        if(rootView != null)
+        if (rootView != null)
             unbinder = ButterKnife.bind(this, rootView);
         return rootView;
     }
@@ -94,6 +98,7 @@ public class FgtAskgetmoney extends BaseFragment {
         super.onDestroyView();
         unbinder.unbind();
     }
+
     private Activity activity;
 
     @Override
@@ -104,11 +109,11 @@ public class FgtAskgetmoney extends BaseFragment {
     @Override
     public void onViewCreated() {
         activity = getActivity();
-        if(activity instanceof ActMain){
+        if (activity instanceof ActMain) {
             TitleBarUtils.getInstance()
                     .setTitle(mView, "邀请赚钱")
-                    .setTitleListen(mView,0,null);
-        }else {
+                    .setTitleListen(mView, 0, null);
+        } else {
             TitleBarUtils.getInstance()
                     .setTitle(mView, "邀请赚钱")
                     .setTitleFinish(mView, activity);
@@ -150,10 +155,7 @@ public class FgtAskgetmoney extends BaseFragment {
         ask_top_3.setLayoutParams(layoutParams3);
         ViewUtil.setDefaultText(tvSize);
         ViewUtil.setDefaultText(tvMoney);
-
-        showViewPager();
-
-        initData();
+        initData(true);
 
         initListener();
 
@@ -182,28 +184,43 @@ public class FgtAskgetmoney extends BaseFragment {
                 return false;
             }
         });
+
+        refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+            @Override
+            public void onRefresh() {
+                refreshData();
+                refresh.setRefreshing(false);
+            }
+        });
+    }
+
+    public void refreshData() {
+        initData(false);
     }
 
     private UserEntity userEntity;
 
-    public void initData() {
-        ViewUtil.newInstance().showProgress(activity);
+    public void initData(final boolean isShow) {
+        if (isShow)
+            showProgress();
         SheepApp.getInstance().getNetComponent().getApiService().FriendCountAndAward()
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        ViewUtil.newInstance().hideProgress(activity);
-                        if(BuildConfig.DEBUG)
+                        if (isShow)
+                            hideProgress();
+                        if (BuildConfig.DEBUG)
                             G.showToast(baseMessage);
                     }
 
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        if(baseMessage!=null){
-                            mEntity = FastJsonUtils.toBean( JSONObject.toJSONString(baseMessage.getData()),FriendAndAwardEntity.class);
-                            ViewUtil.newInstance().hideProgress(activity);
+                        if (baseMessage != null) {
+                            mEntity = FastJsonUtils.toBean(JSONObject.toJSONString(baseMessage.getData()), FriendAndAwardEntity.class);
+                            if (isShow)
+                                hideProgress();
                             activity.runOnUiThread(new Runnable() {
                                 @Override
                                 public void run() {
@@ -211,12 +228,14 @@ public class FgtAskgetmoney extends BaseFragment {
                                     tvMoney.setText(mEntity.getAward());
                                 }
                             });
-                        }else{
-                            ViewUtil.newInstance().hideProgress(activity);
+                        } else {
+                            if (isShow)
+                                hideProgress();
                         }
 
                     }
                 });
+        showViewPager();
         CommonUtil.getInstance().updateUserInfo(new Action1<UserEntity>() {
             @Override
             public void call(UserEntity result) {
@@ -230,7 +249,6 @@ public class FgtAskgetmoney extends BaseFragment {
     }
 
 
-
     @Override
     public void onStop() {
         super.onStop();
@@ -267,16 +285,16 @@ public class FgtAskgetmoney extends BaseFragment {
     public void onViewClicked(View view) {
         switch (view.getId()) {
             case R.id.copy_my_invitation_tv:
-                if(TextUtils.isEmpty(my_invitation_tv.getText().toString()))
+                if (TextUtils.isEmpty(my_invitation_tv.getText().toString()))
                     return;
                 QR_COPY.onEvent();
-                StringUtils.CopyText(userEntity.getInvitation_code()+"");
+                StringUtils.CopyText(userEntity.getInvitation_code() + "");
                 G.showToast("复制邀请码成功");
                 break;
             case R.id.ask_invite_rl:
                 break;
             case R.id.ask_invite_tv:
-               // showShareView();
+                // showShareView();
                 startActivity(new Intent(getActivity(), ActInvitation.class));
                 break;
         }

+ 69 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMsgCenter.java

@@ -0,0 +1,69 @@
+package com.sheep.gamegroup.view.fragment;
+
+
+import android.content.Intent;
+import android.support.v7.widget.RecyclerView;
+
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.MessageCenterEntity;
+import com.sheep.gamegroup.view.activity.ActMsg;
+import com.sheep.gamegroup.view.activity.MessageCenterDetailActivity;
+import com.sheep.gamegroup.view.adapter.MessageLeftAdapter;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+
+import java.util.Locale;
+
+import rx.Observable;
+
+/**
+ * Created by realicing on 2018/9/7.
+ * realicing@sina.com
+ */
+public class FgtMsgCenter extends BaseListFragment<MessageCenterEntity> implements MessageLeftAdapter.ItemOnClickListener {
+
+    @Override
+    protected boolean isFirstGetACache() {
+        return false;
+    }
+
+    @Override
+    public boolean refreshDataAfterOnResume() {
+        return true;
+    }
+
+    @Override
+    protected RecyclerView.Adapter getAdapter() {
+        return new MessageLeftAdapter(SheepApp.getInstance(), list, this);
+    }
+
+    @Override
+    protected String getKey(int page, int per_page) {
+        return String.format(Locale.CHINA, "app/message/system_notification?page=%d&per_page=%d", page, per_page);
+    }
+
+    @Override
+    protected Observable<BaseMessage> getApi(ApiService apiService) {
+        return apiService.getMessageCenter(page, per_page);
+    }
+
+    @Override
+    protected Class<MessageCenterEntity> getTClass() {
+        return MessageCenterEntity.class;
+    }
+
+
+    @Override
+    public void notifyData() {
+        if(activity instanceof ActMsg) {
+            ((ActMsg) activity).updateMsgOval(0, lastMessage != null && lastMessage.getTotal() > 0);
+        }
+    }
+
+    @Override
+    public void itemClick(int id) {
+        Intent intent = new Intent(getActivity(), MessageCenterDetailActivity.class);
+        intent.putExtra("id", id);
+        startActivity(intent);
+    }
+}

+ 63 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMsgReply.java

@@ -0,0 +1,63 @@
+package com.sheep.gamegroup.view.fragment;
+
+
+import android.content.Intent;
+import android.support.v7.widget.RecyclerView;
+
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.MessageReplyEntity;
+import com.sheep.gamegroup.view.activity.ActMsg;
+import com.sheep.gamegroup.view.activity.MessageInteractionDetailActivity;
+import com.sheep.gamegroup.view.adapter.MessageLeftAdapter;
+import com.sheep.gamegroup.view.adapter.MessageRightAdapter;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+
+import java.util.Locale;
+
+import rx.Observable;
+
+/**
+ * Created by realicing on 2018/9/7.
+ * realicing@sina.com
+ */
+public class FgtMsgReply extends BaseListFragment<MessageReplyEntity> implements MessageRightAdapter.ItemOnClickListener {
+    @Override
+    protected boolean isFirstGetACache() {
+        return false;
+    }
+
+    @Override
+    protected RecyclerView.Adapter getAdapter() {
+        return new MessageRightAdapter(SheepApp.getInstance(), list, this);
+    }
+
+    @Override
+    protected String getKey(int page, int per_page) {
+        return String.format(Locale.CHINA, "app/message/system_message?page=%d&per_page=%d", page, per_page);
+    }
+
+    @Override
+    protected Observable<BaseMessage> getApi(ApiService apiService) {
+        return apiService.getMessageReply(page, per_page);
+    }
+
+    @Override
+    protected Class<MessageReplyEntity> getTClass() {
+        return MessageReplyEntity.class;
+    }
+
+    @Override
+    public void notifyData() {
+        if(activity instanceof ActMsg) {
+            ((ActMsg) activity).updateMsgOval(1, lastMessage != null && lastMessage.getTotal() > 0);
+        }
+    }
+
+    @Override
+    public void itemClick(int position) {
+        Intent intent = new Intent(activity, MessageInteractionDetailActivity.class);
+        intent.putExtra("id", position);
+        startActivity(new Intent(intent));
+    }
+}

+ 5 - 11
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPersonalCenter.java

@@ -32,7 +32,7 @@ import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.ViewUtil;
-import com.sheep.gamegroup.view.activity.MessagesActivity;
+import com.sheep.gamegroup.view.activity.ActMsg;
 import com.sheep.gamegroup.view.activity.PersonalCenterAct;
 import com.sheep.gamegroup.view.dialog.DialogShare;
 import com.sheep.jiuyan.samllsheep.R;
@@ -95,7 +95,6 @@ public class FgtPersonalCenter extends BaseFragment {
     public UserEntity userEntity;
     private String faqUrl;
     private String agentUrl;
-    private int mCounts = 0;//未读消息数量
     private Activity activity;
 
     @Override
@@ -188,7 +187,6 @@ public class FgtPersonalCenter extends BaseFragment {
 
     /**
      * 获取是否有未读消息并更新图标
-     *
      */
     private void getUnReadMessageCounts() {
         SheepApp.getInstance()
@@ -200,26 +198,22 @@ public class FgtPersonalCenter extends BaseFragment {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        MessageUnReadEntity entity=baseMessage.getData(MessageUnReadEntity.class);
-                        mCounts= entity.getNum();
-                        if (mCounts > 0) {
+                        MessageUnReadEntity entity = baseMessage.getData(MessageUnReadEntity.class);
+                        if (entity != null && entity.getNum() > 0) {
                             ivMessageIcon.setImageResource(R.mipmap.message_unread_icon);
-                        }else {
+                        } else {
                             ivMessageIcon.setImageResource(R.mipmap.message_read_icon);
                         }
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-
-                        LogUtil.logI("返回格式错误---" + new Gson().toJson(baseMessage));
                     }
                 });
 
     }
 
 
-
     /**
      * 兑换红包
      *
@@ -373,7 +367,7 @@ public class FgtPersonalCenter extends BaseFragment {
     public void onViewClicked(View view) {
         switch (view.getId()) {
             case R.id.ibtn_baseactivity_message://消息
-                startActivity(new Intent(activity, MessagesActivity.class));
+                startActivity(new Intent(activity, ActMsg.class));
                 break;
             case R.id.iv_redpackage://邀请成功后有可领红包
                 ViewUtil.changeRedPackage(getActivity(), getView(), FgtPersonalCenter.this);

+ 0 - 11
app/src/main/java/com/sheep/gamegroup/view/fragment/MessageCenterFragment.java

@@ -10,26 +10,16 @@ import android.support.constraint.ConstraintLayout;
 import android.support.v4.app.Fragment;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.OrientationHelper;
-import android.support.v7.widget.RecyclerView;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
 
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
 import com.jcodecraeer.xrecyclerview.XRecyclerView;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.MessageCenterEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.ListUtil;
-import com.sheep.gamegroup.util.LogUtil;
-import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.activity.MessageCenterDetailActivity;
-import com.sheep.gamegroup.view.activity.MessageInteractionDetailActivity;
-import com.sheep.gamegroup.view.activity.MessageReplyDetailActivity;
 import com.sheep.gamegroup.view.adapter.MessageLeftAdapter;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
@@ -40,7 +30,6 @@ import org.greenrobot.eventbus.EventBus;
 import java.util.ArrayList;
 import java.util.List;
 
-import rx.Scheduler;
 import rx.android.schedulers.AndroidSchedulers;
 import rx.schedulers.Schedulers;
 

+ 51 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java

@@ -1,6 +1,8 @@
 package com.sheep.jiuyan.samllsheep.utils;
 
 import android.app.Activity;
+import android.graphics.Color;
+import android.graphics.Typeface;
 import android.graphics.drawable.ColorDrawable;
 import android.support.annotation.DrawableRes;
 import android.support.design.widget.TabLayout;
@@ -397,4 +399,53 @@ public class TitleBarUtils {
 //        CommonUtil.getInstance().reflex(tabLayout, activity);
         return this;
     }
+
+    public TitleBarUtils addMsgTab(final BaseActivity activity, final ViewPager viewPager) {
+        //设置标题不可见
+        TextView titleView = activity.findViewById(R.id.txt_baseactivity_title);
+        titleView.setVisibility(View.GONE);
+        //设置tab可见
+        View msg_title_tab = activity.findViewById(R.id.msg_title_tab);
+        msg_title_tab.setVisibility(View.VISIBLE);
+        final TextView[] textViews = new TextView[2];
+        textViews[0] = activity.findViewById(R.id.title_tab_tv_0);
+        textViews[1] = activity.findViewById(R.id.title_tab_tv_1);
+        textViews[0].setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                viewPager.setCurrentItem(0);
+            }
+        });
+        textViews[1].setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                viewPager.setCurrentItem(1);
+            }
+        });
+        viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+            private int lastPosition = 0;
+            @Override
+            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+
+            }
+
+            @Override
+            public void onPageSelected(int position) {
+                TextView lastTextView = textViews[lastPosition];
+                TextView curTextView = textViews[position];
+                curTextView.setTextColor(Color.parseColor("#333333"));
+                lastTextView.setTextColor(Color.parseColor("#666666"));
+                curTextView.setTypeface(Typeface.DEFAULT_BOLD);
+                lastTextView.setTypeface(Typeface.DEFAULT);
+
+                lastPosition = position;
+            }
+
+            @Override
+            public void onPageScrollStateChanged(int state) {
+
+            }
+        });
+        return this;
+    }
 }

+ 18 - 56
app/src/main/res/layout/act_invitation.xml

@@ -6,26 +6,17 @@
     android:layout_marginTop="30dp"
     android:background="#F0F0F0">
 
-    <ImageView
-        android:id="@+id/img_baseactivity_title"
-        android:layout_width="?attr/actionBarSize"
-        android:layout_height="?attr/actionBarSize"
-        android:gravity="center_vertical"
-        android:scaleType="centerInside"
-        android:src="@drawable/narrow_back_black"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-
     <RelativeLayout
         android:id="@+id/act_invitation_rl"
         android:layout_width="0dp"
         android:layout_height="0dp"
+        android:layout_marginTop="40dp"
         android:background="#F0F0F0"
         android:clipChildren="false"
         app:layout_constraintBottom_toTopOf="@+id/layout_f"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/img_baseactivity_title">
+        app:layout_constraintTop_toTopOf="parent">
 
         <TextView
             android:id="@+id/tv_flags"
@@ -33,22 +24,32 @@
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
             android:layout_centerHorizontal="true"
-            android:layout_marginBottom="@dimen/content_padding_16"
-            android:layout_marginTop="@dimen/content_padding_12"
+            android:layout_marginBottom="8dp"
+            android:layout_marginTop="8dp"
             android:text="左右滑动选择分享图" />
 
         <com.sheep.gamegroup.view.customview.ClipViewPager
             android:id="@+id/act_invitation_cvp"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:layout_marginStart="50dp"
-            android:layout_marginEnd="50dp"
             android:layout_above="@+id/tv_flags"
             android:layout_centerHorizontal="true"
+            android:layout_marginEnd="50dp"
+            android:layout_marginStart="50dp"
             android:clipChildren="false"
             android:overScrollMode="never" />
     </RelativeLayout>
 
+    <ImageView
+        android:id="@+id/img_baseactivity_title"
+        android:layout_width="?attr/actionBarSize"
+        android:layout_height="?attr/actionBarSize"
+        android:gravity="center_vertical"
+        android:scaleType="centerInside"
+        android:src="@drawable/narrow_back_black"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
     <RelativeLayout
         android:id="@+id/layout_f"
         android:layout_width="match_parent"
@@ -66,52 +67,13 @@
             android:textColor="#ff333333"
             android:textSize="14sp" />
 
-        <TextView
-            android:id="@+id/tv_copy"
-            android:layout_width="40dp"
-            android:layout_height="20dp"
-            android:layout_alignParentEnd="true"
-            android:layout_marginEnd="15dp"
-            android:layout_marginTop="20dp"
-            android:background="@drawable/shape_blue_stroke_withe_radius_5"
-            android:gravity="center"
-            android:text="复制"
-            android:textColor="@color/white"
-            android:visibility="invisible" />
-
-        <TextView
-            android:id="@+id/tv_invitation_code"
-            android:layout_width="wrap_content"
-            android:layout_height="30dp"
-            android:layout_marginRight="5dp"
-            android:layout_marginTop="15dp"
-            android:layout_toLeftOf="@id/tv_copy"
-            android:gravity="center"
-            android:text="12332"
-            android:textColor="#ff333333"
-            android:visibility="invisible" />
-
-        <TextView
-            android:id="@+id/tv_f_invatation"
-            android:layout_width="wrap_content"
-            android:layout_height="30dp"
-            android:layout_marginRight="5dp"
-            android:layout_marginTop="15dp"
-            android:layout_toLeftOf="@id/tv_invitation_code"
-            android:gravity="center"
-            android:text="你的邀请码:"
-            android:textColor="#ff333333"
-            android:visibility="invisible" />
-
-
         <android.support.v7.widget.RecyclerView
             android:id="@+id/ask_share_list"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_below="@+id/ask_share_title"
-            android:layout_marginBottom="15dp"
-            android:layout_marginStart="@dimen/content_padding_15"
-            android:layout_marginTop="20dp" />
+            android:layout_marginBottom="8dp"
+            android:layout_marginStart="@dimen/content_padding_15" />
     </RelativeLayout>
 
 

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

@@ -0,0 +1,12 @@
+<?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">
+
+    <include layout="@layout/title"/>
+    <android.support.v4.view.ViewPager
+        android:id="@+id/act_msg_vp"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"/>
+</LinearLayout>

+ 3 - 2
app/src/main/res/layout/activity_message_interaction.xml

@@ -10,9 +10,10 @@
         android:id="@+id/tv_title"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginLeft="17dp"
+        android:layout_marginStart="17dp"
         android:layout_marginTop="17dp"
-        android:text=""
+        android:text="关于小绵羊的优化建议?"
+        android:textStyle="bold"
         android:textColor="#ff333333"
         android:textSize="18sp" />
 

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

@@ -17,7 +17,7 @@
             android:layout_marginBottom="15dp"
             android:layout_marginStart="17dp"
             android:layout_marginTop="15dp"
-            android:src="@mipmap/add_black_img" />
+            android:src="@mipmap/icon" />
 
         <RelativeLayout
             android:layout_width="match_parent"

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

@@ -15,7 +15,7 @@
         android:id="@+id/ask_to_share_item_name"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginTop="20dp"
+        android:layout_marginTop="8dp"
         android:text="面对面"
         android:textColor="#ff333333"
         android:textSize="12sp" />

+ 55 - 0
app/src/main/res/layout/include_title_tab.xml

@@ -0,0 +1,55 @@
+<?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:id="@+id/msg_title_tab"
+    android:layout_width="match_parent"
+    android:layout_height="?attr/actionBarSize"
+    android:visibility="gone"
+    android:gravity="center"
+    android:orientation="horizontal">
+
+    <android.support.constraint.ConstraintLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content">
+
+        <TextView
+            android:id="@+id/title_tab_tv_0"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="消息中心"
+            android:textColor="#333333"
+            android:textSize="15sp"
+            android:textStyle="bold" />
+
+        <View
+            android:id="@+id/title_tab_oval_0"
+            android:layout_width="8dp"
+            android:layout_height="8dp"
+            android:background="@drawable/shape_oval_red"
+            app:layout_constraintEnd_toEndOf="parent" />
+    </android.support.constraint.ConstraintLayout>
+
+    <View
+        android:layout_width="16dp"
+        android:layout_height="match_parent" />
+
+    <android.support.constraint.ConstraintLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content">
+
+        <TextView
+            android:id="@+id/title_tab_tv_1"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="回复互动"
+            android:textColor="#666666"
+            android:textSize="15sp" />
+
+        <View
+            android:id="@+id/title_tab_oval_1"
+            android:layout_width="8dp"
+            android:layout_height="8dp"
+            android:background="@drawable/shape_oval_red"
+            app:layout_constraintEnd_toEndOf="parent" />
+    </android.support.constraint.ConstraintLayout>
+</LinearLayout>

+ 12 - 7
app/src/main/res/layout/item_image2.xml

@@ -14,21 +14,24 @@
 
     <LinearLayout
         android:layout_width="70dp"
-        android:layout_height="76dp"
+        android:layout_height="80dp"
         android:layout_alignParentBottom="true"
         android:layout_centerHorizontal="true"
         android:background="@drawable/shape_white_solid_rectangle_2"
         android:orientation="vertical">
 
         <RelativeLayout
-            android:layout_width="70dp"
-            android:layout_height="66dp"
+            android:layout_width="wrap_content"
+            android:layout_height="0dp"
+            android:layout_weight="8"
+            android:paddingEnd="4dp"
+            android:paddingStart="4dp"
             android:paddingTop="4dp">
 
             <ImageView
                 android:id="@+id/image_bottom"
-                android:layout_width="62dp"
-                android:layout_height="62dp"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
                 android:layout_centerInParent="true"
                 android:src="@drawable/loading_01" />
 
@@ -42,8 +45,10 @@
         <TextView
             android:id="@+id/image_bottom_tv"
             android:layout_width="match_parent"
-            android:layout_height="10dp"
-            android:gravity="center"
+            android:layout_height="0dp"
+            android:layout_weight="1"
+            android:layout_marginTop="-3dp"
+            android:gravity="top|center_horizontal"
             android:text="扫我开始赚钱"
             android:textColor="#ff999999"
             android:textSize="8sp" />

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

@@ -23,6 +23,7 @@
         android:minWidth="100dp"
         android:visibility="gone"
         />
+    <include layout="@layout/include_title_tab"/>
     <TextView
         android:id="@+id/txt_baseactivity_title"
         android:layout_width="wrap_content"

+ 153 - 147
app/src/main/res/layout/x_ask_getmoney_act_layout.xml

@@ -7,190 +7,196 @@
     android:layout_height="match_parent"
     tools:context="com.sheep.gamegroup.view.activity.AskGetMoneyAct">
 
-    <android.support.v4.widget.NestedScrollView
-        android:id="@+id/ask_scroll_view"
+    <com.sheep.gamegroup.util.SheepSwipeRefreshLayout
+        android:id="@+id/refresh"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_marginBottom="60dp"
-        android:orientation="vertical"
-        android:fillViewport="true"
-        android:layout_gravity="fill_vertical"
-        android:scrollbars="none"
-        app:layout_behavior="@string/appbar_scrolling_view_behavior">
-
-        <RelativeLayout
+        android:layout_height="wrap_content">
+
+        <android.support.v4.widget.NestedScrollView
+            android:id="@+id/ask_scroll_view"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:background="#FFD269">
-
-            <ImageView
-                android:id="@+id/ask_bg"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content" />
-
-            <!--底部有白条,用这一层覆盖-->
-            <View
-                android:id="@+id/ask_top_3"
-                android:layout_width="match_parent"
-                android:layout_height="100dp"
-                android:layout_marginTop="300dp"
-                android:background="#FFD269"/>
-            <!--内容   注:layout_marginBottom 为底部添加一点空间-->
-            <LinearLayout
+            android:layout_gravity="fill_vertical"
+            android:layout_marginBottom="60dp"
+            android:fillViewport="true"
+            android:orientation="vertical"
+            android:scrollbars="none"
+            app:layout_behavior="@string/appbar_scrolling_view_behavior">
+
+            <RelativeLayout
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
-                android:layout_marginBottom="@dimen/content_padding_10"
-                android:baselineAligned="false"
-                android:descendantFocusability="beforeDescendants"
-                android:focusable="true"
-                android:focusableInTouchMode="true"
-                android:orientation="vertical">
+                android:background="#FFD269">
 
+                <ImageView
+                    android:id="@+id/ask_bg"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content" />
 
+                <!--底部有白条,用这一层覆盖-->
                 <View
-                    android:id="@+id/ask_top_1"
+                    android:id="@+id/ask_top_3"
                     android:layout_width="match_parent"
-                    android:layout_height="320dp" />
-
+                    android:layout_height="100dp"
+                    android:layout_marginTop="300dp"
+                    android:background="#FFD269" />
+                <!--内容   注:layout_marginBottom 为底部添加一点空间-->
                 <LinearLayout
-                    android:id="@+id/ask_top_2"
                     android:layout_width="match_parent"
-                    android:layout_height="60dp"
-                    android:orientation="horizontal"
-                    android:layout_marginBottom="@dimen/content_padding_20">
-
-                    <RelativeLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1">
+                    android:layout_height="match_parent"
+                    android:layout_marginBottom="@dimen/content_padding_10"
+                    android:baselineAligned="false"
+                    android:descendantFocusability="beforeDescendants"
+                    android:focusable="true"
+                    android:focusableInTouchMode="true"
+                    android:orientation="vertical">
 
-                        <TextView
 
-                            android:id="@+id/tv_size"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_centerHorizontal="true"
-                            android:text="@string/app_name"
-                            android:textColor="#ffffff"
-                            android:textSize="24sp"
-                            android:textStyle="bold" />
+                    <View
+                        android:id="@+id/ask_top_1"
+                        android:layout_width="match_parent"
+                        android:layout_height="320dp" />
 
-                        <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_below="@id/tv_size"
-                            android:layout_centerHorizontal="true"
-                            android:text="@string/friend"
-                            android:textColor="#ffffff"
-                            android:textSize="13sp" />
+                    <LinearLayout
+                        android:id="@+id/ask_top_2"
+                        android:layout_width="match_parent"
+                        android:layout_height="60dp"
+                        android:layout_marginBottom="@dimen/content_padding_20"
+                        android:orientation="horizontal">
 
-                    </RelativeLayout>
+                        <RelativeLayout
+                            android:layout_width="0dp"
+                            android:layout_height="match_parent"
+                            android:layout_weight="1">
 
-                    <RelativeLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:orientation="vertical">
+                            <TextView
 
-                        <LinearLayout
-                            android:id="@+id/tv_money_ll"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_centerHorizontal="true"
-                            android:orientation="horizontal">
+                                android:id="@+id/tv_size"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:layout_centerHorizontal="true"
+                                android:text="@string/app_name"
+                                android:textColor="#ffffff"
+                                android:textSize="24sp"
+                                android:textStyle="bold" />
 
                             <TextView
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
-                                android:text="¥"
-                                android:textColor="#FCFF00"
-                                android:textSize="12sp" />
+                                android:layout_below="@id/tv_size"
+                                android:layout_centerHorizontal="true"
+                                android:text="@string/friend"
+                                android:textColor="#ffffff"
+                                android:textSize="13sp" />
+
+                        </RelativeLayout>
+
+                        <RelativeLayout
+                            android:layout_width="0dp"
+                            android:layout_height="match_parent"
+                            android:layout_weight="1"
+                            android:orientation="vertical">
+
+                            <LinearLayout
+                                android:id="@+id/tv_money_ll"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:layout_centerHorizontal="true"
+                                android:orientation="horizontal">
+
+                                <TextView
+                                    android:layout_width="wrap_content"
+                                    android:layout_height="wrap_content"
+                                    android:text="¥"
+                                    android:textColor="#FCFF00"
+                                    android:textSize="12sp" />
+
+                                <TextView
+                                    android:id="@+id/tv_money"
+                                    android:layout_width="wrap_content"
+                                    android:layout_height="wrap_content"
+                                    android:textColor="#FCFF00"
+                                    android:textSize="24sp"
+                                    android:textStyle="bold" />
+                            </LinearLayout>
 
                             <TextView
-                                android:id="@+id/tv_money"
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
-                                android:textColor="#FCFF00"
-                                android:textSize="24sp"
-                                android:textStyle="bold" />
-                        </LinearLayout>
-
-                        <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_below="@id/tv_money_ll"
-                            android:layout_centerHorizontal="true"
-                            android:text="@string/reward"
-                            android:textColor="#ffffff"
-                            android:textSize="13sp" />
+                                android:layout_below="@id/tv_money_ll"
+                                android:layout_centerHorizontal="true"
+                                android:text="@string/reward"
+                                android:textColor="#ffffff"
+                                android:textSize="13sp" />
 
-                    </RelativeLayout>
+                        </RelativeLayout>
 
 
-                </LinearLayout>
+                    </LinearLayout>
 
-                <android.support.design.widget.TabLayout
-                    android:id="@+id/indicator"
-                    style="@style/style_tab_askgetmoney"/>
+                    <android.support.design.widget.TabLayout
+                        android:id="@+id/indicator"
+                        style="@style/style_tab_askgetmoney" />
 
-                <View
-                    android:layout_width="match_parent"
-                    android:layout_height="1dp"
-                    android:background="@color/yellow_FFAD3C"/>
-
-                <com.kfzs.duanduan.view.ViewPagerAutoHeigh
-                    android:id="@+id/pager"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:minHeight="@dimen/ask_friend_list_h"
-                    app:layout_behavior="@string/appbar_scrolling_view_behavior"
-                    android:layout_marginEnd="@dimen/content_padding_10"
-                    android:layout_marginStart="@dimen/content_padding_10"
-                    android:layout_marginTop="@dimen/content_padding_10"/>
-
-                <!--发放情况-->
-                <LinearLayout
-                    android:id="@+id/homepage_item_notice_layout"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_marginEnd="@dimen/content_padding_10"
-                    android:layout_marginStart="@dimen/content_padding_10"
-                    android:layout_marginTop="@dimen/content_padding_10"
-                    android:background="@drawable/x_shap_shadow_bg_rectgangle_purple"
-                    android:orientation="horizontal"
-                    android:padding="@dimen/content_padding_10"
-                    android:visibility="gone">
-
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:text="发放情况:"
-                        android:textColor="#ffffff"
-                        android:textSize="12sp" />
+                    <View
+                        android:layout_width="match_parent"
+                        android:layout_height="1dp"
+                        android:background="@color/yellow_FFAD3C" />
 
-                    <com.sunfusheng.marqueeview.MarqueeView
-                        android:id="@+id/ask_award_info"
+                    <com.kfzs.duanduan.view.ViewPagerAutoHeigh
+                        android:id="@+id/pager"
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:layout_marginEnd="@dimen/content_padding_10"
+                        android:layout_marginStart="@dimen/content_padding_10"
+                        android:layout_marginTop="@dimen/content_padding_10"
+                        android:minHeight="@dimen/ask_friend_list_h"
+                        app:layout_behavior="@string/appbar_scrolling_view_behavior" />
+
+                    <!--发放情况-->
+                    <LinearLayout
+                        android:id="@+id/homepage_item_notice_layout"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
-                        android:textColor="#ffffff"
-                        android:textSize="12sp"
-                        app:mvAnimDuration="1000"
-                        app:mvDirection="right_to_left"
-                        app:mvInterval="3000"
-                        app:mvSingleLine="true" />
-                </LinearLayout>
+                        android:layout_marginEnd="@dimen/content_padding_10"
+                        android:layout_marginStart="@dimen/content_padding_10"
+                        android:layout_marginTop="@dimen/content_padding_10"
+                        android:background="@drawable/x_shap_shadow_bg_rectgangle_purple"
+                        android:orientation="horizontal"
+                        android:padding="@dimen/content_padding_10"
+                        android:visibility="gone">
 
-                <!--邀请小技巧-->
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="发放情况:"
+                            android:textColor="#ffffff"
+                            android:textSize="12sp" />
 
-                <include
-                    layout="@layout/ask_getmoney_act_item_three_notice_layout"/>
-            </LinearLayout>
-        </RelativeLayout>
-    </android.support.v4.widget.NestedScrollView>
+                        <com.sunfusheng.marqueeview.MarqueeView
+                            android:id="@+id/ask_award_info"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:textColor="#ffffff"
+                            android:textSize="12sp"
+                            app:mvAnimDuration="1000"
+                            app:mvDirection="right_to_left"
+                            app:mvInterval="3000"
+                            app:mvSingleLine="true" />
+                    </LinearLayout>
+
+                    <!--邀请小技巧-->
+
+                    <include layout="@layout/ask_getmoney_act_item_three_notice_layout" />
+                </LinearLayout>
+            </RelativeLayout>
+        </android.support.v4.widget.NestedScrollView>
+    </com.sheep.gamegroup.util.SheepSwipeRefreshLayout>
 
+    <include
+        layout="@layout/title"
+        android:visibility="gone" />
 
-    <include layout="@layout/title"
-        android:visibility="gone"/>
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"