Browse Source

Merge remote-tracking branch 'origin/sheep_develop' into sheep_develop

# Conflicts:
#	app/src/main/AndroidManifest.xml
#	app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java
#	app/src/main/res/layout/homepage_act_layout.xml
#	app/src/main/res/layout/tablayout_viewpager_layout.xml
yuanshenglan 7 years ago
parent
commit
77b952f164
56 changed files with 2325 additions and 133 deletions
  1. 58 2
      app/src/main/java/com/kfzs/duanduan/ActMain.java
  2. 40 0
      app/src/main/java/com/kfzs/duanduan/adp/ViewPagerFragmentStateAdapter.java
  3. 1 3
      app/src/main/java/com/kfzs/duanduan/fragment/FgtCreditCardTaskList.java
  4. 7 5
      app/src/main/java/com/kfzs/duanduan/fragment/FgtFind.java
  5. 4 3
      app/src/main/java/com/kfzs/duanduan/fragment/FgtPersonalCenter.java
  6. 170 5
      app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java
  7. 5 10
      app/src/main/java/com/kfzs/duanduan/mine/GiftpackListAdapter.java
  8. 35 5
      app/src/main/java/com/kfzs/duanduan/react/TabsHelper.java
  9. 20 0
      app/src/main/java/com/kfzs/duanduan/utils/NumberFormatUtils.java
  10. 2 1
      app/src/main/java/com/sheep/gamegroup/di/modules/NetModule.java
  11. 1 1
      app/src/main/java/com/sheep/gamegroup/helper/TaskHelper.java
  12. 42 0
      app/src/main/java/com/sheep/gamegroup/model/cookie/CookieManager.java
  13. 2 1
      app/src/main/java/com/sheep/gamegroup/model/entity/DialogConfig.java
  14. 10 1
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskAcceptedEty.java
  15. 15 5
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskReleaseEty.java
  16. 8 0
      app/src/main/java/com/sheep/gamegroup/model/entity/Welfare.java
  17. 1 3
      app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java
  18. 33 2
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  19. 3 0
      app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java
  20. 15 0
      app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java
  21. 265 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActDownloadWelfareList.java
  22. 51 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGameCenter.java
  23. 266 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGiftCenter.java
  24. 113 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMyWelfare.java
  25. 8 5
      app/src/main/java/com/sheep/gamegroup/view/activity/LoginAct.java
  26. 5 5
      app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAct.java
  27. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailCreditCardAct.java
  28. 1 1
      app/src/main/java/com/sheep/gamegroup/view/adapter/CreditCardProgressQueryAdp.java
  29. 1 1
      app/src/main/java/com/sheep/gamegroup/view/adapter/CreditCardTaskAdp.java
  30. 32 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/DownloadWelfareAdapter.java
  31. 41 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/GiftCenterAdapter.java
  32. 5 7
      app/src/main/java/com/sheep/gamegroup/view/adapter/TaskListItemAdp.java
  33. 5 5
      app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java
  34. 143 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtDownloadWelfare.java
  35. 3 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMainAudit.java
  36. 121 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMyGift.java
  37. 239 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWelfareCenter.java
  38. 121 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWelfareUseRecord.java
  39. 3 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/MessageCenterFragment.java
  40. 33 2
      app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java
  41. 40 21
      app/src/main/res/layout/act_audit_layout.xml
  42. 16 0
      app/src/main/res/layout/act_game_center.xml
  43. 5 9
      app/src/main/res/layout/fgt_find.xml
  44. 4 4
      app/src/main/res/layout/fgt_personacenter_item_top.xml
  45. 3 1
      app/src/main/res/layout/fgt_personalcenter_layout.xml
  46. 78 0
      app/src/main/res/layout/fgt_welfare_center.xml
  47. 1 1
      app/src/main/res/layout/homepage_act_layout.xml
  48. 10 5
      app/src/main/res/layout/homepage_item_get_award.xml
  49. 152 0
      app/src/main/res/layout/item_download_welfare.xml
  50. 30 0
      app/src/main/res/layout/item_hot_welfare.xml
  51. 20 12
      app/src/main/res/layout/title.xml
  52. 1 1
      app/src/main/res/layout/x_ask_getmoney_act_layout.xml
  53. 1 0
      app/src/main/res/layout/x_msg_dialog.xml
  54. BIN
      app/src/main/res/mipmap-xxhdpi/yilingq.png
  55. 30 0
      app/src/main/res/values/dd_styles.xml
  56. 5 5
      app/src/main/res/values/strings.xml

+ 58 - 2
app/src/main/java/com/kfzs/duanduan/ActMain.java

@@ -4,6 +4,8 @@ import android.annotation.SuppressLint;
 import android.content.Intent;
 import android.graphics.Color;
 import android.os.Build;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.WindowManager;
@@ -32,7 +34,10 @@ import butterknife.ButterKnife;
 import rx.functions.Action1;
 
 
