Переглянути джерело

Merge branch 'master' into sheep_tinker_3.0.2

# Conflicts:
#	app/build.gradle
zengjiebin 7 роки тому
батько
коміт
cfc4cc67ca
100 змінених файлів з 4494 додано та 850 видалено
  1. 2 1
      .gitignore
  2. 7 0
      app/build.gradle
  3. BIN
      app/libs/com.kfzs.safe.aar
  4. 22 6
      app/src/main/AndroidManifest.xml
  5. 72 6
      app/src/main/java/com/kfzs/duanduan/ActMain.java
  6. 40 0
      app/src/main/java/com/kfzs/duanduan/adp/ViewPagerFragmentStateAdapter.java
  7. 29 29
      app/src/main/java/com/kfzs/duanduan/fragment/FgtAskgetmoney.java
  8. 1 3
      app/src/main/java/com/kfzs/duanduan/fragment/FgtCreditCardTaskList.java
  9. 47 55
      app/src/main/java/com/kfzs/duanduan/fragment/FgtFind.java
  10. 20 0
      app/src/main/java/com/kfzs/duanduan/fragment/FgtNull.java
  11. 9 3
      app/src/main/java/com/kfzs/duanduan/fragment/FgtPersonalCenter.java
  12. 9 2
      app/src/main/java/com/kfzs/duanduan/fragment/FgtRouser.java
  13. 219 27
      app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java
  14. 5 3
      app/src/main/java/com/kfzs/duanduan/mine/GiftpackListAdapter.java
  15. 25 0
      app/src/main/java/com/kfzs/duanduan/react/FileUtil.java
  16. 2 1
      app/src/main/java/com/kfzs/duanduan/react/MainTab.java
  17. 59 5
      app/src/main/java/com/kfzs/duanduan/react/TabsHelper.java
  18. 13 8
      app/src/main/java/com/kfzs/duanduan/react/upfile/UpFileUtils.java
  19. 20 0
      app/src/main/java/com/kfzs/duanduan/utils/NumberFormatUtils.java
  20. 10 1
      app/src/main/java/com/sheep/gamegroup/absBase/AbsChooseImageActivity.java
  21. 8 13
      app/src/main/java/com/sheep/gamegroup/absBase/BaseActivity.java
  22. 9 0
      app/src/main/java/com/sheep/gamegroup/db/DBUtils.java
  23. 0 16
      app/src/main/java/com/sheep/gamegroup/di/components/PhoneComponent.java
  24. 2 1
      app/src/main/java/com/sheep/gamegroup/di/modules/NetModule.java
  25. 1 2
      app/src/main/java/com/sheep/gamegroup/helper/TaskHelper.java
  26. 16 0
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  27. 9 0
      app/src/main/java/com/sheep/gamegroup/model/api/ICallBack.java
  28. 42 0
      app/src/main/java/com/sheep/gamegroup/model/cookie/CookieManager.java
  29. 2 1
      app/src/main/java/com/sheep/gamegroup/model/entity/DialogConfig.java
  30. 21 1
      app/src/main/java/com/sheep/gamegroup/model/entity/LoginEntity.java
  31. 10 1
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskAcceptedEty.java
  32. 15 8
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskEty.java
  33. 15 5
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskReleaseEty.java
  34. 8 0
      app/src/main/java/com/sheep/gamegroup/model/entity/Welfare.java
  35. 2 0
      app/src/main/java/com/sheep/gamegroup/model/util/SheepSubscriber.java
  36. 1 1
      app/src/main/java/com/sheep/gamegroup/presenter/LoginPresenter.java
  37. 0 3
      app/src/main/java/com/sheep/gamegroup/presenter/PhonePresenter.java
  38. 0 20
      app/src/main/java/com/sheep/gamegroup/util/BinaryUtil.java
  39. 1 3
      app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java
  40. 37 42
      app/src/main/java/com/sheep/gamegroup/util/DataUtil.java
  41. 56 21
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  42. 19 0
      app/src/main/java/com/sheep/gamegroup/util/PngUtil.java
  43. 397 0
      app/src/main/java/com/sheep/gamegroup/util/ScreenShotListenManager.java
  44. 8 1
      app/src/main/java/com/sheep/gamegroup/util/TestUtil.java
  45. 4 1
      app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java
  46. 81 4
      app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java
  47. 192 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActBindMobileRegister.java
  48. 265 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActDownloadWelfareList.java
  49. 2 2
      app/src/main/java/com/sheep/gamegroup/view/activity/ActFindInformation.java
  50. 51 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGameCenter.java
  51. 266 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGiftCenter.java
  52. 113 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMyWelfare.java
  53. 144 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActSheepPngList.java
  54. 89 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActivityMessages.java
  55. 240 55
      app/src/main/java/com/sheep/gamegroup/view/activity/LoginAct.java
  56. 56 0
      app/src/main/java/com/sheep/gamegroup/view/activity/MessageInteractionDetailActivity.java
  57. 51 0
      app/src/main/java/com/sheep/gamegroup/view/activity/MessageReplyDetailActivity.java
  58. 0 337
      app/src/main/java/com/sheep/gamegroup/view/activity/PhoneAct.java
  59. 73 25
      app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAct.java
  60. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailCreditCardAct.java
  61. 1 1
      app/src/main/java/com/sheep/gamegroup/view/adapter/CreditCardProgressQueryAdp.java
  62. 1 1
      app/src/main/java/com/sheep/gamegroup/view/adapter/CreditCardTaskAdp.java
  63. 40 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/DownloadWelfareAdapter.java
  64. 41 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/GiftCenterAdapter.java
  65. 37 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/MessageAdapter.java
  66. 82 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/MessageInteractionAdapter.java
  67. 105 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/MessageLeftAdapter.java
  68. 5 7
      app/src/main/java/com/sheep/gamegroup/view/adapter/TaskListItemAdp.java
  69. 5 5
      app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java
  70. 1 1
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtAskGetMoneyRank.java
  71. 143 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtDownloadWelfare.java
  72. 3 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMainAudit.java
  73. 121 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMyGift.java
  74. 5 26
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtTryMakeMoney.java
  75. 239 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWelfareCenter.java
  76. 121 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWelfareUseRecord.java
  77. 78 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/MessageCenterFragment.java
  78. 67 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/MessageReplyFragment.java
  79. 20 4
      app/src/main/java/com/sheep/jiuyan/samllsheep/BaseApplication.java
  80. 18 7
      app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java
  81. 37 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/utils/FileUtil.java
  82. 0 82
      app/src/main/java/com/sheep/jiuyan/samllsheep/utils/HexUtils.java
  83. 33 2
      app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java
  84. 6 0
      app/src/main/jni/Android.mk
  85. 1 0
      app/src/main/jni/Application.mk
  86. 29 0
      app/src/main/jni/com_sheep_gamegroup_util_PngUtil.h
  87. 337 0
      app/src/main/jni/pngUtil.c
  88. BIN
      app/src/main/jniLibs/arm64-v8a/libindoor.so
  89. BIN
      app/src/main/jniLibs/arm64-v8a/libjcore120.so
  90. BIN
      app/src/main/jniLibs/arm64-v8a/liblocSDK7b.so
  91. BIN
      app/src/main/jniLibs/arm64-v8a/libsecurityenv.so
  92. BIN
      app/src/main/jniLibs/armeabi-v7a/libindoor.so
  93. BIN
      app/src/main/jniLibs/armeabi-v7a/libjcore120.so
  94. BIN
      app/src/main/jniLibs/armeabi-v7a/liblocSDK7b.so
  95. BIN
      app/src/main/jniLibs/armeabi-v7a/libsecurityenv.so
  96. BIN
      app/src/main/jniLibs/armeabi/libindoor.so
  97. BIN
      app/src/main/jniLibs/armeabi/libjcore120.so
  98. BIN
      app/src/main/jniLibs/armeabi/liblocSDK7b.so
  99. BIN
      app/src/main/jniLibs/armeabi/libsecurityenv.so
  100. 0 0
      app/src/main/jniLibs/mips/libjcore120.so

+ 2 - 1
.gitignore

@@ -9,4 +9,5 @@
 .externalNativeBuild
 /.idea
 /kfzslibrary
-/banner
+/banner
+/app/src/main/obj

+ 7 - 0
app/build.gradle

@@ -110,6 +110,13 @@ android {
 
         }
     }
+    sourceSets {
+        main() {
+            jniLibs.srcDirs = ['src/main/libs']
+            jni.srcDirs = [] //屏蔽掉默认的jni编译生成过程
+        }
+    }
+
 }
 
 repositories {

BIN
app/libs/com.kfzs.safe.aar


+ 22 - 6
app/src/main/AndroidManifest.xml

@@ -174,9 +174,6 @@
             </intent-filter>
         </activity>
 
-        <activity android:name="com.sheep.gamegroup.view.activity.PhoneAct"
-            android:configChanges="keyboardHidden|screenSize|orientation"
-            android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.PersonalCenterAct"
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.WithdrawalAct"
@@ -202,6 +199,9 @@
         <activity android:name="com.sheep.gamegroup.view.activity.ChangeTelAct"
             android:screenOrientation="portrait"
             android:launchMode="singleTask"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActBindMobileRegister"
+            android:screenOrientation="portrait"
+            android:launchMode="singleTask"/>
         <activity android:name="com.sheep.gamegroup.view.activity.TaskDetailAct"
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.DialogToastAct"
@@ -358,9 +358,6 @@
         <activity
             android:name="com.sheep.gamegroup.view.activity.FeedbackAct"
             android:screenOrientation="portrait" />
-        <activity
-            android:name="com.sheep.gamegroup.view.activity.ActMainGame"
-            android:screenOrientation="portrait" />
 
 
         <activity
@@ -562,6 +559,8 @@
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActSheepApkList"
             android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActSheepPngList"
+            android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActFindGame"
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActFindInformation"
@@ -577,6 +576,23 @@
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActSetting"
             android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActivityMessages"
+            android:screenOrientation="portrait"/>
+        <activity
+            android:name="com.sheep.gamegroup.view.activity.ActMainGame"
+            android:screenOrientation="portrait" />
+        <activity android:name="com.sheep.gamegroup.view.activity.ActGameCenter"
+            android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActDownloadWelfareList"
+            android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActGiftCenter"
+            android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActMyWelfare"
+            android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.MessageReplyDetailActivity"
+            android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.MessageInteractionDetailActivity"
+            android:exported="true"/>
 
         <!--start幂动科技-->
 

+ 72 - 6
app/src/main/java/com/kfzs/duanduan/ActMain.java

@@ -1,13 +1,21 @@
 package com.kfzs.duanduan;
 
+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;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 
 import com.kfzs.appstore.utils.restful.KFZSNetwork;
 import com.kfzs.duanduan.event.BigEvent;
 import com.kfzs.duanduan.react.TabsHelper;
+import com.kfzs.duanduan.utils.StatusBarUtils;
 import com.kfzs.duanduan.utils.dlg.HelperUtils;
 import com.kfzs.duanduan.view.DialogStorageLow;
 import com.sheep.gamegroup.absBase.BaseActivity;
@@ -19,12 +27,17 @@ import com.umeng.socialize.UMShareAPI;
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 
+import java.lang.reflect.Field;
+
 import butterknife.BindView;
 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)
@@ -36,9 +49,10 @@ public class ActMain extends BaseActivity {
     private ImageView mImgDot;//下载按钮的小红点
 
 
-
     public TabsHelper tabsHelper;
 
+    private TabsHelper.ItemPosition itemPosition;
+
     @Override
     protected int getLayoutId() {
         return R.layout.activity_main;
@@ -47,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);
@@ -80,6 +94,33 @@ 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);
+        }
+    }
+
+
 
     private Container<Action1<Integer>> container = new Container<>();
 
@@ -90,14 +131,14 @@ public class ActMain extends BaseActivity {
     @Override
     protected void onResume() {
         super.onResume();
-        if(container != null && container.getT() != null)
+        if (container != null && container.getT() != null)
             container.getT().call(1);
     }
 
     @Override
     protected void onPause() {
         super.onPause();
-        if(container != null && container.getT() != null)
+        if (container != null && container.getT() != null)
             container.getT().call(2);
     }
 
@@ -109,7 +150,7 @@ public class ActMain extends BaseActivity {
         super.onDestroy();
         KFZSNetwork.stopByTag(TAG);
         EventBus.getDefault().unregister(this);
-        if(container != null && container.getT() != null)
+        if (container != null && container.getT() != null)
             container.setT(null);
     }
 
@@ -155,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;
+    }
+}

+ 29 - 29
app/src/main/java/com/kfzs/duanduan/fragment/FgtAskgetmoney.java

@@ -4,19 +4,17 @@ import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.os.Bundle;
 import android.support.design.widget.TabLayout;
-import android.support.v4.view.ViewPager;
 import android.support.v4.widget.NestedScrollView;
 import android.text.TextUtils;
 import android.view.MotionEvent;
 import android.view.View;
-
-import com.kfzs.duanduan.ActMain;
-import com.tencent.smtt.sdk.WebView;
+import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSONObject;
+import com.kfzs.duanduan.ActMain;
 import com.kfzs.duanduan.BaseCompatFragment;
 import com.kfzs.duanduan.mine.GiftpackListAdapter;
 import com.kfzs.duanduan.view.ViewPagerAutoHeigh;
@@ -26,6 +24,7 @@ import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.FastJsonUtils;
+import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.StringUtils;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.fragment.FgtAskGetMoneyFriend;
@@ -57,7 +56,7 @@ public class FgtAskgetmoney extends BaseCompatFragment {
     @BindView(R.id.tv_money)
     TextView tvMoney;
     @BindView(R.id.ask_bg)
-    WebView ask_bg;
+    ImageView ask_bg;
     @BindView(R.id.ask_top_1)
     View ask_top_1;
     @BindView(R.id.ask_top_2)
@@ -96,30 +95,31 @@ public class FgtAskgetmoney extends BaseCompatFragment {
         }
         unbinder = ButterKnife.bind(this, mContentView);
 
-
-        String content = "<!DOCTYPEhtml>\n" +
-                "<html>\n" +
-                "  <head>\n" +
-                "    <title>HTML字符串</title>\n" +
-                "    <metahttp-equivmetahttp-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n" +
-                "    <meta name=\"viewport\" content=\"width=" + G.WIDTH + ", user-scalable=no\">\n" +
-                "    <style type=\"text/css\">\n" +
-                "      body {\n" +
-                "        margin: 0;\n" +
-                "        padding: 0;\n" +
-                "      }\n" +
-                "      img {\n" +
-                "        padding: 0;\n" +
-                "        margin: 0;\n" +
-                "      }\n" +
-                "    </style>\n" +
-                "  </head>\n" +
-                "  <body>\n" +
-                "    <img src=\"http://cdngame.kuaifazs.com/yaoqingzq_bg.png\" width=\"100%\">\n" +
-                "  </body>\n" +
-                "</html>";
-        ask_bg.getSettings().setDefaultTextEncodingName("UTF-8");
-        ask_bg.loadData(content, "text/html", "UTF-8");
+//
+//        String content = "<!DOCTYPEhtml>\n" +
+//                "<html>\n" +
+//                "  <head>\n" +
+//                "    <title>HTML字符串</title>\n" +
+//                "    <metahttp-equivmetahttp-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n" +
+//                "    <meta name=\"viewport\" content=\"width=" + G.WIDTH + ", user-scalable=no\">\n" +
+//                "    <style type=\"text/css\">\n" +
+//                "      body {\n" +
+//                "        margin: 0;\n" +
+//                "        padding: 0;\n" +
+//                "      }\n" +
+//                "      img {\n" +
+//                "        padding: 0;\n" +
+//                "        margin: 0;\n" +
+//                "      }\n" +
+//                "    </style>\n" +
+//                "  </head>\n" +
+//                "  <body>\n" +
+//                "    <img src=\"http://cdngame.kuaifazs.com/yaoqingzq_bg.png\" width=\"100%\">\n" +
+//                "  </body>\n" +
+//                "</html>";
+//        ask_bg.getSettings().setDefaultTextEncodingName("UTF-8");
+//        ask_bg.loadData(content, "text/html", "UTF-8");
+        GlideImageLoader.setImage(ask_bg, "http://cdngame.kuaifazs.com/yaoqingzq_bg.png");
 //                16,18,19
         LinearLayout.LayoutParams layoutParams1 = (LinearLayout.LayoutParams) ask_top_1.getLayoutParams();
         layoutParams1.height = G.WIDTH * 660 / 625;

+ 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());
     }

+ 47 - 55
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,38 +59,19 @@ 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);
-        indicator.setupWithViewPager(pager);
-        pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
-            @Override
-            public void onPageScrolled(int i, float v, int i1) {
-
-            }
-
-            @Override
-            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
-            public void onPageScrollStateChanged(int i) {
-
-            }
-        });
-        CommonUtil.getInstance().reflex(indicator, activity);
-
-        pager.setCurrentItem(0);
     }
 
     private void initData() {
         //尝试获取缓存数据
         List<FindTag> newList = DataUtil.getInstance().getCacheList(ApiKey.articles_tags, FindTag.class);
-        loadList(newList);
-        initNetData();
+        if(ListUtil.isEmpty(newList)){
+            initNetData();
+        } else {
+            loadList(newList);
+        }
     }
 
     private int onResumeCount = 0;
@@ -96,7 +79,7 @@ public class FgtFind extends BaseCompatFragment {
     @Override
     public void onResume() {
         super.onResume();
-        if (list.isEmpty() && onResumeCount != 0)//非第一次时,并且没有数据时调用该接口
+        if (list.isEmpty() && onResumeCount != 0)//非第一次时,或者没有数据时调用该接口
             initNetData();
         onResumeCount++;
     }
@@ -108,15 +91,13 @@ public class FgtFind extends BaseCompatFragment {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        if (list.isEmpty()) {//无数据时加载网络获取的新数据,否则不加载新数据
-                            List<FindTag> newList = baseMessage.getDatas(FindTag.class);
+                        List<FindTag> newList = baseMessage.getDatas(FindTag.class);
+                        if(list.isEmpty() && !ListUtil.isEmpty(newList))//有缓存时不会加载,没有缓存时获取到数据会加载
                             loadList(newList);
-                        }
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        G.showToast(baseMessage);
                     }
                 });
     }
@@ -126,34 +107,45 @@ public class FgtFind extends BaseCompatFragment {
         if (!ListUtil.isEmpty(newList)) {
             list.clear();
             ListUtil.addAll(list, newList);
-            loadMore();
-        }
-    }
+            CommonUtil.getInstance().initUrlConfigByNet("awaken_on", new Action1<String>() {
+                @Override
+                public void call(String url) {
+                    int awaken_on = NumberFormatUtils.parseInteger(url);
+                    int count = 1;
+                    if (awaken_on == 1) {
+                        count++;
+                        mAdapter.add(new FgtRouser(), "看点");
+                    }
+                    for (FindTag findLabel : list) {
+                        mAdapter.add(FgtFindChild.newInstance(findLabel.getId()), findLabel.getName());
+                        count++;
+                    }
+                    pager.setAdapter(mAdapter);
+                    indicator.setupWithViewPager(pager);
+                    pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+                        @Override
+                        public void onPageScrolled(int i, float v, int i1) {
 
-    private List<FindTag> list = ListUtil.emptyList();
+                        }
 
-    private void loadMore() {
+                        @Override
+                        public void onPageSelected(int i) {
+                            FIND_TAG.onEvent("find_tag_name", ListUtil.hasIndex(list, i - 1) ? list.get(i - 1).getName() : "全部");
+                        }
 
-        CommonUtil.getInstance().initUrlConfigByNet("awaken_on", new Action1<String>() {
-            @Override
-            public void call(String url) {
-                int awaken_on = NumberFormatUtils.parseInteger(url);
+                        @Override
+                        public void onPageScrollStateChanged(int i) {
 
-                if (awaken_on == 1) {
-                    mAdapter.add(new FgtRouser(), "看点");
-                }
-                for (FindTag findLabel : list) {
-                    mAdapter.add(FgtFindChild.newInstance(findLabel.getId()), findLabel.getName());
-                }
-                mAdapter.notifyDataSetChanged();
-                CommonUtil.getInstance().reflex(indicator, activity);
-                pager.setCurrentItem(position);
+                        }
+                    });
+                    CommonUtil.getInstance().reflex(indicator, activity);
+                    pager.setOffscreenPageLimit(count);
 
-            }
-        });
+                }
+            });
+        }
     }
 
-    private int position = 0;//默认选中第一个
-
+    private List<FindTag> list = ListUtil.emptyList();
 
 }

+ 20 - 0
app/src/main/java/com/kfzs/duanduan/fragment/FgtNull.java

@@ -0,0 +1,20 @@
+package com.kfzs.duanduan.fragment;
+
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+
+/**
+ * Created by realicing on 2018/8/30.
+ * realicing@sina.com
+ */
+public class FgtNull extends BaseFragment {
+    @Override
+    public int getLayoutId() {
+        return R.layout.empty;
+    }
+
+    @Override
+    public void onViewCreated() {
+
+    }
+}

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

@@ -2,6 +2,7 @@ package com.kfzs.duanduan.fragment;
 
 import android.app.ActionBar;
 import android.app.Activity;
