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

打卡,战绩接口调试基本完成;
修复通过内部加载重定向网页后无法单击返回到上一个界面

zengjiebin лет назад: 7
Родитель
Сommit
d0286f5c69
21 измененных файлов с 640 добавлено и 211 удалено
  1. 10 0
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  2. 29 0
      app/src/main/java/com/sheep/gamegroup/model/entity/PunchAndSign.java
  3. 64 0
      app/src/main/java/com/sheep/gamegroup/model/entity/PunchStarList.java
  4. 57 0
      app/src/main/java/com/sheep/gamegroup/model/entity/PunchUser.java
  5. 10 0
      app/src/main/java/com/sheep/gamegroup/util/ConnectAddress.java
  6. 1 2
      app/src/main/java/com/sheep/gamegroup/util/GlideImageLoader.java
  7. 2 0
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  8. 1 0
      app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java
  9. 3 22
      app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java
  10. 281 34
      app/src/main/java/com/sheep/gamegroup/view/activity/ActSignCard.java
  11. 67 50
      app/src/main/java/com/sheep/gamegroup/view/activity/ActSignCardRecord.java
  12. 3 1
      app/src/main/java/com/sheep/gamegroup/view/activity/ActWeb.java
  13. 60 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSignCardRecord.java
  14. BIN
      app/src/main/res/drawable-xxhdpi/daka_btn_gray.webp
  15. 1 1
      app/src/main/res/drawable/selector_button_daka.xml
  16. 6 2
      app/src/main/res/layout/act_sign_card.xml
  17. 14 5
      app/src/main/res/layout/act_sign_card_record.xml
  18. 19 18
      app/src/main/res/layout/adapter_message_left_fragment.xml
  19. 10 76
      app/src/main/res/layout/ask_to_share.xml
  20. 1 0
      app/src/main/res/layout/fgt_sign_rankings.xml
  21. 1 0
      app/src/main/res/layout/sign_rankings_item.xml

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