-public class ActMain extends BaseActivity {
+/**
+ *
+ */
+public class ActMain extends BaseActivity implements TabsHelper.ItemPosition {
     private static final String TAG = "ActMain";
 
     @BindView(R.id.other_container)
@@ -46,6 +51,8 @@ public class ActMain extends BaseActivity {
 
     public TabsHelper tabsHelper;
 
+    private TabsHelper.ItemPosition itemPosition;
+
     @Override
     protected int getLayoutId() {
         return R.layout.activity_main;
@@ -54,7 +61,7 @@ public class ActMain extends BaseActivity {
     @Override
     public void initView() {
         KFZSApp.actMain = this;
-        tabsHelper = new TabsHelper();
+        tabsHelper = new TabsHelper(this);
         HelperUtils.init();//初始化屏幕的高,density等
         ButterKnife.bind(this);
         EventBus.getDefault().register(this);
@@ -87,7 +94,31 @@ public class ActMain extends BaseActivity {
 
     }
 
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setStatusSC();
+    }
 
+    /**
+     * 设置状态栏沉浸式
+     */
+    private void setStatusSC() {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            getWindow().setStatusBarColor(Color.TRANSPARENT);
+            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION	 | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
+        }
+    }
+
+    /**
+     * 设置状态栏正常
+     */
+    private void setStatusVI() {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            getWindow().setStatusBarColor(Color.parseColor("#29d6fd"));
+           //getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
+        }
+    }
 
 
 
@@ -165,4 +196,29 @@ public class ActMain extends BaseActivity {
         super.onActivityResult(requestCode, resultCode, data);
         UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
     }
+
+    @Override
+    public void positionClick(int position) {
+        switch (position) {
+            case 0://赚钱
+                setStatusSC();
+                break;
+            /*case 1://审核
+                setStatusVI();
+                break;
+            case 2://邀请
+                setStatusVI();
+                break;
+            case 3://发现
+                setStatusVI();
+                break;
+            case 4://个人中心
+                setStatusVI();
+                break;*/
+            default:
+                setStatusVI();
+                break;
+
+        }
+    }
 }

+ 40 - 0
app/src/main/java/com/kfzs/duanduan/adp/ViewPagerFragmentStateAdapter.java

@@ -0,0 +1,40 @@
+package com.kfzs.duanduan.adp;
+
+import android.os.Parcelable;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentStatePagerAdapter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by ljy on 2018/8/29.
+ */
+
+public class ViewPagerFragmentStateAdapter extends FragmentStatePagerAdapter {
+    private List<Fragment> mList = new ArrayList<>();;
+
+    public ViewPagerFragmentStateAdapter(FragmentManager fm) {
+        super(fm);
+    }
+    public void addAll(List<Fragment> fragmentList) {
+        mList.clear();
+        mList.addAll(fragmentList);
+    }
+
+    @Override
+    public Fragment getItem(int position) {
+        return mList.get(position);
+    }
+
+    @Override
+    public int getCount() {
+        return mList != null ? mList.size() : 0;
+    }
+
+    @Override
+    public Parcelable saveState() {
+        return null;
+    }
+}

+ 1 - 3
app/src/main/java/com/kfzs/duanduan/fragment/FgtCreditCardTaskList.java

@@ -5,7 +5,6 @@ import android.view.View;
 import android.widget.AdapterView;
 import android.widget.ListView;
 
-import com.alibaba.fastjson.JSON;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.TaskReleaseEty;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
@@ -13,7 +12,6 @@ import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.view.adapter.CreditCardTaskAdp;
 import com.sheep.gamegroup.view.customview.RefreshLayout;
-import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseFragment;
@@ -73,7 +71,7 @@ public class FgtCreditCardTaskList extends BaseFragment {
     }
 
     private void onItemClickTask(TaskReleaseEty taskReleaseEty) {
-        taskReleaseEty.getTask().setBonus(taskReleaseEty.getBonus());
+        taskReleaseEty.getTask().setBonus(taskReleaseEty.getBonusText());
         taskReleaseEty.getTask().setName(taskReleaseEty.getName());
         Jump2View.getInstance().goCreditCardTaskDetail(activity, taskReleaseEty.getId());
     }

+ 7 - 5
app/src/main/java/com/kfzs/duanduan/fragment/FgtFind.java

@@ -4,7 +4,7 @@ import android.app.Activity;
 import android.os.Bundle;
 import android.support.design.widget.TabLayout;
 import android.support.v4.view.ViewPager;
-import android.text.TextUtils;
+import android.view.View;
 
 import com.kfzs.duanduan.BaseCompatFragment;
 import com.kfzs.duanduan.mine.GiftpackListAdapter;
@@ -14,8 +14,8 @@ import com.sheep.gamegroup.model.entity.FindTag;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
-import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.view.adapter.AdpTryMakemoney;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
@@ -42,13 +42,15 @@ public class FgtFind extends BaseCompatFragment {
 
     @Override
     protected void initView(Bundle savedInstanceState) {
-        setContentView(R.layout.fgt_find);
+        setContentView(R.layout.common_tab_vp);
         activity = getActivity();
         ButterKnife.bind(this, mContentView);
         initView();
         initData();
     }
 
+    @BindView(R.id.layout_navigationBar)
+    View layout_navigationBar;
     @BindView(R.id.indicator)
     TabLayout indicator;
     @BindView(R.id.pager)
@@ -57,6 +59,7 @@ public class FgtFind extends BaseCompatFragment {
     private GiftpackListAdapter mAdapter;
 
     private void initView() {
+        layout_navigationBar.setVisibility(View.GONE);
         mAdapter = new GiftpackListAdapter(getFragmentManager(), SheepApp.getInstance());
         mAdapter.add(FgtFindChild.newInstance(0), "全部");
         pager.setAdapter(mAdapter);
@@ -71,7 +74,6 @@ public class FgtFind extends BaseCompatFragment {
             public void onPageSelected(int i) {
                 position = i;
                 FIND_TAG.onEvent("find_tag_name", ListUtil.hasIndex(list, i - 1) ? list.get(i - 1).getName() : "全部");
-                pager.setCurrentItem(i);
             }
 
             @Override
@@ -148,6 +150,7 @@ public class FgtFind extends BaseCompatFragment {
                 mAdapter.notifyDataSetChanged();
                 CommonUtil.getInstance().reflex(indicator, activity);
                 pager.setCurrentItem(position);
+                pager.setOffscreenPageLimit(mAdapter.getCount());
 
             }
         });
@@ -155,5 +158,4 @@ public class FgtFind extends BaseCompatFragment {
 
     private int position = 0;//默认选中第一个
 
-
 }

+ 4 - 3
app/src/main/java/com/kfzs/duanduan/fragment/FgtPersonalCenter.java

@@ -184,7 +184,7 @@ public class FgtPersonalCenter extends BaseCompatFragment {
      * @return 是否显示红包
      */
     private void isShowRedPackage() {
-        //  DataUtil.getInstance().是官方包吗();
+         // DataUtil.getInstance().是官方包吗();
         if (userEntity == null) {
             userEntity = DataUtil.getInstance().getUserEntity();
         }
@@ -314,8 +314,8 @@ public class FgtPersonalCenter extends BaseCompatFragment {
     })
     public void onViewClicked(View view) {
         switch (view.getId()) {
-            case R.id.ibtn_baseactivity_message:
-                startActivity(new Intent(activity, ActivityMessages.class));
+            case R.id.ibtn_baseactivity_message://消息
+               // startActivity(new Intent(activity, ActivityMessages.class));
                 break;
             case R.id.iv_redpackage://邀请成功后有可领红包
                 ViewUtil.changeRedPackage(getActivity(), getView(), FgtPersonalCenter.this);
@@ -392,6 +392,7 @@ public class FgtPersonalCenter extends BaseCompatFragment {
 
     @Override
     public void onResume() {
+        isShowRedPackage();
         super.onResume();
         try {
             initData();

+ 170 - 5
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -30,6 +30,7 @@ import android.view.animation.Animation;
 import android.view.animation.OvershootInterpolator;
 import android.view.animation.TranslateAnimation;
 import android.widget.AdapterView;
+import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.PopupWindow;
@@ -254,6 +255,168 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
 
         }
     };
+    /**
+     * @return 是否显示兑换邀请码红包
+     */
+    private void isShowRedPackageWithCode() {
+        //  DataUtil.getInstance().是官方包吗();
+        if (userEntity == null) {
+            userEntity = DataUtil.getInstance().getUserEntity();
+        }
+        if (!userEntity.getParent_code().equals("") || (userEntity.getCreate_time_line() < 2) || (userEntity.getPackage_cate() == 1)) {
+
+        } else {
+           changeRedPackage(getActivity(),LayoutInflater.from(getContext()).inflate(R.layout.activity_main,null),this);
+        }
+    }
+    /**
+     * 兑换红包弹窗
+     *
+     * @param mActivity 当前Activity的,
+     */
+    public static void changeRedPackage(final Activity mActivity, View viewAnchor, final FgtSmallSheep fgtSmallSheep) {
+        View view = LayoutInflater.from(mActivity).inflate(R.layout.pop_get_redpackage, null);
+        final EditText edInvitationCode = view.findViewById(R.id.ed_invitation_code);
+        TextView tvTitle = view.findViewById(R.id.tv_title);
+        final TextView tvGetRedPackage = view.findViewById(R.id.tv_get_redpackage);
+        ImageView ivClose = view.findViewById(R.id.iv_close);
+        final PopupWindow popupWindow = new PopupWindow(mActivity);
+        popupWindow.setContentView(view);
+        popupWindow.setWidth(ActionBar.LayoutParams.MATCH_PARENT);
+        popupWindow.setHeight(ActionBar.LayoutParams.MATCH_PARENT);
+        popupWindow.setTouchable(true);
+        popupWindow.setFocusable(true);
+        popupWindow.setOutsideTouchable(false);
+        popupWindow.setBackgroundDrawable(new BitmapDrawable());
+        backgroundAlpha(0.7f, mActivity);
+        try {
+            popupWindow.showAtLocation(viewAnchor, Gravity.CENTER, 0, 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        popupWindow.setOnDismissListener(new ViewUtil.PopDismissListener(mActivity));
+        tvTitle.setText("邀请码领取,金额更大");
+        tvGetRedPackage.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (TextUtils.isEmpty(edInvitationCode.getText())) {
+                    G.showToast("邀请码不能为空!");
+                } else {
+                    fgtSmallSheep.getRedPackage(edInvitationCode.getText().toString(), popupWindow);
+                    popupWindow.dismiss();
+                }
+            }
+        });
+        ivClose.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                popupWindow.dismiss();
+            }
+        });
+
+    }
+    /**
+     * 兑换红包
+     *
+     * @param code ,邀请码
+     */
+    public void getRedPackage(String code, final PopupWindow popupWindow) {
+        SheepApp.getInstance().getNetComponent().getApiService().exchangeRedPackage(code)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        LogUtil.logI("0------" + new Gson().toJson(baseMessage));
+                        G.showToast(baseMessage.getMsg());
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        showRedPackageAfterInvitation(activity, LayoutInflater.from(getContext()).inflate(R.layout.activity_main,null), baseMessage);
+                        if (popupWindow.isShowing()) {
+                            popupWindow.dismiss();
+                        }
+
+                    }
+                });
+    }
+    /**
+     * 邀请成功后在个人资料显示领红包弹窗
+     *
+     * @param mActivity 当前Activity
+     */
+    public void showRedPackageAfterInvitation(final Activity mActivity, View viewAnchor, BaseMessage baseMessage) {
+        if (viewAnchor == null) {
+            return;
+        }
+        View view = LayoutInflater.from(mActivity).inflate(R.layout.dialog_redpackage_after_invitation, null, false);
+        TextView tvGetRedPackage = view.findViewById(R.id.tv_get_redpackage);
+        TextView tvMoney = view.findViewById(R.id.tv_money);
+        ImageView ivClose = view.findViewById(R.id.iv_close);
+        final PopupWindow popupWindow = new PopupWindow(mActivity);
+        popupWindow.setContentView(view);
+        popupWindow.setAnimationStyle(R.style.Rising);
+        popupWindow.setWidth(ActionBar.LayoutParams.MATCH_PARENT);
+        popupWindow.setHeight(ActionBar.LayoutParams.MATCH_PARENT);
+        popupWindow.setTouchable(true);
+        popupWindow.setFocusable(true);
+        popupWindow.setOutsideTouchable(false);
+        popupWindow.setBackgroundDrawable(new BitmapDrawable());
+        backgroundAlpha(0.7f, mActivity);
+        try {
+            popupWindow.showAtLocation(viewAnchor, Gravity.CENTER, 0, 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        popupWindow.setOnDismissListener(new ViewUtil.PopDismissListener(mActivity));
+        tvMoney.setText("1");
+        tvGetRedPackage.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                //   CommonUtil.getInstance().updateUserInfo(null);
+                updateUserInfo(null);
+                popupWindow.dismiss();
+            }
+        });
+        ivClose.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                popupWindow.dismiss();
+
+            }
+        });
+
+    }
+
+    public void updateUserInfo(final Action1<UserEntity> action1) {
+        SheepApp.get(SheepApp.getInstance())
+                .getNetComponent()
+                .getApiService()
+                .getInfo()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        if (action1 != null)
+                            action1.call(null);
+
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        UserEntity userEntity = baseMessage.getData(UserEntity.class);
+                        if (userEntity != null) {
+                            DataUtil.getInstance().setUserEntity(userEntity);
+                        }
+                        if (action1 != null)
+                            action1.call(userEntity);
+                    }
+                });
+    }
+
+
 
     /**
      * 新手任务对话框中,注册账号并登录得红包,这里判断是否已经领取过了,如果领取过了就不显示,不然就显示
@@ -277,13 +440,12 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         if (userEntity == null) {
             userEntity = DataUtil.getInstance().getUserEntity();
         }
-        if (userEntity == null) {
-            return;
-        }
-        if (SpUtils.getFirst("first" + userEntity.getId())) {
+
+        if (SpUtils.getFirst("first" + userEntity.getId())) {//不是第一次进入APP
+            isShowRedPackageWithCode();//虽然不是第一次,但是邀请码的那个红包还是让它显示
             return;
         }
-        SpUtils.saveFirst("first" + userEntity.getId(), true);
+        SpUtils.saveFirst("first" + userEntity.getId(), true);//第一次登录成功后保存起来,下次进来就不再弹新人红包
         if (((userEntity.getNewbie_task_status() & 16) == 0) && userEntity.getIs_new() == 1) {
             showRedPackage(getContext());
         }
@@ -917,6 +1079,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         }
         if (DataUtil.getInstance().isTaskListChange(getClass()))//数据变化才刷新
             refreshTaskList();
+        setAnimation(ivDuty);
     }
 
 
@@ -1264,6 +1427,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             @Override
             public void onClick(View view) {
                 popupWindow.dismiss();
+                isShowRedPackageWithCode();//关闭新人注册红包后,弹出邀请红包
             }
         });
 
@@ -1289,6 +1453,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                     public void onNext(BaseMessage baseMessage) {
                         if (popupWindow.isShowing()) {
                             popupWindow.dismiss();
+                            isShowRedPackageWithCode();//兑换成功后弹出邀请红包
                         }
                         CommonUtil.getInstance().updateUserInfo(null);
                     }

+ 5 - 10
app/src/main/java/com/kfzs/duanduan/mine/GiftpackListAdapter.java

@@ -1,16 +1,10 @@
 package com.kfzs.duanduan.mine;
 
-import android.annotation.SuppressLint;
 import android.content.Context;
+import android.os.Parcelable;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentManager;
 import android.support.v4.app.FragmentPagerAdapter;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import com.sheep.jiuyan.samllsheep.R;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -21,13 +15,11 @@ import java.util.List;
  */
 
 public class GiftpackListAdapter extends FragmentPagerAdapter {
-    private Context mContext;
     private List<Object> mListFragment = new ArrayList<>();
     private List<Object> mTitles = new ArrayList<>();
 
     public GiftpackListAdapter(FragmentManager fm, Context mContext) {
         super(fm);
-        this.mContext = mContext;
     }
 
     public void add(Fragment fragment, String title) {
@@ -55,5 +47,8 @@ public class GiftpackListAdapter extends FragmentPagerAdapter {
         return (CharSequence) mTitles.get(position);
     }
 
-
+    @Override
+    public Parcelable saveState() {
+        return null;
+    }
 }

+ 35 - 5
app/src/main/java/com/kfzs/duanduan/react/TabsHelper.java

@@ -11,6 +11,8 @@ import com.kf.utils.ToastBuilder;
 import com.kfzs.duanduan.ActMain;
 import com.kfzs.duanduan.KFZSApp;
 import com.kfzs.duanduan.adp.ViewPagerFragmentAdapter;
+import com.kfzs.duanduan.adp.ViewPagerFragmentStateAdapter;
+import com.kfzs.duanduan.fragment.FgtFind;
 import com.kfzs.duanduan.fragment.FgtPersonalCenter;
 import com.kfzs.duanduan.fragment.FgtSmallSheep;
 import com.sheep.gamegroup.util.LogUtil;
@@ -19,6 +21,7 @@ import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.view.fragment.FgtMainAudit;
 import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.G;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -50,7 +53,12 @@ public class TabsHelper {
 
     private ViewPager view_pager_container;
     private TextView mTxtToolBar;
-
+    private ItemPosition itemPosition;
+    public TabsHelper() {
+    }
+    public TabsHelper(ItemPosition itemPosition) {
+        this.itemPosition = itemPosition;
+    }
 
     private void initViews() {
         activity = KFZSApp.actMain;
@@ -108,9 +116,11 @@ public class TabsHelper {
                         int sheepPosition = MainTab.FgtSmallSheep.ordinal();
                         int personnalPosition = MainTab.FgtPersonnalCenter.ordinal();
                         int auditPosition = MainTab.FgtMainAudit.ordinal();
+                        int fPosition = MainTab.Fgt_Find.ordinal();
                         FgtSmallSheep fgtSmallSheep = (FgtSmallSheep) fragmentList.get(sheepPosition);
                         FgtPersonalCenter personnalCenter = (FgtPersonalCenter) fragmentList.get(personnalPosition);
                         FgtMainAudit auditFgt = (FgtMainAudit) fragmentList.get(auditPosition);
+                        FgtFind findFgt = (FgtFind) fragmentList.get(fPosition);
                         if(position == sheepPosition){
                             fgtSmallSheep.onResume();
                         } else {
@@ -122,6 +132,9 @@ public class TabsHelper {
                         if(position == auditPosition){
                             auditFgt.onResume();
                         }
+                        if(position == fPosition){
+                            findFgt.onResume();
+                        }
                         checkWhichPage(position);
                     }
 
@@ -140,12 +153,19 @@ public class TabsHelper {
      * @param position
      */
     private void checkWhichPage(int position){
-        if(position == MainTab.FgtSmallSheep.ordinal()) {
+        if(position == MainTab.FgtSmallSheep.ordinal()) {//赚钱
+            itemPosition.positionClick(0);
             UMConfigUtils.Event.TAB_SHEEP.onEvent();
-        }else if(position == MainTab.Fgt_Find.ordinal()) {
+        }else if(position == MainTab.Fgt_Find.ordinal()) {//发现
+            itemPosition.positionClick(1);
             UMConfigUtils.Event.TAB_FIND.onEvent();
-        }else if(position == MainTab.FgtPersonnalCenter.ordinal()) {
+        }else if(position == MainTab.FgtPersonnalCenter.ordinal()) {//个人中心
+            itemPosition.positionClick(2);
             UMConfigUtils.Event.TAB_USER.onEvent();
+        }else if (position==MainTab.FgtMainAudit.ordinal()){//审核
+            itemPosition.positionClick(3);
+        }else if(position==MainTab.FgtMainAskGetMoney.ordinal()){//邀请
+            itemPosition.positionClick(4);
         }
     }
 
@@ -184,7 +204,7 @@ public class TabsHelper {
 
     private void initViewPager() {
         LogUtil.logI("fragmentList.size---"+fragmentList.size());
-        ViewPagerFragmentAdapter mViewPagerFragmentAdapter = new ViewPagerFragmentAdapter(activity.getSupportFragmentManager(), fragmentList);
+        ViewPagerFragmentAdapter mViewPagerFragmentAdapter = new ViewPagerFragmentAdapter(activity.getSupportFragmentManager(),fragmentList);
         view_pager_container.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
 
             @Override
@@ -250,4 +270,14 @@ public class TabsHelper {
         tabs.get(postion).performClick();
     }
 
+    /**
+     * 设置获取当前是哪个fragment位置的回调
+     */
+   public interface ItemPosition{
+        /**
+         * @param position ,fragment的位置
+         */
+        void positionClick(int position);
+    }
+
 }

+ 20 - 0
app/src/main/java/com/kfzs/duanduan/utils/NumberFormatUtils.java

@@ -3,6 +3,7 @@ package com.kfzs.duanduan.utils;
 import android.text.TextUtils;
 
 import java.math.BigDecimal;
+import java.text.DecimalFormat;
 
 /**
  *
@@ -88,4 +89,23 @@ public class NumberFormatUtils {
         }
         return defaultValue;
     }
+
+    /**
+     * 最多保留两位小数
+     * @param bonus
+     * @return
+     */
+    public static String retainMost2(float bonus) {
+        DecimalFormat df = new DecimalFormat("#.##");
+        return df.format(bonus);
+    }
+    /**
+     * 保留两位小数
+     * @param bonus
+     * @return
+     */
+    public static String retain2(float bonus) {
+        DecimalFormat df = new DecimalFormat("0.00");
+        return df.format(bonus);
+    }
 }

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/di/modules/NetModule.java

@@ -2,6 +2,7 @@ package com.sheep.gamegroup.di.modules;
 
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.api.StringConverterFactory;
+import com.sheep.gamegroup.model.cookie.CookieManager;
 import com.sheep.gamegroup.model.util.AddPuplicParameIntercept;
 import com.sheep.gamegroup.model.util.CacheInterceptor;
 import com.sheep.gamegroup.model.util.EntityUtils;
@@ -17,7 +18,6 @@ import javax.inject.Singleton;
 import dagger.Module;
 import dagger.Provides;
 import okhttp3.OkHttpClient;
-import okhttp3.logging.HttpLoggingInterceptor;
 import retrofit2.Retrofit;
 import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
 import retrofit2.converter.gson.GsonConverterFactory;
@@ -36,6 +36,7 @@ public class NetModule {
         OkHttpClient okhttpClient = new OkHttpClient.Builder()
                 .connectTimeout(5, TimeUnit.SECONDS)
                 .readTimeout(20,TimeUnit.SECONDS)
+                .cookieJar(new CookieManager(SheepApp.getInstance()))
                 .addInterceptor(new AddPuplicParameIntercept())
                 .addInterceptor(new CacheInterceptor())
                 .addInterceptor(loggingInterceptor)

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

@@ -171,7 +171,7 @@ public class TaskHelper {
         find_information_game_surplus1.setVisibility(View.VISIBLE);
         setNumText(find_information_game_surplus1, taskReleaseEty);
         ViewUtil.setText(find_information_game_time, String.format(Locale.CHINA, "截止日期:%s", taskReleaseEty.getDeadline().equals("永久") ? taskReleaseEty.getDeadline() : TimeUtil.TimeStamp2Date(NumberFormatUtils.parseLong(taskReleaseEty.getDeadline()), "yyyy/MM/dd HH:mm")));
-        ViewUtil.setText(find_information_game_yuan, String.format(Locale.CHINA, "+%s元", taskReleaseEty.getBonus()));
+        ViewUtil.setText(find_information_game_yuan, String.format(Locale.CHINA, "+%s元", taskReleaseEty.getBonusText()));
         find_information_game_task0.setVisibility(View.GONE);
         find_information_game_yuan.setVisibility(View.VISIBLE);
         switch (taskEty.getTask_type()) {// 1时间试玩任务 2 信用卡任务 3应用下载 4h5业务 1001畅思 1000连续任务, 1002 1003游戏任务

+ 42 - 0
app/src/main/java/com/sheep/gamegroup/model/cookie/CookieManager.java

@@ -0,0 +1,42 @@
+package com.sheep.gamegroup.model.cookie;
+
+import android.content.Context;
+
+import com.sheep.gamegroup.util.ListUtil;
+import com.zhy.http.okhttp.cookie.store.PersistentCookieStore;
+
+import java.util.List;
+
+import okhttp3.Cookie;
+import okhttp3.CookieJar;
+import okhttp3.HttpUrl;
+
+/**
+ * Created by realicing on 2018/8/29.
+ * realicing@sina.com
+ */
+public class CookieManager implements CookieJar {
+
+
+    private static PersistentCookieStore cookieStore;
+
+    public CookieManager(Context context) {
+        if (cookieStore == null) {
+            cookieStore = new PersistentCookieStore(context);
+        }
+    }
+
+
+    @Override
+    public void saveFromResponse(HttpUrl url, List<Cookie> cookies) {
+        if (!ListUtil.isEmpty(cookies)) {
+            cookieStore.add(url, cookies);
+        }
+    }
+
+    @Override
+    public List<Cookie> loadForRequest(HttpUrl url) {
+        return cookieStore.get(url);
+    }
+
+}

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

@@ -1,6 +1,7 @@
 package com.sheep.gamegroup.model.entity;
 
 import android.support.annotation.IntDef;
+import android.support.annotation.LayoutRes;
 import android.view.Gravity;
 import android.view.View;
 
@@ -201,7 +202,7 @@ public class DialogConfig {
     public int getLayoutId() {
         return layoutId;
     }
-    public DialogConfig setLayoutId(int layoutId) {
+    public DialogConfig setLayoutId(@LayoutRes int layoutId) {
         this.layoutId = layoutId;
         return this;
     }

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

@@ -24,6 +24,7 @@ public class TaskAcceptedEty implements Serializable{
 
     private TaskReleaseEty release_task;
     private int child_task_id;//0 1开始子任务  2完成第二个子任务
+    private int task_child_id;
 
     public int getChild_task_id() {
         return child_task_id;
@@ -137,10 +138,18 @@ public class TaskAcceptedEty implements Serializable{
         this.cash_task = cash_task;
     }
 
+    public int getTask_child_id() {
+        return task_child_id;
+    }
+
+    public void setTask_child_id(int task_child_id) {
+        this.task_child_id = task_child_id;
+    }
+
     @Override
     public boolean equals(Object obj) {
         return obj instanceof TaskAcceptedEty &&
-                (((TaskAcceptedEty) obj).id == id || ( release_task != null && release_task.equals(((TaskAcceptedEty) obj).getRelease_task())));
+                (((TaskAcceptedEty) obj).task_child_id == task_child_id) && (((TaskAcceptedEty) obj).id == id  || ( release_task != null && release_task.equals(((TaskAcceptedEty) obj).getRelease_task())));
     }
 
 

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

@@ -2,9 +2,11 @@ package com.sheep.gamegroup.model.entity;
 
 import android.text.TextUtils;
 
+import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.sheep.gamegroup.helper.DownloadHelper;
 
 import java.io.Serializable;
+import java.util.Locale;
 
 /**
  * 获取已经发布任务
@@ -12,7 +14,7 @@ import java.io.Serializable;
  */
 
 public class TaskReleaseEty implements Serializable{
-    private String bonus;// 0,
+    private float bonus;// 0,
     private String create_time;// 0,
     private String deadline;// 0,
     private String duration;// 0,
@@ -107,12 +109,12 @@ public class TaskReleaseEty implements Serializable{
         this.cancel_duration = cancel_duration;
     }
 
-    public String getBonus() {
-        return TextUtils.isEmpty(bonus)?"0":bonus;
+    public void setBonus(float bonus) {
+        this.bonus = bonus;
     }
 
-    public void setBonus(String bonus) {
-        this.bonus = bonus;
+    public float getBonus() {
+        return bonus;
     }
 
     public String getCreate_time() {
@@ -258,6 +260,14 @@ public class TaskReleaseEty implements Serializable{
     }
 
 
+    /**
+     * 获取奖金的文本表示(这里保留两位有效数字,因为服务器可能返回这样的结果:0.6000000238418579)
+     * @return
+     */
+    public String getBonusText() {
+        return NumberFormatUtils.retainMost2(bonus);
+    }
+
 
     public String getCashOrWelfare(){
         switch (cash_task){

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

@@ -0,0 +1,8 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by realicing on 2018/8/28.
+ * realicing@sina.com
+ */
+public class Welfare {
+}

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

@@ -14,7 +14,6 @@ import android.support.design.widget.TabLayout;
 import android.support.v7.app.AlertDialog;
 import android.text.Html;
 import android.text.TextUtils;
-import android.util.Log;
 import android.util.TypedValue;
 import android.view.View;
 import android.view.ViewTreeObserver;
@@ -56,7 +55,6 @@ import com.sheep.gamegroup.usage.AppUsageManager;
 import com.sheep.gamegroup.view.activity.GameTaskOrderListAct;
 import com.sheep.gamegroup.view.dialog.DialogNewbieTask1;
 import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
-import com.sheep.gamegroup.view.dialog.DialogNewbieTaskRegistSuccess;
 import com.sheep.gamegroup.view.dialog.DialogShare;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
@@ -1134,7 +1132,7 @@ public class CommonUtil {
                     public void onNext(BaseMessage baseMessage) {
                         if (baseMessage.getCode() == 200) {
                             ViewUtil.showMsgDialog(context, new DialogConfig().setTitle("预约成功")
-                                    .setMsg(String.format(Locale.CHINA, "恭喜您获得%s元绵羊币\n注意%s准时开放下载", taskReleaseEty.getBonus(),
+                                    .setMsg(String.format(Locale.CHINA, "恭喜您获得%s元绵羊币\n注意%s准时开放下载", taskReleaseEty.getBonusText(),
                                             TimeUtil.TimeStamp2Date(taskReleaseEty.getTask().getAppointment_time(), "yyyy-MM-dd\u0020HH:mm")))
                                     .setBtnLeftText("收入钱包").setBtnLeftOnClickListener(new View.OnClickListener() {
                                         @Override

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

@@ -35,17 +35,20 @@ import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.view.activity.ActAudit;
 import com.sheep.gamegroup.view.activity.ActCreditCardTaskList;
 import com.sheep.gamegroup.view.activity.ActCreditCardWeb;
+import com.sheep.gamegroup.view.activity.ActDownloadWelfareList;
 import com.sheep.gamegroup.view.activity.ActFindGame;
 import com.sheep.gamegroup.view.activity.ActFindInformation;
 import com.sheep.gamegroup.view.activity.ActGameAccount;
 import com.sheep.gamegroup.view.activity.ActGameAgencyRecharge;
+import com.sheep.gamegroup.view.activity.ActGameCenter;
+import com.sheep.gamegroup.view.activity.ActGiftCenter;
 import com.sheep.gamegroup.view.activity.ActGuide;
 import com.sheep.gamegroup.view.activity.ActGuideDeblocked;
 import com.sheep.gamegroup.view.activity.ActGuideOnHook;
 import com.sheep.gamegroup.view.activity.ActLoadH5;
-import com.sheep.gamegroup.view.activity.ActMainGame;
 import com.sheep.gamegroup.view.activity.ActMiDong;
 import com.sheep.gamegroup.view.activity.ActMyMoney;
+import com.sheep.gamegroup.view.activity.ActMyWelfare;
 import com.sheep.gamegroup.view.activity.ActNewAboutUs;
 import com.sheep.gamegroup.view.activity.ActNewbieTaskList;
 import com.sheep.gamegroup.view.activity.ActNotice;
@@ -112,7 +115,10 @@ import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_DOWNLOAD_WELFARE_LIST;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_GIFT_CENTER;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_MY_WELFARE;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.MI_DONG_VIEW;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECHARGE;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECHARGE_QQ;
@@ -886,7 +892,7 @@ public class Jump2View {
      * @param context
      */
     public void goMainGame(Context context) {
-        Intent intent = new Intent(context, ActMainGame.class);
+        Intent intent = new Intent(context, ActGameCenter.class);
         context.startActivity(intent);
     }
 
@@ -1459,4 +1465,29 @@ public class Jump2View {
         activity.startActivity(intent);
         XIAOMI_GAME_LIST.onEvent();
     }
+
+    /**
+     * 进入下载福利列表界面
+     */
+    public void goWelfareList(Activity activity) {
+        Intent intent = new Intent(activity, ActDownloadWelfareList.class);
+        activity.startActivity(intent);
+        GAME_DOWNLOAD_WELFARE_LIST.onEvent();
+    }
+    /**
+     * 进入礼包中心界面
+     */
+    public void goGiftCenter(Activity activity) {
+        Intent intent = new Intent(activity, ActGiftCenter.class);
+        activity.startActivity(intent);
+        GAME_GIFT_CENTER.onEvent();
+    }
+    /**
+     * 进入礼包中心界面
+     */
+    public void goMyWelfare(Activity activity) {
+        Intent intent = new Intent(activity, ActMyWelfare.class);
+        activity.startActivity(intent);
+        GAME_MY_WELFARE.onEvent();
+    }
 }

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

@@ -154,6 +154,9 @@ public class UMConfigUtils {
         SETTING("进入设置界面"),//5121
         XIAOMI_GAME_LIST("小米游戏列表"),//5122
         XIAOMI_GAME_RECEIVE("小米游戏账号领取"),//5123
+        GAME_DOWNLOAD_WELFARE_LIST("下载福利列表"),
+        GAME_GIFT_CENTER("礼包中心"),
+        GAME_MY_WELFARE("我的福利"),
         ;
         private String tag;
 

+ 15 - 0
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -15,6 +15,7 @@ import android.media.MediaPlayer;
 import android.net.Uri;
 import android.os.Build;
 import android.provider.MediaStore;
+import android.support.v4.app.FragmentActivity;
 import android.support.v7.app.AlertDialog;
 import android.support.v7.widget.GridLayoutManager;
 import android.support.v7.widget.RecyclerView;
@@ -1320,4 +1321,18 @@ public class ViewUtil {
         }
 
     }
+    /**
+     * 获取状态栏高度
+     *
+     * @return , 状态栏高度
+     * @param activity
+     */
+    public static int getBarHeight(FragmentActivity activity) {
+        int result = 0;
+        int resourceId = activity.getResources().getIdentifier("status_bar_height", "dimen", "android");
+        if (resourceId > 0) {
+            result = activity.getResources().getDimensionPixelSize(resourceId);
+        }
+        return result;
+    }
 }

+ 265 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActDownloadWelfareList.java

@@ -0,0 +1,265 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.TextView;
+
+import com.arialyy.annotations.Download;
+import com.arialyy.aria.core.Aria;
+import com.arialyy.aria.core.download.DownloadTask;
+import com.kfzs.duanduan.services.DownloadTaskService;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.FindApp;
+import com.sheep.gamegroup.model.entity.Welfare;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.SysAppUtil;
+import com.sheep.gamegroup.view.adapter.DownloadWelfareAdapter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import butterknife.BindView;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
+import rx.schedulers.Schedulers;
+
+import static android.content.Intent.ACTION_PACKAGE_ADDED;
+import static android.content.Intent.ACTION_PACKAGE_REMOVED;
+
+/**
+ * 福利中心--点击全部福利  进入  下载福利列表
+ * Created by realicing on 2018/8/28.
+ * realicing@sina.com
+ */
+public class ActDownloadWelfareList extends BaseActivity {
+    @Override
+    protected int getLayoutId() {
+        return R.layout.net_empty_fresh_list_not_wrap;
+    }
+
+    @BindView(R.id.refresh)
+    SwipeRefreshLayout refresh;
+    @BindView(R.id.empty_view)
+    View empty_view;
+    @BindView(R.id.check_net_ll)
+    View check_net_ll;
+    @BindView(R.id.view_list)
+    RecyclerView view_list;
+
+    @Override
+    public void initView() {
+        activity = this;
+        TitleBarUtils.getInstance()
+                .setTitle(this, "下载福利列表")
+                .setTitleFinish(this);
+
+        EventBus.getDefault().register(this);
+        Aria.download(this).register();
+
+        refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+            @Override
+            public void onRefresh() {
+                initData();
+                refresh.setRefreshing(false);
+            }
+        });
+
+        view_list.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
+        view_list.setAdapter(new DownloadWelfareAdapter(activity, list));
+    }
+
+    private Activity activity;
+    private List<Welfare> list = ListUtil.emptyList();
+    @Override
+    public void initListener() {
+
+    }
+
+
+    @Override
+    public void initData() {
+        empty_view.setVisibility(View.INVISIBLE);
+        SysAppUtil.checkNet(new Action1<Integer>() {
+            @Override
+            public void call(Integer result) {
+                if (result != 0) {//无网络
+                    if (check_net_ll != null)
+                        check_net_ll.setVisibility(View.VISIBLE);
+                } else {
+                    if (check_net_ll != null)
+                        check_net_ll.setVisibility(View.GONE);
+                }
+            }
+        });
+        SheepApp.getInstance().getNetComponent().getApiService().getFindAppReservationList(1, 100)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        List<Welfare> newList = baseMessage.getDataList(Welfare.class);
+                        list.clear();
+                        ListUtil.addAll(list, newList);
+                        if(!list.isEmpty())
+                            list.add(null);//底部圆角
+                        notifyDataSetChanged();
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        list.clear();
+                        notifyDataSetChanged();
+                    }
+                });
+    }
+
+
+    private void notifyDataSetChanged() {
+        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
+        refresh.setRefreshing(false);
+        view_list.getAdapter().notifyDataSetChanged();
+    }
+
+    private Map<String, FindApp> findAppMap = new HashMap<>();
+    //获取任务对应的findApp
+    private FindApp getFindAppByKey(String key) {
+        if(findAppMap.containsKey(key))
+            return findAppMap.get(key);
+        return null;
+    }
+    private Map<String, TextView> downLoadTextViewMap = new HashMap<>();
+    //获取任务对应的TextView来更新进度
+    private TextView getTextViewByTask(DownloadTask task) {
+        return getTextViewByKey(task.getKey());
+    }
+    private TextView getTextViewByKey(String key) {
+        if(downLoadTextViewMap.containsKey(key))
+            return downLoadTextViewMap.get(key);
+        return null;
+    }
+    //下载状态监听
+
+    @Download.onPre void onPre(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText("准备下载中");
+        }
+    }
+
+    @Download.onTaskStart void taskStart(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText("开始下载中");
+        }
+    }
+    @Download.onTaskResume void taskResume(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText("恢复下载中");
+        }
+    }
+    //在这里处理任务执行中的状态,如进度进度条的刷新
+    @Download.onTaskRunning protected void running(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText(String.format(Locale.CHINA, "%d%%", Math.abs(task.getPercent())));
+        }
+    }
+
+    @Download.onTaskStop void taskStop(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText(CommonUtil.CONTINUE_DOWNLOAD);
+        }
+    }
+
+    @Download.onNoSupportBreakPoint void onNoSupportBreakPoint(DownloadTask task) {
+    }
+
+    @Download.onTaskCancel void taskCancel(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText("已经取消");
+        }
+    }
+
+    @Download.onTaskFail void taskFail(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText(CommonUtil.FAIL_DOWNLOAD);
+        }
+    }
+
+    @Download.onTaskComplete void taskComplete(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText(CommonUtil.START_INSTALL);
+        }
+        FindApp findApp = getFindAppByKey(task.getKey());
+        if(findApp != null) {
+            findApp.updateState(DownloadTaskService.STATUS_FINISH);
+        }
+    }
+
+    @Subscribe
+    public void onEventMainThread(Intent intent) {
+        if(intent != null && intent.getAction() != null && intent.getDataString() != null && intent.getDataString().contains("package:")){
+            String packageName = intent.getDataString().replace("package:","");
+
+            TextView textView = getTextViewByKey(packageName);
+            if(textView != null) {
+                switch (intent.getAction()){
+                    case ACTION_PACKAGE_ADDED:
+                        textView.setText(CommonUtil.GAME_OPEN);
+                        break;
+                    case ACTION_PACKAGE_REMOVED:
+                        String path = PackageUtil.isExistsFile(packageName);
+                        if(TextUtils.isEmpty(path)) {
+                            textView.setText(CommonUtil.START_DOWNLOAD);
+                        } else {
+                            textView.setText(CommonUtil.START_INSTALL);
+                        }
+                        break;
+                }
+            }
+            FindApp findApp = getFindAppByKey(packageName);
+            if(findApp != null) {
+                switch (intent.getAction()){
+                    case ACTION_PACKAGE_ADDED:
+                        findApp.updateState(DownloadTaskService.STATUS_INSTALLED);
+                        break;
+                    case ACTION_PACKAGE_REMOVED:
+                        String path = PackageUtil.isExistsFile(packageName);
+                        if(TextUtils.isEmpty(path)) {
+                            findApp.updateState(DownloadTaskService.STATUS_INIT);
+                        } else {
+                            findApp.updateState(DownloadTaskService.STATUS_FINISH);
+                        }
+                        break;
+                }
+            }
+        }
+    }
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        EventBus.getDefault().unregister(this);
+    }
+}

+ 51 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActGameCenter.java

@@ -0,0 +1,51 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.support.v4.view.ViewPager;
+import android.view.View;
+
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.view.fragment.FgtWelfareCenter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import butterknife.BindView;
+
+/**
+ * Created by realicing on 2018/8/29.
+ * realicing@sina.com
+ */
+public class ActGameCenter extends BaseActivity {
+    @BindView(R.id.act_game_center_vp)
+    ViewPager act_game_center_vp;
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_game_center;
+    }
+    private ActGameCenter activity;
+    @Override
+    public void initView() {
+        activity = this;
+        TitleBarUtils.getInstance()
+                .setTitleFinish(activity)
+                .setRightBotton(activity, "我的福利", 0, new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        // 进入我的福利界面
+                        Jump2View.getInstance().goMyWelfare(activity);
+                    }
+                })
+                .addTabs(activity, act_game_center_vp,"玩转游戏", new FgtWelfareCenter(), "福利中心", new FgtWelfareCenter());
+
+    }
+
+    @Override
+    public void initListener() {
+
+    }
+
+    @Override
+    public void initData() {
+
+    }
+}

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

@@ -0,0 +1,266 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.TextView;
+
+import com.arialyy.annotations.Download;
+import com.arialyy.aria.core.Aria;
+import com.arialyy.aria.core.download.DownloadTask;
+import com.kfzs.duanduan.services.DownloadTaskService;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.FindApp;
+import com.sheep.gamegroup.model.entity.Welfare;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.SysAppUtil;
+import com.sheep.gamegroup.view.adapter.DownloadWelfareAdapter;
+import com.sheep.gamegroup.view.adapter.GiftCenterAdapter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import butterknife.BindView;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
+import rx.schedulers.Schedulers;
+
+import static android.content.Intent.ACTION_PACKAGE_ADDED;
+import static android.content.Intent.ACTION_PACKAGE_REMOVED;
+
+/**
+ * 福利中心--点击全部礼包  进入  礼包中心
+ * Created by realicing on 2018/8/28.
+ * realicing@sina.com
+ */
+public class ActGiftCenter extends BaseActivity {
+    @Override
+    protected int getLayoutId() {
+        return R.layout.net_empty_fresh_list_not_wrap;
+    }
+
+    @BindView(R.id.refresh)
+    SwipeRefreshLayout refresh;
+    @BindView(R.id.empty_view)
+    View empty_view;
+    @BindView(R.id.check_net_ll)
+    View check_net_ll;
+    @BindView(R.id.view_list)
+    RecyclerView view_list;
+
+    @Override
+    public void initView() {
+        activity = this;
+        TitleBarUtils.getInstance()
+                .setTitle(this, "礼包中心")
+                .setTitleFinish(this);
+
+        EventBus.getDefault().register(this);
+        Aria.download(this).register();
+
+        refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+            @Override
+            public void onRefresh() {
+                initData();
+                refresh.setRefreshing(false);
+            }
+        });
+
+        view_list.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
+        view_list.setAdapter(new GiftCenterAdapter(activity, list));
+    }
+
+    private Activity activity;
+    private List<Welfare> list = ListUtil.emptyList();
+    @Override
+    public void initListener() {
+
+    }
+
+
+    @Override
+    public void initData() {
+        empty_view.setVisibility(View.INVISIBLE);
+        SysAppUtil.checkNet(new Action1<Integer>() {
+            @Override
+            public void call(Integer result) {
+                if (result != 0) {//无网络
+                    if (check_net_ll != null)
+                        check_net_ll.setVisibility(View.VISIBLE);
+                } else {
+                    if (check_net_ll != null)
+                        check_net_ll.setVisibility(View.GONE);
+                }
+            }
+        });
+        SheepApp.getInstance().getNetComponent().getApiService().getFindAppReservationList(1, 100)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        List<Welfare> newList = baseMessage.getDataList(Welfare.class);
+                        list.clear();
+                        ListUtil.addAll(list, newList);
+                        if(!list.isEmpty())
+                            list.add(null);//底部圆角
+                        notifyDataSetChanged();
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        list.clear();
+                        notifyDataSetChanged();
+                    }
+                });
+    }
+
+
+    private void notifyDataSetChanged() {
+        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
+        refresh.setRefreshing(false);
+        view_list.getAdapter().notifyDataSetChanged();
+    }
+
+    private Map<String, FindApp> findAppMap = new HashMap<>();
+    //获取任务对应的findApp
+    private FindApp getFindAppByKey(String key) {
+        if(findAppMap.containsKey(key))
+            return findAppMap.get(key);
+        return null;
+    }
+    private Map<String, TextView> downLoadTextViewMap = new HashMap<>();
+    //获取任务对应的TextView来更新进度
+    private TextView getTextViewByTask(DownloadTask task) {
+        return getTextViewByKey(task.getKey());
+    }
+    private TextView getTextViewByKey(String key) {
+        if(downLoadTextViewMap.containsKey(key))
+            return downLoadTextViewMap.get(key);
+        return null;
+    }
+    //下载状态监听
+
+    @Download.onPre void onPre(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText("准备下载中");
+        }
+    }
+
+    @Download.onTaskStart void taskStart(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText("开始下载中");
+        }
+    }
+    @Download.onTaskResume void taskResume(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText("恢复下载中");
+        }
+    }
+    //在这里处理任务执行中的状态,如进度进度条的刷新
+    @Download.onTaskRunning protected void running(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText(String.format(Locale.CHINA, "%d%%", Math.abs(task.getPercent())));
+        }
+    }
+
+    @Download.onTaskStop void taskStop(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText(CommonUtil.CONTINUE_DOWNLOAD);
+        }
+    }
+
+    @Download.onNoSupportBreakPoint void onNoSupportBreakPoint(DownloadTask task) {
+    }
+
+    @Download.onTaskCancel void taskCancel(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText("已经取消");
+        }
+    }
+
+    @Download.onTaskFail void taskFail(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText(CommonUtil.FAIL_DOWNLOAD);
+        }
+    }
+
+    @Download.onTaskComplete void taskComplete(DownloadTask task) {
+        TextView textView = getTextViewByTask(task);
+        if(textView != null) {
+            textView.setText(CommonUtil.START_INSTALL);
+        }
+        FindApp findApp = getFindAppByKey(task.getKey());
+        if(findApp != null) {
+            findApp.updateState(DownloadTaskService.STATUS_FINISH);
+        }
+    }
+
+    @Subscribe
+    public void onEventMainThread(Intent intent) {
+        if(intent != null && intent.getAction() != null && intent.getDataString() != null && intent.getDataString().contains("package:")){
+            String packageName = intent.getDataString().replace("package:","");
+
+            TextView textView = getTextViewByKey(packageName);
+            if(textView != null) {
+                switch (intent.getAction()){
+                    case ACTION_PACKAGE_ADDED:
+                        textView.setText(CommonUtil.GAME_OPEN);
+                        break;
+                    case ACTION_PACKAGE_REMOVED:
+                        String path = PackageUtil.isExistsFile(packageName);
+                        if(TextUtils.isEmpty(path)) {
+                            textView.setText(CommonUtil.START_DOWNLOAD);
+                        } else {
+                            textView.setText(CommonUtil.START_INSTALL);
+                        }
+                        break;
+                }
+            }
+            FindApp findApp = getFindAppByKey(packageName);
+            if(findApp != null) {
+                switch (intent.getAction()){
+                    case ACTION_PACKAGE_ADDED:
+                        findApp.updateState(DownloadTaskService.STATUS_INSTALLED);
+                        break;
+                    case ACTION_PACKAGE_REMOVED:
+                        String path = PackageUtil.isExistsFile(packageName);
+                        if(TextUtils.isEmpty(path)) {
+                            findApp.updateState(DownloadTaskService.STATUS_INIT);
+                        } else {
+                            findApp.updateState(DownloadTaskService.STATUS_FINISH);
+                        }
+                        break;
+                }
+            }
+        }
+    }
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        EventBus.getDefault().unregister(this);
+    }
+}