+import android.content.Intent;
 import android.graphics.Color;
 import android.graphics.drawable.BitmapDrawable;
 import android.os.Bundle;
@@ -35,6 +36,7 @@ import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.activity.ActivityMessages;
 import com.sheep.gamegroup.view.activity.PersonalCenterAct;
 import com.sheep.gamegroup.view.dialog.DialogShare;
 import com.sheep.jiuyan.samllsheep.R;
@@ -182,7 +184,7 @@ public class FgtPersonalCenter extends BaseCompatFragment {
      * @return 是否显示红包
      */
     private void isShowRedPackage() {
-        //  DataUtil.getInstance().是官方包吗();
+         // DataUtil.getInstance().是官方包吗();
         if (userEntity == null) {
             userEntity = DataUtil.getInstance().getUserEntity();
         }
@@ -227,7 +229,7 @@ public class FgtPersonalCenter extends BaseCompatFragment {
      * @param mActivity 当前Activity
      */
     public void showRedPackageAfterInvitation(final Activity mActivity, View viewAnchor, BaseMessage baseMessage) {
-        if(viewAnchor == null){
+        if (viewAnchor == null) {
             return;
         }
         View view = LayoutInflater.from(mActivity).inflate(R.layout.dialog_redpackage_after_invitation, null, false);
@@ -308,10 +310,13 @@ public class FgtPersonalCenter extends BaseCompatFragment {
             R.id.account_task_layout, R.id.proxy_service_layout, R.id.feedbook_layout,
             R.id.recommend_friend_layout, R.id.faq_layout, R.id.reservation_layout, R.id.version_layout,
             R.id.change_layout, R.id.order_layout, R.id.proxy_game_account_layout,
-            R.id.iv_redpackage
+            R.id.iv_redpackage, R.id.ibtn_baseactivity_message
     })
     public void onViewClicked(View view) {
         switch (view.getId()) {
+            case R.id.ibtn_baseactivity_message://消息
+               // startActivity(new Intent(activity, ActivityMessages.class));
+                break;
             case R.id.iv_redpackage://邀请成功后有可领红包
                 ViewUtil.changeRedPackage(getActivity(), getView(), FgtPersonalCenter.this);
                 break;
@@ -387,6 +392,7 @@ public class FgtPersonalCenter extends BaseCompatFragment {
 
     @Override
     public void onResume() {
+        isShowRedPackage();
         super.onResume();
         try {
             initData();

+ 9 - 2
app/src/main/java/com/kfzs/duanduan/fragment/FgtRouser.java

@@ -137,13 +137,19 @@ public class FgtRouser extends BaseCompatFragment {
                 time_tv.setText(item.getContent()+"");
                 if (!TextUtils.isEmpty(item.getImg())) {
                     final String[] images = item.getImg().split(";");
-                    final String[] images1 = new String[3];
+                    String[] images1 = new String[3];
                     if(images.length > 1){
                         if(images.length > 3){
                             for(int i=0;i<3;i++){
                                 images1[i] = images[i];
                             }
+                        }else {
+                            images1 = new String[images.length];
+                            for(int i=0;i<images.length;i++){
+                                images1[i] = images[i];
+                            }
                         }
+
                         one_img_iv.setVisibility(View.GONE);
                         home_list_gridview_gv.setVisibility(View.VISIBLE);
                         home_list_gridview_gv.setAdapter(new ArrayAdapter<String>(activity, R.layout.rouser_image_adp ,images1){
@@ -157,12 +163,13 @@ public class FgtRouser extends BaseCompatFragment {
                                 return true;
                             }
                         });
+                        final String[] finalImages = images1;
                         home_list_gridview_gv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                             @Override
                             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                                 try{
                                     PhotoPreview.builder()
-                                            .setPhotos( new ArrayList<>(Arrays.asList(images1)))
+                                            .setPhotos( new ArrayList<>(Arrays.asList(finalImages)))
                                             .setCurrentItem(position)
                                             .setShowDeleteButton(false)
                                             .start( activity, 101);

+ 219 - 27
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -26,7 +26,11 @@ import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
+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;
@@ -213,28 +217,37 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
 
     private static final int LIST_COUNT = 2;//tryMakeMoneyAdp 总共有2条数据
     private static final RecyleObj NULL = RecyleObj.make(RecyleType.NONE, null);//空数据
-    public Handler mHanderl = new Handler(Looper.getMainLooper()) {
+    public static final int WHAT_LOAD_USER_INFO = 0;//加载用户信息
+    public static final int WHAT_LOAD_RUN_TASK = 1;//加载正在进行的任务列表
+    public static final int WHAT_UPDATE_VP_HEIGHT = 2;//刷新viewpager高度
+    public static final int WHAT_TRY_SHOW_HB = 7;//尝试显示红包
+    public Handler mHandler = new Handler(Looper.getMainLooper()) {
         @Override
         public void handleMessage(Message msg) {
             super.handleMessage(msg);
             switch (msg.what) {
-                case 0:
+                case WHAT_LOAD_USER_INFO:
                     loadUserInfo();
                     break;
-                case 1:
+                case WHAT_LOAD_RUN_TASK:
                     tryMakeMoneyAdp.clear();
-                    if(!ListUtil.isEmpty(allTaskAcceptedTaskList)){
-                        if(recyclerview_line != null)
-                            recyclerview_line.setVisibility(View.VISIBLE);
+                    //正在进行中的任务列表
+                    boolean isAcceptedTaskListEmpty = ListUtil.isEmpty(allTaskAcceptedTaskList);
+                    if(!isAcceptedTaskListEmpty){
                         tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.RUN_TASK, allTaskAcceptedTaskList));
                     }
+                    //正在进行中的任务下面的线是否显示
+                    if(recyclerview_line != null)
+                        recyclerview_line.setVisibility(isAcceptedTaskListEmpty ? View.GONE : View.VISIBLE);
+
+                    //发布的任务列表----注:3.0开始已经没有展示,使用viewpager展示
                     if(!ListUtil.isEmpty(releaseEtyLists)) {
                         tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.RELEASE_TASK, releaseEtyLists));
                     }
                     tryMakeMoneyAdp.notifyDataSetChanged();
                     checkAndInitView();
                     break;
-                case 2:
+                case WHAT_UPDATE_VP_HEIGHT:
                     FgtTryMakeMoney item = (FgtTryMakeMoney) adpViewPagerDetail.getItem(curPosition);
                     if(mViewPager == null || item == null){
                         return;
@@ -244,17 +257,180 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                     params.height = count == 0 ? G.HEIGHT / 2 : (count * getResources().getDimensionPixelSize(R.dimen.content_padding_96)+getResources().getDimensionPixelSize(R.dimen.content_padding));
                     mViewPager.setLayoutParams(params);
                     break;
-                case 7:
+                case WHAT_TRY_SHOW_HB:
                     isShowRedPackages(activity);
                     break;
             }
 
         }
     };
+    /**
+     * @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);
+                    }
+                });
+    }
+
+
 
     /**
      * 新手任务对话框中,注册账号并登录得红包,这里判断是否已经领取过了,如果领取过了就不显示,不然就显示
-     * @param obj     ,Context对象
+     *
+     * @param obj ,Context对象
      */
     public void isShowRedPackages(Context obj) {
         if (userEntity == null) {
@@ -273,13 +449,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());
         }
@@ -289,7 +464,6 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     protected void initView(Bundle savedInstanceState) {
         setContentView(R.layout.homepage_act_layout);
         activity = getActivity();
-        DataUtil.getInstance().isTaskListChange(getClass());
         showPDialog();
         initView();
         initListener();
@@ -341,7 +515,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             @Override
             public void onPageSelected(int position) {
                 curPosition = position;
-                mHanderl.sendEmptyMessage(2);//重新计算viewpager高度
+                mHandler.sendEmptyMessage(WHAT_UPDATE_VP_HEIGHT);//重新计算viewpager高度
             }
 
             @Override
@@ -350,10 +524,23 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             }
         });
         CommonUtil.getInstance().reflex(tabLayout, activity);
+        setAnimation(ivDuty);
     }
 
     private int curPosition = 0;
 
+    /**
+     * 给请红包浮标设置动画,达到左右晃动
+     * @param imageView  设置动画的imageview
+     */
+    private void setAnimation(ImageView imageView) {
+        TranslateAnimation animation = new TranslateAnimation(0, -5, 0, 0);
+        animation.setInterpolator(new OvershootInterpolator());
+        animation.setDuration(150);
+        animation.setRepeatCount(Integer.MAX_VALUE);//根据产品要求,要一直晃动
+        animation.setRepeatMode(Animation.REVERSE);
+        imageView.startAnimation(animation);
+    }
 
     private void loadUserInfo() {
 
@@ -440,7 +627,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
 //        List<TaskReleaseEty> cacheTaskReleaseEtyList = DataUtil.getInstance().getCacheList(ApiKey.release_task, TaskReleaseEty.class);
 //        if (cacheTaskReleaseEtyList != null) {
 //            releaseEtyLists.addAll(cacheTaskReleaseEtyList);
-//            mHanderl.sendEmptyMessage(1);
+//            mHandler.sendEmptyMessage(WHAT_LOAD_RUN_TASK);
 //        }
 
 
@@ -530,7 +717,8 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             homepageItemNoticeMv.stopFlipping();
             homepageItemNoticeMv.startFlipping();
         }
-        pagePresenter.getUserInfo();
+        if(onResumeCount > 0 || userEntity == null)//非第一次才更新用户信息
+            pagePresenter.getUserInfo();
 
         if (views.size() < 1) {
             pagePresenter.getAwardDetail();
@@ -610,7 +798,6 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     }
 
     private void refreshTaskList() {
-        DataUtil.getInstance().isTaskListChange(getClass());
         tryMakeMoneyPresenter.returnTask(is_succession, show_game_task);
         RequestParameEty parameEty = new RequestParameEty();
         parameEty.setHashMap(
@@ -672,7 +859,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             return;
         }
         DataUtil.getInstance().setUserEntity(userEntity);
-        mHanderl.sendEmptyMessage(0);
+        mHandler.sendEmptyMessage(WHAT_LOAD_USER_INFO);
     }
 
     @Override
@@ -718,7 +905,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         } else {
             allTaskAcceptedTaskList.clear();
         }
-        mHanderl.sendEmptyMessage(1);
+        mHandler.sendEmptyMessage(WHAT_LOAD_RUN_TASK);
     }
 
     @Override
@@ -739,7 +926,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             G.showToast(" 网络错误!");
         }
         allTaskAcceptedTaskList.clear();
-        mHanderl.sendEmptyMessage(1);
+        mHandler.sendEmptyMessage(WHAT_LOAD_RUN_TASK);
     }
 
     @Override
@@ -749,7 +936,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             List<TaskReleaseEty> releaseEtyList = ((BaseMessage) object).getDataList(TaskReleaseEty.class);
             if (releaseEtyList != null) {
                 releaseEtyLists = releaseEtyList;
-                mHanderl.sendEmptyMessage(1);
+                mHandler.sendEmptyMessage(WHAT_LOAD_RUN_TASK);
             }
         }
     }
@@ -898,8 +1085,10 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             userEntity = result;
             loadUserInfo();
         }
-        if(DataUtil.getInstance().isTaskListChange(getClass()))//数据变化才刷新
+        if(onResumeCount > 0)
             refreshTaskList();
+        onResumeCount++;
+        setAnimation(ivDuty);
     }
 
 
@@ -950,13 +1139,13 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     public void onEventMainThread(BigEvent event) {
         switch (event.getEventTypes()) {
             case ONFRESH_FGT_FAMLLSHEEP:
-                mHanderl.sendEmptyMessage(1);
+                mHandler.sendEmptyMessage(WHAT_LOAD_RUN_TASK);
                 break;
             case FGT_SHEEP_REFRESH_H:
-                mHanderl.sendEmptyMessage(2);
+                mHandler.sendEmptyMessage(WHAT_UPDATE_VP_HEIGHT);
                 break;
             case FGT_SHEEP_SHOW_NEW_USER_HONG_BAO:
-                mHanderl.sendEmptyMessage(7);
+                mHandler.sendEmptyMessage(WHAT_TRY_SHOW_HB);
                 break;
         }
     }
@@ -1247,6 +1436,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             @Override
             public void onClick(View view) {
                 popupWindow.dismiss();
+                isShowRedPackageWithCode();//关闭新人注册红包后,弹出邀请红包
             }
         });
 
@@ -1272,11 +1462,13 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                     public void onNext(BaseMessage baseMessage) {
                         if (popupWindow.isShowing()){
                             popupWindow.dismiss();
+                            isShowRedPackageWithCode();//兑换成功后弹出邀请红包
                         }
                         CommonUtil.getInstance().updateUserInfo(null);
                     }
                 });
     }
+
     /**
      * 新手任务
      */

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

@@ -1,6 +1,7 @@
 package com.kfzs.duanduan.mine;
 
 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;
@@ -14,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) {
@@ -48,5 +47,8 @@ public class GiftpackListAdapter extends FragmentPagerAdapter {
         return (CharSequence) mTitles.get(position);
     }
 
-
+    @Override
+    public Parcelable saveState() {
+        return null;
+    }
 }

+ 25 - 0
app/src/main/java/com/kfzs/duanduan/react/FileUtil.java

@@ -149,4 +149,29 @@ public class FileUtil {
             e.printStackTrace();
         }
     }
+    /*
+     * Java文件操作 获取文件扩展名
+     * */
+    public static String getExtensionName(String filename) {
+        if ((filename != null) && (filename.length() > 0)) {
+            int dot = filename.lastIndexOf('.');
+            if ((dot >-1) && (dot < (filename.length() - 1))) {
+                return filename.substring(dot + 1);
+            }
+        }
+        return filename;
+    }
+    /*
+     * Java文件操作 获取不带扩展名的文件名
+     * */
+    public static String getFileNameNoEx(String filename) {
+        if ((filename != null) && (filename.length() > 0)) {
+            int dot = filename.lastIndexOf('.');
+            if ((dot >-1) && (dot < (filename.length()))) {
+                return filename.substring(0, dot);
+            }
+        }
+        return filename;
+    }
+
 }

+ 2 - 1
app/src/main/java/com/kfzs/duanduan/react/MainTab.java

@@ -5,6 +5,7 @@ import android.support.v4.app.Fragment;
 import com.kfzs.duanduan.ActMain;
 import com.kfzs.duanduan.fragment.FgtAskgetmoney;
 import com.kfzs.duanduan.fragment.FgtFind;
+import com.kfzs.duanduan.fragment.FgtNull;
 import com.kfzs.duanduan.fragment.FgtPersonalCenter;
 import com.kfzs.duanduan.fragment.FgtSmallSheep;
 import com.sheep.gamegroup.view.fragment.FgtMainAudit;
@@ -51,7 +52,7 @@ public enum MainTab {
     Fgt_Find(R.string.main_tab_find) {
         @Override
         public Fragment getFragment() {
-            return new FgtFind();
+            return new FgtNull();
         }
 
         @Override

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

@@ -1,6 +1,8 @@
 package com.kfzs.duanduan.react;
 
+import android.os.Bundle;
 import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentTransaction;
 import android.support.v4.view.ViewPager;
 import android.view.View;
 import android.widget.LinearLayout;
@@ -11,10 +13,11 @@ 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.fragment.FgtFind;
 import com.kfzs.duanduan.fragment.FgtPersonalCenter;
 import com.kfzs.duanduan.fragment.FgtSmallSheep;
-import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.DrawablesHelper;
+import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.view.fragment.FgtMainAudit;
@@ -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,9 +132,13 @@ public class TabsHelper {
                         if(position == auditPosition){
                             auditFgt.onResume();
                         }
+                        if(position == fPosition){
+//                            findFgt.onResume();
+                        }
                         checkWhichPage(position);
                     }
 
+
                 }
             });
             index++;
@@ -140,12 +154,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);
         }
     }
 
@@ -198,6 +219,7 @@ public class TabsHelper {
                 if (lastPosition > -1)
                     tabs.get(lastPosition).setActivated(false);
                 tabs.get(position).setActivated(true);
+                showFind(position == MainTab.Fgt_Find.ordinal());
                 //更新position
                 lastPosition = position;
             }
@@ -213,10 +235,32 @@ public class TabsHelper {
         checkViewState(lastPosition);
     }
 
+    private void showFind(boolean isFind) {
+        View frame_container = activity.findViewById(R.id.frame_container);
+        if(isFind)
+            frame_container.bringToFront();
+        else
+            other_container.bringToFront();
+    }
+
     public void init() {
         initViews();
         initArrays();
         initViewPager();
+
+        FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
+        Bundle bundle = new Bundle();
+        Fragment fragment = activity.getSupportFragmentManager().findFragmentByTag("tag");
+        if(fragment == null){
+            fragment = new FgtFind();
+            fragment.setArguments(bundle);
+            transaction.add(R.id.frame_container, fragment, "tag");
+            transaction.commitAllowingStateLoss();
+        }else {
+            fragment.setArguments(bundle);
+            transaction.replace(R.id.frame_container, fragment);
+            transaction.commitAllowingStateLoss();
+        }
     }
 
     private long lastbackrn = 0;
@@ -250,4 +294,14 @@ public class TabsHelper {
         tabs.get(postion).performClick();
     }
 
+    /**
+     * 设置获取当前是哪个fragment位置的回调
+     */
+   public interface ItemPosition{
+        /**
+         * @param position ,fragment的位置
+         */
+        void positionClick(int position);
+    }
+
 }

+ 13 - 8
app/src/main/java/com/kfzs/duanduan/react/upfile/UpFileUtils.java

@@ -4,7 +4,9 @@ package com.kfzs.duanduan.react.upfile;
 import android.graphics.Bitmap;
 
 import com.nanchen.compresshelper.CompressHelper;
+import com.sheep.gamegroup.model.api.ICallBack;
 import com.sheep.gamegroup.model.util.ExceptionHandle;
+import com.sheep.gamegroup.util.PngUtil;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.zhy.http.okhttp.OkHttpUtils;
 import com.zhy.http.okhttp.callback.Callback;
@@ -15,6 +17,7 @@ import java.util.ArrayList;
 import okhttp3.Call;
 import okhttp3.Response;
 import okhttp3.ResponseBody;