@@ -501,6 +501,11 @@ public interface ApiService {
     Observable<BaseMessage> getPunchLog(@Path("action") int action);
 
     /**
+     * 获取所有打卡记录
+     */
+    @GET("app/punch/all_punch_log")
+    Observable<BaseMessage> getAllPunchLog(@Query("page") int page, @Query("per_page") int per_page);
+    /**
      * 获取连续打卡记录
      */
     @GET("app/punch/continue_punch_top")
@@ -554,6 +559,11 @@ public interface ApiService {
      */
     @GET("app/punch/punch_and_sign_count")
     Observable<BaseMessage> getPunchAndSignCount();
+    /**
+     * 获取今日之星数据
+     */
+    @GET("app/punch/star")
+    Observable<BaseMessage> getPunchStar();
 
     /**
      * 获取广告类型 1:开屏广告 2:弹窗广告

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

@@ -1,5 +1,9 @@
 package com.sheep.gamegroup.model.entity;
 
+import com.kfzs.duanduan.utils.NumberFormatUtils;
+
+import java.util.List;
+
 /**
  * Created by Administrator on 2018/5/24.
  * 今日参与打卡和报名人数
@@ -7,9 +11,11 @@ package com.sheep.gamegroup.model.entity;
 
 public class PunchAndSign {
     //        {"sign_up_count":3,"punch_count":1,total_award:1}
+    private long countdown;
     private String sign_up_count;
     private String punch_count;
     private String total_award;
+    private List<PunchUser> avatar ;
 
     public String getSign_up_count() {
         return sign_up_count;
@@ -34,4 +40,27 @@ public class PunchAndSign {
     public void setTotal_award(String total_award) {
         this.total_award = total_award;
     }
+
+    public List<PunchUser> getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(List<PunchUser> avatar) {
+        this.avatar = avatar;
+    }
+
+    public long getCountdown() {
+        return countdown;
+    }
+
+    public void setCountdown(long countdown) {
+        this.countdown = countdown;
+    }
+
+
+
+
+    public String getNoPunch_count() {
+        return Integer.toString(NumberFormatUtils.parseInteger(total_award) - NumberFormatUtils.parseInteger(punch_count));
+    }
 }

+ 64 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/PunchStarList.java

@@ -0,0 +1,64 @@
+package com.sheep.gamegroup.model.entity;
+
+import android.text.TextUtils;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.kfzs.duanduan.utils.NumberFormatUtils;
+import com.sheep.gamegroup.util.ListUtil;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Created by realicing on 2018/9/17.
+ * realicing@sina.com
+ */
+public class PunchStarList {
+    @JSONField(name = "continue")
+    private PunchUser go_continue;
+    private PunchUser early;
+    private PunchUser total;
+
+    public PunchUser getGo_continue() {
+        return go_continue;
+    }
+
+    public void setGo_continue(PunchUser go_continue) {
+        this.go_continue = go_continue;
+    }
+
+    public PunchUser getEarly() {
+        return early;
+    }
+
+    public void setEarly(PunchUser early) {
+        this.early = early;
+    }
+
+    public PunchUser getTotal() {
+        return total;
+    }
+
+    public void setTotal(PunchUser total) {
+        this.total = total;
+    }
+
+
+
+
+    public List<PunchUser> getList() {
+        if(early != null && !TextUtils.isEmpty(early.getDesc())){
+            Date date = new Date();
+            date.setTime(1000*NumberFormatUtils.parseLong(early.getDesc()));
+            early.setDescText(String.format(Locale.CHINA, "%tR打卡", date));
+        }
+        if(total != null && !TextUtils.isEmpty(total.getDesc())){
+            total.setDescText(String.format(Locale.CHINA, "累计%s次打卡", total.getDesc()));
+        }
+        if(go_continue != null && !TextUtils.isEmpty(go_continue.getDesc())){
+            go_continue.setDescText(String.format(Locale.CHINA, "连续%s次打卡", go_continue.getDesc()));
+        }
+        return ListUtil.asList(early, total, go_continue);
+    }
+}

+ 57 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/PunchUser.java

@@ -0,0 +1,57 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by realicing on 2018/9/17.
+ * realicing@sina.com
+ */
+public class PunchUser {
+    private String avatar;
+
+    private String nickname;
+
+    private String invitation_code;
+
+    private String desc;
+
+    public void setAvatar(String avatar){
+        this.avatar = avatar;
+    }
+    public String getAvatar(){
+        return this.avatar;
+    }
+    public void setInvitation_code(String invitation_code){
+        this.invitation_code = invitation_code;
+    }
+    public String getInvitation_code(){
+        return this.invitation_code;
+    }
+    public void setDesc(String desc){
+        this.desc = desc;
+    }
+    public String getDesc(){
+        return this.desc;
+    }
+
+    public String getNickname() {
+        return nickname;
+    }
+
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
+
+
+
+
+
+
+    private String descText;
+    public String getDescText() {
+        return descText;
+    }
+
+    public void setDescText(String descText) {
+        this.descText = descText;
+    }
+}

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

@@ -31,6 +31,16 @@ public enum ConnectAddress {
         public String getName() {
             return "谢兴";
         }
+    },sheepmeien {
+
+        @Override
+        public String getAppUrl() {
+            return "http://10.8.210.229:8080/";
+        }
+        @Override
+        public String getName() {
+            return "梅恩";
+        }
     },sheepzhangwei {
 
         @Override

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

@@ -195,12 +195,11 @@ public class GlideImageLoader {
         if(TextUtils.isEmpty(avatar)){
             Glide.with(SheepApp.getInstance())
                     .load(R.drawable.avatar)
-                    .apply(new RequestOptions().circleCrop())
                     .into(iconImgIv);
         } else {
             Glide.with(SheepApp.getInstance())
                     .load(avatar)
-                    .apply(new RequestOptions().placeholder(R.drawable.avatar))
+                    .apply(new RequestOptions().circleCrop().placeholder(R.drawable.avatar))
                     .into(iconImgIv);
         }
     }

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

@@ -136,6 +136,7 @@ import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECHARGE;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECHARGE_QQ;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.SEARCH_GAME;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.SETTING;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.SYSTEM_NOTIFICATION_DETAIL;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_ABOUT_US;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_FEEDBACK;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_FIND_APP_ORDER;
@@ -1585,6 +1586,7 @@ public class Jump2View {
      * 普通的消息详情
      */
     public void goActSysNfDetail(Activity activity, Object object) {
+        SYSTEM_NOTIFICATION_DETAIL.onEvent();
         Intent intent = new Intent(activity, ActSysNfDetail.class);
         if(object instanceof Integer)
             intent.putExtra("id", (Integer) object);

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

@@ -171,6 +171,7 @@ public class UMConfigUtils {
         SHARE_TO_WEIXIN_CIRCLE("分享到微信朋友圈"),
         SEARCH_APP("玩转游戏 -> 搜索游戏"),
         GIFT_DETAIL("礼包详情页面"),
+        SYSTEM_NOTIFICATION_DETAIL("消息详情页面"),
         ;
         private String tag;
 

+ 3 - 22
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -1390,24 +1390,11 @@ public class ViewUtil {
         new DialogAddAccount(activity).showAddAccount(action1);
     }
 
-    public static void showShareDialog(final Activity activity, final String url, final String description) {
+    public static void showShareDialog(final Activity activity, final String url, final String description){
         View dialog_parent = View.inflate(activity, R.layout.ask_to_share, null);
         final AlertDialog dialog = new AlertDialog.Builder(activity, R.style.AppTheme_Dialog_Alert)
-                .setView(dialog_parent).setCancelable(true)
+                .setView(dialog_parent)
                 .create();
-        Window windows = dialog.getWindow();
-        if(windows != null) {
-            windows.setGravity(Gravity.BOTTOM); //Dialog在屏幕底部弹出来
-            WindowManager.LayoutParams layoutParams = windows.getAttributes();//获得布局属性
-            layoutParams.width = 400; //设置Dialog的宽
-            layoutParams.height = 200; //设置Dialog的高
-            windows.setWindowAnimations(R.style.Rising);//设置动画效果
-        }
-        View viewEmpty = dialog_parent.findViewById(R.id.empty_view);
-        //SpeedRecyclerView speedRecyclerView = dialog_parent.findViewById(R.id.recyclerView);
-        // ImageView card = dialog_parent.findViewById(R.id.blurView);
-        // List<Integer> mList = new ArrayList<>();
-        // init(speedRecyclerView, card, mList, activity);
 //        TextView ask_share_title = dialog_parent.findViewById(R.id.ask_share_title);
         RecyclerView ask_share_list = dialog_parent.findViewById(R.id.ask_share_list);
         GridLayoutManager gridLayoutManager = new GridLayoutManager(activity, 5);
@@ -1432,12 +1419,6 @@ public class ViewUtil {
         nameList.add("QQ好友");
         nameList.add("朋友圈");
         nameList.add("复制链接");
-        viewEmpty.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
-                dialog.cancel();
-            }
-        });
         AdbCommonRecycler<String> adapter = new AdbCommonRecycler<String>(activity, list) {
 
             @Override
@@ -1468,7 +1449,7 @@ public class ViewUtil {
         try {
             dialog.show();
             Window window = dialog.getWindow();
-            if (window != null) {
+            if(window != null) {
                 window.setGravity(Gravity.BOTTOM);
                 WindowManager.LayoutParams params = window.getAttributes();
                 params.width = G.WIDTH > G.HEIGHT ? G.HEIGHT : G.WIDTH;

+ 281 - 34
app/src/main/java/com/sheep/gamegroup/view/activity/ActSignCard.java

@@ -1,6 +1,9 @@
 package com.sheep.gamegroup.view.activity;
 
 import android.graphics.Paint;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
 import android.support.v7.widget.GridLayoutManager;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
@@ -9,26 +12,38 @@ import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
 
-import com.kfzs.duanduan.data.graph.provider.player.User;
+import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.DialogConfig;
+import com.sheep.gamegroup.model.entity.PunchAndSign;
+import com.sheep.gamegroup.model.entity.PunchStarList;
+import com.sheep.gamegroup.model.entity.PunchUser;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.SysAppUtil;
+import com.sheep.gamegroup.util.TimeUtil;
+import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.util.ViewHolder;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 import java.util.List;
+import java.util.Locale;
 
 import butterknife.BindView;
 import butterknife.OnClick;
 import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
 /**
@@ -42,6 +57,14 @@ public class ActSignCard extends BaseActivity {
     TextView sign_card_total_bonus;
     @BindView(R.id.sign_card_total_people)
     TextView sign_card_total_people;
+    @BindView(R.id.sign_card_success_people)
+    TextView sign_card_success_people;
+    @BindView(R.id.sign_card_fail_people)
+    TextView sign_card_fail_people;
+    @BindView(R.id.sign_card_award)
+    TextView sign_card_award;
+    @BindView(R.id.sign_card_join)
+    TextView sign_card_join;
     @BindView(R.id.sign_card_users)
     RecyclerView sign_card_users;
     @BindView(R.id.sign_card_super_users)
@@ -75,7 +98,7 @@ public class ActSignCard extends BaseActivity {
                 });
         //加下划线
         sign_card_tip.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
-        if(DataUtil.getAsBoolean("isNotShowDialogSignCard", true)) {//没有记录显示过该对话框,就显示之
+        if (DataUtil.getAsBoolean("isNotShowDialogSignCard", true)) {//没有记录显示过该对话框,就显示之
             DataUtil.putAsBoolean("isNotShowDialogSignCard", false);
             ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("活动说明").setBtnLeftText("我知道了")
                     .setMsgGravity(Gravity.START).setMsg("支付1元参与次日早起打卡挑战\n\n" +
@@ -83,93 +106,190 @@ public class ActSignCard extends BaseActivity {
                             "次日未打卡或超过规定打卡时间则不可参与奖金瓜分\n\n" +
                             "早起打卡时间:7:00-9:00"));
         }
+        ViewUtil.setDefaultText(sign_card_total_bonus);
+        ViewUtil.setDefaultText(sign_card_total_people);
+        ViewUtil.setDefaultText(sign_card_success_people);
+        ViewUtil.setDefaultText(sign_card_fail_people);
+        ViewUtil.setDefaultText(sign_card_award);
+        ViewUtil.setDefaultText(sign_card_join);
     }
 
     @Override
     public void initListener() {
-        sign_card_users.setLayoutManager(new LinearLayoutManager(sign_card_users.getContext(), LinearLayoutManager.HORIZONTAL, false));
+        sign_card_users.setLayoutManager(new GridLayoutManager(SheepApp.getInstance(), 8));
         sign_card_users.setNestedScrollingEnabled(false);
-        sign_card_users.setAdapter(new AdbCommonRecycler<User>(SheepApp.getInstance(), userList) {
+        sign_card_users.setAdapter(new AdbCommonRecycler<PunchUser>(SheepApp.getInstance(), userList) {
             @Override
             public int getViewIdByType(int type) {
                 return R.layout.item_user;
             }
 
             @Override
-            public void convert(ViewHolder holder, User user) {
+            public void convert(ViewHolder holder, PunchUser user) {
                 ImageView item_user_iv = holder.getView(R.id.item_user_iv);
                 TextView item_user_tv = holder.getView(R.id.item_user_tv);
-                ViewUtil.setDefaultText(item_user_tv);
-                //TODO
+                if (user == null) {
+                    ViewUtil.setDefaultText(item_user_tv);
+                    GlideImageLoader.setAvatar(item_user_iv, null);
+                } else {
+                    ViewUtil.setText(item_user_tv, user.getNickname());
+                    GlideImageLoader.setAvatar(item_user_iv, user.getAvatar());
+                }
             }
         });
         sign_card_super_users.setLayoutManager(new GridLayoutManager(SheepApp.getInstance(), 3));
         sign_card_super_users.setHasFixedSize(true);
         sign_card_super_users.setNestedScrollingEnabled(false);
-        sign_card_super_users.setAdapter(new AdbCommonRecycler<User>(SheepApp.getInstance(), superUserList) {
+        sign_card_super_users.setAdapter(new AdbCommonRecycler<PunchUser>(SheepApp.getInstance(), superUserList) {
             @Override
             public int getViewIdByType(int type) {
                 return R.layout.item_super_user;
             }
 
             @Override
-            public void convert(ViewHolder holder, User user) {
+            public void convert(ViewHolder holder, PunchUser user) {
                 int position = holder.getAdapterPosition();
-                ImageView item_super_user_bg1 = (ImageView)holder.itemView.findViewById(R.id.item_super_user_bg1);
-                ImageView item_super_user_iv = (ImageView)holder.itemView.findViewById(R.id.item_super_user_iv);
-                ImageView item_super_user_bg2 = (ImageView)holder.itemView.findViewById(R.id.item_super_user_bg2);
-                TextView item_super_user_tv1 = (TextView)holder.itemView.findViewById(R.id.item_super_user_tv1);
-                TextView item_super_user_tv2 = (TextView)holder.itemView.findViewById(R.id.item_super_user_tv2);
-                TextView item_super_user_tv3 = (TextView)holder.itemView.findViewById(R.id.item_super_user_tv3);
+                ImageView item_super_user_iv = (ImageView) holder.itemView.findViewById(R.id.item_super_user_iv);
+                TextView item_super_user_tv1 = (TextView) holder.itemView.findViewById(R.id.item_super_user_tv1);
+                TextView item_super_user_tv2 = (TextView) holder.itemView.findViewById(R.id.item_super_user_tv2);
+                TextView item_super_user_tv3 = (TextView) holder.itemView.findViewById(R.id.item_super_user_tv3);
                 ViewUtil.setText(item_super_user_tv1, XING_TEXTS[position]);
-                ViewUtil.setDefaultText(item_super_user_tv2);
-                ViewUtil.setDefaultText(item_super_user_tv3);
-                //TODO
+                if (user == null) {
+                    ViewUtil.setDefaultText(item_super_user_tv2);
+                    ViewUtil.setDefaultText(item_super_user_tv3);
+                    GlideImageLoader.setAvatar(item_super_user_iv, null);
+                } else {
+                    ViewUtil.setText(item_super_user_tv2, String.format(Locale.CHINA, "绵羊号%s", user.getInvitation_code()));
+                    ViewUtil.setText(item_super_user_tv3, user.getDescText());
+                    GlideImageLoader.setAvatar(item_super_user_iv, user.getAvatar());
+                }
             }
         });
     }
+
     private final static String[] XING_TEXTS = {"早起之星", "挑战之星", "毅力之星"};
-    private List<User> userList = ListUtil.emptyList();
-    private List<User> superUserList = ListUtil.emptyList();
+    private List<PunchUser> userList = ListUtil.emptyList();
+    private List<PunchUser> superUserList = ListUtil.emptyList();
+    private boolean isCanSignUp = false;//判断今日是否能报名 true可以 false不可以
+    private int initCanSignUp = INIT;//是否已经初始化完成 isSignUp, -1 初始化状态 0 加载中 1 成功
+    public static final int INIT = -2;
+    public static final int LOADING = -1;
+    public static final int SUCCESS = 0;
+    private int punchType = INIT;//1未报名 2已打卡 3可以打卡 4已经过了时间 5活动暂未开始
+
     @Override
     public void initData() {
+        initPunchAndSignCount();
+        initPunchStar();
+        initCanSignUp();
+        initPunchType();
+        //暂时没有显示 今日参与打卡奖励
+//        SheepApp.getInstance().getNetComponent().getApiService().getPunchAward()
+//                .subscribeOn(Schedulers.io())
+//                .observeOn(AndroidSchedulers.mainThread())
+//                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+//                    @Override
+//                    public void onNext(BaseMessage baseMessage) {
+//                    }
+//
+//                    @Override
+//                    public void onError(BaseMessage baseMessage) {
+//                    }
+//                });
+    }
+    //初始化早起之星
+    private void initPunchStar() {
+        SheepApp.getInstance().getNetComponent().getApiService().getPunchStar()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        PunchStarList punchStarList = baseMessage.getData(PunchStarList.class);
+                        superUserList.clear();
+                        ListUtil.addAllItem(superUserList, punchStarList.getList());
+                        sign_card_super_users.getAdapter().notifyDataSetChanged();
+                    }
 
-        SheepApp.getInstance().getNetComponent().getApiService().getFindTagList()
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                    }
+                });
+    }
+    private PunchAndSign punchAndSign;
+    //初始化打卡数据
+    private void initPunchAndSignCount() {
+        SheepApp.getInstance().getNetComponent().getApiService().getPunchAndSignCount()
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        List<User> newList = baseMessage.getDatas(User.class);
-                        ListUtil.addAll(userList, newList);
+                        punchAndSign = baseMessage.getData(PunchAndSign.class);
+                        userList.clear();
+                        if (ListUtil.isEmpty(punchAndSign.getAvatar())) {
+                            userList.add(null);
+                        } else {
+                            ListUtil.addAll(userList, punchAndSign.getAvatar());
+                        }
                         sign_card_users.setLayoutManager(new GridLayoutManager(SheepApp.getInstance(), userList.size()));
                         sign_card_users.getAdapter().notifyDataSetChanged();
+                        ViewUtil.setText(sign_card_total_bonus, punchAndSign.getSign_up_count());
+                        ViewUtil.setText(sign_card_total_people, String.format(Locale.CHINA, "当前参与人数%s人", punchAndSign.getSign_up_count()));
+                        ViewUtil.setText(sign_card_success_people, punchAndSign.getPunch_count());
+                        ViewUtil.setText(sign_card_fail_people, punchAndSign.getNoPunch_count());
+                        ViewUtil.setText(sign_card_award, punchAndSign.getTotal_award());
+                        initBtnState();
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        userList.clear();
+                        userList.add(null);
+                        sign_card_users.getAdapter().notifyDataSetChanged();
+                    }
+                });
+    }
+
+    private void initCanSignUp() {
+        initCanSignUp = LOADING;
+        SheepApp.getInstance().getNetComponent().getApiService().getPunchCanSignUp()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        initCanSignUp = SUCCESS;
+                        isCanSignUp = baseMessage.getData(Boolean.class);
+                        initBtnState();
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
+                        initCanSignUp = INIT;
                     }
                 });
-        SheepApp.getInstance().getNetComponent().getApiService().getFindTagList()
+    }
+
+    private void initPunchType() {
+        punchType = LOADING;
+        SheepApp.getInstance().getNetComponent().getApiService().getPunchCanpunch()
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        List<User> newList = baseMessage.getDatas(User.class);
-                        ListUtil.addAll(superUserList, newList);
-                        int size;
-                        while((size =superUserList.size()) > 3){
-                            superUserList.remove(size - 1);
-                        }
-                        sign_card_super_users.getAdapter().notifyDataSetChanged();
+                        punchType = baseMessage.getData(Integer.class);
+                        initBtnState();
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
+                        punchType = INIT;
                     }
                 });
     }
+
     @OnClick({R.id.sign_card_join, R.id.sign_card_tip, R.id.sign_card_look_more})
     public void onViewClicked(View view) {
         switch (view.getId()) {
@@ -186,11 +306,12 @@ public class ActSignCard extends BaseActivity {
     }
 
     private void 查看详细榜单() {
-        //TODO
+        Jump2View.getInstance().goSignRankingsAct(activity, null);
     }
+
     private void 显示活动说明() {
         ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("早起也能赚钱了").setBtnLeftText("我知道了")
-            .setMsgGravity(Gravity.START).setMsg("1、支付1元作为早起动力金参与早起打卡,放入早起打卡挑战奖池内。\n" +
+                .setMsgGravity(Gravity.START).setMsg("1、支付1元作为早起动力金参与早起打卡,放入早起打卡挑战奖池内。\n" +
                         "2、次日早上7:00-9:00时段为早起打卡时间,用户在此期间进入小绵羊点击打卡按钮则成功打卡成功打卡不仅能拿回您原来投入的1元动力金,还能瓜分当天所有打卡失败者的全部动力金。\n" +
                         "3、未在次日早上7:00-9:00内进行打卡视为打卡失败,打卡失败后您所投入的1元动力金将不予以退回,也不参与瓜分当天所有打卡失败者的全部动力金。\n" +
                         "4、奖金将会在当天9:00进行结算,于12小时内发放至你的账户。由于网络原因,部分用户可能出现到账不及时的情况,请与我们的客服联系(客服电话:4008-698-576)\n" +
@@ -198,6 +319,132 @@ public class ActSignCard extends BaseActivity {
     }
 
     private void 参加打卡挑战() {
-        //TODO
+        if (punchType == 3) {//可以打卡
+            参加打卡();
+        } else if (initCanSignUp == SUCCESS && isCanSignUp) {//可以报名
+            参加报名();
+        } else {
+            ViewUtil.showMsgDialog(activity, "活动暂未开始,请于早上7点至9点来参与打卡");
+        }
+    }
+
+    private void 参加打卡() {
+        UMConfigUtils.Event.PUNCH_SIGN_UP.onEvent();
+        SheepApp.getInstance().getNetComponent().getApiService().getPunch()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        if ("OK".equals(baseMessage.getMsg())) {
+                            ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("恭喜您").setMsg("打卡成功,活动结束后平分奖励会直接发放到个人账户中")
+                                    .setBtnLeftText("好的").setBtnRightText("查看战绩")
+                                    .setBtnRightOnClickListener(new View.OnClickListener() {
+                                        @Override
+                                        public void onClick(View view) {
+                                            Jump2View.getInstance().goSignRecordAct(activity, null);
+                                        }
+                                    }));
+                            initPunchAndSignCount();//(刷新数据)获取可打卡和报名人数
+                            punchType = 2;//1未报名 2已打卡 3可以打卡 4已经过了时间 5活动暂未开始
+                            initBtnState();
+                        } else {
+                            G.showToast(baseMessage);
+                        }
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast(baseMessage);
+                    }
+                });
+    }
+
+    private void 参加报名() {
+        UMConfigUtils.Event.PUNCH_PUNCH.onEvent();
+        CommonUtil.getInstance().callActionWithUserInfo(new Action1<UserEntity>() {
+            @Override
+            public void call(UserEntity userEntity) {
+                if (userEntity != null) {
+                    if (NumberFormatUtils.parseFloat(userEntity.getBalance()) >= 1) {
+                        SheepApp.getInstance().getNetComponent().getApiService().getPunchUp()
+                                .subscribeOn(Schedulers.io())
+                                .observeOn(AndroidSchedulers.mainThread())
+                                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                                    @Override
+                                    public void onNext(BaseMessage baseMessage) {
+                                        if ("OK".equals(baseMessage.getMsg())) {
+                                            ViewUtil.showMsgDialog(activity, new DialogConfig().setMsg("记得明日7:00-9:00来参加打卡哦!").setTitle("恭喜你,报名成功").setBtnLeftText("设置闹铃提醒")
+                                                    .setBtnLeftOnClickListener(new View.OnClickListener() {
+                                                        @Override
+                                                        public void onClick(View view) {
+                                                            //跳转到系统闹钟
+                                                            SysAppUtil.startAlermApp(activity, "小绵羊打卡任务", 7, 5);
+                                                        }
+                                                    }));
+                                            initPunchAndSignCount();//(刷新数据)获取可打卡和报名人数
+                                        } else {
+                                            G.showToast(baseMessage);
+                                        }
+                                    }
+
+                                    @Override
+                                    public void onError(BaseMessage baseMessage) {
+                                        G.showToast(baseMessage);
+                                    }
+                                });
+                    } else {
+                        ViewUtil.showMsgDialog(activity, new DialogConfig().setMsg("抱歉,你的余额不足,请先去充值再来参与打卡哦!").setBtnRightText("好的").setBtnLeftText("去充值")
+                                .setBtnLeftOnClickListener(new View.OnClickListener() {
+                                    @Override
+                                    public void onClick(View view) {
+                                        Jump2View.getInstance().goSignRechargeAct(activity, null);
+                                    }
+                                }));
+                    }
+                } else {
+                    G.showToast(R.string.service_data_error);
+                }
+            }
+        });
+    }
+    private Handler handler = new Handler(Looper.getMainLooper()){
+        @Override
+        public void handleMessage(Message msg) {
+            switch (msg.what){
+                case 0://UPDATE_TIME:
+                    if(totalTime > 0) {
+                        sign_card_join.setText(String.format(Locale.CHINA, "%s后可打卡", TimeUtil.getHours(totalTime-- * 1000)));
+                        sendEmptyMessageDelayed(msg.what, 1000L);
+                    }
+                    break;
+            }
+        }
+    };
+    private long totalTime = INIT;
+    private void initBtnState() {
+        if (punchType == 3) {//可以打卡
+            sign_card_join.setEnabled(true);
+            sign_card_join.setText("参加打卡挑战");
+        } else if (initCanSignUp == SUCCESS && isCanSignUp) {//可以报名
+            sign_card_join.setEnabled(true);
+            sign_card_join.setText("报名打卡");
+        } else if(punchAndSign != null && punchAndSign.getCountdown() > 0){
+            if(totalTime == INIT) {//只设置一次
+                sign_card_join.setEnabled(false);
+                totalTime = punchAndSign.getCountdown();
+                handler.sendEmptyMessage(0);//开始计时
+            }
+        } else {
+            sign_card_join.setEnabled(false);
+            sign_card_join.setText(R.string.loading);
+        }
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        handler.removeMessages(0);
+        handler = null;
     }
 }

+ 67 - 50
app/src/main/java/com/sheep/gamegroup/view/activity/ActSignCardRecord.java

@@ -1,27 +1,29 @@
 package com.sheep.gamegroup.view.activity;
 
 import android.graphics.Color;
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.v7.widget.RecyclerView;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentTransaction;
 import android.view.View;
 import android.widget.TextView;
 
 import com.haibin.calendarview.Calendar;
 import com.haibin.calendarview.CalendarView;
-import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
-import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.PunchLogEntity;
+import com.sheep.gamegroup.model.entity.StatisticsEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.fragment.FgtSignCardRecord;
 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.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
@@ -36,10 +38,18 @@ import rx.schedulers.Schedulers;
  * realicing@sina.com
  */
 public class ActSignCardRecord extends BaseActivity {
-    @BindView(R.id.sign_card_record_rv)
-    RecyclerView recyclerView;
     @BindView(R.id.sign_card_record_cv)
     CalendarView sign_card_record_cv;
+    @BindView(R.id.total_award)
+    TextView total_award;
+    @BindView(R.id.total_money)
+    TextView total_money;
+    @BindView(R.id.total_punch_count)
+    TextView total_punch_count;
+    @BindView(R.id.continue_punch_count)
+    TextView continue_punch_count;
+    @BindView(R.id.frame_container_bottom)
+    View frame_container_bottom;
 
     @Override
     protected int getLayoutId() {
@@ -53,69 +63,61 @@ public class ActSignCardRecord extends BaseActivity {
         activity = this;
         TitleBarUtils
                 .getInstance()
-                .setTitle(activity, "我的战绩")
                 .setTitleFinish(activity)
-                .setRightImgBotton(activity, R.drawable.sign_right_record_bg, new View.OnClickListener() {
+                .setTitle(activity, "我的战绩")
+                .setRightBtn(activity, "分享", 0, new View.OnClickListener() {
                     @Override
-                    public void onClick(View v) {
-                        Jump2View.getInstance().goSignRankingsAct(activity, null);
+                    public void onClick(View view) {
+                        CommonUtil.getInstance().tryShowShareDialog(activity);
                     }
                 });
+
+        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
+        Bundle bundle = new Bundle();
+        Fragment fragment = getSupportFragmentManager().findFragmentByTag("tag");
+        if(fragment == null){
+            fragment = new FgtSignCardRecord();
+            fragment.setArguments(bundle);
+            transaction.add(R.id.frame_container, fragment, "tag");
+            transaction.commitAllowingStateLoss();
+        }else {
+            fragment.setArguments(bundle);
+            transaction.replace(R.id.frame_container, fragment);
+            transaction.commitAllowingStateLoss();
+        }
+        ViewUtil.setDefaultText(total_award);
+        ViewUtil.setText(total_money);
+        ViewUtil.setText(total_punch_count);
+        ViewUtil.setText(continue_punch_count);
     }
 
-    RecyclerViewAdapter<PunchLogEntity> adapter;
 
     @Override
     public void initListener() {
-        adapter = new RecyclerViewAdapter<PunchLogEntity>(SheepApp.getInstance(), R.layout.item_sign_card_record, list) {
-            @Override
-            public void convert(ViewHolder viewHolder, PunchLogEntity item, int position) {
-                TextView sign_card_record_date = (TextView)viewHolder.itemView.findViewById(R.id.sign_card_record_date);
-                TextView sign_card_record_time = (TextView)viewHolder.itemView.findViewById(R.id.sign_card_record_time);
-                TextView sign_card_record_bonus = (TextView)viewHolder.itemView.findViewById(R.id.sign_card_record_bonus);
-                ViewUtil.setTextTime(sign_card_record_date, item.getCreateTime(), "yyyy/MM/dd");
-                ViewUtil.setTextTime(sign_card_record_time, item.getCreateTime(), "HH:mm");
-                ViewUtil.setText(sign_card_record_bonus, item.getAmount()+"元");
-            }
-        };
-        recyclerView.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
-        recyclerView.setNestedScrollingEnabled(false);
-        recyclerView.setAdapter(adapter);
-    }
-    private Calendar getSchemeCalendar(int year, int month, int day) {
-        Calendar calendar = new Calendar();
-        calendar.setYear(year);
-        calendar.setMonth(month);
-        calendar.setDay(day);
-        calendar.setSchemeColor(Color.parseColor("#FD2D54"));
-        return calendar;
     }
 
-    private List<PunchLogEntity> list = ListUtil.emptyList();
-
     @Override
     public void initData() {
-        initLogList(1);
-        initLogList(2);
-        initLogList(3);
+        initStatistics();
     }
 
-    private void initLogList(final int action) {
-        SheepApp.getInstance().getNetComponent().getApiService().getPunchLog(action)
+    private void initStatistics() {
+        SheepApp.getInstance().getNetComponent().getApiService().getStatistics()
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        List<PunchLogEntity> newList = baseMessage.getDatas(PunchLogEntity.class);
-                        ListUtil.addAll(list, newList);
-                        adapter.notifyDataSetChanged();
-                        if(action == 1)
-                            updateCalendarSchemeDate(newList);
+                        StatisticsEntity result = baseMessage.getData(StatisticsEntity.class);
+                        ViewUtil.setText(total_award, result.getTotal_award());
+                        ViewUtil.setText(total_money, result.getTotal_money());
+                        ViewUtil.setText(total_punch_count, result.getTotal_punch_count());
+                        ViewUtil.setText(continue_punch_count, result.getContinue_punch_count());
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
+                        G.showToast(baseMessage);
                     }
                 });
     }
@@ -123,16 +125,31 @@ public class ActSignCardRecord extends BaseActivity {
     /**
      * 标记日期时间
      */
-    private void updateCalendarSchemeDate(List<PunchLogEntity> newList) {
+    public void updateCalendarSchemeDate(List<PunchLogEntity> newList) {
+        if(ListUtil.isEmpty(newList)){
+            frame_container_bottom.setVisibility(View.VISIBLE);
+            return;
+        }
         int year = sign_card_record_cv.getCurYear();
         int month = sign_card_record_cv.getCurMonth();
         Map<String, Calendar> map = new HashMap<>();
         for (PunchLogEntity item : newList) {
             java.util.Calendar date = java.util.Calendar.getInstance(Locale.CHINA);
-            date.setTimeInMillis(item.getCreateTime()*1000);
-            Calendar calendar = getSchemeCalendar(year, month, date.get(java.util.Calendar.DAY_OF_MONTH));
-            map.put(calendar.toString(), calendar);
+            date.setTimeInMillis(item.getCreateTime() * 1000);
+            if(year == date.get(java.util.Calendar.YEAR) && month == date.get(java.util.Calendar.MONTH)){
+                Calendar calendar = getSchemeCalendar(year, month, date.get(java.util.Calendar.DAY_OF_MONTH));
+                map.put(calendar.toString(), calendar);
+            }
         }
         sign_card_record_cv.setSchemeDate(map);
     }
+
+    private Calendar getSchemeCalendar(int year, int month, int day) {
+        Calendar calendar = new Calendar();
+        calendar.setYear(year);
+        calendar.setMonth(month);
+        calendar.setDay(day);
+        calendar.setSchemeColor(Color.parseColor("#FD2D54"));
+        return calendar;
+    }
 }

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

@@ -265,10 +265,12 @@ public class ActWeb extends BaseActivity {
                                 }).setNegativeButton("取消", null).show();
                     }
                     return true;
-                } else {
+                } else if(url.contains("17xmy.com")){
                     Map<String, String> extraHeaders = new HashMap<>();
                     extraHeaders.put("Referer", "http://17xmy.com");
                     view.loadUrl(url, extraHeaders);
+                } else {
+                    return false;
                 }
                 return true;
             }

+ 60 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSignCardRecord.java

@@ -0,0 +1,60 @@
+package com.sheep.gamegroup.view.fragment;
+
+import android.support.v7.widget.RecyclerView;
+import android.widget.TextView;
+
+import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
+import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.PunchLogEntity;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.activity.ActSignCardRecord;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+
+import java.util.Locale;
+
+import rx.Observable;
+
+/**
+ * Created by realicing on 2018/9/17.
+ * realicing@sina.com
+ */
+public class FgtSignCardRecord extends  BaseListFragment<PunchLogEntity>{
+    @Override
+    protected RecyclerView.Adapter getAdapter() {
+        return new RecyclerViewAdapter<PunchLogEntity>(SheepApp.getInstance(), R.layout.item_sign_card_record, list) {
+            @Override
+            public void convert(ViewHolder viewHolder, PunchLogEntity item, int position) {
+                TextView sign_card_record_date = (TextView) viewHolder.itemView.findViewById(R.id.sign_card_record_date);
+                TextView sign_card_record_time = (TextView) viewHolder.itemView.findViewById(R.id.sign_card_record_time);
+                TextView sign_card_record_bonus = (TextView) viewHolder.itemView.findViewById(R.id.sign_card_record_bonus);
+                ViewUtil.setTextTime(sign_card_record_date, item.getCreateTime(), "yyyy/MM/dd");
+                ViewUtil.setTextTime(sign_card_record_time, item.getCreateTime(), "HH:mm");
+                ViewUtil.setText(sign_card_record_bonus, item.getAmount() + "元");
+            }
+        };
+    }
+
+    @Override
+    protected String getKey(int page, int per_page) {
+        return String.format(Locale.CHINA, "app/punch/all_punch_log?page=%d&per_page=%d", page, per_page);
+    }
+
+    @Override
+    protected Observable<BaseMessage> getApi(ApiService apiService) {
+        return apiService.getAllPunchLog(page, per_page);
+    }
+
+    @Override
+    protected Class<PunchLogEntity> getTClass() {
+        return PunchLogEntity.class;
+    }
+
+    @Override
+    public void notifyData() {
+        if(activity instanceof ActSignCardRecord)
+            ((ActSignCardRecord)activity).updateCalendarSchemeDate(list);
+    }
+}

BIN
app/src/main/res/drawable-xxhdpi/daka_btn_gray.webp


+ 1 - 1
app/src/main/res/drawable/selector_button_daka.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android" >
-  <item android:state_enabled="false" android:drawable="@drawable/daka_btn_click" />
+  <item android:state_enabled="false" android:drawable="@drawable/daka_btn_gray" />
   <item android:state_focused="true" android:drawable="@drawable/daka_btn_click" />
   <item android:state_checked="true" android:drawable="@drawable/daka_btn_click"/>
   <item android:state_selected="true" android:drawable="@drawable/daka_btn_click"/>

+ 6 - 2
app/src/main/res/layout/act_sign_card.xml

@@ -127,6 +127,7 @@
                 android:orientation="horizontal">
 
                 <TextView
+                    android:id="@+id/sign_card_success_people"
                     android:layout_width="0dp"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
@@ -136,6 +137,7 @@
                     android:textSize="13sp" />
 
                 <TextView
+                    android:id="@+id/sign_card_fail_people"
                     android:layout_width="0dp"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
@@ -145,11 +147,12 @@
                     android:textSize="13sp" />
 
                 <TextView
+                    android:id="@+id/sign_card_award"
                     android:layout_width="0dp"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
                     android:gravity="center"
-                    android:text="5617"
+                    android:text="5617"
                     android:textColor="#FD8C1E"
                     android:textSize="13sp" />
             </LinearLayout>
@@ -195,8 +198,9 @@
             android:layout_marginTop="260dp"
             android:background="@drawable/selector_button_daka"
             android:gravity="center"
+            android:enabled="false"
             android:paddingBottom="6dp"
-            android:text="参加打卡挑战"
+            android:text="@string/loading"
             android:textColor="@color/white"
             android:textSize="16sp" />
     </RelativeLayout>

+ 14 - 5
app/src/main/res/layout/act_sign_card_record.xml

@@ -136,24 +136,27 @@
                 android:orientation="horizontal">
 
                 <TextView
+                    android:id="@+id/total_award"
                     android:layout_width="0dp"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
                     android:gravity="center"
-                    android:text="4379"
+                    android:text="4379"
                     android:textColor="#FD2D54"
                     android:textSize="13sp" />
 
                 <TextView
+                    android:id="@+id/total_money"
                     android:layout_width="0dp"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
                     android:gravity="center"
-                    android:text="1238"
+                    android:text="1238"
                     android:textColor="#2EBEF2"
                     android:textSize="13sp" />
 
                 <TextView
+                    android:id="@+id/total_punch_count"
                     android:layout_width="0dp"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
@@ -163,6 +166,7 @@
                     android:textSize="13sp" />
 
                 <TextView
+                    android:id="@+id/continue_punch_count"
                     android:layout_width="0dp"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
@@ -184,10 +188,15 @@
 
             <include layout="@layout/item_sign_card_record_title" />
 
-            <android.support.v7.widget.RecyclerView
-                android:id="@+id/sign_card_record_rv"
+            <FrameLayout
+                android:id="@+id/frame_container"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content" />
+                android:layout_height="match_parent"/>
+            <View
+                android:id="@+id/frame_container_bottom"
+                android:layout_width="match_parent"
+                android:layout_height="100dp"
+                android:visibility="gone"/>
         </LinearLayout>
     </android.support.v4.widget.NestedScrollView>
 </LinearLayout>

+ 19 - 18
app/src/main/res/layout/adapter_message_left_fragment.xml

@@ -30,36 +30,37 @@
         android:gravity="center"
         android:orientation="vertical">
 
-        <RelativeLayout
+        <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="20dp">
+            android:layout_height="20dp"
+            android:gravity="center"
+            android:orientation="horizontal">
 
             <TextView
-                android:id="@+id/tv_time"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentEnd="true"
-                android:layout_centerVertical="true"
-                android:layout_marginEnd="11dp"
-                android:text="今天 8:58"
-                android:textColor="#ff999999"
-                android:textSize="11sp" />
-            <TextView
                 android:id="@+id/tv_title"
-                android:layout_width="match_parent"
+                android:layout_width="0dp"
                 android:layout_height="wrap_content"
-                android:layout_alignParentStart="true"
-                android:layout_centerVertical="true"
-                android:layout_toStartOf="@+id/tv_time"
-                android:layout_marginEnd="5dp"
+                android:layout_weight="4"
                 android:ellipsize="end"
+                android:gravity="start"
                 android:lines="1"
                 android:text="系统消息"
                 android:textColor="#ff333333"
                 android:textSize="15sp" />
 
+            <TextView
+                android:id="@+id/tv_time"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="11dp"
+                android:layout_weight="3"
+                android:gravity="end"
+                android:text="今天 8:58"
+                android:textColor="#ff999999"
+                android:textSize="11sp" />
+
 
-        </RelativeLayout>
+        </LinearLayout>
 
 
         <TextView

+ 10 - 76
app/src/main/res/layout/ask_to_share.xml

@@ -1,96 +1,30 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content">
+    android:layout_height="match_parent">
 
     <RelativeLayout
-        android:id="@+id/layout_f"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
+        android:layout_gravity="bottom"
         android:background="#ffffffff">
 
         <TextView
             android:id="@+id/ask_share_title"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:padding="10dp"
             android:text="邀请好友"
             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" />
-
-        <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" />
-
-        <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:textSize="14sp"
+            android:padding="@dimen/content_padding_15"/>
         <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="35dp"
+            android:layout_marginTop="20dp"
             android:layout_marginStart="@dimen/content_padding_15"
-            android:layout_marginTop="20dp" />
+            android:layout_marginBottom="35dp"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"/>
     </RelativeLayout>
 
-   <RelativeLayout
-       android:layout_width="match_parent"
-       android:layout_height="450dp"
-       android:id="@+id/layout_f1"
-       android:layout_above="@id/layout_f"
-       android:background="@color/white">
-
-
-       <TextView
-           android:id="@+id/tv_flags"
-           android:layout_width="wrap_content"
-           android:layout_height="wrap_content"
-           android:text="左右滑动选择推广页"
-           android:layout_alignParentBottom="true"
-           android:layout_centerHorizontal="true"/>
-       <android.support.v7.widget.RecyclerView
-           android:id="@+id/recycle_picture"
-           android:layout_width="match_parent"
-           android:layout_height="match_parent"
-           android:layout_above="@id/tv_flags"/>
-   </RelativeLayout>
-
-    <View
-        android:id="@+id/empty_view"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_above="@id/layout_f1"
-       />
-
-</RelativeLayout>
+</FrameLayout>

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

@@ -77,6 +77,7 @@
                 android:gravity="center"
                 android:text="累计奖励"
                 android:textColor="#282828"
+                android:visibility="gone"
                 android:textSize="@dimen/text_size_12" />
         </LinearLayout>
 

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

@@ -56,6 +56,7 @@
         android:layout_height="match_parent"
         android:layout_weight="2"
         android:gravity="center"
+        android:visibility="gone"
         android:text="1.4元"
         android:textColor="#cc282828"
         android:textSize="@dimen/text_size_10" />