+ 113 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActMyWelfare.java

@@ -0,0 +1,113 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.support.design.widget.TabLayout;
+import android.support.v4.view.ViewPager;
+import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.TextView;
+
+import com.arialyy.annotations.Download;
+import com.arialyy.aria.core.Aria;
+import com.arialyy.aria.core.download.DownloadTask;
+import com.kfzs.duanduan.fragment.FgtFindChild;
+import com.kfzs.duanduan.mine.GiftpackListAdapter;
+import com.kfzs.duanduan.services.DownloadTaskService;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.FindApp;
+import com.sheep.gamegroup.model.entity.Welfare;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.SysAppUtil;
+import com.sheep.gamegroup.view.adapter.GiftCenterAdapter;
+import com.sheep.gamegroup.view.fragment.FgtDownloadWelfare;
+import com.sheep.gamegroup.view.fragment.FgtMyGift;
+import com.sheep.gamegroup.view.fragment.FgtWelfareUseRecord;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import butterknife.BindView;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
+import rx.schedulers.Schedulers;
+
+import static android.content.Intent.ACTION_PACKAGE_ADDED;
+import static android.content.Intent.ACTION_PACKAGE_REMOVED;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.FIND_TAG;
+
+/**
+ * Created by realicing on 2018/8/28.
+ * realicing@sina.com
+ */
+public class ActMyWelfare extends BaseActivity {
+    @BindView(R.id.indicator)
+    TabLayout indicator;
+    @BindView(R.id.pager)
+    ViewPager pager;
+    @Override
+    protected int getLayoutId() {
+        return R.layout.common_tab_vp;
+    }
+
+
+    @Override
+    public void initView() {
+        activity = this;
+        TitleBarUtils.getInstance()
+                .setTitle(this, "我的福利")
+                .setTitleFinish(this);
+
+    }
+
+    private Activity activity;
+
+
+    private GiftpackListAdapter mAdapter;
+    @Override
+    public void initListener() {
+        mAdapter = new GiftpackListAdapter(getSupportFragmentManager(), SheepApp.getInstance());
+        mAdapter.add(new FgtDownloadWelfare(), "下载福利");
+        mAdapter.add(new FgtMyGift(), "我的礼包");
+        mAdapter.add(new FgtWelfareUseRecord(), "使用记录");
+        pager.setAdapter(mAdapter);
+        indicator.setupWithViewPager(pager);
+        pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+            @Override
+            public void onPageScrolled(int i, float v, int i1) {
+
+            }
+
+            @Override
+            public void onPageSelected(int i) {
+            }
+
+            @Override
+            public void onPageScrollStateChanged(int i) {
+
+            }
+        });
+        CommonUtil.getInstance().reflex(indicator, activity);
+    }
+
+
+    @Override
+    public void initData() {
+    }
+
+}

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