+import rx.functions.Action1;
 
 /**
  * Created by howie on 2017/5/11.
@@ -56,21 +59,23 @@ public class UpFileUtils {
 
     }
 
-    public static void upImages(ArrayList<String> photos, final UpFileListener upFileListener) {
-        upImages(photos, upFileListener, 0);
+    public static void upImages(ArrayList<String> photos, final UpFileListener upFileListener, ICallBack<String> action1) {
+        upImages(photos, upFileListener, action1, 0);
     }
-
-    public static void upImages(final ArrayList<String> photos, final UpFileListener upFileListener, final int index) {
-        if (index < photos.size()) {
+    public static void upImages(final ArrayList<String> photos, final UpFileListener upFileListener, final ICallBack<String> action1, final int index) {
+        int size = photos.size();
+        if (index < size) {
             File file;
             if ((file = new File(photos.get(index))).exists()) {
                 File newFile = new CompressHelper.Builder(SheepApp.getInstance())
                         .setMaxWidth(2000)  // 默认最大宽度为720
                         .setMaxHeight(2000) // 默认最大高度为960
                         .setQuality(80)    // 默认压缩质量为80
-                        .setCompressFormat(Bitmap.CompressFormat.JPEG) // 设置默认压缩为jpg格式
+                        .setCompressFormat(Bitmap.CompressFormat.PNG) // 设置默认压缩为png格式
                         .build().compressToFile(file);
 //                org.xutils.common.util.FileUtil.copy(newFile.getAbsolutePath(), ClassFileHelper.DIR+"/1.png");
+                if(action1 != null)
+                    action1.call(newFile.getAbsolutePath(), size, index);
                 OkHttpUtils.post()
                         .addFile("uploadfile", "1.png", newFile)//
                         .url(URL_RN_UP_IMAGE)
@@ -98,11 +103,11 @@ public class UpFileUtils {
                             @Override
                             public void onResponse(Object response, int id) {
                                 upFileListener.Success(response.toString(), index);
-                                upImages(photos, upFileListener, index + 1);
+                                upImages(photos, upFileListener, action1,index + 1);
                             }
                         });
             }else {//文件不存在就不用上传
-                upImages(photos, upFileListener, index + 1);
+                upImages(photos, upFileListener, action1,index + 1);
             }
         } else
             upFileListener.Success("全部上传完成", -1);

+ 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);
+    }
 }

+ 10 - 1
app/src/main/java/com/sheep/gamegroup/absBase/AbsChooseImageActivity.java

@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSON;
 import com.kfzs.duanduan.react.upfile.UpFileListener;
 import com.kfzs.duanduan.react.upfile.UpFileUtils;
 import com.sheep.gamegroup.model.api.BaseMessageConverter;
+import com.sheep.gamegroup.model.api.ICallBack;
 import com.sheep.gamegroup.model.entity.UploadResult;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.view.dialog.DialogProgress;
@@ -144,13 +145,21 @@ public abstract class AbsChooseImageActivity extends BaseActivity implements UpF
             onGetImage(path);
             if (isUpload) {
                 AbsChooseImageActivity.this.dialogShowLoading = DialogProgress.showDialog(AbsChooseImageActivity.this);
-                UpFileUtils.upImages(photos, AbsChooseImageActivity.this);
+                UpFileUtils.upImages(photos, AbsChooseImageActivity.this, getCallBack());
             }
         } else {
             onNotGetImage("没有数据");
         }
     }
 
+    /**
+     * 上传图片前的回调
+     * @return
+     */
+    protected ICallBack<String> getCallBack(){
+        return null;
+    }
+
     @Override
     public void Success(String msg, int index) {
         if(index == -1 && !urls.isEmpty()) {//多图

+ 8 - 13
app/src/main/java/com/sheep/gamegroup/absBase/BaseActivity.java

@@ -27,21 +27,24 @@ public abstract class BaseActivity extends AppCompatActivity {
         initListener();
         initData();
     }
-    public boolean isShowing(){
+
+    public boolean isShowing() {
         return dialogLoading != null && dialogLoading.getAlertDialog() != null && dialogLoading.getAlertDialog().isShowing();
     }
-    public void  showProgress(){
+
+    public void showProgress() {
         hideProgress();
         dialogLoading = DialogLoading.showDialog(this);
     }
-    protected void  showProgress(boolean cancel){
+
+    protected void showProgress(boolean cancel) {
         hideProgress();
         dialogLoading = DialogLoading.showDialog(this, cancel);
     }
 
 
-    public void  hideProgress(){
-        if(isShowing()){
+    public void hideProgress() {
+        if (isShowing()) {
             try {
                 dialogLoading.getAlertDialog().dismiss();
             } catch (Exception e) {
@@ -51,13 +54,6 @@ public abstract class BaseActivity extends AppCompatActivity {
     }
 
 
-
-
-
-
-
-
-
     @Override
     public boolean onKeyDown(int keyCode, KeyEvent event) {
         /*if (BuildConfig.DEBUG)
@@ -78,5 +74,4 @@ public abstract class BaseActivity extends AppCompatActivity {
     public abstract void initData();
 
 
-
 }

+ 9 - 0
app/src/main/java/com/sheep/gamegroup/db/DBUtils.java

@@ -0,0 +1,9 @@
+package com.sheep.gamegroup.db;
+
+/**
+ * created on:2018/8/27 on 15:26
+ * created by: YSL
+ * 描述:
+ */
+public class DBUtils {
+}

+ 0 - 16
app/src/main/java/com/sheep/gamegroup/di/components/PhoneComponent.java

@@ -1,16 +0,0 @@
-package com.sheep.gamegroup.di.components;
-
-import com.sheep.gamegroup.di.modules.PhoneModule;
-import com.sheep.gamegroup.di.scopes.UserScope;
-import com.sheep.gamegroup.view.activity.PhoneAct;
-
-import dagger.Component;
-
-/**
- * Created by ljy on 2018/3/15.
- */
-@UserScope
-@Component(modules = PhoneModule.class, dependencies = NetComponent.class)
-public interface PhoneComponent {
-    void inject(PhoneAct phoneAct);
-}

+ 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 - 2
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游戏任务
@@ -238,7 +238,6 @@ public class TaskHelper {
                                                 @Override
                                                 public void onNext(BaseMessage baseMessage) {
                                                     CommonUtil.getInstance().setTAskEnty(null);
-                                                    DataUtil.getInstance().setTaskListChanged();//主页任务列表发生变化,回到主页后自动刷新
                                                     refreshTask();
                                                 }
 

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

@@ -239,6 +239,22 @@ public interface ApiService {
      */
     @POST("app/user/sms_for_bind_mobile")
     Observable<BaseMessage> smsBindMobile(@Body JSONObject jsonObject);
+    /**
+     * 使用第三方登录时,未找到该qq对应的账号,不再直接创建账号,会先绑定手机号来注册新账号
+     * captcha	string
+     验证码 第二步需要
+     mobile	string
+     platform	string
+     登录返回来的platform
+     scope	string
+     传kfzs为官包 传空为邀请包
+     step	string
+     步骤:first发验证码 second绑定
+     token	string
+     登录返回来的token
+     */
+    @POST("app/auth/bind_mobile")
+    Observable<BaseMessage> bindMobileRegister(@Body JSONObject jsonObject);
 
     /**
      * 修改任务进度

+ 9 - 0
app/src/main/java/com/sheep/gamegroup/model/api/ICallBack.java

@@ -0,0 +1,9 @@
+package com.sheep.gamegroup.model.api;
+
+/**
+ * Created by realicing on 2018/8/28.
+ * realicing@sina.com
+ */
+public interface ICallBack<T> {
+    T call(Object...args);
+}

+ 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;
     }

+ 21 - 1
app/src/main/java/com/sheep/gamegroup/model/entity/LoginEntity.java

@@ -1,12 +1,16 @@
 package com.sheep.gamegroup.model.entity;
 
+import java.io.Serializable;
+
 /**
  * 手机登录返回数据
  * Created by ljy on 2018/3/17.
  */
 
-public class LoginEntity {
+public class LoginEntity implements Serializable{
     private String token;//11@9667453894253cd1f3e9beec1bb063e9
+    private String code;
+    private String platform;
     private UserEntity user;
 
     public String getToken() {
@@ -24,4 +28,20 @@ public class LoginEntity {
     public void setUser(UserEntity user) {
         this.user = user;
     }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getPlatform() {
+        return platform;
+    }
+
+    public void setPlatform(String platform) {
+        this.platform = platform;
+    }
 }

+ 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 - 8
app/src/main/java/com/sheep/gamegroup/model/entity/TaskEty.java

@@ -542,7 +542,7 @@ public class TaskEty implements Serializable, IDownload {
         //先找审核失败的子任务
         TaskChild commitScreenShotTask = getCanCommitChild(TaskEty.STATUS_FAIL);
         if(commitScreenShotTask == null){
-        //再找进行中的子任务
+            //再找进行中的子任务
             commitScreenShotTask = getCanCommitChild(TaskEty.STATUS_RUNNING);
         }
         return commitScreenShotTask == null ? -1 : commitScreenShotTask.getAlready_accepted_task_id();
@@ -581,12 +581,19 @@ public class TaskEty implements Serializable, IDownload {
      * @return
      */
     public boolean canCancelTask() {
-       switch (task_type){
-           case 1000:
-               TaskChild taskChild = ListUtil.getItem(child, 0);
-               return taskChild == null || taskChild.getStatus() == 3;
-           default:
-               return true;
-       }
+        switch (task_type){
+            case 1000:
+                TaskChild taskChild = ListUtil.getItem(child, 0);
+                return taskChild == null || taskChild.getStatus() == 3;
+            default:
+                return true;
+        }
+    }
+    /**
+     * 是否连续任务
+     * @return
+     */
+    public boolean isSuccession() {
+        return task_type == 1000;
     }
 }

+ 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 {
+}

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

@@ -12,6 +12,7 @@ import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.NetUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 
 import rx.Subscriber;
 
@@ -52,6 +53,7 @@ public abstract class SheepSubscriber<T> extends Subscriber<T> {
                 ExceptionHandle.ResponeThrowable throwable = ExceptionHandle.handleException(e);
                 //token 过期
                 if(throwable.code == 401){
+                    SpUtils.saveToken(SheepApp.getInstance(), "");
                     Jump2View.getInstance().gotoLoginAgain();
                     return;
                 }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/presenter/LoginPresenter.java

@@ -9,6 +9,7 @@ import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.ChannelContent;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.FastJsonUtils;
+import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.PreferenceUtils;
 import com.sheep.gamegroup.util.TestUtil;
@@ -86,7 +87,6 @@ public class LoginPresenter implements LoginContract.Presenter {
             loginEty =FastJsonUtils.toBean( JSONObject.toJSONString(baseMessage.getData()),LoginEntity.class);
             SpUtils.saveToken(SheepApp.mContext, loginEty.getToken());
             DataUtil.getInstance().setUserEntity(loginEty.getUser());
-            LogUtil.logI("token--------"+loginEty.getToken());
         }
         view.NetSuccess(1,"登录成功", EntityUtils.getUserCode(loginEty));
         TestUtil.saveUser(loginEty);

+ 0 - 3
app/src/main/java/com/sheep/gamegroup/presenter/PhonePresenter.java

@@ -78,9 +78,6 @@ public class PhonePresenter implements PhoneContract.Presenter {
     public boolean getCaptchaa(String telphone) {
 
         try {
-            Map map = new HashMap();
-            map.put("account", telphone);
-            Log.e("hash-map", map.toString());
             com.alibaba.fastjson.JSONObject j = new com.alibaba.fastjson.JSONObject();
             j.put("account", telphone);
 

+ 0 - 20
app/src/main/java/com/sheep/gamegroup/util/BinaryUtil.java

@@ -1,20 +0,0 @@
-package com.sheep.gamegroup.util;
-
-/**
- * Created by realicing on 2018/4/18.
- * realicing@sina.com
- */
-public class BinaryUtil {
-    public static boolean isInt(int num, int index, int thsInt) {
-        return get(num, index) == thsInt;
-    }
-
-    /**
-     * @param num:要获取二进制值的数
-     * @param index:倒数第一位为0,依次类推
-     */
-    public static int get(int num, int index) {
-        return (num & (0x1 << index)) >> index;
-    }
-
-}

+ 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

+ 37 - 42
app/src/main/java/com/sheep/gamegroup/util/DataUtil.java

@@ -13,7 +13,6 @@ import android.text.TextUtils;
 import com.alibaba.fastjson.JSON;
 import com.sheep.gamegroup.model.api.BaseMessageConverter;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.AutoTaskListUtil;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
@@ -27,12 +26,17 @@ import org.afinal.simplecache.ACache;
 import org.afinal.simplecache.ApiKey;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
+import java.util.concurrent.TimeUnit;
 
+import rx.Observable;
+import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
+import rx.schedulers.Schedulers;
 
 import static android.app.Activity.RESULT_OK;
 
@@ -88,7 +92,6 @@ public class DataUtil {
      * @return
      */
     public String getInvitationCode() {
-        UserEntity userEntity = DataUtil.getInstance().getUserEntity();
         if (userEntity != null && userEntity.getInvitation_code() != null)
             return userEntity.getInvitation_code();
         return "";
@@ -100,7 +103,6 @@ public class DataUtil {
      * @return
      */
     public String getUserId() {
-        UserEntity userEntity = DataUtil.getInstance().getUserEntity();
         if (userEntity != null && userEntity.getId() != null)
             return userEntity.getId();
         return "";
@@ -112,7 +114,6 @@ public class DataUtil {
      * @return
      */
     public String getUserParentCode() {
-        UserEntity userEntity = DataUtil.getInstance().getUserEntity();
         if (userEntity != null && userEntity.getParent_code() != null)
             return userEntity.getParent_code();
         return "";
@@ -124,7 +125,6 @@ public class DataUtil {
      * @return
      */
     public String getUserMobile() {
-        UserEntity userEntity = DataUtil.getInstance().getUserEntity();
         if (userEntity != null && userEntity.getMobile() != null)
             return userEntity.getMobile();
         return "";
@@ -141,7 +141,6 @@ public class DataUtil {
      * @return
      */
     public String getUserWxOpenId() {
-        UserEntity userEntity = DataUtil.getInstance().getUserEntity();
         if (userEntity != null && userEntity.getWx_openid() != null)
             return userEntity.getWx_openid();
         return "";
@@ -234,38 +233,6 @@ public class DataUtil {
     }
 
     //-----------------------------------------缓存数据部分-----------------------------------------------------结束
-    //-----------------------------------------进行任务部分-----------------------------------------------------开始
-
-    /**
-     * 是否首页正在运行的任务与发布的任务列表发生变化
-     *
-     * @return
-     */
-    public boolean isTaskListChange(Class<?> tagClass) {
-        return isTaskListChange(tagClass.getName());
-    }
-
-    /**
-     * 是否首页正在运行的任务与发布的任务列表发生变化
-     *
-     * @return
-     */
-    public boolean isTaskListChange(String tag) {
-        if (tagList.contains(tag)) {//包含tag,说明使用该tag的地方已经刷新数据
-            return false;
-        } else {
-            tagList.add(tag);
-            return true;
-        }
-    }
-
-    private List<String> tagList = ListUtil.emptyList();
-
-    public void setTaskListChanged() {
-        tagList.clear();
-    }
-
-    //-----------------------------------------进行任务部分-----------------------------------------------------结束
 
     //-----------------------------------------其它数据部分-----------------------------------------------------开始
     private Map<String, Object> objectMap = new HashMap<>();
@@ -292,7 +259,9 @@ public class DataUtil {
         return null;
     }
     //是否使用小绵羊截图方案
-    public static final boolean IS_USE_SCREEN_SHOT = false;//BuildConfig.DEBUG;
+    public static final boolean IS_USE_SCREEN_SHOT = false;
+    //是否监听媒体库图片变化
+    public static final boolean IS_LISTEN_SCREEN_SHOT = false;
     /**
      * 截图路径
      *
@@ -300,8 +269,6 @@ public class DataUtil {
      */
     public File getScreenShotsFile(String packageName) {
         File dir = getScreenShotsDir(packageName);
-        if(!dir.exists())
-            dir.mkdirs();
         return new File(dir, TimeUtil.getDate("yyyy-MM-dd-hh-mm-ss")+".png");
     }
 
@@ -319,7 +286,10 @@ public class DataUtil {
      * @return
      */
     public File getScreenShotsDir(String packageName) {
-        return new File(SheepApp.getInstance().getDir("ScreenShots", Context.MODE_PRIVATE), packageName);
+        File dir = new File(SheepApp.getInstance().getDir("ScreenShots", Context.MODE_PRIVATE), packageName);
+        if(!dir.exists())
+            dir.mkdirs();
+        return dir;
     }
 
     /**
@@ -410,6 +380,31 @@ public class DataUtil {
     public static boolean 是官方包吗(){
         return "kfzs".equals(ChannelContent.getInstance().getChannel_name());
     }
+
+    public void addPng(final String imagePath) {
+        final String packageName = getPackageNameInForeground();
+        if(TextUtils.isEmpty(packageName)){
+            LogUtil.println("ScreenShotListenManager", "无法获取到当前运行的应用的包名");
+            return;
+        }
+//        File shotFile = getScreenShotsFile(packageName);
+        LogUtil.println("ScreenShotListenManager", packageName);
+        Observable.just(1).delay(1, TimeUnit.SECONDS)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new Action1<Integer>() {
+                    @Override
+                    public void call(Integer integer) {
+                        try {
+                            FileUtil.copyFile(new File (imagePath), getScreenShotsDir(packageName));
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                            LogUtil.println("ScreenShotListenManager", "复制截屏图片失败");
+                        }
+                    }
+                });
+
+    }
 //    //正在运行的任务
 //    List<TaskAcceptedEty> taskAcceptedEtyList = ListUtil.emptyList();
 //    public void addTaskAcceptedEtyList(List<TaskAcceptedEty> list) {

+ 56 - 21
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -23,6 +23,7 @@ import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.DialogEntity;
 import com.sheep.gamegroup.model.entity.FindApp;
 import com.sheep.gamegroup.model.entity.FindItem;
+import com.sheep.gamegroup.model.entity.LoginEntity;
 import com.sheep.gamegroup.model.entity.NewbieTask;
 import com.sheep.gamegroup.model.entity.NewbieTaskRecord;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
@@ -33,12 +34,15 @@ import com.sheep.gamegroup.model.entity.WebviewEntity;
 import com.sheep.gamegroup.model.entity.XianWanEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.view.activity.ActAudit;
+import com.sheep.gamegroup.view.activity.ActBindMobileRegister;
 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.ActGiftCenter;
 import com.sheep.gamegroup.view.activity.ActGuide;
 import com.sheep.gamegroup.view.activity.ActGuideDeblocked;
 import com.sheep.gamegroup.view.activity.ActGuideOnHook;
@@ -46,6 +50,7 @@ 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;
@@ -71,7 +76,6 @@ import com.sheep.gamegroup.view.activity.LieMakeMoneyAct;
 import com.sheep.gamegroup.view.activity.LoginAct;
 import com.sheep.gamegroup.view.activity.PersonalCenterAct;
 import com.sheep.gamegroup.view.activity.PersonalInfoAct;
-import com.sheep.gamegroup.view.activity.PhoneAct;
 import com.sheep.gamegroup.view.activity.RealNameAuthenAct;
 import com.sheep.gamegroup.view.activity.RechargeAct;
 import com.sheep.gamegroup.view.activity.RechargeQAct;
@@ -113,7 +117,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;
@@ -300,18 +307,6 @@ public class Jump2View {
         });
     }
 
-
-    /**
-     * 跳到手机登录页面
-     * @param context
-     * @param o:  0:登录,1:旧手机号,2:新手机号
-     */
-    public void goPhoneLoginView(Context context, int o){
-        Intent intent = new Intent(context, PhoneAct.class);
-        intent.putExtra("show_notice",  o);
-        context.startActivity(intent);
-    }
-
     /**
      * 跳到个人中心页面
      * @param context
@@ -646,13 +641,26 @@ public class Jump2View {
      */
     public void goBindPhone(Context context, Object o){
         Intent i = new Intent(context, ChangeTelAct.class);
-        if(o != null && o instanceof Integer)
+        if(o instanceof Integer){
             i.putExtra("where_from", (Integer) o);
+        }
         if(!(context instanceof Activity))
             i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         context.startActivity(i);
     }
     /**
+     * 绑定手机页面并注册第三方账号
+     * @param context
+     * @param loginEntity
+     */
+    public void goBindPhoneRegister(Context context, LoginEntity loginEntity){
+        Intent intent = new Intent(context, ActBindMobileRegister.class);
+        intent.putExtra(LoginEntity.class.getSimpleName(), loginEntity);
+        if(!(context instanceof Activity))
+            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        context.startActivity(intent);
+    }
+    /**
      * 跳转到非wifi网络提示
      * @param context
      * @param o
@@ -981,14 +989,16 @@ public class Jump2View {
      */
     public void startShotScreenFloat(Context context, Object object) {
         if(DataUtil.IS_USE_SCREEN_SHOT) {
-            Intent intent = new Intent(context, FloatShotScreenService.class);
-            if(object instanceof Boolean) {
-                intent.putExtra("isShow", (Boolean) object);
-                intent.putExtra("type", SET_SHOW_OR_HIDE);
-            } else if(object instanceof Integer){
-                intent.putExtra("type", (Integer) object);
+            if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {//5.0才上系统才使用
+                Intent intent = new Intent(context, FloatShotScreenService.class);
+                if (object instanceof Boolean) {
+                    intent.putExtra("isShow", (Boolean) object);
+                    intent.putExtra("type", SET_SHOW_OR_HIDE);
+                } else if (object instanceof Integer) {
+                    intent.putExtra("type", (Integer) object);
+                }
+                context.startService(intent);
             }
-            context.startService(intent);
         }
     }
 
@@ -1470,4 +1480,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();
+    }
 }

+ 19 - 0
app/src/main/java/com/sheep/gamegroup/util/PngUtil.java

@@ -0,0 +1,19 @@
+package com.sheep.gamegroup.util;
+
+/**
+ * Created by realicing on 2018/8/15.
+ * realicing@sina.com
+ */
+public class PngUtil {
+
+    // 动态导入 so 库
+    static {
+        System.loadLibrary("PngUtil");
+    }
+
+    //给png图片添加备注
+    public native static String decodePng(String filePath, String gamePackageName, String comment) throws Exception;
+    //检查是否是正版小绵羊app
+    public native static String isKfzsSheepApp();
+
+}

+ 397 - 0
app/src/main/java/com/sheep/gamegroup/util/ScreenShotListenManager.java

@@ -0,0 +1,397 @@
+package com.sheep.gamegroup.util;
+
+import android.content.Context;
+import android.database.ContentObserver;
+import android.database.Cursor;
+import android.graphics.BitmapFactory;
+import android.graphics.Point;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Handler;
+import android.os.Looper;
+import android.provider.MediaStore;
+import android.text.TextUtils;
+import android.view.Display;
+import android.view.WindowManager;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+/**
+ * 截屏监听管理器 <br/><br/>
+ *
+ * <p>
+ * 截屏判断依据: 监听媒体数据库的数据改变, 在有数据改变时获取最后
+ * 插入数据库的一条图片数据, 如果符合以下规则, 则认为截屏了: <br/>
+ *
+ * 1. 时间判断, 图片的生成时间在开始监听之后, 并与当前时间相隔10秒内; <br/>
+ * 2. 尺寸判断, 图片的尺寸没有超过屏幕的尺寸; <br/>
+ * 3. 路径判断, 图片路径符合包含特定的关键词。<br/>
+ *
+ * <p>
+ * Demo:
+ * <pre> {@code
+ *
+ *      // Requires Permission: android.permission.READ_EXTERNAL_STORAGE
+ *
+ *      ScreenShotListenManager manager = ScreenShotListenManager.newInstance(context);
+ *
+ *      manager.setListener(
+ *          new OnScreenShotListener() {
+ *              public void onShot(String imagePath) {
+ *                  // do something
+ *              }
+ *          }
+ *      );
+ *
+ *      manager.startListen();
+ *      ...
+ *      manager.stopListen();
+ *
+ * }</pre>
+ *
+ * @author xietansheng
+ */
+public class ScreenShotListenManager {
+
+    private static final String TAG = "ScreenShotListenManager";
+
+    /** 读取媒体数据库时需要读取的列 */
+    private static final String[] MEDIA_PROJECTIONS =  {
+            MediaStore.Images.ImageColumns.DATA,
+            MediaStore.Images.ImageColumns.DATE_TAKEN,
+    };
+    /** 读取媒体数据库时需要读取的列, 其中 WIDTH 和 HEIGHT 字段在 API 16 以后才有 */
+    private static final String[] MEDIA_PROJECTIONS_API_16 = {
+            MediaStore.Images.ImageColumns.DATA,
+            MediaStore.Images.ImageColumns.DATE_TAKEN,
+            MediaStore.Images.ImageColumns.WIDTH,
+            MediaStore.Images.ImageColumns.HEIGHT,
+    };
+
+    /** 截屏依据中的路径判断关键字 */
+    private static final String[] KEYWORDS = {
+            "screenshot", "screen_shot", "screen-shot", "screen shot",
+            "screencapture", "screen_capture", "screen-capture", "screen capture",
+            "screencap", "screen_cap", "screen-cap", "screen cap"
+    };
+
+    private static Point sScreenRealSize;
+
+    /** 已回调过的路径 */
+    private final List<String> sHasCallbackPaths = new ArrayList<String>();
+
+    private Context mContext;
+
+    private OnScreenShotListener mListener;
+
+    private long mStartListenTime;
+
+    /** 内部存储器内容观察者 */
+    private MediaContentObserver mInternalObserver;
+
+    /** 外部存储器内容观察者 */
+    private MediaContentObserver mExternalObserver;
+
+    /** 运行在 UI 线程的 Handler, 用于运行监听器回调 */
+    private final Handler mUiHandler = new Handler(Looper.getMainLooper());
+
+    private ScreenShotListenManager(Context context) {
+        if (context == null) {
+            throw new IllegalArgumentException("The context must not be null.");
+        }
+        mContext = context;
+
+        // 获取屏幕真实的分辨率
+        if (sScreenRealSize == null) {
+            sScreenRealSize = getRealScreenSize();
+            if (sScreenRealSize != null) {
+                LogUtil.println(TAG, "Screen Real Size: " + sScreenRealSize.x + " * " + sScreenRealSize.y);
+            } else {
+                LogUtil.println(TAG, "Get screen real size failed.");
+            }
+        }
+    }
+
+    public static ScreenShotListenManager newInstance(Context context) {
+        assertInMainThread();
+        return new ScreenShotListenManager(context);
+    }
+
+    /**
+     * 启动监听
+     */
+    public void startListen() {
+        assertInMainThread();
+
+        sHasCallbackPaths.clear();
+
+        // 记录开始监听的时间戳
+        mStartListenTime = System.currentTimeMillis();
+
+        // 创建内容观察者
+        mInternalObserver = new MediaContentObserver(MediaStore.Images.Media.INTERNAL_CONTENT_URI, mUiHandler);
+        mExternalObserver = new MediaContentObserver(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, mUiHandler);
+
+        // 注册内容观察者
+        mContext.getContentResolver().registerContentObserver(
+                MediaStore.Images.Media.INTERNAL_CONTENT_URI,
+                false,
+                mInternalObserver
+        );
+        mContext.getContentResolver().registerContentObserver(
+                MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
+                false,
+                mExternalObserver
+        );
+    }
+
+    /**
+     * 停止监听
+     */
+    public void stopListen() {
+        assertInMainThread();
+
+        // 注销内容观察者
+        if (mInternalObserver != null) {
+            try {
+                mContext.getContentResolver().unregisterContentObserver(mInternalObserver);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            mInternalObserver = null;
+        }
+        if (mExternalObserver != null) {
+            try {
+                mContext.getContentResolver().unregisterContentObserver(mExternalObserver);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            mExternalObserver = null;
+        }
+
+        // 清空数据
+        mStartListenTime = 0;
+        sHasCallbackPaths.clear();
+    }
+
+    /**
+     * 处理媒体数据库的内容改变
+     */
+    private void handleMediaContentChange(Uri contentUri) {
+        Cursor cursor = null;
+        try {
+            // 数据改变时查询数据库中最后加入的一条数据
+            cursor = mContext.getContentResolver().query(
+                    contentUri,
+                    Build.VERSION.SDK_INT < 16 ? MEDIA_PROJECTIONS : MEDIA_PROJECTIONS_API_16,
+                    null,
+                    null,
+                    MediaStore.Images.ImageColumns.DATE_ADDED + " desc limit 1"
+            );
+
+            if (cursor == null) {
+                LogUtil.println(TAG, "Deviant logic.");
+                return;
+            }
+            if (!cursor.moveToFirst()) {
+                LogUtil.println(TAG, "Cursor no data.");
+                return;
+            }
+
+            // 获取各列的索引
+            int dataIndex = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);
+            int dateTakenIndex = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATE_TAKEN);
+            int widthIndex = -1;
+            int heightIndex = -1;
+            if (Build.VERSION.SDK_INT >= 16) {
+                widthIndex = cursor.getColumnIndex(MediaStore.Images.ImageColumns.WIDTH);
+                heightIndex = cursor.getColumnIndex(MediaStore.Images.ImageColumns.HEIGHT);
+            }
+
+            // 获取行数据
+            String data = cursor.getString(dataIndex);
+            long dateTaken = cursor.getLong(dateTakenIndex);
+            int width = 0;
+            int height = 0;
+            if (widthIndex >= 0 && heightIndex >= 0) {
+                width = cursor.getInt(widthIndex);
+                height = cursor.getInt(heightIndex);
+            } else {
+                // API 16 之前, 宽高要手动获取
+                Point size = getImageSize(data);
+                width = size.x;
+                height = size.y;
+            }
+
+            // 处理获取到的第一行数据
+            handleMediaRowData(data, dateTaken, width, height);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+
+        } finally {
+            if (cursor != null && !cursor.isClosed()) {
+                cursor.close();
+            }
+        }
+    }
+
+    private Point getImageSize(String imagePath) {
+        BitmapFactory.Options options = new BitmapFactory.Options();
+        options.inJustDecodeBounds = true;
+        BitmapFactory.decodeFile(imagePath, options);
+        return new Point(options.outWidth, options.outHeight);
+    }
+
+    /**
+     * 处理获取到的一行数据
+     */
+    private void handleMediaRowData(String data, long dateTaken, int width, int height) {
+        if (checkScreenShot(data, dateTaken, width, height)) {
+            LogUtil.println(TAG, "ScreenShot: path = " + data + "; size = " + width + " * " + height
+                    + "; date = " + dateTaken);
+            if (mListener != null && !checkCallback(data)) {
+                mListener.onShot(data);
+            }
+        } else {
+            // 如果在观察区间媒体数据库有数据改变,又不符合截屏规则,则输出到 log 待分析
+            LogUtil.println(TAG, "Media content changed, but not screenshot: path = " + data
+                    + "; size = " + width + " * " + height + "; date = " + dateTaken);
+        }
+    }
+
+    /**
+     * 判断指定的数据行是否符合截屏条件
+     */
+    private boolean checkScreenShot(String data, long dateTaken, int width, int height) {
+        /*
+         * 判断依据一: 时间判断
+         */
+        // 如果加入数据库的时间在开始监听之前, 或者与当前时间相差大于10秒, 则认为当前没有截屏
+        if (dateTaken < mStartListenTime || (System.currentTimeMillis() - dateTaken) > 10 * 1000) {
+            return false;
+        }
+
+        /*
+         * 判断依据二: 尺寸判断
+         */
+        if (sScreenRealSize != null) {
+            // 如果图片尺寸超出屏幕, 则认为当前没有截屏
+            if (
+                    !(
+                            (width <= sScreenRealSize.x && height <= sScreenRealSize.y)
+                                    ||
+                                    (height <= sScreenRealSize.x && width <= sScreenRealSize.y)
+                    )) {
+                return false;
+            }
+        }
+
+        /*
+         * 判断依据三: 路径判断
+         */
+        if (TextUtils.isEmpty(data)) {
+            return false;
+        }
+        data = data.toLowerCase();
+        // 判断图片路径是否含有指定的关键字之一, 如果有, 则认为当前截屏了
+        for (String keyWork : KEYWORDS) {
+            if (data.contains(keyWork)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * 判断是否已回调过, 某些手机ROM截屏一次会发出多次内容改变的通知; <br/>
+     * 删除一个图片也会发通知, 同时防止删除图片时误将上一张符合截屏规则的图片当做是当前截屏.
+     */
+    private boolean checkCallback(String imagePath) {
+        if (sHasCallbackPaths.contains(imagePath)) {
+            return true;
+        }
+        // 大概缓存15~20条记录便可
+        if (sHasCallbackPaths.size() >= 20) {
+            for (int i = 0; i < 5; i++) {
+                sHasCallbackPaths.remove(0);
+            }
+        }
+        sHasCallbackPaths.add(imagePath);
+        return false;
+    }
+
+    /**
+     * 获取屏幕分辨率
+     */
+    private Point getRealScreenSize() {
+        Point screenSize = null;
+        try {
+            screenSize = new Point();
+            WindowManager windowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
+            Display defaultDisplay = windowManager.getDefaultDisplay();
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
+                defaultDisplay.getRealSize(screenSize);
+            } else {
+                try {
+                    Method mGetRawW = Display.class.getMethod("getRawWidth");
+                    Method mGetRawH = Display.class.getMethod("getRawHeight");
+                    screenSize.set(
+                            (Integer) mGetRawW.invoke(defaultDisplay),
+                            (Integer) mGetRawH.invoke(defaultDisplay)
+                    );
+                } catch (Exception e) {
+                    screenSize.set(defaultDisplay.getWidth(), defaultDisplay.getHeight());
+                    e.printStackTrace();
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return screenSize;
+    }
+
+    /**
+     * 设置截屏监听器
+     */
+    public void setListener(OnScreenShotListener listener) {
+        mListener = listener;
+    }
+
+    public static interface OnScreenShotListener {
+        public void onShot(String imagePath);
+    }
+
+    private static void assertInMainThread() {
+        if (Looper.myLooper() != Looper.getMainLooper()) {
+            StackTraceElement[] elements = Thread.currentThread().getStackTrace();
+            String methodMsg = null;
+            if (elements != null && elements.length >= 4) {
+                methodMsg = elements[3].toString();
+            }
+            throw new IllegalStateException("Call the method must be in main thread: " + methodMsg);
+        }
+    }
+
+    /**
+     * 媒体内容观察者(观察媒体数据库的改变)
+     */
+    private class MediaContentObserver extends ContentObserver {
+
+        private Uri mContentUri;
+
+        public MediaContentObserver(Uri contentUri, Handler handler) {
+            super(handler);
+            mContentUri = contentUri;
+        }
+
+        @Override
+        public void onChange(boolean selfChange) {
+            super.onChange(selfChange);
+            LogUtil.println(TAG, "onChange", selfChange);
+            handleMediaContentChange(mContentUri);
+        }
+    }
+}

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

@@ -29,6 +29,7 @@ import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.usage.AppUsageManager;
 import com.sheep.gamegroup.view.activity.ActInstallApkList;
 import com.sheep.gamegroup.view.activity.ActSheepApkList;
+import com.sheep.gamegroup.view.activity.ActSheepPngList;
 import com.sheep.gamegroup.view.activity.ActWeb;
 import com.sheep.gamegroup.view.dialog.DialogLoading;
 import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
@@ -285,7 +286,7 @@ public class TestUtil {
      * @param activity
      */
     public static void test(final Activity activity) {
-        final String[] items = {"审核中心","复制token","复制打点数据","loading","progress","查看截图","复制imsi","小米游戏","测试可用金额","测试定位信息","测试apk的渠道","幂动科技","游戏搜索",
+        final String[] items = {"复制token","复制打点数据","审核中心","检查正版","crc32","loading","progress","查看截图","复制imsi","小米游戏","测试可用金额","测试定位信息","测试apk的渠道","幂动科技","游戏搜索",
                 "游戏帐号","游戏代充","尝试开启第三方应用使用情况","测试代理页面","第三方应用使用情况",
                 "开启第三方应用使用情况","h5跳转","新手对话框","md5","空间不足提示框",
                 "显示已经安装应用列表","复制faq地址","复制代理地址","复制世界杯地址","任务游戏列表","世界杯活动","交通银行信用卡测试",
@@ -300,6 +301,12 @@ public class TestUtil {
                             case "审核中心":
                                 Jump2View.getInstance().goAuditTastList(activity, null);
                                 break;
+                            case "检查正版":
+                                PngUtil.isKfzsSheepApp();
+                                break;
+                            case "crc32":
+                                activity.startActivity(new Intent(activity, ActSheepPngList.class));
+                                break;
                             case "loading":
                                 DialogLoading.showDialog(activity);
                                 break;

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

@@ -98,7 +98,7 @@ public class UMConfigUtils {
         NEWBIE_TASK("点击新手任务图标"),//5065
         AD_SPLASH("点击开屏广告 需要传点击的广告对应的id,如:{\"ad_id\": 1}"),//5066
         AD_TOAST("点击弹窗广告 需要传点击的广告对应的id,如:{\"ad_id\": 1}"),//5067
-        LOGIN_PHONE("点击登录界面中的手机号登录"),//5068
+        LOGIN_PHONE("点击登录界面中的手机号登录  注:!!!!!手机号登录界面已经与登录界面合并了,所以不再触发该操作!!!!!"),//5068
         LOGIN_QQ("点击登录界面中的QQ登录"),//5069
         LOGIN_WX("点击登录界面中的微信登录"),//5070
         USER_INFO("个人中心 -> 个人资料"),//5071
@@ -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;
 

+ 81 - 4
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;
@@ -53,6 +54,7 @@ import com.sheep.gamegroup.model.entity.GameAccountEntity;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
 import com.sheep.gamegroup.model.entity.PayEntity;
 import com.sheep.gamegroup.model.entity.RobTask;
+import com.sheep.gamegroup.model.entity.Welfare;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.glide.RoundedCornersTransformation;
 import com.sheep.gamegroup.view.activity.PersonalInfoAct;
@@ -99,7 +101,6 @@ public class ViewUtil {
 
     public static final int REQUEST_CODE_TASK_LIST = 110;
     private static ViewUtil viewUtil;
-    static int result = 0;
     static RobTask mRobTask;
 
     public static ViewUtil newInstance() {
@@ -534,6 +535,67 @@ public class ViewUtil {
         }
 
     }
+    /**
+     * 领取福利成功的对话框
+     *
+     * @param activity
+     * @param welfare
+     */
+    public static void shareGetWelfareDialog(final Activity activity, final Welfare welfare) {
+        View dialog_parent = View.inflate(activity, R.layout.dialog_parent, null);
+        final AlertDialog dialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
+                .setView(dialog_parent)
+                .create();
+        TextView dialog_title = dialog_parent.findViewById(R.id.dialog_title);
+        View dialog_close = dialog_parent.findViewById(R.id.dialog_close);
+        LinearLayout dialog_center_ll = dialog_parent.findViewById(R.id.dialog_center_ll);
+        View view = LayoutInflater.from(activity).inflate(R.layout.x_get_welfare_dialog, dialog_center_ll, true);
+        dialog_title.setText("领取成功");
+
+        TextView dialog_btn_left = view.findViewById(R.id.dialog_btn_left);
+        TextView dialog_btn_right = view.findViewById(R.id.dialog_btn_right);
+        dialog_btn_left.setText("关闭");
+        dialog_btn_right.setText("启动游戏");
+
+        final TextView get_welfare_code_tv = view.findViewById(R.id.get_welfare_code_tv);
+        TextView get_welfare_copy_tv = view.findViewById(R.id.get_welfare_copy_tv);
+        TextView get_welfare_content_tv = view.findViewById(R.id.get_welfare_content_tv);
+        //TODO 设置内容与兑换码
+
+        get_welfare_copy_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                StringUtils.CopyText(get_welfare_code_tv.getText().toString());
+            }
+        });
+
+        dialog_btn_right.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                dialog.dismiss();
+                //TODO 启动游戏
+            }
+        });
+        dialog_btn_left.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                dialog.dismiss();
+            }
+        });
+        dialog_close.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                dialog.dismiss();
+            }
+        });
+
+        try {
+            dialog.show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
 
     /**
      * 获取一个 View 的缓存视图
@@ -1298,7 +1360,8 @@ public class ViewUtil {
     public void showGridviewStatues(Context context, TextView textView, HomeListEntity entity) {
         textView.setVisibility(View.INVISIBLE);
 
-        int padding = textView.getContext().getResources().getDimensionPixelSize(R.dimen.content_padding_2);
+        int padding1 = textView.getContext().getResources().getDimensionPixelSize(R.dimen.content_padding_1);
+        int padding2 = textView.getContext().getResources().getDimensionPixelSize(R.dimen.content_padding_2);
         switch (entity.getTag()) {
             default:
 
@@ -1308,16 +1371,30 @@ public class ViewUtil {
                 textView.setBackgroundResource(R.drawable.shape_red_stroke_rectangle_no_lb);
                 textView.setTextColor(context.getResources().getColor(R.color.red_FD2D54));
                 textView.setText("现金");
-                textView.setPadding(4 * padding, padding, 4 * padding, padding);
+                textView.setPadding( padding2, padding1,  padding2, padding1);
                 break;
             case 4:
                 textView.setVisibility(View.VISIBLE);
                 textView.setBackgroundResource(R.drawable.shape_red_f07422_stroke_retangle_no_lb);
                 textView.setTextColor(context.getResources().getColor(R.color.red_F07422));
                 textView.setText("活跃");
-                textView.setPadding(4 * padding, padding, 4 * padding, padding);
+                textView.setPadding( padding2, padding1,  padding2, padding1);
                 break;
         }
 
     }
+    /**
+     * 获取状态栏高度
+     *
+     * @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;
+    }
 }

+ 192 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActBindMobileRegister.java

@@ -0,0 +1,192 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.app.Activity;
+import android.support.v7.widget.AppCompatEditText;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.LoginEntity;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.ChannelContent;
+import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.gamegroup.util.SelfCountDownTimer;
+import com.sheep.gamegroup.util.StringUtils;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import butterknife.BindView;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by ljy on 2018/3/27.
+ */
+
+public class ActBindMobileRegister extends BaseActivity {
+
+    @BindView(R.id.bind_mobile_register_phone_iv)
+    ImageView bindMobileRegisterPhoneIv;
+    @BindView(R.id.bind_mobile_register_phone_et)
+    AppCompatEditText bindMobileRegisterPhoneEt;
+    @BindView(R.id.bind_mobile_register_code_iv)
+    ImageView bindMobileRegisterCodeIv;
+    @BindView(R.id.bind_mobile_register_code_et)
+    AppCompatEditText bindMobileRegisterCodeEt;
+    @BindView(R.id.bind_mobile_register_code_tv)
+    TextView bind_mobile_register_code_tv;
+    private Activity activity;
+
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_bind_mobile_register;
+    }
+
+    @Override
+    public void initView() {
+        activity = this;
+        GlideImageLoader.setImage(bindMobileRegisterPhoneIv, "http://cdngame.kuaifazs.com/phone_icon_iv.png");
+        GlideImageLoader.setImage(bindMobileRegisterCodeIv, "http://cdngame.kuaifazs.com/code_icon_iv.png");
+        TitleBarUtils.getInstance()
+                .setTitle(this, "绑定手机号")
+                .setTitleFinish(this, new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        finish();
+                    }
+                });
+    }
+
+    @Override
+    public void initListener() {
+        selfCountDownTimer = new SelfCountDownTimer(60 * 1000, 1000, SelfCountDownTimer.FULL_SECOND) {
+            @Override
+            public void onTimerRest() {
+                bind_mobile_register_code_tv.setText(getString(R.string.get_captcha));
+                bind_mobile_register_code_tv.setEnabled(true);
+            }
+
+            @Override
+            public void onTimerTick(long millisUntilFinished, int countTime) {
+                String textStr = countTime + " s";
+                bind_mobile_register_code_tv.setText(textStr);
+            }
+
+            @Override
+            public void onTimerFinish() {
+                selfCountDownTimer.reset(SelfCountDownTimer.FULL_SECOND);
+            }
+        };
+    }
+
+    private LoginEntity loginEntity;
+    @Override
+    public void initData() {
+        loginEntity = (LoginEntity) getIntent().getSerializableExtra(LoginEntity.class.getSimpleName());
+        if(loginEntity == null)//必须传入LoginEntity才能保证正常运行
+            finish();
+    }
+
+    private SelfCountDownTimer selfCountDownTimer;
+    /**
+     * 获取验证码
+     * captcha	string
+     验证码 第二步需要
+     mobile	string
+     platform	string
+     登录返回来的platform
+     scope	string
+     传kfzs为官包 传空为邀请包
+     step	string
+     步骤:first发验证码 second绑定
+     token	string
+     登录返回来的token
+     * @param view
+     */
+    public void getCaptcha(View view) {
+        bind_mobile_register_code_tv.setEnabled(false);
+        //检查手机号
+        final String mobile = bindMobileRegisterPhoneEt.getText().toString().trim();
+        if(!StringUtils.isMobile(mobile)){
+            G.showToast("请填写正确的手机号!");
+            return;
+        }
+        //提交数据获取验证码
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("mobile", mobile);
+        jsonObject.put("platform", loginEntity.getPlatform());
+        jsonObject.put("scope", ChannelContent.getInstance().getChannel_name());
+        jsonObject.put("step", "first");
+        jsonObject.put("token", loginEntity.getToken());
+        SheepApp.getInstance().getNetComponent().getApiService().bindMobileRegister(jsonObject)
+                        .subscribeOn(Schedulers.io())
+                        .observeOn(AndroidSchedulers.mainThread())
+                        .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                            @Override
+                            public void onNext(BaseMessage baseMessage) {
+                                mMobile = mobile;
+                                selfCountDownTimer.start();
+                            }
+
+                            @Override
+                            public void onError(BaseMessage baseMessage) {
+                                G.showToast(baseMessage);
+                                bind_mobile_register_code_tv.setEnabled(true);
+                            }
+                        });
+    }
+    private String mMobile;//获取验证码成功后得到手机号
+    /**
+     * 提交
+     * @param view
+     */
+    public void toCommit(View view) {
+        //检查验证码
+        final String captcha = bindMobileRegisterCodeEt.getText().toString().trim();
+        if(TextUtils.isEmpty(captcha)){
+            G.showToast("验证码不能为空!");
+            return;
+        }
+        if(captcha.length() != 6){
+            G.showToast(getString(R.string.toast_warning_phone_captcha_image_code_size));
+            return;
+        }
+        //提交数据注册手机号并绑定第三方账号
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("captcha", captcha);
+        jsonObject.put("mobile", mMobile);
+        jsonObject.put("platform", loginEntity.getPlatform());
+        jsonObject.put("scope", ChannelContent.getInstance().getChannel_name());
+        jsonObject.put("step", "second");
+        jsonObject.put("token", loginEntity.getToken());
+        SheepApp.getInstance().getNetComponent().getApiService().bindMobileRegister(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast(baseMessage);
+                    }
+                });
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        if(selfCountDownTimer != null){
+            selfCountDownTimer.cancel();
+        }
+    }
+}

+ 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);
+    }
+}

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/ActFindInformation.java

@@ -180,7 +180,7 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
         WebViewClient wvc = new WebViewClient() {
             @Override
             public boolean shouldOverrideUrlLoading(WebView view, String url) {
-                 webView.loadUrl(url);
+                webView.loadUrl(url);
                 Jump2View.getInstance().goWeb(ActFindInformation.this, url);
                 return true;
             }
@@ -623,7 +623,6 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
     protected void onResume() {
         super.onResume();
         taskHelper.onResume();
-        Aria.download(this).unRegister();
         try {
             if (webView != null) {
                 webView.resumeTimers();
@@ -639,6 +638,7 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
     protected void onDestroy() {
         super.onDestroy();
         LogUtil.logI("释放资源");
+        Aria.download(this).unRegister();
         EventBus.getDefault().unregister(this);
         taskHelper.destroy();
         if (webView != null) {

+ 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() {
+    }
+
+}

+ 144 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActSheepPngList.java

@@ -0,0 +1,144 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.kfzs.duanduan.react.FileUtil;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.PngUtil;
+import com.sheep.gamegroup.util.ViewHolder;
+import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+
+import static com.sheep.jiuyan.samllsheep.utils.ClassFileHelper.DIR;
+
+/**
+ * Created by realicing on 2018/6/19.
+ * realicing@sina.com
+ */
+public class ActSheepPngList extends BaseActivity {
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_user_label_list;
+    }
+
+
+    @BindView(R.id.user_label_list)
+    RecyclerView user_label_list;
+
+    @BindView(R.id.user_label_commit_tv)
+    TextView user_label_commit_tv;
+
+    @Override
+    public void initView() {
+        TitleBarUtils
+                .getInstance()
+                .setTitle(this, "Sheep目录png测试")
+                .setTitleFinish(this);
+        user_label_commit_tv.setVisibility(View.GONE);
+    }
+
+    @Override
+    public void initListener() {
+
+    }
+
+    @Override
+    public void initData() {
+        loadData(getList());
+    }
+
+    private List<File> getList() {
+        File dir = new File(DIR);
+        File[] files = dir.listFiles(new FileFilter() {
+            @Override
+            public boolean accept(File file) {
+                return TextUtils.equals(FileUtil.getExtensionName(file.getName()), "png");
+            }
+        });
+        return ListUtil.asList(files);
+    }
+    private void loadData(List<File> list) {
+        user_label_list.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
+        user_label_list.setAdapter(new AdbCommonRecycler<File>(SheepApp.getInstance(), list){
+
+            @Override
+            public int getViewIdByType(int type) {
+                return R.layout.app_info_item;
+            }
+
+            @Override
+            public void convert(ViewHolder holder, final File item) {
+                ImageView app_info_iv = holder.itemView.findViewById(R.id.app_info_iv);
+                TextView app_info_name_tv = holder.itemView.findViewById(R.id.app_info_name_tv);
+                TextView app_info_package_name_tv = holder.itemView.findViewById(R.id.app_info_package_name_tv);
+                TextView app_info_size_tv = holder.itemView.findViewById(R.id.app_info_size_tv);
+                TextView app_info_path_tv = holder.itemView.findViewById(R.id.app_info_path_tv);
+
+                Glide.with(SheepApp.getInstance())
+                        .load(item)
+                        .into(app_info_iv);
+
+                holder.itemView.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        try {
+                            onClickItem(item);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            G.showToast(e.getMessage());
+                        }
+                    }
+                });
+                holder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
+                    @Override
+                    public boolean onLongClick(View view) {
+                        return true;
+                    }
+                });
+            }
+        });
+
+    }
+
+    private void onClickItem(final File file) throws Exception {
+        //加密文本内容:包名;签名md5;试玩应用包名;试玩应用签名md5;任务id;图片总数;图片位置
+        String iEndData = PngUtil.decodePng(file.getAbsolutePath(), "com.realicing.android.upgrade.sheep", "280;7;0");
+        if(iEndData == null){
+            G.showToast("失败");
+        } else if(TextUtils.isEmpty(iEndData)){
+            G.showToast("添加iEnd data成功");
+        } else {
+            G.showToast(iEndData);
+        }
+    }
+
+    @OnClick({R.id.user_label_commit_tv})
+    public void onViewClicked(View view) {
+        switch (view.getId()) {
+            case R.id.user_label_commit_tv:
+                toCommit();
+                break;
+        }
+    }
+
+    private void toCommit() {
+    }
+
+}

+ 89 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActivityMessages.java

@@ -0,0 +1,89 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.annotation.SuppressLint;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.support.design.widget.TabLayout;
+import android.support.v4.view.ViewPager;
+import android.support.v7.app.AppCompatActivity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.view.adapter.MessageAdapter;
+import com.sheep.jiuyan.samllsheep.R;
+
+
+/**
+ * created on:2018/8/28 on 11:44
+ * created by: YSL
+ * 描述:消息Activity,展示消息中心和互动消息两个模块
+ */
+public class ActivityMessages extends AppCompatActivity {
+    private String[] mTitle = new String[]{"消息中心", "回复互动"};
+    private TabLayout tabLayout = null;
+    private ViewPager viewPager = null;
+
+
+    @SuppressLint("WrongViewCast")
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_messages);
+        viewPager = findViewById(R.id.message_view_pager_grd);
+        tabLayout = findViewById(R.id.tab_layout);
+        tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
+            @Override
+            public void onTabSelected(TabLayout.Tab tab) {
+                for (int i = 0; i < tabLayout.getTabCount(); i++) {
+                    View tabView = tabLayout.getTabAt(i).getCustomView();
+                    if (tabView == null) {
+                        tabView = getCustomView(i);
+                        tabLayout.getTabAt(i).setCustomView(tabView);
+                    }
+                    TextView tvtable = tabView.findViewById(R.id.tv_message);
+                    ImageView ivtable = tabView.findViewById(R.id.iv_message);
+                    if (i == tab.getPosition()) {
+                        tvtable.setTextColor(Color.parseColor("#ff333333"));
+                    } else {
+                        tvtable.setTextColor(Color.parseColor("#ff666666"));
+                    }
+                    tvtable.setText(mTitle[i]);
+                }
+            }
+
+            @Override
+            public void onTabUnselected(TabLayout.Tab tab) {
+
+            }
+
+            @Override
+            public void onTabReselected(TabLayout.Tab tab) {
+
+            }
+        });
+        viewPager.setAdapter(new MessageAdapter(getSupportFragmentManager(), this));
+        tabLayout.setupWithViewPager(viewPager);
+        //返回
+        findViewById(R.id.iv_back).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                ActivityMessages.this.finish();
+            }
+        });
+    }
+
+    /**
+     * 、
+     * 设置每个tab的view,可根据position的不同,针对性的对每个tab做处理,这里消息互动和消息中心的tab布局一样,所以就统一设置
+     *
+     * @param position tab的位置
+     * @return ,tab的view
+     */
+    private View getCustomView(int position) {
+        View view = LayoutInflater.from(this).inflate(R.layout.layout_fragment_mseeages, null, false);
+        return view;
+    }
+}
+

+ 240 - 55
app/src/main/java/com/sheep/gamegroup/view/activity/LoginAct.java

@@ -1,20 +1,36 @@
 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;
-import android.widget.CheckBox;
 import android.widget.ImageView;
+import android.widget.LinearLayout;
 import android.widget.TextView;
 
+import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.absBase.BaseUMActivity;
 import com.sheep.gamegroup.di.components.DaggerLoginComponent;
 import com.sheep.gamegroup.di.modules.LoginModule;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.LoginEntity;
+import com.sheep.gamegroup.model.util.EntityUtils;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.presenter.LoginContract;
 import com.sheep.gamegroup.presenter.LoginPresenter;
-import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.gamegroup.util.ActivityManager;
+import com.sheep.gamegroup.util.ChannelContent;
+import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.LogUtil;
+import com.sheep.gamegroup.util.PreferenceUtils;
+import com.sheep.gamegroup.util.SelfCountDownTimer;
 import com.sheep.gamegroup.util.TestUtil;
+import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
@@ -23,15 +39,18 @@ import com.umeng.socialize.UMAuthListener;
 import com.umeng.socialize.UMShareAPI;
 import com.umeng.socialize.bean.SHARE_MEDIA;
 
+import java.util.Locale;
 import java.util.Map;
 
 import javax.inject.Inject;
 
 import butterknife.BindView;
+import butterknife.ButterKnife;
 import butterknife.OnClick;
+import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
+import rx.schedulers.Schedulers;
 
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.LOGIN_PHONE;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.LOGIN_QQ;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.LOGIN_WX;
 
@@ -43,45 +62,75 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
 
     @Inject
     LoginPresenter mPresenter;
-
-    @BindView(R.id.login_bg_img)
-    ImageView login_bg_img;
-
-    @BindView(R.id.tel_login_tv)
-    TextView telLoginTv;
+    @BindView(R.id.login_agreement_cb)
+    AppCompatCheckBox loginAgreementCb;
+    @BindView(R.id.login_agreement_tv)
+    TextView loginAgreementTv;
+    @BindView(R.id.login_agreement_ll)
+    LinearLayout loginAgreementLl;
     @BindView(R.id.iv_wx)
     ImageView ivWx;
     @BindView(R.id.iv_qq)
     ImageView ivQq;
-
-    @BindView(R.id.tel_agreement_cb)
-    CheckBox tel_agreement_cb;
-    @BindView(R.id.tel_agreement_tv)
-    TextView tel_agreement_tv;
+    @BindView(R.id.login_other_ll)
+    LinearLayout loginOtherLl;
+    @BindView(R.id.login_et_account)
+    AppCompatEditText loginEtAccount;
+    @BindView(R.id.login_et_code)
+    AppCompatEditText loginEtCode;
+    @BindView(R.id.login_btn_code)
+    TextView loginBtnCode;
+    @BindView(R.id.login_et_scope)
+    AppCompatEditText loginEtScope;
+    @BindView(R.id.test_change)
+    TextView testChange;
+    @BindView(R.id.test_change_user)
+    TextView testChangeUser;
 
 
     @Override
     protected int getLayoutId() {
         return R.layout.login_act_layout;
     }
-
+    private LoginAct activity;
     @Override
     public void initView() {
+        activity = this;
         DaggerLoginComponent.builder()
                 .netComponent(SheepApp.get(this).getNetComponent())
                 .loginModule(new LoginModule(this))
                 .build()
                 .inject(this);
-        GlideImageLoader.setImage(login_bg_img, "http://cdngame.kuaifazs.com/login_bg_img.png");
         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)});
+        }
     }
 
 
     @Override
     public void initListener() {
+        selfCountDownTimer = new SelfCountDownTimer(60 * 1000, 1000, SelfCountDownTimer.FULL_SECOND) {
+            @Override
+            public void onTimerRest() {
+                canGetCaptchaPhone = true;
+                loginBtnCode.setText(getString(R.string.get_captcha));
+            }
 
+            @Override
+            public void onTimerTick(long millisUntilFinished, int countTime) {
+                loginBtnCode.setText(String.format(Locale.CHINA, "%d s", countTime));
+            }
+
+            @Override
+            public void onTimerFinish() {
+                canGetCaptchaPhone = true;
+                loginBtnCode.setText(getString(R.string.get_captcha));
+            }
+        };
     }
 
     @Override
@@ -89,22 +138,6 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
 
     }
 
-
-
-
-    private void goTelLogin() {
-        LOGIN_PHONE.onEvent();
-        String openId = SpUtils.getToken(getApplicationContext());
-        LogUtil.logI("手机号码登录--token----"+openId);
-        if (!TextUtils.isEmpty(openId)) {
-            Jump2View.getInstance().checkPhoneOrGoHomePage(this);
-            finish();
-        } else {
-            Jump2View.getInstance().goPhoneLoginView(LoginAct.this, 0);
-//            finish();
-        }
-    }
-
     private void goWeixin() {
         LOGIN_WX.onEvent();
         UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.WEIXIN, new UMAuthListener() {
@@ -115,17 +148,17 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
 
             @Override
             public void onComplete(SHARE_MEDIA platform, int action, Map<String, String> data) {
-                mPresenter.logByAuther(1,data.get("access_token"),data.get("openid"));
+                mPresenter.logByAuther(1, data.get("access_token"), data.get("openid"));
             }
 
             @Override
             public void onError(SHARE_MEDIA platform, int action, Throwable t) {
                 hideProgress();
-                String  str=t.getMessage();
-                if(str.indexOf("2008")>0) {
+                String str = t.getMessage();
+                if (str.indexOf("2008") > 0) {
                     G.showToast("微信授权失败,请先安装微信客户端 在登录吧!");
 
-                }else{
+                } else {
                     G.showToast("微信授权失败  请检查网络是否正常");
 
                 }
@@ -147,13 +180,13 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
         UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.QQ, new UMAuthListener() {
             @Override
             public void onStart(SHARE_MEDIA platform) {
-                 showProgress();
+                showProgress();
             }
 
             @Override
             public void onComplete(SHARE_MEDIA platform, int action, Map<String, String> data) {
 //                mPresenter.logByAuther(2,data.get("openid"));
-                mPresenter.logByAuther(2,data.get("access_token"),data.get("openid"));
+                mPresenter.logByAuther(2, data.get("access_token"), data.get("openid"));
 
             }
 
@@ -190,40 +223,192 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
     }
 
 
-
-    @OnClick({R.id.tel_login_tv, R.id.iv_wx, R.id.iv_qq, R.id.tel_agreement_tv})
+    @OnClick({R.id.login_agreement_tv, R.id.iv_wx, R.id.iv_qq, R.id.login_btn_code, R.id.login_commit})
     public void onViewClicked(View view) {
         switch (view.getId()) {
-            case R.id.tel_login_tv:
-                if(checkAgreement())
-                    goTelLogin();
+            case R.id.login_agreement_tv:
+                Jump2View.getInstance().tryShowAgreement(this, new Action1<String>() {
+                    @Override
+                    public void call(String msg) {
+                        if (!TextUtils.isEmpty(msg)) {
+                            G.showToast(msg);
+                        }
+                    }
+                });
                 break;
             case R.id.iv_wx:
-                if(checkAgreement())
+                if (checkAgreement())
                     goWeixin();
                 break;
             case R.id.iv_qq:
-                if(checkAgreement())
+                if (checkAgreement())
                     loginQQ();
                 break;
-            case R.id.tel_agreement_tv:
-                Jump2View.getInstance().tryShowAgreement(this, new Action1<String>() {
-                            @Override
-                            public void call(String msg) {
-                                if(!TextUtils.isEmpty(msg)) {
-                                    G.showToast(msg);
-                                }
-                            }
-                        });
+            case R.id.login_btn_code:
+                etPhone = loginEtAccount.getText().toString().trim();
+                getCaptcha();
+                break;
+            case R.id.login_commit:
+                etPhone = loginEtAccount.getText().toString().trim();
+                etCode = loginEtCode.getText().toString().trim();
+                if (TestUtil.isTest() && TextUtils.isEmpty(etCode) && !TextUtils.isEmpty(etPhone)) {
+                    goMain(etPhone);
+                    TestUtil.addUser(etPhone);
+                    return;
+                }
+                loginByPhoneCaptcha();
                 break;
         }
     }
+    private void goMain(String openId) {
+        SpUtils.saveToken(getApplicationContext(), openId);
+        Jump2View.getInstance().goHomePageView(this, null);
+        ActivityManager.getInstance().endActivity(LoginAct.class);
+        finish();
+    }
 
+    /**
+     * 登录
+     */
+    private void loginByPhoneCaptcha() {
+        if (!checkPhoneInput()) {
+            return;
+        }
+        if (!checkCodeInput()) {
+            return;
+        }
+        String scope = loginEtScope.getText().toString();
+        if(TextUtils.isEmpty(scope)){
+            scope = ChannelContent.getInstance().getChannel_name();
+        }
+        showProgress();
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("account", etPhone);
+        jsonObject.put("sec_code", etCode);
+        jsonObject.put("invitation_code", scope);
+        PreferenceUtils.setPrefString(SheepApp.mContext, UMConfigUtils.LOGIN_TYPE, UMConfigUtils.Source.SHEEP);
+        SheepApp.getInstance().getNetComponent().getApiService().loginByCaptcha(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        hideProgress();
+                        G.showToast(baseMessage);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        hideProgress();
+                        if (baseMessage == null) {
+                            return;
+                        }
+                        LoginEntity loginEty = null;
+                        try {
+                            loginEty = JSONObject.parseObject(JSONObject.toJSONString(baseMessage.getData()), LoginEntity.class);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        if (loginEty != null) {
+                            SpUtils.saveToken(activity, loginEty.getToken());
+                            DataUtil.getInstance().setUserEntity(loginEty.getUser());
+                        }
+
+                        Jump2View.getInstance().goHomePageView(activity, EntityUtils.getUserCode(loginEty));
+                        TestUtil.saveUser(loginEty);
+
+                    }
+                });
+
+    }
+    private String etPhone;
+    private String etCode;
+    private boolean canGetCaptchaPhone = true;
+    private SelfCountDownTimer selfCountDownTimer;
+    /**
+     * 获取验证码
+     */
+    private void getCaptcha() {
+
+        if (!canGetCaptchaPhone) {
+            return;
+        }
+        if (!checkPhoneInput()) {
+            return;
+        }
+        selfCountDownTimer.reset(SelfCountDownTimer.FULL_SECOND);
+        canGetCaptchaPhone = true;
+        getCaptcha(etPhone, new Action1<BaseMessage>() {
+            @Override
+            public void call(BaseMessage baseMessage) {
+                if(baseMessage != null)
+                    selfCountDownTimer.start();
+            }
+        });
+    }
+
+    public void getCaptcha(String etPhone, final Action1<BaseMessage> action1) {
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("account", etPhone);
+        SheepApp.getInstance().getNetComponent().getApiService().getCaptcha(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        action1.call(null);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        action1.call(baseMessage);
+                    }
+                });
+
+    }
+    private boolean checkPhoneInput() {
+        if (TextUtils.isEmpty(etPhone)) {
+            G.showToast(getString(R.string.input_your_phone));
+            return false;
+        }
+        if (etPhone.length() != 11) {
+            G.showToast(getString(R.string.toast_warning_phone_number_size));
+            return false;
+        }
+        return true;
+    }
+
+    private boolean checkCodeInput() {
+        if (TextUtils.isEmpty(etCode)) {
+            G.showToast(getString(R.string.input_your_captcha));
+            return false;
+        }
+        if (etCode.length() != 6) {
+            G.showToast(getString(R.string.toast_warning_phone_captcha_image_code_size));
+            return false;
+        }
+        return true;
+    }
     private boolean checkAgreement() {
-        if(tel_agreement_cb.isChecked()){
+        if (loginAgreementCb.isChecked()) {
             return true;
         }
         G.showToast("温馨提示:您必须同意用户协议才能继续体验小绵羊APP!");
         return false;
     }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        // TODO: add setContentView(...) invocation
+        ButterKnife.bind(this);
+    }
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        if (selfCountDownTimer != null) {
+            selfCountDownTimer.cancel();
+        }
+    }
+
 }

+ 56 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/MessageInteractionDetailActivity.java

@@ -0,0 +1,56 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.OrientationHelper;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.view.adapter.MessageInteractionAdapter;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+/**
+ * created on:2018/8/28 on 17:15
+ * created by: YSL
+ * 描述:互动消息详情Activity
+ */
+public class MessageInteractionDetailActivity extends AppCompatActivity {
+    @BindView(R.id.txt_baseactivity_title)
+    TextView tvTitle;
+    @BindView(R.id.recycle_view)
+    RecyclerView recyclerView;
+    private MessageInteractionAdapter adapter;
+    private List<?> mList;
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_message_interaction);
+        ButterKnife.bind(this);
+        tvTitle.setText("回复详情");
+        LinearLayoutManager manager = new LinearLayoutManager(this);
+        manager.setOrientation(OrientationHelper.VERTICAL);
+        recyclerView.setLayoutManager(manager);
+        adapter = new MessageInteractionAdapter(this, mList);
+        recyclerView.setAdapter(adapter);
+    }
+
+    @OnClick({R.id.img_baseactivity_title})
+    public void initClick(View view) {
+        switch (view.getId()) {
+            case R.id.img_baseactivity_title:
+                MessageInteractionDetailActivity.this.finish();
+                break;
+        }
+    }
+}

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

@@ -0,0 +1,51 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.widget.TextView;
+
+import com.sheep.jiuyan.samllsheep.R;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+/**
+ * created on:2018/8/28 on 17:55
+ * created by: YSL
+ * 描述:消息回复详情Activity
+ */
+public class MessageReplyDetailActivity extends AppCompatActivity {
+    @BindView(R.id.tv_content)
+    TextView tvContent;
+    @BindView(R.id.tv_title)
+    TextView tvTitle;
+    @BindView(R.id.txt_baseactivity_title)
+    TextView tvBaseTitle;
+
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_messagesystem);
+        ButterKnife.bind(this);
+    }
+
+    @OnClick({R.id.img_baseactivity_title})
+    public void initClick(View view) {
+        switch (view.getId()) {
+            case R.id.img_baseactivity_title:
+                MessageReplyDetailActivity.this.finish();
+                break;
+        }
+
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+
+    }
+}

+ 0 - 337
app/src/main/java/com/sheep/gamegroup/view/activity/PhoneAct.java

@@ -1,337 +0,0 @@
-package com.sheep.gamegroup.view.activity;
-
-import android.app.Activity;
-import android.content.Context;
-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.KeyEvent;
-import android.view.View;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import com.alibaba.fastjson.JSONObject;
-import com.sheep.gamegroup.absBase.BaseActivity;
-import com.sheep.gamegroup.di.components.DaggerPhoneComponent;
-import com.sheep.gamegroup.di.modules.PhoneModule;
-import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.LoginEntity;
-import com.sheep.gamegroup.model.entity.UserEntity;
-import com.sheep.gamegroup.model.util.EntityUtils;
-import com.sheep.gamegroup.presenter.PhoneContract;
-import com.sheep.gamegroup.presenter.PhonePresenter;
-import com.sheep.gamegroup.util.ActivityManager;
-import com.sheep.gamegroup.util.DataUtil;
-import com.sheep.gamegroup.util.GlideImageLoader;
-import com.sheep.gamegroup.util.Jump2View;
-import com.sheep.gamegroup.util.LogUtil;
-import com.sheep.gamegroup.util.MyDbManager;
-import com.sheep.gamegroup.util.SelfCountDownTimer;
-import com.sheep.gamegroup.util.TestUtil;
-import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.utils.G;
-import com.sheep.jiuyan.samllsheep.utils.SpUtils;
-import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
-
-import javax.inject.Inject;
-
-import butterknife.BindView;
-import butterknife.OnClick;
-
-/**
- * Created by ljy on 2018/3/15.
- */
-
-public class PhoneAct extends BaseActivity implements PhoneContract.View {
-    Activity activity;
-    @BindView(R.id.phone_et_account)
-    AppCompatEditText phoneEtAccount;
-    @BindView(R.id.phone_et_code)
-    AppCompatEditText phoneEtCode;
-    @BindView(R.id.phone_btn_code)
-    TextView phoneBtnCode;
-    @BindView(R.id.phone_sure_tv)
-    TextView phoneSureTv;
-    @BindView(R.id.phone_iv)
-    ImageView phone_iv;
-
-    @Inject
-    PhonePresenter phonePresenter;
-    @BindView(R.id.phone_tip_tv)
-    TextView phoneTipTv;
-
-    private SelfCountDownTimer selfCountDownTimer;
-    private boolean canGetCaptchaPhone = true;
-
-    private String etPhone;
-    private String etCode;
-    private int showNotice;//0:登录,1:旧手机号,2:新手机号
-
-
-    @Override
-    protected int getLayoutId() {
-        return R.layout.bind_phone_number_act_layout;
-    }
-
-    @Override
-    public void initView() {
-        activity = this;
-        showNotice = getIntent().getIntExtra("show_notice", 0);
-        TitleBarUtils
-                .getInstance()
-                .setTitle(this, "手机号登录")
-                .setTitleFinish(this);
-        DaggerPhoneComponent.builder()
-                .netComponent(SheepApp.get(this).getNetComponent())
-                .phoneModule(new PhoneModule(this))
-                .build()
-                .inject(this);
-        if (TestUtil.isTest()) {
-            phoneEtAccount.setInputType(InputType.TYPE_CLASS_TEXT);
-            phoneEtAccount.setFilters(new InputFilter[]{new InputFilter.LengthFilter(1000)});
-        }
-        GlideImageLoader.centerImage(phone_iv, "http://cdngame.kuaifazs.com/icon_phone.png");
-    }
-
-    @Override
-    public void initListener() {
-        selfCountDownTimer = new SelfCountDownTimer(60 * 1000, 1000, SelfCountDownTimer.FULL_SECOND) {
-            @Override
-            public void onTimerRest() {
-                canGetCaptchaPhone = true;
-                phoneBtnCode.setText(getString(R.string.get_captcha));
-            }
-
-            @Override
-            public void onTimerTick(long millisUntilFinished, int counTime) {
-                String textStr = counTime + " s";
-                phoneBtnCode.setText(textStr);
-            }
-
-            @Override
-            public void onTimerFinish() {
-                canGetCaptchaPhone = true;
-                phoneBtnCode.setText(getString(R.string.get_captcha));
-            }
-        };
-    }
-
-    @Override
-    public void initData() {
-        if (showNotice == 0) {
-            phoneTipTv.setVisibility(View.GONE);
-        } else if (showNotice == 1) {
-            phoneTipTv.setVisibility(View.GONE);
-            phone_iv.setVisibility(View.GONE);
-        } else if (showNotice == 2) {
-            phoneTipTv.setVisibility(View.GONE);
-            phone_iv.setVisibility(View.GONE);
-        } else {
-            phoneTipTv.setVisibility(View.VISIBLE);
-
-        }
-
-    }
-
-    @OnClick({R.id.phone_et_account, R.id.phone_et_code, R.id.phone_btn_code, R.id.phone_sure_tv})
-    public void onViewClicked(View view) {
-        switch (view.getId()) {
-            case R.id.phone_et_account:
-                break;
-            case R.id.phone_et_code:
-                break;
-            case R.id.phone_btn_code:
-                etPhone = phoneEtAccount.getText().toString().trim();
-                getCaptcha();
-                break;
-            case R.id.phone_sure_tv:
-                etPhone = phoneEtAccount.getText().toString().trim();
-                etCode = phoneEtCode.getText().toString().trim();
-                if (TestUtil.isTest() && TextUtils.isEmpty(etCode)) {
-                    if (TextUtils.isEmpty(etPhone))
-                        etPhone = "13626@395a75211751465f54789a7f459089bd";
-                    goMain(etPhone);
-                    if (!TextUtils.isEmpty(etPhone))
-                        TestUtil.addUser(etPhone);
-                    return;
-                }
-                loginByPhoneGaptcha();
-                break;
-        }
-    }
-
-    private boolean checkPhoneInput() {
-        if (TextUtils.isEmpty(etPhone)) {
-            G.showToast(getString(R.string.input_your_phone));
-            return false;
-        }
-        if (etPhone.length() != 11) {
-            G.showToast(getString(R.string.toast_warning_phone_number_size));
-            return false;
-        }
-        return true;
-    }
-
-    private boolean checkCodeInput() {
-        if (TextUtils.isEmpty(etCode)) {
-            G.showToast(getString(R.string.input_your_captcha));
-            return false;
-        }
-        if (etCode.length() != 6) {
-            G.showToast(getString(R.string.toast_warning_phone_captcha_image_code_size));
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * 获取验证码
-     */
-    private void getCaptcha() {
-
-        if (!canGetCaptchaPhone) {
-            return;
-        }
-        if (!checkPhoneInput()) {
-            return;
-        }
-        selfCountDownTimer.reset(SelfCountDownTimer.FULL_SECOND);
-        canGetCaptchaPhone = true;
-        if (phonePresenter.getCaptchaa(etPhone)) {//成功获取验证码后,开启倒计时
-            selfCountDownTimer.start();
-        }
-
-    }
-
-    /**
-     * 登录
-     */
-    private void loginByPhoneGaptcha() {
-        if (!checkPhoneInput()) {
-            return;
-        }
-        if (!checkCodeInput()) {
-            return;
-        }
-
-        showProgress();
-        phonePresenter.loginByCaptcha(etPhone, etCode);
-    }
-
-    @Override
-    public void returnGaptcha(Object o) {
-        Log.e("---Gaptcha-", o.toString());
-
-    }
-
-    /**
-     * 验证码获取失败
-     *
-     * @param o
-     */
-    @Override
-    public void gaptchaFail(BaseMessage o) {
-        hideProgress();
-        G.showToast(o.getMsg() + "");
-
-    }
-
-    @Override
-    public void returnLogindata(Object o) {
-        hideProgress();
-        if (o == null) {
-            return;
-        }
-        BaseMessage baseMessage = (BaseMessage) o;
-//        JSONObject a = JSON.parseObject(o.toString());
-        Log.e("------data", baseMessage.getData() + "");
-        LoginEntity loginEty = null;
-        try {
-            loginEty = JSONObject.parseObject(JSONObject.toJSONString(baseMessage.getData()), LoginEntity.class);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        if (loginEty != null) {
-            SpUtils.saveToken(activity, loginEty.getToken());
-            DataUtil.getInstance().setUserEntity(loginEty.getUser());
-        }
-
-        Jump2View.getInstance().goHomePageView(this, EntityUtils.getUserCode(loginEty));
-        Log.e("---login_-", o.toString());
-        TestUtil.saveUser(loginEty);
-    }
-
-    @Override
-    public void loginFail(BaseMessage o) {
-        hideProgress();
-        G.showToast(o.getMsg() + "");
-//        testData();
-    }
-
-    @Override
-    public void changeTelSuccess(BaseMessage o) {
-
-    }
-
-    @Override
-    public void changeTelFail(BaseMessage o) {
-
-    }
-
-    @Override
-    public void bindTelSuccess(BaseMessage o) {
-
-    }
-
-    @Override
-    public void bindTelFail(BaseMessage o) {
-
-    }
-
-    @Override
-    public void bindTelSmsSuccess(BaseMessage o) {
-
-    }
-
-    @Override
-    public void bindTelSmsFail(BaseMessage o) {
-
-    }
-
-
-    /**
-     * 监听软键盘
-     */
-    @Override
-    public boolean dispatchKeyEvent(KeyEvent event) {
-        if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
-            InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
-            if (inputMethodManager.isActive()) {
-                inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0);
-                return true;
-            }
-        }
-        return super.dispatchKeyEvent(event);
-    }
-
-
-    private void goMain(String openId) {
-        LogUtil.logI("goMain--token----"+openId);
-        SpUtils.saveToken(getApplicationContext(), openId);
-        Jump2View.getInstance().goHomePageView(this, null);
-        ActivityManager.getInstance().endActivity(LoginAct.class);
-        finish();
-    }
-
-    @Override
-    protected void onDestroy() {
-        super.onDestroy();
-        if (selfCountDownTimer != null) {
-            selfCountDownTimer.cancel();
-        }
-    }
-}

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

@@ -28,6 +28,7 @@ import com.sheep.gamegroup.absBase.AbsChooseImageActivity;
 import com.sheep.gamegroup.di.components.DaggerTaskDetailComponent;
 import com.sheep.gamegroup.di.modules.TaskDetailModule;
 import com.sheep.gamegroup.helper.TaskHelper;
+import com.sheep.gamegroup.model.api.ICallBack;
 import com.sheep.gamegroup.model.api.IDownload;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.DialogEntity;
@@ -53,6 +54,7 @@ import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.LocationUtils;
 import com.sheep.gamegroup.util.MyDbManager;
 import com.sheep.gamegroup.util.MyListview;
+import com.sheep.gamegroup.util.PngUtil;
 import com.sheep.gamegroup.util.SelfCountDownTimer;
 import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.TimeUtil;
@@ -252,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 {
@@ -435,11 +437,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                         btnUpImag.setVisibility(View.GONE);
                         break;
                     default:
-                        if(taskEty.getTask_type() == 1000)//连续任务
-                            setSuccessionTaskBottomState();
-                        else if(gettaskAcceptedEty.getStatus() == 6) {//试玩任务审核失败可以重新提交
-                            btnUpImag.setText("重新提交");
-                        }
+                        setOtherNormalTaskBtnState();
                         break;
                 }
                 break;
@@ -460,6 +458,32 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
     }
 
     /**
+     * 设置连续任务与试玩任务两个按钮状态(任务未下线且有任务记录且是手动审核任务且已经安装应用)
+     * 注:前提是gettaskAcceptedEty不为空哦
+     */
+    private void setOtherNormalTaskBtnState() {
+        boolean isSuccession = taskEty.isSuccession();
+        if(isSuccession){//连续任务
+            setSuccessionTaskBottomState();
+        } else {
+            switch (gettaskAcceptedEty.getStatus()) {
+                case 1://"已接受任务";
+                case 2:// "正在进行中";
+                    break;
+                case 6://试玩任务审核失败可以重新提交
+                    btnUpImag.setText("重新提交");
+                    break;
+                case 7:// "提交审核";
+                    btnUpImag.setVisibility(View.GONE);
+                    break;
+                case 3://完成任务
+                    btnUpImag.setVisibility(View.GONE);
+                    break;
+            }
+        }
+    }
+
+    /**
      * 设置游戏任务中两个按钮的状态和文字显示(任务未下线且有任务记录)
      * 注:前提是gettaskAcceptedEty不为空哦
      */
@@ -639,7 +663,6 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                                 gettaskAcceptedEty = null;
                                 taskReleaseEty = null;
                                 CommonUtil.getInstance().setTAskEnty(null);
-                                DataUtil.getInstance().setTaskListChanged();
                                 presenter.taskDesc(releaseTaskId);
                             }
                         });
@@ -782,7 +805,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                 break;
         }
         if (commitScreenShotTaskId > 0) {
-            if (DataUtil.IS_USE_SCREEN_SHOT) {//小绵羊截图方案
+            if (DataUtil.IS_USE_SCREEN_SHOT || DataUtil.IS_LISTEN_SCREEN_SHOT) {//小绵羊截图方案
                 File dir = DataUtil.getInstance().getScreenShotsDir(taskEty.getPackage_names());
                 showChooseDialog(false, true, DEFAULT_MAX_COUNT, dir);
             } else {//用户手动截图方案
@@ -828,7 +851,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() + "");
 
@@ -837,7 +860,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();
                         }
 
@@ -938,12 +961,13 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
 //                            onGetNetImageUrl(data);
         dismissLoaddingDialog();
         G.showToast("提交成功,等待审核!");
-        //这里领取了奖励,要刷新用户信息
-        CommonUtil.getInstance().updateUserInfo(null);
-        if (DataUtil.IS_USE_SCREEN_SHOT) {//小绵羊截图方案:上传截图成功后删除之前的截图
-            DataUtil.getInstance().clearScreenShots();
+        if (DataUtil.IS_USE_SCREEN_SHOT || DataUtil.IS_LISTEN_SCREEN_SHOT) {//小绵羊截图方案或者监听方案:上传截图成功后删除之前的截图
+            //这里领取了奖励,要刷新用户信息
+            CommonUtil.getInstance().updateUserInfo(null);
+            if (DataUtil.IS_USE_SCREEN_SHOT) {//小绵羊截图方案:上传截图成功后删除之前的截图
+                DataUtil.getInstance().clearScreenShots();
+            }
         }
-
         UMConfigUtils.finishTask();
         if (taskEty.hasCommitLast(commitScreenShotTaskId)) {//非自动审核任务中的连续任务已经提交了最后一个子任务,或者普通任务提交截图成功
             if (isFromTaskList)//之前界面为任务记录界面,需要回调刷新任务记录列表
@@ -988,7 +1012,28 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
     protected void onGetImage(String path) {
 
     }
-
+    private ICallBack<String> callBack = new ICallBack<String>() {
+        @Override
+        public String call(Object... args) {
+            String pngFilePath = (String) args[0];
+            int size = (int) args[1];
+            int index = (int) args[2];
+            try {
+                //加密文本内容:包名;签名md5;试玩应用包名;试玩应用签名md5;任务id;图片总数;图片位置
+                return PngUtil.decodePng(pngFilePath, taskEty.getPackage_names(), String.format(Locale.CHINA, "%d;%d;%d", commitScreenShotTaskId, size, index));
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            return null;
+        }
+    };
+    /**
+     * 上传图片前的回调
+     * @return
+     */
+    protected ICallBack<String> getCallBack(){
+        return callBack;
+    }
     private int commitScreenShotTaskId;
 
     @Override
@@ -1088,8 +1133,6 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                         taskReleaseEty.getTask().setRelease_task_id(taskReleaseEty.getId());
                         CommonUtil.getInstance().setTAskEnty(taskReleaseEty.getTask());
 
-                        DataUtil.getInstance().setTaskListChanged();//主页任务列表发生变化,回到主页后自动刷新
-
                         getAcceptedTaskDetail(releaseTaskId);
 
                     }
@@ -1199,15 +1242,19 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
         }
     }
 
+    private int onResumeCount = 0;
     @Override
     protected void onResume() {
         super.onResume();
-        if (taskReleaseEty == null || isFresh) {
-            isFresh = true;
-            freshData();
-        } else {
-            updateBottom();
+        if(onResumeCount > 0) {//第一次不加载
+            if (taskReleaseEty == null || isFresh) {
+                isFresh = true;
+                freshData();
+            } else {
+                updateBottom();
+            }
         }
+        onResumeCount++;
     }
 
     /**
@@ -1331,11 +1378,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();
@@ -1383,5 +1430,6 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
     protected void onDestroy() {
         super.onDestroy();
         CommonUtil.getInstance().cancelAllTimers(CommonUtil.getInstance().timerHashMap);
+        Aria.download(this).unRegister();
     }
 }

+ 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];

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

@@ -0,0 +1,40 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.app.Activity;
+import android.content.Context;
+import android.view.View;
+
+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 DownloadWelfareAdapter extends AdbCommonRecycler<Welfare> implements View.OnClickListener{
+
+    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) {
+        holder.itemView.setOnClickListener(this);
+        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);
+    }
+
+    @Override
+    public void onClick(View view) {
+        ViewUtil.shareGetWelfareDialog((Activity) context, null);
+    }
+}

+ 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启动游戏---设置---激活兑换"));
+    }
+}

+ 37 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/MessageAdapter.java

@@ -0,0 +1,37 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.content.Context;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentPagerAdapter;
+
+import com.sheep.gamegroup.view.fragment.MessageCenterFragment;
+import com.sheep.gamegroup.view.fragment.MessageReplyFragment;
+
+/**
+ * created on:2018/8/29 on 9:47
+ * created by: YSL
+ * 描述: 消息模块的FragmentAdapter,
+ */
+public class MessageAdapter extends FragmentPagerAdapter {
+    private Context context;
+
+    public MessageAdapter(FragmentManager fm, Context context) {
+        super(fm);
+        this.context = context;
+    }
+
+    @Override
+    public Fragment getItem(int position) {
+        if (position == 0) {
+            return new MessageCenterFragment(context);
+        } else {
+            return new MessageReplyFragment(context);
+        }
+    }
+
+    @Override
+    public int getCount() {
+        return 2;
+    }
+}

+ 82 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/MessageInteractionAdapter.java

@@ -0,0 +1,82 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.content.Context;
+import android.support.annotation.NonNull;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.List;
+
+/**
+ * created on:2018/8/28 on 17:26
+ * created by: YSL
+ * 描述:消息互动中item点击展开后FAQ的形式
+ */
+public class MessageInteractionAdapter extends RecyclerView.Adapter<MessageInteractionAdapter.MyHolder> {
+    private Context mContext;
+    private List<?> mList;
+
+    public MessageInteractionAdapter(Context mContext, List<?> mList) {
+        this.mContext = mContext;
+        this.mList = mList;
+    }
+
+    @NonNull
+    @Override
+    public MyHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+        View view = null;
+        if (mList == null || mList.isEmpty()) {
+            view = LayoutInflater.from(mContext).inflate(R.layout.empty_view, null);
+        } else {
+            view = LayoutInflater.from(mContext).inflate(R.layout.adapter_message_interaction, null);
+        }
+        return new MyHolder(view);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull MyHolder viewHolder, int i) {
+        if (mList == null || mList.isEmpty()) {
+            return;
+        } else {
+            if (i == mList.size() - 1) {
+                viewHolder.viewLine.setVisibility(View.GONE);//最后一条数据隐藏线条
+            }
+            GlideImageLoader.centerImage(viewHolder.ivIcon, "");
+            viewHolder.tvPeople.setText("");
+            viewHolder.tvTime.setText("");
+            viewHolder.tvContent.setText("");
+        }
+    }
+
+    @Override
+    public int getItemCount() {
+        return mList == null ? 0 : mList.size();
+    }
+
+    class MyHolder extends RecyclerView.ViewHolder {
+        private ImageView ivIcon;//头像
+        private TextView tvPeople;//标题
+        private TextView tvTime;//谁的消息
+        private TextView tvContent;//每条消息的内容,这里最多只显示一行
+        private View viewLine;//item之间的线条
+        private LinearLayout itemLayout;//整个item布局
+
+        public MyHolder(View view) {
+            super(view);
+            ivIcon = view.findViewById(R.id.iv_icon);
+            tvPeople = view.findViewById(R.id.tv_people);
+            tvTime = view.findViewById(R.id.tv_time);
+            tvContent = view.findViewById(R.id.tv_content);
+            viewLine = view.findViewById(R.id.view_line);
+            itemLayout = view.findViewById(R.id.item_layout);
+        }
+    }
+}

+ 105 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/MessageLeftAdapter.java

@@ -0,0 +1,105 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.content.Context;
+import android.support.annotation.NonNull;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.jiuyan.samllsheep.R;
+
+
+import java.util.List;
+
+
+/**
+ * created on:2018/8/28 on 16:08
+ * created by: YSL
+ * 描述:
+ */
+public class MessageLeftAdapter extends RecyclerView.Adapter<MessageLeftAdapter.Myholder> {
+    private Context mContext;
+    private List<?> mList;
+    private ItemOnClickListener itemClick;
+    private int position;
+
+    public MessageLeftAdapter(Context mContext, List<?> mList, ItemOnClickListener itemClick) {
+        this.mContext = mContext;
+        this.mList = mList;
+        this.itemClick = itemClick;
+    }
+
+
+    @NonNull
+    @Override
+    public Myholder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+        View view = null;
+        if (mList == null || mList.isEmpty()) {
+            view = LayoutInflater.from(mContext).inflate(R.layout.empty_view, null);
+        } else {
+            view = LayoutInflater.from(mContext).inflate(R.layout.adapter_message_left_fragment, null);
+        }
+        return new Myholder(view);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull Myholder viewHolder, int i) {
+        if (mList == null || mList.isEmpty()) {
+            return;
+        } else {
+            if (i == mList.size() - 1) {
+                viewHolder.viewLine.setVisibility(View.GONE);//最后一条数据隐藏线条
+            }
+            GlideImageLoader.centerImage(viewHolder.ivIcon, "");
+            viewHolder.tvTitle.setText("");
+            viewHolder.tvTime.setText("");
+            viewHolder.tvContent.setText("");
+            position = i;
+            viewHolder.itemLayout.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    itemClick.itemClick(position);
+                }
+            });
+        }
+    }
+
+    @Override
+    public int getItemCount() {
+        return mList == null ? 0 : mList.size();
+    }
+
+    class Myholder extends RecyclerView.ViewHolder {
+        private ImageView ivIcon;//头像
+        private TextView tvTitle;//标题
+        private TextView tvTime;//时间
+        private TextView tvContent;//每条消息的内容,这里最多只显示一行
+        private View viewLine;//item之间的线条
+        private LinearLayout itemLayout;//整个item布局
+
+        public Myholder(View view) {
+            super(view);
+            ivIcon = view.findViewById(R.id.iv_icon);
+            tvTitle = view.findViewById(R.id.tv_title);
+            tvTime = view.findViewById(R.id.tv_time);
+            tvContent = view.findViewById(R.id.tv_content);
+            viewLine = view.findViewById(R.id.view_line);
+            itemLayout = view.findViewById(R.id.item_layout);
+        }
+    }
+
+    /**
+     * 设置每一条消息的回调
+     */
+    public interface ItemOnClickListener {
+        /**
+         * @param position,当前消息在获取数据集合中的对应位置
+         */
+        void itemClick(int position);
+    }
+}

+ 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());

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

@@ -87,7 +87,7 @@ public class FgtAskGetMoneyRank extends BaseFragment {
         initData();
     }
     public void initData() {
-        showProgress();
+//        showProgress();
 
         initAskTop5();
     }

+ 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();
+    }
+}

+ 5 - 26
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtTryMakeMoney.java

@@ -25,7 +25,6 @@ import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.ListUtil;
-import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.view.activity.GamemakeMoneyAct;
 import com.sheep.gamegroup.view.activity.TryMakeMoneyact;
 import com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp;
@@ -36,7 +35,6 @@ import com.sheep.jiuyan.samllsheep.utils.G;
 
 import org.afinal.simplecache.ApiKey;
 import org.greenrobot.eventbus.EventBus;
-import org.greenrobot.eventbus.Subscribe;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -137,7 +135,6 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
     @Override
     public void onViewCreated() {
         activity = getActivity();
-        DataUtil.getInstance().isTaskListChange(getClass());
         initView();
         initData();
     }
@@ -156,8 +153,6 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
             task_type = "1002,1003,1004";
             isGameTask = true;
         }
-        EventBus.getDefault().register(this);
-//        ButterKnife.bind(this, mContentView);
         DaggerFgtTryMakeMoneyComponent.builder()
                 .netComponent(SheepApp.get(activity).getNetComponent())
                 .tryMakeMoneyModule(new TryMakeMoneyModule(FgtTryMakeMoney.this))