@@ -3,6 +3,8 @@ package com.sheep.gamegroup.view.activity;
 import android.os.Bundle;
 import android.support.v7.widget.AppCompatCheckBox;
 import android.support.v7.widget.AppCompatEditText;
+import android.text.InputFilter;
+import android.text.InputType;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.View;
@@ -102,6 +104,10 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
         TestUtil.testChange(this, (TextView) findViewById(R.id.test_change));
         TestUtil.testChangeUser(this, (TextView) findViewById(R.id.test_change_user));
 
+        if (TestUtil.isTest()) {
+            loginEtAccount.setInputType(InputType.TYPE_CLASS_TEXT);
+            loginEtAccount.setFilters(new InputFilter[]{new InputFilter.LengthFilter(1000)});
+        }
     }
 
 
@@ -245,12 +251,9 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
             case R.id.login_commit:
                 etPhone = loginEtAccount.getText().toString().trim();
                 etCode = loginEtCode.getText().toString().trim();
-                if (TestUtil.isTest() && TextUtils.isEmpty(etCode)) {
-                    if (TextUtils.isEmpty(etPhone))
-                        etPhone = "13626@395a75211751465f54789a7f459089bd";
+                if (TestUtil.isTest() && TextUtils.isEmpty(etCode) && !TextUtils.isEmpty(etPhone)) {
                     goMain(etPhone);
-                    if (!TextUtils.isEmpty(etPhone))
-                        TestUtil.addUser(etPhone);
+                    TestUtil.addUser(etPhone);
                     return;
                 }
                 loginByPhoneCaptcha();

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

@@ -254,7 +254,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
 
         taskEty = taskReleaseEty.getTask();
         nameTv.setText(taskReleaseEty.getName() + "");
-        priceTv.setText("+" + taskReleaseEty.getBonus() + "元");
+        priceTv.setText("+" + taskReleaseEty.getBonusText() + "元");
         if (!taskReleaseEty.getDeadline().equals("永久")) {
             dateTv.setText("截至日期:" + TimeUtil.getDate(TimeUtil.FORMAT, Long.valueOf(taskReleaseEty.getDeadline())) + "");
         } else {
@@ -830,7 +830,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                             CommonUtil.getInstance().setTAskEnty(null);
                             //这里领取了奖励,要刷新用户信息
                             CommonUtil.getInstance().updateUserInfo(null);
-                            String amount = taskReleaseEty.getBonus();
+                            String amount = taskReleaseEty.getBonusText();
                             try {
                                 Map h = JSON.parseObject(baseMessage.getData() + "");
 
@@ -839,7 +839,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                                 e.printStackTrace();
                             }
 
-                            G.showToast(String.format(Locale.CHINA, "恭喜你,任务已完成,获得奖励%s元", TextUtils.isEmpty(amount) ? taskReleaseEty.getBonus() : amount));
+                            G.showToast(String.format(Locale.CHINA, "恭喜你,任务已完成,获得奖励%s元", TextUtils.isEmpty(amount) ? taskReleaseEty.getBonusText() : amount));
                             finish();
                         }
 
@@ -1355,11 +1355,11 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                     @Override
                     public void onNext(BaseMessage baseMessage) {
                         hideProgress();
-//                        G.showToast(taskReleaseEty.getBonus() + "元");
+//                        G.showToast(taskReleaseEty.getBonusText() + "元");
                         //这里领取了奖励,要刷新用户信息
                         CommonUtil.getInstance().updateUserInfo(null);
                         ViewUtil.showMsgDialog(activity,
-                                "恭喜你获得" + taskReleaseEty.getBonus() + "元奖励",
+                                "恭喜你获得" + taskReleaseEty.getBonusText() + "元奖励",
                                 "提示",
                                 true);
 //                        finish();

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

@@ -144,7 +144,7 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
                 + "<style>body{max-width:100% !important;}</style>" + "</head><body>";
         webText.loadDataWithBaseURL(null, sHead + taskEty.getDesc() + "</body></html>", "text/html", "utf-8", null);
         nameTv.setText(taskReleaseEty.getName());
-        priceTv.setText(String.format(Locale.CHINA, "+%s元", taskReleaseEty.getBonus()));
+        priceTv.setText(String.format(Locale.CHINA, "+%s元", taskReleaseEty.getBonusText()));
         if(!taskReleaseEty.getDeadline().equals("永久")){
             dateTv.setText(TimeUtil.TimeStamp2Date(Long.valueOf(taskReleaseEty.getDeadline()), "yyyy/MM/dd HH:mm"));
         }else {

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

@@ -73,7 +73,7 @@ public class CreditCardProgressQueryAdp extends BaseAdapter {
             holder.credit_card_task_name_tv.setText(ety.getName());
             String[] remarks = ety.getTask().getRemarks().split(";");
             holder.credit_card_task_tip1_tv.setText(remarks.length > 0 ? remarks[0] : "");
-            holder.credit_card_task_tip2_tv.setText("¥"+ety.getBonus());
+            holder.credit_card_task_tip2_tv.setText("¥"+ety.getBonusText());
             holder.credit_card_task_find_tv.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View view) {

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

@@ -62,7 +62,7 @@ public class CreditCardTaskAdp extends BaseAdapter {
         final TaskReleaseEty ety = (TaskReleaseEty) getItem(position);
         if(ety != null) {
             holder.credit_card_task_tv.setText("+");
-            holder.credit_card_task_tv.append(ety.getBonus());
+            holder.credit_card_task_tv.append(ety.getBonusText());
             holder.credit_card_task_tv.append("元");
             holder.credit_card_task_name_tv.setText(ety.getName());
             String[] remarks = new String[0];

+ 32 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/DownloadWelfareAdapter.java

@@ -0,0 +1,32 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.content.Context;
+import android.view.View;
+
+import com.sheep.gamegroup.model.entity.Welfare;
+import com.sheep.gamegroup.util.ViewHolder;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.List;
+
+/**
+ * Created by realicing on 2018/8/28.
+ * realicing@sina.com
+ */
+public class DownloadWelfareAdapter extends AdbCommonRecycler<Welfare> {
+
+    public DownloadWelfareAdapter(Context context, List<Welfare> list) {
+        super(context, list);
+    }
+
+    @Override
+    public int getViewIdByType(int type) {
+        return R.layout.item_download_welfare;
+    }
+
+    @Override
+    public void convert(ViewHolder holder, Welfare welfareCenter) {
+        View item_download_welfare_line = holder.getView(R.id.item_download_welfare_line);
+        item_download_welfare_line.setVisibility(holder.getAdapterPosition() + 1 == getItemCount() ? View.GONE : View.VISIBLE);
+    }
+}

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

@@ -0,0 +1,41 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.content.Context;
+import android.view.Gravity;
+import android.view.View;
+
+import com.sheep.gamegroup.model.entity.DialogConfig;
+import com.sheep.gamegroup.model.entity.Welfare;
+import com.sheep.gamegroup.util.ViewHolder;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.List;
+
+/**
+ * Created by realicing on 2018/8/28.
+ * realicing@sina.com
+ */
+public class GiftCenterAdapter extends AdbCommonRecycler<Welfare> implements View.OnClickListener {
+
+    public GiftCenterAdapter(Context context, List<Welfare> list) {
+        super(context, list);
+    }
+
+    @Override
+    public int getViewIdByType(int type) {
+        return R.layout.item_download_welfare;
+    }
+
+    @Override
+    public void convert(ViewHolder holder, Welfare welfareCenter) {
+        holder.itemView.setOnClickListener(this);
+    }
+
+    @Override
+    public void onClick(View view) {
+        ViewUtil.showMsgDialog(context, new DialogConfig().setTitle("礼包使用说明").setBtnLeftText("我知道了")
+                .setMsgGravity(Gravity.START)//.setMsgLayoutWidth()
+                .setMsg("礼包内容:\n元宝X1000、钻石X2000、符文X20\n\n使用方式:\n启动游戏---设置---激活兑换"));
+    }
+}

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

@@ -2,7 +2,6 @@ package com.sheep.gamegroup.view.adapter;
 
 import android.app.Activity;
 import android.content.Context;
-import android.content.Intent;
 import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -15,8 +14,6 @@ import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.RequestOptions;
 import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
-import com.sheep.gamegroup.model.entity.TaskEty;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
 import com.sheep.gamegroup.presenter.TaskListPresenter;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.TestUtil;
@@ -25,6 +22,7 @@ import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
 
 import java.util.List;
+import java.util.Locale;
 
 import javax.inject.Inject;
 
@@ -92,12 +90,12 @@ public class TaskListItemAdp extends BaseAdapter {
 
         ViewUtil.setText(holder.name_tv, ety.getRelease_task().getName());
         ViewUtil.setText(holder.date_tv, TimeUtil.getDate(TimeUtil.FORMAT, NumberFormatUtils.parseLong(ety.getUpdate_time())));
-        String stateStr = "";
+        String stateStr;
         if(ety.getStatus() == 3){
-            stateStr = "+"+ ety.getRelease_task().getBonus() +"元";
+            stateStr = String.format(Locale.CHINA, "+%s元", ety.getRelease_task().getBonusText());
             holder.price_tv.setTextColor(context.getResources().getColor(R.color.txt_red));
         }else {
-            stateStr = ety.getRelease_task().getBonus() +"元";
+            stateStr = String.format(Locale.CHINA, "%s元", ety.getRelease_task().getBonusText());
             holder.price_tv.setTextColor(context.getResources().getColor(R.color.time_created));
         }
         holder.price_tv.setText(stateStr);
@@ -135,7 +133,7 @@ public class TaskListItemAdp extends BaseAdapter {
                 stateStr = "正在进行中";
                 break;
             case 3:
-                stateStr = "+"+ ety.getRelease_task().getBonus() +"元";
+                stateStr = "+"+ ety.getRelease_task().getBonusText() +"元";
                 break;
             case 4:
                 stateStr = "放弃任务";

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

@@ -300,7 +300,7 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
                 task_type_tv.setText(taskTypeTvValue+"");
                 task_type_tv.setTag(PUBLIC_TAG_PREFIX_TEXTVIEW_LIST + item.getDownload_url());
 //                TaskHelper.setNumText((TextView) viewHolder.itemView.findViewById(R.id.item_num_tv), taskReleaseEty);
-//                ((TextView)viewHolder.itemView.findViewById(R.id.item_money)).setText("+"+ item.getBonus() +"元");
+//                ((TextView)viewHolder.itemView.findViewById(R.id.item_money)).setText("+"+ item.getBonusText() +"元");
                 //任务领取
                 task_type_tv.setOnClickListener(new View.OnClickListener() {
                     @Override
@@ -575,7 +575,7 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
                 viewHolder.itemView.setTag(TAG_ID_TEMP, etyList.get(i).getId());
                 ((TextView) viewHolder.itemView.findViewById(R.id.item_name_tv)).setText(taskReleaseEty.getName() + "");
                 setCommonViewData(viewHolder.itemView, taskReleaseEty);
-                ((TextView) viewHolder.itemView.findViewById(R.id.item_money)).setText("+" + taskReleaseEty.getBonus() + "元");
+                ((TextView) viewHolder.itemView.findViewById(R.id.item_money)).setText("+" + taskReleaseEty.getBonusText() + "元");
 
                 GlideImageLoader.setGameImage((ImageView) viewHolder.itemView.findViewById(R.id.item_icon_iv), taskEty.getIcon());
                 if (isBegin == 1 || type == 2) {//即将开始
@@ -684,7 +684,7 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
                     public void onClick(View v) {
                         UMConfigUtils.IdEvent.TASK.commit(taskReleaseEty.getId());
                         taskEty.setRunTask(0);
-                        taskEty.setBonus(taskReleaseEty.getBonus());
+                        taskEty.setBonus(taskReleaseEty.getBonusText());
                         taskEty.setRelease_task_id(taskReleaseEty.getId());
                         taskEty.setName(taskReleaseEty.getName());
                         if("0".equals(taskReleaseEty.getLast_num())){
@@ -774,7 +774,7 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
 
                 ((TextView)viewHolder.itemView.findViewById(R.id.item_name_tv)).setText(taskReleaseEty.getName()+"");
                 setCommonViewData(viewHolder.itemView, taskReleaseEty);
-                ((TextView)viewHolder.itemView.findViewById(R.id.item_money)).setText("+"+ taskReleaseEty.getBonus() +"元");
+                ((TextView)viewHolder.itemView.findViewById(R.id.item_money)).setText("+"+ taskReleaseEty.getBonusText() +"元");
                 if(!taskReleaseEty.getDeadline().equals("永久")){
                     ((TextView)viewHolder.itemView.findViewById(R.id.item_date_tv)).setText(
                             "截止时间:" + TimeUtil.getDate(TimeUtil.FORMAT_DD, Long.valueOf(taskReleaseEty.getDeadline()))+"");
@@ -832,7 +832,7 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
                         UMConfigUtils.IdEvent.TASK.commit(item.getRelease_task_id());
 
                         taskEty.setRunTask(1);
-                        taskEty.setBonus(taskReleaseEty.getBonus());
+                        taskEty.setBonus(taskReleaseEty.getBonusText());
                         taskEty.setRelease_task_id(taskReleaseEty.getId());
                         taskEty.setAcceptedTaskId(taskAcceptedEty.getId());
                         taskEty.setName(taskReleaseEty.getName());

+ 143 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtDownloadWelfare.java

@@ -0,0 +1,143 @@
+package com.sheep.gamegroup.view.fragment;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.TextView;
+
+import com.arialyy.annotations.Download;
+import com.arialyy.aria.core.Aria;
+import com.arialyy.aria.core.download.DownloadTask;
+import com.kfzs.duanduan.services.DownloadTaskService;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.FindApp;
+import com.sheep.gamegroup.model.entity.Welfare;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.SysAppUtil;
+import com.sheep.gamegroup.view.adapter.GiftCenterAdapter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
+import rx.schedulers.Schedulers;
+
+import static android.content.Intent.ACTION_PACKAGE_ADDED;
+import static android.content.Intent.ACTION_PACKAGE_REMOVED;
+
+/**
+ * 我的福利--下载福利
+ * Created by realicing on 2018/8/28.
+ * realicing@sina.com
+ */
+public class FgtDownloadWelfare extends BaseFragment {
+    @Override
+    public int getLayoutId() {
+        return R.layout.net_empty_fresh_list_not_wrap;
+    }
+
+    @Override
+    public void onViewCreated() {
+        ButterKnife.bind(this, mView);
+        initView();
+        initListener();
+        initData();
+    }
+
+    @BindView(R.id.refresh)
+    SwipeRefreshLayout refresh;
+    @BindView(R.id.empty_view)
+    View empty_view;
+    @BindView(R.id.title)
+    View title;
+    @BindView(R.id.check_net_ll)
+    View check_net_ll;
+    @BindView(R.id.view_list)
+    RecyclerView view_list;
+
+    public void initView() {
+        activity = getActivity();
+        title.setVisibility(View.GONE);
+        check_net_ll.setVisibility(View.GONE);
+
+    }
+
+    private Activity activity;
+    private List<Welfare> list = ListUtil.emptyList();
+    public void initListener() {
+        refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+            @Override
+            public void onRefresh() {
+                initData();
+                refresh.setRefreshing(false);
+            }
+        });
+
+        view_list.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
+        view_list.setAdapter(new GiftCenterAdapter(activity, list));
+    }
+
+
+    public void initData() {
+        empty_view.setVisibility(View.INVISIBLE);
+        SysAppUtil.checkNet(new Action1<Integer>() {
+            @Override
+            public void call(Integer result) {
+                if (result != 0) {//无网络
+                    if (check_net_ll != null)
+                        check_net_ll.setVisibility(View.VISIBLE);
+                } else {
+                    if (check_net_ll != null)
+                        check_net_ll.setVisibility(View.GONE);
+                }
+            }
+        });
+        SheepApp.getInstance().getNetComponent().getApiService().getFindAppReservationList(1, 100)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        List<Welfare> newList = baseMessage.getDataList(Welfare.class);
+                        list.clear();
+                        ListUtil.addAll(list, newList);
+                        if(!list.isEmpty())
+                            list.add(null);//底部圆角
+                        notifyDataSetChanged();
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        list.clear();
+                        notifyDataSetChanged();
+                    }
+                });
+    }
+
+
+    private void notifyDataSetChanged() {
+        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
+        refresh.setRefreshing(false);
+        view_list.getAdapter().notifyDataSetChanged();
+    }
+}

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

@@ -6,6 +6,7 @@ import android.support.design.widget.TabLayout;
 import android.support.v4.view.ViewPager;
 import android.view.View;
 import android.widget.ImageView;
+import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import com.kfzs.duanduan.BaseCompatFragment;
@@ -13,8 +14,10 @@ import com.kfzs.duanduan.mine.GiftpackListAdapter;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.TaskAuditEntity;
 import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 import butterknife.BindView;

+ 121 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMyGift.java

@@ -0,0 +1,121 @@
+package com.sheep.gamegroup.view.fragment;
+
+import android.app.Activity;
+import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.Welfare;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.SysAppUtil;
+import com.sheep.gamegroup.view.adapter.GiftCenterAdapter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+
+import java.util.List;
+
+import butterknife.BindView;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
+import rx.schedulers.Schedulers;
+
+/**
+ * 我的福利--我的礼包
+ * Created by realicing on 2018/8/28.
+ * realicing@sina.com
+ */
+public class FgtMyGift extends BaseFragment {
+    @Override
+    public int getLayoutId() {
+        return R.layout.net_empty_fresh_list_not_wrap;
+    }
+
+    @Override
+    public void onViewCreated() {
+        initView();
+        initListener();
+        initData();
+    }
+
+    @BindView(R.id.refresh)
+    SwipeRefreshLayout refresh;
+    @BindView(R.id.empty_view)
+    View empty_view;
+    @BindView(R.id.title)
+    View title;
+    @BindView(R.id.check_net_ll)
+    View check_net_ll;
+    @BindView(R.id.view_list)
+    RecyclerView view_list;
+
+    public void initView() {
+        activity = getActivity();
+        title.setVisibility(View.GONE);
+        check_net_ll.setVisibility(View.GONE);
+
+    }
+
+    private Activity activity;
+    private List<Welfare> list = ListUtil.emptyList();
+    public void initListener() {
+        refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+            @Override
+            public void onRefresh() {
+                initData();
+                refresh.setRefreshing(false);
+            }
+        });
+
+        view_list.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
+        view_list.setAdapter(new GiftCenterAdapter(activity, list));
+    }
+
+
+    public void initData() {
+        empty_view.setVisibility(View.INVISIBLE);
+        SysAppUtil.checkNet(new Action1<Integer>() {
+            @Override
+            public void call(Integer result) {
+                if (result != 0) {//无网络
+                    if (check_net_ll != null)
+                        check_net_ll.setVisibility(View.VISIBLE);
+                } else {
+                    if (check_net_ll != null)
+                        check_net_ll.setVisibility(View.GONE);
+                }
+            }
+        });
+        SheepApp.getInstance().getNetComponent().getApiService().getFindAppReservationList(1, 100)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        List<Welfare> newList = baseMessage.getDataList(Welfare.class);
+                        list.clear();
+                        ListUtil.addAll(list, newList);
+                        if(!list.isEmpty())
+                            list.add(null);//底部圆角
+                        notifyDataSetChanged();
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        list.clear();
+                        notifyDataSetChanged();
+                    }
+                });
+    }
+
+
+    private void notifyDataSetChanged() {
+        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
+        refresh.setRefreshing(false);
+        view_list.getAdapter().notifyDataSetChanged();
+    }
+}

+ 239 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWelfareCenter.java

@@ -0,0 +1,239 @@
+package com.sheep.gamegroup.view.fragment;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Bundle;
+import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.Welfare;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.ViewHolder;
+import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
+import com.sheep.gamegroup.view.adapter.DownloadWelfareAdapter;
+import com.sheep.gamegroup.view.adapter.GiftCenterAdapter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+import butterknife.Unbinder;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by realicing on 2018/8/28.
+ * realicing@sina.com
+ */
+public class FgtWelfareCenter extends BaseFragment {
+    @BindView(R.id.refresh)
+    SwipeRefreshLayout refresh;
+    @BindView(R.id.wc_hot_welfare_list)
+    RecyclerView wcHotWelfareList;
+    @BindView(R.id.wc_all_welfare)
+    TextView wcAllWelfare;
+    @BindView(R.id.wc_download_welfare_list)
+    RecyclerView wcDownloadWelfareList;
+    @BindView(R.id.wc_all_gift)
+    TextView wcAllGift;
+    @BindView(R.id.wc_gift_center_list)
+    RecyclerView wcGiftCenterList;
+    @BindView(R.id.bottom_line_text)
+    TextView bottomLineText;
+    @BindView(R.id.bottom_line)
+    LinearLayout bottomLine;
+    Unbinder unbinder;
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.fgt_welfare_center;
+    }
+    private List<Welfare> hotWelfareList = ListUtil.emptyList();
+    private List<Welfare> downloadWelfareList = ListUtil.emptyList();
+    private List<Welfare> giftCenterList = ListUtil.emptyList();
+    private Activity activity;
+    @Override
+    public void onViewCreated() {
+        activity = getActivity();
+        Context context = SheepApp.getInstance();
+        //热门福利
+        LinearLayoutManager hotLayoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
+        wcHotWelfareList.setHasFixedSize(true);
+        wcHotWelfareList.setNestedScrollingEnabled(false);
+        wcHotWelfareList.setLayoutManager(hotLayoutManager);
+        wcHotWelfareList.setAdapter(new AdbCommonRecycler<Welfare>(context, hotWelfareList) {
+            @Override
+            public int getViewIdByType(int type) {
+                return R.layout.item_hot_welfare;
+            }
+
+            @Override
+            public void convert(ViewHolder holder, Welfare welfareCenter) {
+//                ImageView item_hot_welfare_iv = holder.getView(R.id.item_hot_welfare_iv);
+//                TextView item_hot_welfare_tv = holder.getView(R.id.item_hot_welfare_tv);
+//                if(welfareCenter == null){
+//                    ViewUtil.setDefaultText(item_hot_welfare_tv);
+//                } else {
+//                    //TODO 加载数据
+//                    ViewUtil.setText(item_hot_welfare_tv);
+//                }
+            }
+        });
+        //下载福利
+        LinearLayoutManager downloadLayoutManager = new LinearLayoutManager(context);
+        wcDownloadWelfareList.setHasFixedSize(true);
+        wcDownloadWelfareList.setNestedScrollingEnabled(false);
+        wcDownloadWelfareList.setLayoutManager(downloadLayoutManager);
+        wcDownloadWelfareList.setAdapter(new DownloadWelfareAdapter(activity, downloadWelfareList));
+        //礼包中心
+        LinearLayoutManager layoutManager = new LinearLayoutManager(context);
+        wcGiftCenterList.setHasFixedSize(true);
+        wcGiftCenterList.setNestedScrollingEnabled(false);
+        wcGiftCenterList.setLayoutManager(layoutManager);
+        wcGiftCenterList.setAdapter(new GiftCenterAdapter(activity, giftCenterList));
+        refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+            @Override
+            public void onRefresh() {
+                refreshHotWelfare = true;
+                refreshDownloadWelfare = true;
+                refreshGiftCenter = true;
+                refreshData();
+            }
+        });
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        refreshData();
+    }
+    private boolean refreshHotWelfare = true;
+    private boolean refreshDownloadWelfare = true;
+    private boolean refreshGiftCenter = true;
+    //刷新数据
+    private void refreshData() {
+        if(refreshHotWelfare || refreshDownloadWelfare || refreshGiftCenter) {
+            refresh.setRefreshing(true);
+        }
+        //热门福利
+        if(refreshHotWelfare) {
+            SheepApp.getInstance().getNetComponent().getApiService().getFindTagList()
+                    .subscribeOn(Schedulers.io())
+                    .observeOn(AndroidSchedulers.mainThread())
+                    .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                        @Override
+                        public void onNext(BaseMessage baseMessage) {
+                            refreshHotWelfare = false;
+                            ArrayList<Welfare> newList = baseMessage.getDataList(Welfare.class);
+                            hotWelfareList.clear();
+                            ListUtil.addAll(hotWelfareList, newList);
+                            wcHotWelfareList.getAdapter().notifyDataSetChanged();
+                            notifyDataSetChanged();
+                        }
+
+                        @Override
+                        public void onError(BaseMessage baseMessage) {
+                            refreshHotWelfare = false;
+                            hotWelfareList.clear();
+                            wcHotWelfareList.getAdapter().notifyDataSetChanged();
+                            notifyDataSetChanged();
+                        }
+                    });
+        }
+        //下载福利
+        if(refreshDownloadWelfare) {
+            SheepApp.getInstance().getNetComponent().getApiService().getFindTagList()
+                    .subscribeOn(Schedulers.io())
+                    .observeOn(AndroidSchedulers.mainThread())
+                    .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                        @Override
+                        public void onNext(BaseMessage baseMessage) {
+                            refreshDownloadWelfare = false;
+                            ArrayList<Welfare> newList = baseMessage.getDataList(Welfare.class);
+                            downloadWelfareList.clear();
+                            ListUtil.addAll(downloadWelfareList, newList);
+                            wcDownloadWelfareList.getAdapter().notifyDataSetChanged();
+                            notifyDataSetChanged();
+                        }
+
+                        @Override
+                        public void onError(BaseMessage baseMessage) {
+                            refreshDownloadWelfare = false;
+                            downloadWelfareList.clear();
+                            wcDownloadWelfareList.getAdapter().notifyDataSetChanged();
+                            notifyDataSetChanged();
+                        }
+                    });
+        }
+        //礼包中心
+        if(refreshGiftCenter) {
+            SheepApp.getInstance().getNetComponent().getApiService().getFindTagList()
+                    .subscribeOn(Schedulers.io())
+                    .observeOn(AndroidSchedulers.mainThread())
+                    .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                        @Override
+                        public void onNext(BaseMessage baseMessage) {
+                            refreshGiftCenter = false;
+                            ArrayList<Welfare> newList = baseMessage.getDataList(Welfare.class);
+                            giftCenterList.clear();
+                            ListUtil.addAll(giftCenterList, newList);
+                            wcGiftCenterList.getAdapter().notifyDataSetChanged();
+                            notifyDataSetChanged();
+                        }
+
+                        @Override
+                        public void onError(BaseMessage baseMessage) {
+                            refreshGiftCenter = false;
+                            giftCenterList.clear();
+                            wcGiftCenterList.getAdapter().notifyDataSetChanged();
+                            notifyDataSetChanged();
+                        }
+                    });
+        }
+    }
+
+    private void notifyDataSetChanged() {
+        if(!refreshHotWelfare && !refreshDownloadWelfare && !refreshGiftCenter)
+            refresh.setRefreshing(false);
+    }
+
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+        // TODO: inflate a fragment view
+        View rootView = super.onCreateView(inflater, container, savedInstanceState);
+        unbinder = ButterKnife.bind(this, rootView);
+        return rootView;
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        unbinder.unbind();
+    }
+
+    @OnClick({R.id.wc_all_welfare, R.id.wc_all_gift})
+    public void onViewClicked(View view) {
+        switch (view.getId()) {
+            case R.id.wc_all_welfare://全部福利
+                Jump2View.getInstance().goWelfareList(activity);
+                break;
+            case R.id.wc_all_gift://全部礼包
+                Jump2View.getInstance().goGiftCenter(activity);
+                break;
+        }
+    }
+}

+ 121 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWelfareUseRecord.java

@@ -0,0 +1,121 @@
+package com.sheep.gamegroup.view.fragment;
+
+import android.app.Activity;
+import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.Welfare;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.SysAppUtil;
+import com.sheep.gamegroup.view.adapter.GiftCenterAdapter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+
+import java.util.List;
+
+import butterknife.BindView;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
+import rx.schedulers.Schedulers;
+
+/**
+ * 我的福利--使用记录
+ * Created by realicing on 2018/8/28.
+ * realicing@sina.com
+ */
+public class FgtWelfareUseRecord extends BaseFragment {
+    @Override
+    public int getLayoutId() {
+        return R.layout.net_empty_fresh_list_not_wrap;
+    }
+
+    @Override
+    public void onViewCreated() {
+        initView();
+        initListener();
+        initData();
+    }
+
+    @BindView(R.id.refresh)
+    SwipeRefreshLayout refresh;
+    @BindView(R.id.empty_view)
+    View empty_view;
+    @BindView(R.id.title)
+    View title;
+    @BindView(R.id.check_net_ll)
+    View check_net_ll;
+    @BindView(R.id.view_list)
+    RecyclerView view_list;
+
+    public void initView() {
+        activity = getActivity();
+        title.setVisibility(View.GONE);
+        check_net_ll.setVisibility(View.GONE);
+
+    }
+
+    private Activity activity;
+    private List<Welfare> list = ListUtil.emptyList();
+    public void initListener() {
+        refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+            @Override
+            public void onRefresh() {
+                initData();
+                refresh.setRefreshing(false);
+            }
+        });
+
+        view_list.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
+        view_list.setAdapter(new GiftCenterAdapter(activity, list));
+    }
+
+
+    public void initData() {
+        empty_view.setVisibility(View.INVISIBLE);
+        SysAppUtil.checkNet(new Action1<Integer>() {
+            @Override
+            public void call(Integer result) {
+                if (result != 0) {//无网络
+                    if (check_net_ll != null)
+                        check_net_ll.setVisibility(View.VISIBLE);
+                } else {
+                    if (check_net_ll != null)
+                        check_net_ll.setVisibility(View.GONE);
+                }
+            }
+        });
+        SheepApp.getInstance().getNetComponent().getApiService().getFindAppReservationList(1, 100)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        List<Welfare> newList = baseMessage.getDataList(Welfare.class);
+                        list.clear();
+                        ListUtil.addAll(list, newList);
+                        if(!list.isEmpty())
+                            list.add(null);//底部圆角
+                        notifyDataSetChanged();
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        list.clear();
+                        notifyDataSetChanged();
+                    }
+                });
+    }
+
+
+    private void notifyDataSetChanged() {
+        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
+        refresh.setRefreshing(false);
+        view_list.getAdapter().notifyDataSetChanged();
+    }
+}

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