@@ -209,7 +204,6 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
     }
     //强制刷新数据
     public void refreshData(){
-        DataUtil.getInstance().isTaskListChange(getClass());
         isFirstCache = false;
         if(TextUtils.isEmpty(show_type))
             if(refresh != null)
@@ -269,8 +263,6 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
     public void onDestroyView() {
         super.onDestroyView();
         unbinder.unbind();
-
-        EventBus.getDefault().unregister(this);
     }
 
     @Override
@@ -310,7 +302,6 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
     public void giveUpTaskSuccesView(Object object) {
         G.showToast("取消任务成功");
         CommonUtil.getInstance().setTAskEnty(null);
-        DataUtil.getInstance().setTaskListChanged();
         refreshData();
     }
 
@@ -389,24 +380,12 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
         getFromNetWorkFirst(type);
     }
 
-    @Subscribe
-    public void onEventMainThread(BigEvent event){
-        switch (event.getEventTypes()){
-            case ONFRESH_TRYMAKEMANY_PAGE:
-                break;
-        }
-    }
-
     private int onResumeCount = 0;
     @Override
     public void onResume() {
         super.onResume();
-        if (onResumeCount > 0 && presenter != null){
-            if(DataUtil.getInstance().isTaskListChange(getClass())) {//需要全部刷新
-                refreshData();
-            } else {
-                initAcceptedTaskList();
-            }
+        if (onResumeCount > 0 && presenter != null){//直接全部刷新
+            refreshData();
         }
         onResumeCount++;
     }
@@ -422,7 +401,7 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
      * 发布的任务
      * type: 0 1
      */
-    private void getFromAcacheFirst(int type){
+    private void getFromACacheFirst(int type){
         if(TextUtils.isEmpty(show_type)){
             this.type = ++type;
             getFromACache(this.type);
@@ -442,7 +421,7 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
                         releaseEtyLists.clear();
                         releaseEtyLists.addAll(cacheTaskReleaseEtyList);
                         notifyDataSetChanged();
-                        getFromAcacheFirst(type);
+                        getFromACacheFirst(type);
                     }
                     break;
                 case 1:
@@ -452,7 +431,7 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
                         releaseEtyListsBegin.clear();
                         releaseEtyListsBegin.addAll(cacheTaskReleaseEtyList);
                         notifyDataSetChanged();
-                        getFromAcacheFirst(type);
+                        getFromACacheFirst(type);
                     }
                     break;
             }

+ 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();
+    }
+}

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