@@ -59,6 +59,9 @@ public class MessageCenterFragment extends Fragment implements MessageLeftAdapte
     @Override
     public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
         super.onViewCreated(view, savedInstanceState);
+        if (mList==null||mList.isEmpty()){
+            return;
+        }
         adapter = new MessageLeftAdapter(mContext, mList, this);
         LinearLayoutManager manager = new LinearLayoutManager(mContext);
         manager.setOrientation(OrientationHelper.VERTICAL);

+ 33 - 2
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java

@@ -3,12 +3,21 @@ package com.sheep.jiuyan.samllsheep.utils;
 import android.app.Activity;
 import android.graphics.drawable.ColorDrawable;
 import android.support.annotation.DrawableRes;
+import android.support.design.widget.TabLayout;
+import android.support.v4.app.Fragment;
+import android.support.v4.view.ViewPager;
 import android.view.View;
 import android.widget.Button;
 import android.widget.ImageButton;
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import com.kfzs.duanduan.mine.GiftpackListAdapter;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.view.adapter.AdpTryMakemoney;
+import com.sheep.gamegroup.view.fragment.FgtTryMakeMoney;
+import com.sheep.gamegroup.view.fragment.FgtWelfareCenter;
 import com.sheep.jiuyan.samllsheep.R;
 
 