@@ -0,0 +1,78 @@
+package com.sheep.gamegroup.view.fragment;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.OrientationHelper;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.view.activity.MessageReplyDetailActivity;
+import com.sheep.gamegroup.view.adapter.MessageLeftAdapter;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.List;
+
+/**
+ * created on:2018/8/28 on 12:32
+ * created by: YSL
+ * 描述:
+ */
+
+@SuppressLint("ValidFragment")
+public class MessageCenterFragment extends Fragment implements MessageLeftAdapter.ItemOnClickListener {
+    private Context mContext;
+    private RecyclerView recyclerView;
+    private MessageLeftAdapter adapter;
+    private List<?> mList;
+
+
+    public MessageCenterFragment() {
+    }
+
+    public MessageCenterFragment(Context mContext) {
+        this.mContext = mContext;
+    }
+
+    @Nullable
+    @Override
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+        View view = null;
+        if (mList == null || mList.isEmpty()) {
+            view=inflater.inflate(R.layout.layout_empty_no_data,null);
+        } else {
+            view = inflater.inflate(R.layout.fragment_messagecenter, null);
+            recyclerView = view.findViewById(R.id.recycle_fragment_message_center);
+        }
+        return view;
+    }
+
+    @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);
+        recyclerView.setLayoutManager(manager);
+        recyclerView.setAdapter(adapter);
+    }
+
+    @Override
+    public void itemClick(int position) {
+        if (getActivity() != null) {
+            startActivity(new Intent(getActivity(), MessageReplyDetailActivity.class));
+        }
+    }
+}

+ 67 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/MessageReplyFragment.java

@@ -0,0 +1,67 @@
+package com.sheep.gamegroup.view.fragment;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.OrientationHelper;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.sheep.gamegroup.view.activity.MessageInteractionDetailActivity;
+import com.sheep.gamegroup.view.adapter.MessageLeftAdapter;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.List;
+
+/**
+ * created on:2018/8/29 on 9:58
+ * created by: YSL
+ * 描述:
+ */
+
+@SuppressLint("ValidFragment")
+public class MessageReplyFragment extends Fragment implements MessageLeftAdapter.ItemOnClickListener {
+    private Context mContext;
+    private RecyclerView recyclerView;
+    private MessageLeftAdapter adapter;
+    private List<?> mList;
+
+    public MessageReplyFragment() {
+    }
+
+    public MessageReplyFragment(Context mContext) {
+        this.mContext = mContext;
+    }
+
+    @Nullable
+    @Override
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+        View view = inflater.inflate(R.layout.fragment_messagecenter, null);
+        recyclerView = view.findViewById(R.id.recycle_fragment_message_center);
+        return view;
+    }
+
+    @Override
+    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+        super.onViewCreated(view, savedInstanceState);
+        adapter = new MessageLeftAdapter(mContext, mList, this);
+        LinearLayoutManager manager = new LinearLayoutManager(mContext);
+        manager.setOrientation(OrientationHelper.VERTICAL);
+        recyclerView.setLayoutManager(manager);
+        recyclerView.setAdapter(adapter);
+    }
+
+    @Override
+    public void itemClick(int position) {
+        if (getActivity()!=null){
+            startActivity(new Intent(getActivity(), MessageInteractionDetailActivity.class));
+        }
+    }
+}

+ 20 - 4
app/src/main/java/com/sheep/jiuyan/samllsheep/BaseApplication.java