@@ -185,7 +194,7 @@ public class TitleBarUtils {
      * @param backgroundColorResId 设置背景,0为透明,-1不变,-2为Gone,其它为ResID
      * @param onClickListener      点击时的操作。
      */
-    public void setRightBotton(Activity activity, String btnText, int backgroundColorResId,
+    public TitleBarUtils setRightBotton(Activity activity, String btnText, int backgroundColorResId,
                                View.OnClickListener onClickListener) {
         Button button = activity.findViewById(R.id.btn_baseactivity_right);
         ImageButton imageButton = activity.findViewById(R.id.ibtn_baseactivity_right);
@@ -195,7 +204,7 @@ public class TitleBarUtils {
             button.setBackgroundColor(0x00000000);
         } else if (backgroundColorResId == -2) {
             button.setVisibility(View.GONE);
-            return;
+            return this;
         } else if (backgroundColorResId != -1) {
             button.setBackgroundColor(backgroundColorResId);
         }
@@ -207,6 +216,7 @@ public class TitleBarUtils {
         if (onClickListener != null) {
             button.setOnClickListener(onClickListener);
         }
+        return this;
     }
 
 
@@ -369,4 +379,25 @@ public class TitleBarUtils {
         secondImageButton.setOnClickListener(secondOnclick);
         return this;
     }
+
+    public TitleBarUtils addTabs(BaseActivity activity, ViewPager viewPager, String tab1, Fragment fragment1, String tab2, Fragment fragment2) {
+        //设置标题不可见
+        TextView titleView = activity.findViewById(R.id.txt_baseactivity_title);
+        titleView.setVisibility(View.GONE);
+        //设置tab可见
+        TabLayout tabLayout = activity.findViewById(R.id.title_tab);
+        tabLayout.setVisibility(View.VISIBLE);
+
+        GiftpackListAdapter adapter = new GiftpackListAdapter(activity.getSupportFragmentManager(), activity);
+        adapter.add(fragment1, tab1);
+        adapter.add(fragment2, tab2);
+
+        viewPager.setOffscreenPageLimit(2);
+        viewPager.setAdapter(adapter);
+
+        tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(viewPager));
+        tabLayout.setupWithViewPager(viewPager);
+//        CommonUtil.getInstance().reflex(tabLayout, activity);
+        return this;
+    }
 }

+ 40 - 21
app/src/main/res/layout/act_audit_layout.xml

@@ -6,7 +6,13 @@
     android:background="@color/white"
     android:orientation="vertical">
 
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_marginTop="24dp" />
+
     <android.support.constraint.ConstraintLayout
+        android:id="@+id/root_1"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="@mipmap/audit_top_bg"
@@ -17,9 +23,9 @@
             android:id="@+id/img_baseactivity_title"
             android:layout_width="wrap_content"
             android:layout_height="?attr/actionBarSize"
-            android:paddingStart="@dimen/content_padding_20"
-            android:paddingEnd="@dimen/content_padding_20"
             android:gravity="center_vertical"
+            android:paddingEnd="@dimen/content_padding_20"
+            android:paddingStart="@dimen/content_padding_20"
             android:scaleType="centerInside"
             android:src="@drawable/narrow_back_white"
             app:layout_constraintStart_toStartOf="parent"
@@ -43,62 +49,66 @@
             android:id="@+id/number_tv"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:textSize="@dimen/text_size_3"
-            android:textColor="@color/white"
-            android:text=""
             android:gravity="center"
-            app:layout_constraintTop_toBottomOf="@+id/txt_baseactivity_title"
+            android:text=""
+            android:textColor="@color/white"
+            android:textSize="@dimen/text_size_3"
             app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toStartOf="parent"/>
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/txt_baseactivity_title" />
 
         <LinearLayout
-            android:layout_below="@+id/number_tv"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            app:layout_constraintTop_toBottomOf="@+id/number_tv"
+            android:layout_below="@+id/number_tv"
+            android:layout_marginTop="@dimen/content_padding_15"
             app:layout_constraintBottom_toBottomOf="parent"
-            android:layout_marginTop="@dimen/content_padding_15">
+            app:layout_constraintTop_toBottomOf="@+id/number_tv">
+
             <TextView
                 android:id="@+id/audit_total_complete_tv"
                 android:layout_width="0dp"
-                android:layout_weight="1"
                 android:layout_height="wrap_content"
+                android:layout_weight="1"
                 android:gravity="center"
                 android:text=""
                 android:textColor="@color/white"
-                android:textSize="@dimen/text_size_13"/>
+                android:textSize="@dimen/text_size_13" />
+
             <View
                 android:layout_width="1dp"
                 android:layout_height="20dp"
                 android:layout_gravity="center"
-                android:background="@color/disenable_color"/>
+                android:background="@color/disenable_color" />
+
             <TextView
                 android:id="@+id/audit_total_money_tv"
                 android:layout_width="0dp"
-                android:layout_weight="1"
                 android:layout_height="wrap_content"
+                android:layout_weight="1"
                 android:gravity="center"
                 android:text=""
                 android:textColor="@color/white"
-                android:textSize="@dimen/text_size_13"/>
+                android:textSize="@dimen/text_size_13" />
+
             <View
                 android:layout_width="1dp"
                 android:layout_height="20dp"
                 android:layout_gravity="center"
-                android:background="@color/disenable_color"/>
+                android:background="@color/disenable_color" />
 
             <LinearLayout
                 android:layout_width="0dp"
-                android:layout_weight="1"
                 android:layout_height="wrap_content"
+                android:layout_weight="1"
                 android:gravity="center_vertical"
                 android:orientation="horizontal">
 
                 <TextView
                     android:id="@+id/audit_total_welfare_tv"
                     android:layout_width="0dp"
-                    android:layout_weight="1"
                     android:layout_height="wrap_content"
+                    android:layout_weight="1"
                     android:gravity="center"
                     android:text=""
                     android:textColor="@color/white"
@@ -115,9 +125,18 @@
         </LinearLayout>
     </android.support.constraint.ConstraintLayout>
 
-    <android.support.design.widget.TabLayout
-        android:id="@+id/indicator"
-        style="@style/style_tab"/>
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="48dp"
+        android:background="@color/white"
+        android:orientation="vertical">
+
+        <android.support.design.widget.TabLayout
+            android:id="@+id/indicator"
+            style="@style/style_tab" />
+
+        <include layout="@layout/line_1px_hor" />
+    </LinearLayout>
 
     <android.support.v4.view.ViewPager
         android:id="@+id/pager"

+ 16 - 0
app/src/main/res/layout/act_game_center.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    tools:context="com.sheep.gamegroup.view.activity.ActGameCenter">
+
+    <include layout="@layout/title" />
+
+    <android.support.v4.view.ViewPager
+        android:id="@+id/act_game_center_vp"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+
+</LinearLayout>

+ 5 - 9
app/src/main/res/layout/fgt_find.xml

@@ -5,16 +5,12 @@
     android:background="@color/bg_gray"
     android:orientation="vertical">
 
-    <TextView
+    <View
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="@color/white"
-        android:gravity="center"
-        android:padding="@dimen/dp_10"
-        android:text="@string/main_tab_find"
-        android:textColor="@color/black"
-        android:textSize="18sp"
-        android:visibility="gone" />
+        android:layout_height="0dp"
+        android:layout_marginTop="24dp" />
+
+    <include layout="@layout/title" />
 
     <android.support.design.widget.TabLayout
         android:id="@+id/indicator"

+ 4 - 4
app/src/main/res/layout/fgt_personacenter_item_top.xml

@@ -46,21 +46,21 @@
                 android:layout_alignParentRight="true"
                 android:background="@color/translate"
                 android:gravity="center"
-                android:src="@mipmap/add_black_img" />
+                android:src="@mipmap/add_black_img"
+                android:visibility="gone" />
             <!--右边设置图标按钮-->
             <ImageButton
                 android:id="@+id/ibtn_baseactivity_right"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentBottom="true"
-               android:layout_toLeftOf="@id/ibtn_baseactivity_message"
+                android:layout_alignParentEnd="true"
+                android:layout_marginEnd="16dp"
                 android:background="@color/translate"
                 android:gravity="center"
                 android:src="@mipmap/setting" />
 
 
-
-
             <include
                 layout="@layout/title_bottom_line"
                 android:layout_width="match_parent"

+ 3 - 1
app/src/main/res/layout/fgt_personalcenter_layout.xml

@@ -5,10 +5,12 @@
     android:scrollbars="none">
 
     <LinearLayout
+        android:id="@+id/root_4"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="@color/bg_gray"
-        android:orientation="vertical">
+        android:orientation="vertical"
+        android:layout_marginTop="24dp">
 
         <include layout="@layout/fgt_personacenter_item_top" />
 

+ 78 - 0
app/src/main/res/layout/fgt_welfare_center.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/refresh"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/white">
+
+    <android.support.v4.widget.NestedScrollView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical">
+
+            <RelativeLayout style="@style/style_wc_rl">
+
+                <TextView
+                    style="@style/style_wc_line_title"
+                    android:text="热门福利" />
+            </RelativeLayout>
+
+            <android.support.v7.widget.RecyclerView
+                android:id="@+id/wc_hot_welfare_list"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content" />
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="10dp"
+                android:background="#fff5f5f5" />
+
+            <RelativeLayout style="@style/style_wc_rl">
+
+                <TextView
+                    style="@style/style_wc_line_title"
+                    android:text="下载福利" />
+
+                <TextView
+                    android:id="@+id/wc_all_welfare"
+                    style="@style/style_wc_more"
+                    android:text="全部福利" />
+            </RelativeLayout>
+
+            <android.support.v7.widget.RecyclerView
+                android:id="@+id/wc_download_welfare_list"
+                android:layout_width="match_parent"
+                android:paddingTop="4dp"
+                android:paddingBottom="4dp"
+                android:layout_height="wrap_content" />
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="10dp"
+                android:background="#fff5f5f5" />
+
+            <RelativeLayout style="@style/style_wc_rl">
+
+                <TextView
+                    style="@style/style_wc_line_title"
+                    android:text="礼包中心" />
+
+                <TextView
+                    android:id="@+id/wc_all_gift"
+                    style="@style/style_wc_more"
+                    android:text="全部礼包" />
+            </RelativeLayout>
+
+            <android.support.v7.widget.RecyclerView
+                android:id="@+id/wc_gift_center_list"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content" />
+
+            <include layout="@layout/find_item_bottom" />
+        </LinearLayout>
+    </android.support.v4.widget.NestedScrollView>
+</android.support.v4.widget.SwipeRefreshLayout>

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

@@ -133,9 +133,9 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
+            android:layout_marginEnd="13dp"
             android:layout_alignParentRight="true"
             android:layout_marginBottom="@dimen/content_padding_20"
-            android:layout_marginEnd="13dp"
             android:gravity="right"
             android:paddingBottom="@dimen/content_padding_10"
             android:paddingTop="@dimen/content_padding_10"

+ 10 - 5
app/src/main/res/layout/homepage_item_get_award.xml

@@ -19,22 +19,25 @@
         android:id="@+id/homepage_item_get_award_name_tv"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginStart="@dimen/common_margin_10"
+        android:layout_marginStart="@dimen/content_padding_30"
         android:text="你还有329元的奖励未领取"
         android:textColor="@color/black_333333"
         android:textSize="@dimen/text_size_3"
-        app:layout_constraintLeft_toRightOf="@id/homepage_item_get_award_iv" />
+        app:layout_constraintLeft_toRightOf="@id/homepage_item_get_award_iv"
+        android:paddingTop="@dimen/content_padding_3"/>
 
     <TextView
         android:id="@+id/homepage_item_money_tv"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="@dimen/common_margin_10"
-        android:text=""
+        android:text="11"
         android:textColor="@color/black_999999"
         android:textSize="11sp"
         app:layout_constraintStart_toStartOf="@id/homepage_item_get_award_name_tv"
-        app:layout_constraintTop_toBottomOf="@id/homepage_item_get_award_name_tv" />
+        app:layout_constraintTop_toBottomOf="@id/homepage_item_get_award_name_tv"
+        app:layout_constraintBottom_toBottomOf="@+id/homepage_item_get_award_iv"
+        android:paddingBottom="@dimen/content_padding_3"/>
 
     <TextView
         android:id="@+id/homepage_item_juan_tv"
@@ -46,6 +49,8 @@
         android:textColor="@color/black_999999"
         android:textSize="11sp"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/homepage_item_get_award_name_tv" />
+        app:layout_constraintTop_toBottomOf="@id/homepage_item_get_award_name_tv"
+        app:layout_constraintBottom_toBottomOf="@+id/homepage_item_get_award_iv"
+        android:paddingBottom="@dimen/content_padding_3"/>
 
 </android.support.constraint.ConstraintLayout>

+ 152 - 0
app/src/main/res/layout/item_download_welfare.xml

@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+
+    <android.support.constraint.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="16dp"
+        android:layout_marginStart="16dp">
+
+        <ImageView
+            android:id="@+id/item_download_welfare_iv"
+            android:layout_width="62dp"
+            android:layout_height="62dp"
+            android:layout_marginTop="16dp"
+            android:src="@drawable/icon_lj"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="62dp"
+            android:layout_marginStart="@dimen/content_padding"
+            android:orientation="vertical"
+            android:layout_marginTop="16dp"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintEnd_toStartOf="@+id/item_download_welfare_btn_top"
+            app:layout_constraintStart_toEndOf="@+id/item_download_welfare_iv">
+
+            <TextView
+                android:id="@+id/item_download_welfare_name_tv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:ellipsize="middle"
+                android:gravity="start"
+                android:maxLines="2"
+                android:text="游戏名称"
+                android:textColor="#444444"
+                android:textSize="14sp" />
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="3" />
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:orientation="horizontal">
+
+                <TextView
+                    android:id="@+id/item_download_welfare_num_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="第充500送500"
+                    android:textColor="#cc8e8e8e"
+                    android:textSize="10sp" />
+
+                <TextView
+                    android:id="@+id/item_download_welfare_num_tv1"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="@dimen/content_padding"
+                    android:text=""
+                    android:textColor="#cc8e8e8e"
+                    android:textSize="10sp" />
+
+            </LinearLayout>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="1" />
+
+            <TextView
+                android:id="@+id/item_download_welfare_date_tv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="@dimen/content_padding_8"
+                android:layout_marginTop="@dimen/content_padding_2"
+                android:lines="1"
+                android:text="2018/08/20"
+                android:textColor="#8e8e8e"
+                android:textSize="10sp" />
+        </LinearLayout>
+
+        <ImageView
+            android:id="@+id/item_download_welfare_iv2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="14dp"
+            android:layout_marginTop="5dp"
+            app:layout_constraintEnd_toStartOf="@+id/item_download_welfare_btn_top"
+            app:layout_constraintTop_toTopOf="parent"
+            android:src="@mipmap/yilingq"/>
+        <TextView
+            android:id="@+id/item_download_welfare_money"
+            android:layout_width="@dimen/find_bt_with"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:text="+10元"
+            android:textColor="@color/txt_red"
+            android:textSize="15sp"
+            app:layout_constraintEnd_toEndOf="parent"
+            android:layout_marginTop="21dp"
+            app:layout_constraintTop_toTopOf="parent" />
+        <TextView
+            android:id="@+id/item_download_welfare_btn_top"
+            style="@style/style_button_find"
+            android:text="取消任务"
+            android:visibility="invisible"
+            app:layout_constraintEnd_toEndOf="parent"
+            android:layout_marginTop="21dp"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <TextView
+            android:id="@+id/item_download_welfare_btn_center"
+            style="@style/style_button_find"
+            android:layout_centerInParent="true"
+            android:text="取消任务"
+            android:visibility="gone"
+            app:layout_constraintBottom_toBottomOf="@+id/item_download_welfare_iv"
+            app:layout_constraintEnd_toEndOf="parent"
+            android:layout_marginTop="16dp"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <TextView
+            android:id="@+id/item_download_welfare_btn_bottom"
+            style="@style/style_button_find"
+            android:text="取消任务"
+            android:layout_marginBottom="5dp"
+            app:layout_constraintBottom_toBottomOf="@+id/item_download_welfare_iv"
+            app:layout_constraintEnd_toEndOf="parent" />
+    </android.support.constraint.ConstraintLayout>
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="16dp" />
+
+    <View
+        android:id="@+id/item_download_welfare_line"
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginStart="16dp"
+        android:background="@color/gray_F2F2F2" />
+</LinearLayout>

+ 30 - 0
app/src/main/res/layout/item_hot_welfare.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_gravity="center"
+    android:paddingStart="16dp"
+    android:paddingEnd="6dp"
+    android:paddingTop="20dp"
+    android:paddingBottom="20dp"
+    android:orientation="vertical">
+
+    <ImageView
+        android:id="@+id/item_hot_welfare_iv"
+        android:layout_width="62dp"
+        android:layout_height="62dp"
+        android:layout_gravity="center"
+        android:src="@drawable/icon_lj"/>
+
+    <TextView
+        android:id="@+id/item_hot_welfare_tv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="12dp"
+        android:ellipsize="end"
+        android:textColor="#333333"
+        android:textSize="12sp"
+        android:lines="1"
+        android:text="1234"/>
+</LinearLayout>

+ 20 - 12
app/src/main/res/layout/title.xml

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:id="@+id/layout_navigationBar"
-                android:layout_width="match_parent"
-                android:layout_height="?attr/actionBarSize"
-                android:background="@color/white_F9F9F9">
+    android:id="@+id/layout_navigationBar"
+    android:layout_width="match_parent"
+    android:layout_height="?attr/actionBarSize"
+    android:background="@color/white_F9F9F9">
 
     <ImageView
         android:id="@+id/img_baseactivity_title"
@@ -15,6 +15,14 @@
         android:scaleType="centerInside"
         android:src="@drawable/narrow_back_black"/>
 
+    <android.support.design.widget.TabLayout
+        android:id="@+id/title_tab"
+        style="@style/style_tab"
+        android:layout_width="wrap_content"
+        android:layout_centerInParent="true"
+        android:minWidth="100dp"
+        android:visibility="gone"
+        />
     <TextView
         android:id="@+id/txt_baseactivity_title"
         android:layout_width="wrap_content"
@@ -33,23 +41,23 @@
 
     <RelativeLayout
         android:id="@+id/btn_baseactivity_right_layout"
-        android:layout_width="@dimen/app_nav_toolbar_height"
+        android:layout_width="wrap_content"
         android:layout_height="@dimen/app_nav_toolbar_height"
-        android:layout_alignParentRight="true"
+        android:layout_alignParentEnd="true"
         android:layout_centerInParent="true"
         android:visibility="visible">
 
         <Button
             android:id="@+id/btn_baseactivity_right"
             style="?android:attr/borderlessButtonStyle"
-            android:layout_width="@dimen/app_nav_toolbar_height"
+            android:layout_width="wrap_content"
             android:layout_height="@dimen/app_nav_toolbar_height"
-            android:layout_marginRight="5dp"
+            android:layout_marginEnd="17dp"
             android:background="@color/translate"
-            android:gravity="center"
-            android:minWidth="?attr/actionBarSize"
+            android:gravity="center_vertical|end"
+            android:lines="1"
             android:textColor="@color/black_text_deep"
-            android:textSize="@dimen/text_size_3"
+            android:textSize="12sp"
             android:layout_alignParentTop="true"
             android:layout_alignParentEnd="true" />
 
@@ -82,7 +90,7 @@
         android:background="@color/translate"
         android:gravity="center"
         android:minWidth="?attr/actionBarSize"
-        android:layout_toLeftOf="@+id/btn_baseactivity_right_layout"
+        android:layout_toLeftOf="@+id/ibtn_baseactivity_right"
         android:visibility="gone"/>
 
     <TextView

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

@@ -11,7 +11,7 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_marginBottom="60dp"
-        android:layout_marginTop="-60dp"
+        android:layout_marginTop="-36dp"
         android:orientation="vertical"
         android:fillViewport="true"
         android:layout_gravity="fill_vertical"

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

@@ -11,6 +11,7 @@
         android:layout_marginRight="10dp"
         android:layout_marginTop="@dimen/dp_10"
         android:layout_marginBottom="@dimen/dp_10"
+        android:layout_gravity="center_horizontal"
         android:lineSpacingExtra="4dp"
         android:text="内容"
         android:gravity="center"

BIN
app/src/main/res/mipmap-xxhdpi/yilingq.png


+ 30 - 0
app/src/main/res/values/dd_styles.xml

@@ -450,4 +450,34 @@
         <item name="android:textColorHint">#A0D3F6</item>
         <item name="android:textSize">15sp</item>
     </style>
+    <!--福利中心中带线标题与点击查看更多的容器-->
+    <style name="style_wc_rl">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:layout_marginEnd">15dp</item>
+        <item name="android:layout_marginStart">15dp</item>
+        <item name="android:layout_marginTop">18dp</item>
+    </style>
+    <!--福利中心中带线标题-->
+    <style name="style_wc_line_title">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:drawablePadding">@dimen/content_padding_default</item>
+        <item name="android:drawableStart">?line_short</item>
+        <item name="android:gravity">center_vertical</item>
+        <item name="android:textColor">#2c2c2c</item>
+        <item name="android:textSize">15sp</item>
+    </style>
+    <!--福利中心中点击查看更多-->
+    <style name="style_wc_more">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:layout_alignParentEnd">true</item>
+        <item name="android:layout_centerVertical">true</item>
+        <item name="android:drawableEnd">@mipmap/x_ic_next</item>
+        <item name="android:drawablePadding">7dp</item>
+        <item name="android:gravity">end</item>
+        <item name="android:textColor">#666666</item>
+        <item name="android:textSize">12sp</item>
+    </style>
 </resources>

+ 5 - 5
app/src/main/res/values/strings.xml

@@ -82,12 +82,12 @@
     <string name="cancel">取消</string>
 
     <string name="audit_total_audit">%s\n审核中</string>
-    <string name="audit_total_complete">%s个\n\n累计完成</string>
-    <string name="audit_total_money">%s元\n\n累计现金</string>
-    <string name="audit_total_welfare">%s元\n\n累计福利</string>
+    <string name="audit_total_complete">%s个\n累计完成</string>
+    <string name="audit_total_money">%s元\n累计现金</string>
+    <string name="audit_total_welfare">%s元\n累计福利</string>
     <string name="my_invitation_str">我的邀请码:%s</string>
 
     <string name="homepage_award">你还有%s元的奖励未领取</string>
-    <string name="homepage_cash">现金任务%s元</string>
-    <string name="homepage_welfare">游戏福利%s元</string>
+    <string name="homepage_cash">现金任务:%s元</string>
+    <string name="homepage_welfare">游戏福利:%s元</string>
 </resources>