@@ -20,6 +20,8 @@ import cn.jpush.android.api.JPushInterface;
  */
 
 public abstract class BaseApplication extends KFZSApp {
+    private final String DB_NAME = "xiaomianyang.realm";
+
     @Override
     public void onCreate() {
         super.onCreate();
@@ -37,8 +39,20 @@ public abstract class BaseApplication extends KFZSApp {
         JPushInterface.init(this);
 
         initBdLocationOpstion();
+       // initRealm();
+    }
+
+    /**
+     * 构建Realm
+     */
+  /*  private void initRealm() {
+        RealmConfiguration config = new RealmConfiguration.Builder()
+                .name(DB_NAME) //数据库名
+                .schemaVersion(0) //版本号,初次创建设为0,后面表结构变化时,版本号向上叠加
+                .build();
     }
-    private void initBdLocationOpstion(){
+*/
+    private void initBdLocationOpstion() {
         mLocationClient = new LocationClient(getApplicationContext());
         //声明LocationClient类
         mLocationClient.registerLocationListener(myListener);
@@ -78,7 +92,7 @@ public abstract class BaseApplication extends KFZSApp {
         option.SetIgnoreCacheException(true);
 //可选,设置是否收集Crash信息,默认收集,即参数为false
 
-        option.setWifiCacheTimeOut(5*60*1000);
+        option.setWifiCacheTimeOut(5 * 60 * 1000);
 //可选,7.2版本新增能力
 //如果设置了该接口,首次启动定位时,会先判断当前WiFi是否超出有效期,若超出有效期,会先重新扫描WiFi,然后定位
 
@@ -99,15 +113,16 @@ public abstract class BaseApplication extends KFZSApp {
 
     public LocationClient mLocationClient = null;
     private SheepLocationListener myListener = new SheepLocationListener();
+
     //BDAbstractLocationListener为7.2版本新增的Abstract类型的监听接口
     //原有BDLocationListener接口暂时同步保留。具体介绍请参考后文中的说明
     public class SheepLocationListener extends BDAbstractLocationListener {
         @Override
-        public void onReceiveLocation(BDLocation location){
+        public void onReceiveLocation(BDLocation location) {
             //此处的BDLocation为定位结果信息类,通过它的各种get方法可获取定位相关的全部结果
             //以下只列举部分获取地址相关的结果信息
             //更多结果信息获取说明,请参照类参考中BDLocation类中的说明
-            if(location == null)
+            if (location == null)
                 return;
             curLocation = location;
             //获取经纬度
@@ -130,6 +145,7 @@ public abstract class BaseApplication extends KFZSApp {
 //            String street = location.getStreet();    //获取街道信息
         }
     }
+
     private BDLocation curLocation;
 
     public BDLocation getCurLocation() {

+ 18 - 7
app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java

@@ -20,11 +20,10 @@ import com.sheep.gamegroup.util.ConnectAddress;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.LogUtil;
+import com.sheep.gamegroup.util.ScreenShotListenManager;
 import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.view.activity.LoginAct;
-import com.sheep.gamegroup.view.activity.PhoneAct;
-import com.sheep.gamegroup.view.activity.SplashAct;
 import com.sheep.jiuyan.samllsheep.service.DownloadService;
 import com.sheep.jiuyan.samllsheep.service.FloatService;
 import com.sheep.jiuyan.samllsheep.service.FloatShotScreenService;
@@ -142,10 +141,11 @@ public class SheepApp extends BaseApplication {
      * Activity 生命周期监听,用于监控app前后台状态切换
      */
     ActivityLifecycleCallbacks activityLifecycleCallbacks = new ActivityLifecycleCallbacks() {
+        private ScreenShotListenManager manager;
         @Override
         public void onActivityCreated(final Activity activity, Bundle savedInstanceState) {
             ActivityManager.getInstance().pushActivity(activity);
-            if(/*activity instanceof SplashAct || */activity instanceof LoginAct || activity instanceof PhoneAct){
+            if(/*activity instanceof SplashAct || */activity instanceof LoginAct){
                 SysAppUtil.showVersionInfo(activity, SpUtils.getIgnoreMd5());
             } else if(activity instanceof ActMain){
                 SysAppUtil.showVersionInfo(activity, SpUtils.getIgnoreMd5(), new Action1<Integer>() {
@@ -165,6 +165,17 @@ public class SheepApp extends BaseApplication {
                 }
                 AppUsageManager.getInstance().needOpenLookAppUsageStatsPermisson(true);//尝试保存应用使用情况的数据
                 LogUtil.println("SheepApp onActivityCreated", mActivityCount);
+                if(DataUtil.IS_LISTEN_SCREEN_SHOT) {
+                    manager = ScreenShotListenManager.newInstance(context);
+                    manager.setListener(
+                            new ScreenShotListenManager.OnScreenShotListener() {
+                                public void onShot(String imagePath) {
+                                    DataUtil.getInstance().addPng(imagePath);
+                                }
+                            }
+                    );
+                    manager.startListen();
+                }
                 UMConfigUtils.Event.SHEEP_CREATED.onEvent();
             }
         }
@@ -179,8 +190,7 @@ public class SheepApp extends BaseApplication {
                     LogUtil.println("SheepApp onActivityStarted", mActivityCount);
                     UMConfigUtils.Event.SHEEP_STARTED.onEvent();
                     Jump2View.getInstance().startFloat(activity, false);
-                    if(DataUtil.IS_USE_SCREEN_SHOT)
-                        Jump2View.getInstance().startShotScreenFloat(activity, false);
+                    Jump2View.getInstance().startShotScreenFloat(activity, false);
                 }
             }
         }
@@ -203,8 +213,7 @@ public class SheepApp extends BaseApplication {
                     LogUtil.println("SheepApp onActivityStopped", mActivityCount);
                     UMConfigUtils.Event.SHEEP_STOPPED.onEvent();
                     Jump2View.getInstance().startFloat(activity, true);
-                    if(DataUtil.IS_USE_SCREEN_SHOT)
-                        Jump2View.getInstance().startShotScreenFloat(activity, true);
+                    Jump2View.getInstance().startShotScreenFloat(activity, true);
                 }
             }
         }
@@ -221,6 +230,8 @@ public class SheepApp extends BaseApplication {
                 stopService(new Intent(SheepApp.this, FloatService.class));
                 if(DataUtil.IS_USE_SCREEN_SHOT)
                     stopService(new Intent(SheepApp.this, FloatShotScreenService.class));
+                if(manager != null)
+                    manager.stopListen();
                 UMConfigUtils.Event.SHEEP_DESTROYED.onEvent();
             }
         }

+ 37 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/FileUtil.java

@@ -1,7 +1,15 @@
 package com.sheep.jiuyan.samllsheep.utils;
 
 
+import android.support.annotation.NonNull;
+
+import com.sheep.gamegroup.util.LogUtil;
+
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.channels.FileChannel;
 
 /**
  * Created by realicing on 2018/6/1.
@@ -29,4 +37,33 @@ public class FileUtil {
             }
         }
     }
+
+    public static void copyFile(@NonNull File fileFrom, @NonNull File dirTo) throws IOException {
+        LogUtil.println("copyFile", fileFrom.getAbsolutePath(), dirTo.getAbsolutePath());
+        if(!dirTo.isDirectory()){
+            return;
+        }
+        if(!dirTo.exists())
+            dirTo.mkdirs();
+        File dest= new File(dirTo, fileFrom.getName());
+        if (dest.exists()) {
+            if(dest.delete()){
+                LogUtil.println("copyFile", "删除文件失败");
+            }
+        }
+        if(!dest.createNewFile()){
+            LogUtil.println("copyFile", "创建文件失败");
+        }
+        FileChannel outputChannel = null;
+        FileChannel inputChannel = null;
+        try {
+            inputChannel = new FileInputStream(fileFrom).getChannel();
+            outputChannel = new FileOutputStream(dest).getChannel();
+            inputChannel.transferTo(0, inputChannel.size(), outputChannel);
+            inputChannel.close();
+        } finally {
+            if (inputChannel != null) inputChannel.close();
+            if (outputChannel != null) outputChannel.close();
+        }
+    }
 }

+ 0 - 82
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/HexUtils.java

@@ -1,82 +0,0 @@
-package com.sheep.jiuyan.samllsheep.utils;
-
-/**
- * Created by kemllor on 2018/1/22.
- */
-
-public class HexUtils {
-    private static final String HEX_STR_POOL = "0123456789ABCDEF";
-    private static StringBuffer buf = new StringBuffer();
-
-    public static byte[] hexStr2Bytes(String hexStr) {
-        if (hexStr.length() < 1) {
-            return null;
-        } else {
-            byte[] result = new byte[hexStr.length() / 2];
-
-            for (int i = 0; i < hexStr.length() / 2; ++i) {
-                int high = Integer.parseInt(hexStr.substring(i * 2, i * 2 + 1), 16);
-                int low = Integer.parseInt(hexStr.substring(i * 2 + 1, i * 2 + 2), 16);
-                result[i] = (byte) (high * 16 + low);
-            }
-
-            return result;
-        }
-    }
-
-    public static byte[] hexStringToBytes(String hexString) {
-        if (hexString != null && !hexString.equals("")) {
-            hexString = hexString.toUpperCase();
-            int length = hexString.length() / 2;
-            char[] hexChars = hexString.toCharArray();
-            byte[] d = new byte[length];
-
-            for (int i = 0; i < length; ++i) {
-                int pos = i * 2;
-                byte h = charToByte(hexChars[pos]);
-                byte l = charToByte(hexChars[pos + 1]);
-                d[i] = (byte) (h << 4 | l);
-            }
-
-            return d;
-        } else {
-            return null;
-        }
-    }
-
-    private static byte charToByte(char c) {
-        return (byte) "0123456789ABCDEF".indexOf(c);
-    }
-
-    public static String bytes2HexStr(byte[] datas) {
-        if (datas != null && datas.length != 0) {
-            buf.setLength(0);
-
-            for (int i = 0; i < datas.length; ++i) {
-                if ((datas[i] & 255) < 16) {
-                    buf.append("0");
-                }
-
-                buf.append(Long.toHexString((long) (datas[i] & 255)));
-            }
-
-            return buf.toString();
-        } else {
-            return null;
-        }
-    }
-
-    public static String byte2HexStr(byte data) {
-        buf.setLength(0);
-        buf.append("0x");
-        if ((data & 255) < 16) {
-            buf.append("0");
-        }
-
-        buf.append(Long.toHexString((long) (data & 255)));
-        return buf.toString();
-    }
-
-    private HexUtils() {
-    }
-}

+ 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;
+    }
 }

+ 6 - 0
app/src/main/jni/Android.mk

@@ -0,0 +1,6 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := PngUtil
+LOCAL_SRC_FILES := pngUtil.c
+include $(BUILD_SHARED_LIBRARY)

+ 1 - 0
app/src/main/jni/Application.mk

@@ -0,0 +1 @@
+APP_ABI := all

+ 29 - 0
app/src/main/jni/com_sheep_gamegroup_util_PngUtil.h

@@ -0,0 +1,29 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_sheep_gamegroup_util_PngUtil */
+
+#ifndef _Included_com_sheep_gamegroup_util_PngUtil
+#define _Included_com_sheep_gamegroup_util_PngUtil
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_sheep_gamegroup_util_PngUtil
+ * Method:    decodePng
+ * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_com_sheep_gamegroup_util_PngUtil_decodePng
+  (JNIEnv *, jclass, jstring, jstring, jstring);
+
+/*
+ * Class:     com_sheep_gamegroup_util_PngUtil
+ * Method:    isKfzsSheepApp
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_com_sheep_gamegroup_util_PngUtil_isKfzsSheepApp
+  (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 337 - 0
app/src/main/jni/pngUtil.c

@@ -0,0 +1,337 @@
+#include<jni.h>
+#include<stdio.h>
+#include<string.h>
+//导入我们创建的头文件
+#include "com_sheep_gamegroup_util_PngUtil.h"
+//全局获取Context
+jobject getGlobalContext(JNIEnv *env);
+//根据Context获取对应安装的apk文件的md5值
+char* getSignatureMd5(JNIEnv * env, jobject obj_package_manager, jobject obj_package_name);
+//根据Context获取对应安装的apk文件的hashCode值
+//jint getSignatureHashCode(JNIEnv* env, jobject obj_package_manager, jobject obj_package_name);
+// 字节流转换为十六进制字符串
+void ByteToHexStr(const unsigned char* source, char* dest, int sourceLen);
+//调用android toast
+void android_toast(JNIEnv *env, jobject context, jstring str);
+//判断java String 与c String 是否相同
+int j_str_cmp_c_str(JNIEnv *env, jstring jStr, char* cStr);
+//合并字符串
+jstring android_string_concat(JNIEnv *env, jstring jStr, char* cStr);
+//合并字符串
+jstring android_string_concat_string(JNIEnv *env, jstring jStr, jstring jStr2);
+//根据Context获取PackageManager
+jobject getPackageManager(JNIEnv * env, jobject context);
+//根据Context获取对应的包名
+jobject getPackageName(JNIEnv * env, jobject context);
+
+/*
+ * cd app\src\main
+ * ndk-build
+ * Class:     com_sheep_gamegroup_util_PngUtil
+ * Method:    isKfzsSheepApp
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_com_sheep_gamegroup_util_PngUtil_isKfzsSheepApp
+  (JNIEnv *env, jclass jclassp){
+        jobject context = getGlobalContext(env);
+        if(context == NULL){
+            return (*env)->NewStringUTF(env, "error context is NULL");
+        }
+        jobject obj_package_manager = getPackageManager(env, context);
+        jobject obj_package_name = getPackageName(env, context);
+        char* md5 = getSignatureMd5(env, obj_package_manager, obj_package_name);
+        //result已经释放
+        if(strcmp(md5, "C69316882EADA62AE560C31076740400")  == 0){
+            android_toast(env, context, (*env)->NewStringUTF(env, "恭喜,您使用的是正版小绵羊!"));
+        } else {
+            android_toast(env, context, (*env)->NewStringUTF(env, "注意,您使用的不是正版小绵羊!"));
+            return (*env)->NewStringUTF(env, "error this is pirate app");
+        }
+        return NULL;
+  }
+/*
+ * Class:     com_sheep_gamegroup_util_PngUtil
+ * Method:    decodePng
+ * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_com_sheep_gamegroup_util_PngUtil_decodePng
+  (JNIEnv *env, jclass jclassp, jstring filePath, jstring gamePackageName, jstring comment){
+        jobject context = getGlobalContext(env);
+        if(context == NULL){
+            return (*env)->NewStringUTF(env, "error context is NULL");
+        }
+        jobject obj_package_manager = getPackageManager(env, context);
+        jobject obj_package_name = getPackageName(env, context);
+        char* md5 = getSignatureMd5(env, obj_package_manager, obj_package_name);
+        //result已经释放
+        if(strcmp(md5, "C69316882EADA62AE560C31076740400")  == 0){
+    //        android_toast(env, context, (*env)->NewStringUTF(env, "恭喜,您使用的是正版小绵羊!"));
+        } else {
+//            android_toast(env, context, (*env)->NewStringUTF(env, "注意,您使用的不是正版小绵羊!"));
+            return (*env)->NewStringUTF(env, "error this is pirate app");
+        }
+        char* gameMd5 = getSignatureMd5(env, obj_package_manager, gamePackageName);
+
+        //加密文本内容:包名;签名md5;试玩应用包名;试玩应用签名md5;任务id;图片总数;图片位置
+
+        jstring result_a;
+        jstring result_b;
+        result_a = android_string_concat(env, obj_package_name, ";");
+        (*env)->DeleteLocalRef(env, obj_package_name);
+        result_b = android_string_concat(env, result_a, md5);
+        (*env)->DeleteLocalRef(env, result_a);
+        result_a = android_string_concat(env, result_b, ";");
+        (*env)->DeleteLocalRef(env, result_b);
+        result_b = android_string_concat_string(env, result_a, gamePackageName);
+        (*env)->DeleteLocalRef(env, result_a);
+        result_a = android_string_concat(env, result_b, ";");
+        (*env)->DeleteLocalRef(env, result_b);
+        result_b = android_string_concat(env, result_a, gameMd5);
+        (*env)->DeleteLocalRef(env, result_a);
+        result_a = android_string_concat(env, result_b, ";");
+        (*env)->DeleteLocalRef(env, result_b);
+
+        result_b = android_string_concat_string(env, result_a, comment);
+        (*env)->DeleteLocalRef(env, result_a);
+//        android_toast(env, context, result_b);
+
+        //rsa公钥加密
+        jclass kfzssafeClass = (*env)->FindClass(env, "go/kfzssafe/Kfzssafe");
+        jmethodID publicEncryptMethodID = (*env)->GetStaticMethodID(env, kfzssafeClass,"publicEncrypt","(Ljava/lang/String;)Ljava/lang/String;");
+        result_a = (*env)->CallStaticObjectMethod(env, kfzssafeClass, publicEncryptMethodID, result_b);
+        (*env)->DeleteLocalRef(env, result_b);
+
+//        JNIDecodePngUtil.addIEndData(file, result_a);
+
+        jmethodID addIEndDataMethodID = (*env)->GetStaticMethodID(env, kfzssafeClass,"addIEndData2","(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;");
+        jstring result = (*env)->CallStaticObjectMethod(env, kfzssafeClass, addIEndDataMethodID, filePath, result_a);
+        (*env)->DeleteLocalRef(env, result_a);
+
+
+
+        free(md5);
+        free(gameMd5);
+        (*env)->DeleteLocalRef(env, gamePackageName);
+        (*env)->DeleteLocalRef(env, obj_package_manager);
+        (*env)->DeleteLocalRef(env, context);
+        return result;
+  }
+//合并字符串
+jstring android_string_concat(JNIEnv *env, jstring jStr, char* cStr){
+    jclass String_clazz = (*env)->FindClass(env, "java/lang/String");
+    jmethodID concat_methodID = (*env)->GetMethodID(env, String_clazz, "concat", "(Ljava/lang/String;)Ljava/lang/String;");
+    //需要在后面拼接的字符串...
+    jstring strEnd = (*env)->NewStringUTF(env, cStr);
+    jstring result = (*env)->CallObjectMethod(env, jStr, concat_methodID, strEnd);
+    //释放内存
+    (*env)->DeleteLocalRef(env, strEnd);
+    return result;
+}
+//合并字符串
+jstring android_string_concat_string(JNIEnv *env, jstring jStr, jstring jStr2){
+    jclass String_clazz = (*env)->FindClass(env, "java/lang/String");
+    jmethodID concat_methodID = (*env)->GetMethodID(env, String_clazz, "concat", "(Ljava/lang/String;)Ljava/lang/String;");
+    jstring result = (*env)->CallObjectMethod(env, jStr, concat_methodID, jStr2);
+    return result;
+}
+  //判断java String 与c String 是否相同
+int j_str_cmp_c_str(JNIEnv *env, jstring jStr, char* cStr){
+    const char *jStrToCStr = (*env)->GetStringUTFChars(env, jStr, 0);
+    int result = strcmp(jStrToCStr, cStr);
+    (*env)->ReleaseStringUTFChars(env, jStr, jStrToCStr);
+    return result;
+}
+//调用android toast
+void android_toast(JNIEnv *env, jobject context, jstring str){
+    jclass tclss = (*env)->FindClass(env, "android/widget/Toast");
+     jmethodID mid = (*env)->GetStaticMethodID(env, tclss,"makeText","(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;");
+     jobject job = (*env)->CallStaticObjectMethod(env, tclss,mid,context,str);
+     jmethodID showId = (*env)->GetMethodID(env, tclss,"show","()V");
+     (*env)->CallVoidMethod(env, job,showId,context,str);
+}
+//获取Context
+jobject getGlobalContext(JNIEnv *env)
+{
+    //获取Activity Thread的实例对象
+    jclass activityThread = (*env)->FindClass(env, "android/app/ActivityThread");
+    jmethodID currentActivityThread = (*env)->GetStaticMethodID(env, activityThread, "currentActivityThread", "()Landroid/app/ActivityThread;");
+    jobject at = (*env)->CallStaticObjectMethod(env, activityThread, currentActivityThread);
+    //获取Application,也就是全局的Context
+    jmethodID getApplication = (*env)->GetMethodID(env, activityThread, "getApplication", "()Landroid/app/Application;");
+    jobject context = (*env)->CallObjectMethod(env, at, getApplication);
+    return context;
+}
+
+// 字节流转换为十六进制字符串
+//http://blog.csdn.net/pingd/article/details/41945417
+void ByteToHexStr(const unsigned char* source, char* dest, int sourceLen)
+{
+    short i;
+    unsigned char highByte, lowByte;
+
+    for (i = 0; i < sourceLen; i++)
+    {
+        highByte = source[i] >> 4;
+        lowByte = source[i] & 0x0f;
+
+        highByte += 0x30;
+
+        if (highByte > 0x39)
+                dest[i * 2] = highByte + 0x07;
+        else
+                dest[i * 2] = highByte;
+
+        lowByte += 0x30;
+        if (lowByte > 0x39)
+            dest[i * 2 + 1] = lowByte + 0x07;
+        else
+            dest[i * 2 + 1] = lowByte;
+    }
+    return;
+}
+//根据Context获取PackageManager
+jobject getPackageManager(JNIEnv * env, jobject context) {
+    jclass class_context = (*env)->GetObjectClass(env, context);
+    jmethodID tem_method = (*env)->GetMethodID(env, class_context, "getPackageManager", "()Landroid/content/pm/PackageManager;");
+    jobject obj_package_manager = (*env)->CallObjectMethod(env, context, tem_method);
+    return obj_package_manager;
+}
+//根据Context获取对应的包名
+jobject getPackageName(JNIEnv * env, jobject context) {
+    jclass class_context = (*env)->GetObjectClass(env, context);
+    // getPackageName
+    jmethodID tem_method = (*env)->GetMethodID(env, class_context, "getPackageName", "()Ljava/lang/String;");
+    jobject obj_package_name = (*env)->CallObjectMethod(env, context, tem_method);
+    return obj_package_name;
+}
+//根据Context获取对应安装的apk文件的md5值
+//TODO 这个方法中,获取PackageInfo可能会报错,直接挂掉,因为没有安装应用
+char* getSignatureMd5(JNIEnv * env, jobject obj_package_manager, jobject obj_package_name) {
+    jclass tem_class;
+    jmethodID tem_method;
+    // getPackageInfo
+    tem_class = (*env)->GetObjectClass(env, obj_package_manager);
+    tem_method = (*env)->GetMethodID(env, tem_class, "getPackageInfo", "(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;");
+    jobject obj_package_info = (*env)->CallObjectMethod(env, obj_package_manager, tem_method, obj_package_name, 64);
+
+    // Signature[] arrayOfSignature = localPackageInfo.signatures;
+    // Signature localSignature = arrayOfSignature[0];
+    tem_class = (*env)->GetObjectClass(env, obj_package_info);
+    jfieldID fieldID_signatures = (*env)->GetFieldID(env, tem_class, "signatures", "[Landroid/content/pm/Signature;");
+    jobjectArray signatures = (*env)->GetObjectField(env, obj_package_info, fieldID_signatures);
+    jobject signature = (*env)->GetObjectArrayElement(env, signatures, 0);
+    // localSignature.toByteArray()
+    tem_class = (*env)->GetObjectClass(env, signature);
+    tem_method = (*env)->GetMethodID(env, tem_class, "toByteArray", "()[B");
+    jobject obj_sign_byte_array = (*env)->CallObjectMethod(env, signature, tem_method);// 这个就是拿到的签名byte数组
+
+    //      MessageDigest localMessageDigest = MessageDigest.getInstance("MD5");
+    jclass class_MessageDigest = (*env)->FindClass(env, "java/security/MessageDigest");
+    tem_method = (*env)->GetStaticMethodID(env, class_MessageDigest, "getInstance", "(Ljava/lang/String;)Ljava/security/MessageDigest;");
+    jobject obj_md5 = (*env)->CallStaticObjectMethod(env, class_MessageDigest, tem_method, (*env)->NewStringUTF(env, "md5"));
+    //      localMessageDigest.update(localSignature.toByteArray());
+    //tem_class = (*env)->GetObjectClass(env, obj_md5);
+    tem_method = (*env)->GetMethodID(env, class_MessageDigest, "update", "([B)V");// 这个函数的返回值是void,写V
+    (*env)->CallVoidMethod(env, obj_md5, tem_method, obj_sign_byte_array);
+    // localMessageDigest.digest()
+    tem_method = (*env)->GetMethodID(env, class_MessageDigest, "digest", "()[B");
+    // 这个是md5以后的byte数组,现在只要将它转换成16进制字符串,就可以和之前的比较了
+    jobject obj_array_sign = (*env)->CallObjectMethod(env, obj_md5, tem_method);// jni中有强转类型的概念吗
+    //      // 这个就是签名的md5值
+    //      String str2 = toHex(localMessageDigest.digest());
+
+    // 尝试用c写一下:http://blog.csdn.net/pingd/article/details/41945417
+    jsize int_array_length = (*env)->GetArrayLength(env, obj_array_sign);
+    jbyte* byte_array_elements = (*env)->GetByteArrayElements(env, obj_array_sign, JNI_FALSE);
+    char* char_result = (char*) malloc(int_array_length*2+1);// 开始没有+1,在有的情况下会越界产生问题,还是在后面补上\0比较好
+    // 将byte数组转换成16进制字符串,发现这里不用强转,jbyte和unsigned char应该字节数是一样的
+    ByteToHexStr(byte_array_elements, char_result, int_array_length);
+    *(char_result+int_array_length*2) = '\0';// 在末尾补\0
+    // release
+    (*env)->ReleaseByteArrayElements(env, obj_array_sign, byte_array_elements, JNI_ABORT);
+    return char_result;
+
+
+    //java code=======================================================
+    //      PackageInfo localPackageInfo = context.getPackageManager()
+    //              .getPackageInfo(context.getPackageName(), 64);
+    //      StringBuilder localStringBuilder = new StringBuilder();
+    //      Signature[] arrayOfSignature = localPackageInfo.signatures;
+    //      Signature localSignature = arrayOfSignature[0];
+    //      MessageDigest localMessageDigest = MessageDigest.getInstance("MD5");
+    //      localMessageDigest.update(localSignature.toByteArray());
+    //      // 这个就是签名的md5值
+    //      String str2 = toHex(localMessageDigest.digest());
+    //      localStringBuilder.append("Signature of ")
+    //              .append(localPackageInfo.packageName).append('\n').append(str2);
+    //      System.out.println(localStringBuilder.toString());
+    //      TextView tv = (TextView) findViewById(R.id.tv);
+    //      tv.setText(localStringBuilder.toString());
+
+
+    //  private String toHex(byte[] paramArrayOfByte) {
+    //      StringBuffer localStringBuffer = new StringBuffer();
+    //      for (int i = 0; i < paramArrayOfByte.length; i++) {
+    //          Object[] arrayOfObject = new Object[1];
+    //          arrayOfObject[0] = Byte.valueOf(paramArrayOfByte[i]);
+    //          localStringBuffer.append(String.format("%02x", arrayOfObject));
+    //      }
+    //      return localStringBuffer.toString();
+    //  }
+    //java code======================================================
+}
+/**
+*校验APP包名和签名是否合法返回值为1表示合法
+*/
+// jint getSignatureHashCode(JNIEnv* env, jobject packageManager, jobject application_package){
+//	// //获得PackageManager类
+//	jclass packageManager_clazz=(*env)->GetObjectClass(env,packageManager);
+//
+//	//得到getPackageInfo方法的ID
+//	jmethodID methodID_getPackageInfo=(*env)->GetMethodID(env,packageManager_clazz,"getPackageInfo",
+//						"(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;");
+//
+//	// //得到getPackageName方法的ID
+//	jmethodID methodID_getPackageName = (*env)->GetMethodID(env,context_clazz,"getPackageName","()Ljava/lang/String;");
+//
+//
+//	//获得PackageInfo
+//	jobject packageInfo = (*env)->CallObjectMethod(env,packageManager,methodID_getPackageInfo,application_package,64);
+//	jclass packageinfo_clazz = (*env)->GetObjectClass(env,packageInfo);
+//
+//	//获取签名
+//	jfieldID fieldID_signatures = (*env)->GetFieldID(env,packageinfo_clazz,"signatures","[Landroid/content/pm/Signature;");
+//	jobjectArray signature_arr = (jobjectArray)(*env)->GetObjectField(env,packageInfo,fieldID_signatures);
+//
+//	//Signature数组中取出第一个元素
+//	jobject signature = (*env)->GetObjectArrayElement(env,signature_arr,0);
+//
+//	//读signature的hashcode
+//	jclass signature_clazz = (*env)->GetObjectClass(env,signature);
+//	jmethodID methodID_hashcode = (*env)->GetMethodID(env,signature_clazz,"hashCode","()I");
+//	jint hashCode = (*env)->CallIntMethod(env,signature,methodID_hashcode);
+//
+//	return hashCode;
+////	public class SignatureUtils {
+////        public static int getSignatureHashCode(Context context){
+////            Signature signature = getSignature(context);
+////            int hashCode = signature.hashCode();
+////            return hashCode;
+////        }
+////        public static Signature getSignature(Context argContext) {
+////            Signature signature = null;
+////            try {
+////                String packageName = argContext.getPackageName();
+////                PackageManager packageManager = argContext.getPackageManager();
+////                PackageInfo packageInfo = packageManager.getPackageInfo(packageName,packageManager.GET_SIGNATURES);
+////                Signature[] signatures = packageInfo.signatures;
+////                signature = signatures[0];
+////            } catch (PackageManager.NameNotFoundException e) {
+////                e.printStackTrace();
+////            }
+////            return signature;
+////        }
+////    }
+//
+//}
+

BIN
app/src/main/jniLibs/arm64-v8a/libindoor.so


BIN
app/src/main/jniLibs/arm64-v8a/libjcore120.so


BIN
app/src/main/jniLibs/arm64-v8a/liblocSDK7b.so


BIN
app/src/main/jniLibs/arm64-v8a/libsecurityenv.so


BIN
app/src/main/jniLibs/armeabi-v7a/libindoor.so


BIN
app/src/main/jniLibs/armeabi-v7a/libjcore120.so


BIN
app/src/main/jniLibs/armeabi-v7a/liblocSDK7b.so


BIN
app/src/main/jniLibs/armeabi-v7a/libsecurityenv.so


BIN
app/src/main/jniLibs/armeabi/libindoor.so


BIN
app/src/main/jniLibs/armeabi/libjcore120.so


BIN
app/src/main/jniLibs/armeabi/liblocSDK7b.so


BIN
app/src/main/jniLibs/armeabi/libsecurityenv.so


+ 0 - 0
app/src/main/jniLibs/mips/libjcore120.so


Деякі файли не було показано, через те що забагато файлів було змінено