Ver código fonte

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

# Conflicts:
#	app/build.gradle
zengjiebin 7 anos atrás
pai
commit
04515bbc47
79 arquivos alterados com 3689 adições e 721 exclusões
  1. 8 0
      app/build.gradle
  2. BIN
      app/libs/YoumiSdk_v8.3.0_2018-09-20.aar
  3. 122 105
      app/src/main/AndroidManifest.xml
  4. 2 2
      app/src/main/java/com/sheep/gamegroup/di/modules/NetModule.java
  5. 12 9
      app/src/main/java/com/sheep/gamegroup/greendao/DDProviderHelper.java
  6. 48 3
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  7. 11 4
      app/src/main/java/com/sheep/gamegroup/model/entity/GameEntityList.java
  8. 72 0
      app/src/main/java/com/sheep/gamegroup/model/entity/GameListTag.java
  9. 98 0
      app/src/main/java/com/sheep/gamegroup/model/entity/GameListType.java
  10. 25 0
      app/src/main/java/com/sheep/gamegroup/model/entity/GameListTypeList.java
  11. 161 0
      app/src/main/java/com/sheep/gamegroup/model/entity/GameRecommend.java
  12. 19 0
      app/src/main/java/com/sheep/gamegroup/model/util/AbsSubscriber.java
  13. 1 1
      app/src/main/java/com/sheep/gamegroup/model/util/AddPuplicParameIntercept.java
  14. 19 12
      app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java
  15. 2 1
      app/src/main/java/com/sheep/gamegroup/util/ConnectAddress.java
  16. 11 3
      app/src/main/java/com/sheep/gamegroup/util/DataUtil.java
  17. 78 11
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  18. 23 0
      app/src/main/java/com/sheep/gamegroup/util/ObservableUtil.java
  19. 12 0
      app/src/main/java/com/sheep/gamegroup/util/StringUtils.java
  20. 11 1
      app/src/main/java/com/sheep/gamegroup/util/TestUtil.java
  21. 10 3
      app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java
  22. 0 54
      app/src/main/java/com/sheep/gamegroup/view/activity/ActEverydayPlayGame.java
  23. 3 3
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMain.java
  24. 4 5
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMiDong.java
  25. 53 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActPlayGameList.java
  26. 59 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActPlayGameRecommendList.java
  27. 59 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActPlayGameUserLikeList.java
  28. 127 114
      app/src/main/java/com/sheep/gamegroup/view/activity/BaseListActivity.java
  29. 3 1
      app/src/main/java/com/sheep/gamegroup/view/activity/SplashAct.java
  30. 4 4
      app/src/main/java/com/sheep/gamegroup/view/activity/TryMakeMoneyact.java
  31. 76 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameCenter1_2List.java
  32. 85 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameCenter3_3List.java
  33. 1 2
      app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java
  34. 266 224
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPlayGame.java
  35. 112 89
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPlayGameSon.java
  36. 17 2
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java
  37. 10 7
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWelfareCenter.java
  38. 6 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java
  39. 1 1
      app/src/main/java/com/sheep/jiuyan/samllsheep/base/BaseFragment.java
  40. 63 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/net/Network.java
  41. 49 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/net/Scheduler.java
  42. 14 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/net/map/ApiService.java
  43. 58 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/ui/activity/SearchActivity.java
  44. 32 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/ui/activity/SignActivity.java
  45. 25 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/ui/adapter/SearchAdapter.java
  46. 64 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/ui/base/BaseActivity.java
  47. 67 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/ui/base/BaseFragment.java
  48. 62 0
      app/src/main/java/com/youmi/android/offer/BaseActYmPermissionCheck.java
  49. 174 0
      app/src/main/java/com/youmi/android/offer/YmConfig.java
  50. 300 0
      app/src/main/java/com/youmi/android/offer/YmPermissionUtil.java
  51. 222 0
      app/src/main/java/com/youmi/android/offerdemo/PermissionCheckActivity.java
  52. 378 0
      app/src/main/java/com/youmi/android/offerdemo/YoumiOffersAdsDemo.java
  53. 11 0
      app/src/main/java/org/afinal/simplecache/DataKey.java
  54. 9 0
      app/src/main/res/drawable/shape_black_solid_rectangle_tl_br_12.xml
  55. 5 0
      app/src/main/res/drawable/shape_input_background_radius.xml
  56. 17 0
      app/src/main/res/drawable/shape_light_blue_gradient_solid_rectangle_5.xml
  57. 5 0
      app/src/main/res/drawable/shape_main_search_bar_radius.xml
  58. 17 0
      app/src/main/res/drawable/shape_orange_gradient_solid_rectangle_5.xml
  59. 17 0
      app/src/main/res/drawable/shape_purple_gradient_solid_rectangle_5.xml
  60. 9 0
      app/src/main/res/drawable/shape_round_rect_bg.xml
  61. 6 0
      app/src/main/res/drawable/ym_buttonbg.xml
  62. 58 0
      app/src/main/res/layout/activity_search.xml
  63. 47 0
      app/src/main/res/layout/activity_sign.xml
  64. 10 47
      app/src/main/res/layout/fgt_play_game.xml
  65. 30 0
      app/src/main/res/layout/homepage_act_layout.xml
  66. 43 0
      app/src/main/res/layout/item_game_act.xml
  67. 14 13
      app/src/main/res/layout/item_hot_welfare.xml
  68. 49 0
      app/src/main/res/layout/item_play_game.xml
  69. 32 0
      app/src/main/res/layout/item_play_game_list.xml
  70. 25 0
      app/src/main/res/layout/ym_activity_main.xml
  71. 73 0
      app/src/main/res/layout/ym_activity_offers.xml
  72. 15 0
      app/src/main/res/layout/ym_tip.xml
  73. 4 0
      app/src/main/res/values/strings.xml
  74. 8 0
      app/src/main/res/values/styles.xml
  75. 5 0
      app/src/main/res/values/ym_colors.xml
  76. 14 0
      app/src/main/res/values/ym_strings.xml
  77. 16 0
      app/src/main/res/values/ym_styles.xml
  78. 10 0
      app/src/main/res/xml/file_paths.xml
  79. 1 0
      view/src/main/res/values/colors.xml

+ 8 - 0
app/build.gradle

@@ -282,6 +282,14 @@ dependencies {
     implementation "com.liulishuo.okdownload:sqlite:1.0.4"
     // provide okhttp to connect to backend
     implementation "com.liulishuo.okdownload:okhttp:1.0.4"
+
+    implementation 'com.trello.rxlifecycle2:rxlifecycle-components:2.2.2'
+
+    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
+
+    implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
+
+    implementation(name: 'YoumiSdk_v8.3.0_2018-09-20', ext: 'aar')
 }
 
 //static def releaseTime() {

BIN
app/libs/YoumiSdk_v8.3.0_2018-09-20.aar


+ 122 - 105
app/src/main/AndroidManifest.xml

@@ -2,13 +2,14 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     package="com.sheep.jiuyan.samllsheep">
-    <!--极光推送-->
+
+    <!-- 极光推送 -->
     <!-- Required -->
     <permission
         android:name="${applicationId}.permission.JPUSH_MESSAGE"
         android:protectionLevel="signature" />
 
-    <!-- Required  一些系统要求的权限,如访问网络等-->
+    <!-- Required  一些系统要求的权限,如访问网络等 -->
     <uses-permission android:name="${applicationId}.permission.JPUSH_MESSAGE" />
     <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
     <uses-permission android:name="android.permission.INTERNET" />
@@ -33,7 +34,7 @@
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
     <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
     <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
-    <!--极光推送end-->
+    <!-- 极光推送end -->
 
     <uses-permission android:name="android.permission.CAMERA" />
     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
@@ -48,13 +49,13 @@
         android:name="android.permission.PACKAGE_USAGE_STATS"
         tools:ignore="ProtectedPermissions" />
     <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
-    <!--必须的权限配置-->
+    <!-- 必须的权限配置 -->
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
     <uses-permission
         android:name="android.permission.READ_LOGS"
         tools:ignore="ProtectedPermissions" />
-    <!--保存资源到SD卡-->
+    <!-- 保存资源到SD卡 -->
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
     <!-- 推荐的权限 -->
     <!-- 添加如下权限,以便使用更多的第三方SDK和更精准的统计数据 -->
@@ -65,28 +66,28 @@
     <uses-permission android:name="android.permission.ACCESS_SUPERUSER" />
 
     <!-- 百度定位权限 start -->
-    <!-- 这个权限用于进行网络定位-->
+    <!-- 这个权限用于进行网络定位 -->
     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-    <!-- 这个权限用于访问GPS定位-->
+    <!-- 这个权限用于访问GPS定位 -->
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
-    <!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位-->
+    <!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 -->
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
-    <!-- 获取运营商信息,用于支持提供运营商信息相关的接口-->
+    <!-- 获取运营商信息,用于支持提供运营商信息相关的接口 -->
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-    <!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位-->
+    <!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位 -->
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
-    <!-- 用于读取手机当前的状态-->
+    <!-- 用于读取手机当前的状态 -->
     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
-    <!-- 写入扩展存储,向扩展卡写入数据,用于写入离线定位数据-->
+    <!-- 写入扩展存储,向扩展卡写入数据,用于写入离线定位数据 -->
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
-    <!-- 访问网络,网络定位需要上网-->
+    <!-- 访问网络,网络定位需要上网 -->
     <uses-permission android:name="android.permission.INTERNET" />
-    <!-- SD卡读取权限,用户写入离线定位数据-->
+    <!-- SD卡读取权限,用户写入离线定位数据 -->
     <uses-permission
         android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
         tools:ignore="ProtectedPermissions" />
-    <!-- 百度定位权限 end -->
 
+    <!-- 百度定位权限 end -->
     <application
         android:name=".SheepApp"
         android:allowBackup="true"
@@ -118,11 +119,10 @@
         <service android:name=".service.DownloadService" />
         <service
             android:name=".service.AutoCheckService"
-            android:priority="1000"
             android:exported="false"
-            android:process=":auto_check"/>
-        <service
-            android:name=".service.FloatShotScreenService" />
+            android:priority="1000"
+            android:process=":auto_check" />
+        <service android:name=".service.FloatShotScreenService" />
         <service
             android:name=".service.ListenerShotService"
             android:enabled="true"
@@ -145,14 +145,13 @@
                 android:resource="@xml/file_paths" />
         </provider>
 
-
-        <!--必须配置-->
+        <!-- 必须配置 -->
         <activity
             android:name="com.tencent.bugly.beta.ui.BetaActivity"
             android:configChanges="keyboardHidden|orientation|screenSize|locale"
             android:theme="@android:style/Theme.Translucent" />
 
-        <!-- 必须配置 fileProvider, 注意: android:authorities="${applicationId}.fileProvider" 不要直接copy,设置为你的包名.fileProvider-->
+        <!-- 必须配置 fileProvider, 注意: android:authorities="${applicationId}.fileProvider" 不要直接copy,设置为你的包名.fileProvider -->
         <provider
             android:name="android.support.v4.content.FileProvider"
             android:authorities="${applicationId}.fileProvider"
@@ -161,34 +160,29 @@
             <meta-data
                 android:name="android.support.FILE_PROVIDER_PATHS"
                 android:resource="@xml/file_paths" />
-
         </provider>
 
         <activity
             android:name="com.sheep.gamegroup.view.activity.PersonalInfoAct"
-            android:screenOrientation="portrait"></activity>
+            android:screenOrientation="portrait" />
 
-        <!--2.0-->
+        <!-- 2.0 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.LoginAct"
             android:configChanges="keyboardHidden|screenSize|orientation"
             android:launchMode="singleTask"
             android:screenOrientation="portrait"
-            android:theme="@style/FullScreenTheme">
-
-        </activity>
-
+            android:theme="@style/FullScreenTheme"></activity>
         <activity
             android:name="com.sheep.gamegroup.view.activity.SplashAct"
             android:screenOrientation="portrait"
             android:theme="@style/SplashTheme">
-
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
+
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-
         <activity
             android:name="com.sheep.gamegroup.view.activity.MiddleSchemeAct"
             android:configChanges="keyboardHidden|screenSize|orientation"
@@ -199,12 +193,17 @@
             android:theme="@style/AppTheme"
             android:windowSoftInputMode="adjustPan|stateHidden">
             <intent-filter android:autoVerify="true">
-                <!--协议部分,随便设置-->
-                <data android:scheme="sheep" android:host="small.kfzs.com"/>
-                <!--下面这几行也必须得设置-->
-                <category android:name="android.intent.category.DEFAULT"/>
-                <action android:name="android.intent.action.VIEW"/>
-                <category android:name="android.intent.category.BROWSABLE"/>
+
+                <!-- 协议部分,随便设置 -->
+                <data
+                    android:host="small.kfzs.com"
+                    android:scheme="sheep" />
+                <!-- 下面这几行也必须得设置 -->
+                <category android:name="android.intent.category.DEFAULT" />
+
+                <action android:name="android.intent.action.VIEW" />
+
+                <category android:name="android.intent.category.BROWSABLE" />
             </intent-filter>
         </activity>
         <activity
@@ -255,21 +254,21 @@
             android:name="com.sheep.gamegroup.view.activity.DialogToastAct"
             android:theme="@style/MyDialogActivityTheme" />
 
-        <!--&lt;!&ndash;半袋米首页&ndash;&gt;-->
-        <!--<activity-->
-        <!--android:name="com.kfzs.duanduan.ActMain"-->
-        <!--android:configChanges="keyboardHidden|screenSize|orientation"-->
-        <!--android:exported="true"-->
-        <!--android:hardwareAccelerated="true"-->
-        <!--android:launchMode="singleTask"-->
-        <!--android:screenOrientation="portrait"-->
-        <!--android:theme="@style/AppTheme"-->
-        <!--android:windowSoftInputMode="adjustPan|stateHidden">-->
-        <!--<intent-filter>-->
-        <!--<category android:name="android.intent.category.DEFAULT" />-->
-        <!--<action android:name="android.intent.action.VIEW" />-->
-        <!--</intent-filter>-->
-        <!--</activity>-->
+        <!-- &lt;!&ndash;半袋米首页&ndash;&gt; -->
+        <!-- <activity -->
+        <!-- android:name="com.kfzs.duanduan.ActMain" -->
+        <!-- android:configChanges="keyboardHidden|screenSize|orientation" -->
+        <!-- android:exported="true" -->
+        <!-- android:hardwareAccelerated="true" -->
+        <!-- android:launchMode="singleTask" -->
+        <!-- android:screenOrientation="portrait" -->
+        <!-- android:theme="@style/AppTheme" -->
+        <!-- android:windowSoftInputMode="adjustPan|stateHidden"> -->
+        <!-- <intent-filter> -->
+        <!-- <category android:name="android.intent.category.DEFAULT" /> -->
+        <!-- <action android:name="android.intent.action.VIEW" /> -->
+        <!-- </intent-filter> -->
+        <!-- </activity> -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActMain"
             android:configChanges="keyboardHidden|screenSize|orientation"
@@ -281,27 +280,25 @@
             android:windowSoftInputMode="adjustPan|stateHidden">
             <intent-filter>
                 <category android:name="android.intent.category.DEFAULT" />
+
                 <action android:name="android.intent.action.VIEW" />
             </intent-filter>
         </activity>
-
         <activity
             android:name="com.sheep.gamegroup.view.activity.AskGetMoneyAct"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActExchangeCMCC"
             android:screenOrientation="portrait" />
-
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActDownloadMgr"
             android:hardwareAccelerated="false"
             android:screenOrientation="portrait" />
 
-        <!--<provider-->
-        <!--android:name="com.kfzs.duanduan.data.graph.provider.KFZSProvider"-->
-        <!--android:authorities="com.kfzs.duanduan.data.graph.provider.${DUANDUAN_GRAPH}"-->
-        <!--android:exported="true" />-->
-
+        <!-- <provider -->
+        <!-- android:name="com.kfzs.duanduan.data.graph.provider.KFZSProvider" -->
+        <!-- android:authorities="com.kfzs.duanduan.data.graph.provider.${DUANDUAN_GRAPH}" -->
+        <!-- android:exported="true" /> -->
 
         <receiver android:name="com.sheep.gamegroup.receiver.AppAddOrDelReceiver">
             <intent-filter>
@@ -317,7 +314,6 @@
             android:name="com.tencent.tauth.AuthActivity"
             android:launchMode="singleTask"
             android:noHistory="true">
-
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
 
@@ -326,15 +322,11 @@
 
                 <data android:scheme="tencent101461115" />
             </intent-filter>
-
         </activity>
-
         <activity
             android:name="com.tencent.connect.common.AssistActivity"
             android:configChanges="orientation|keyboardHidden|screenSize"
             android:screenOrientation="portrait" />
-
-
         <activity
             android:name="com.sheep.gamegroup.view.activity.CommitWxAct"
             android:screenOrientation="portrait"
@@ -349,7 +341,6 @@
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActGuideDeblocked"
             android:screenOrientation="portrait" />
-
         <activity
             android:name="com.sheep.gamegroup.view.activity.RealNameAuthenAct"
             android:screenOrientation="portrait" />
@@ -364,7 +355,6 @@
             android:name="me.iwf.photopicker.PhotoPickerActivity"
             android:screenOrientation="portrait"
             android:theme="@style/Theme.AppCompat.NoActionBar" />
-
         <activity
             android:name="me.iwf.photopicker.PhotoPagerActivity"
             android:screenOrientation="portrait"
@@ -373,7 +363,6 @@
             android:name="com.yalantis.ucrop.UCropActivity"
             android:screenOrientation="portrait"
             android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
-
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActNewbieTaskList"
             android:screenOrientation="portrait" />
@@ -404,8 +393,6 @@
         <activity
             android:name="com.sheep.gamegroup.view.activity.FeedbackAct"
             android:screenOrientation="portrait" />
-
-
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActSignCard"
             android:screenOrientation="portrait" />
@@ -432,7 +419,7 @@
             android:screenOrientation="user"
             android:theme="@style/MyDialogActivityTheme" />
 
-        <!--友盟start-->
+        <!-- 友盟start -->
         <meta-data
             android:name="UMENG_APPKEY"
             android:value="${umeng_app_key}" />
@@ -440,8 +427,8 @@
             android:name="UMENG_CHANNEL"
             android:value="xxx" />
 
+        <!-- 极光推送 -->
 
-        <!--极光推送-->
 
         <!-- For test only 测试状态通知栏,需要打开的Activity -->
         <activity
@@ -449,15 +436,16 @@
             android:exported="false">
             <intent-filter>
                 <action android:name="jpush.testAction" />
+
                 <category android:name="jpush.testCategory" />
             </intent-filter>
         </activity>
-        <!-- Rich push 核心功能 since 2.0.6-->
+        <!-- Rich push 核心功能 since 2.0.6 -->
         <activity
             android:name="cn.jpush.android.ui.PopWinActivity"
             android:exported="false"
-            android:theme="@style/MyDialogStyle"></activity>
-        <!-- Required SDK核心功能-->
+            android:theme="@style/MyDialogStyle" />
+        <!-- Required SDK核心功能 -->
         <activity
             android:name="cn.jpush.android.ui.PushActivity"
             android:configChanges="orientation|keyboardHidden"
@@ -471,7 +459,7 @@
             </intent-filter>
         </activity>
 
-        <!-- Required SDK 核心功能-->
+        <!-- Required SDK 核心功能 -->
         <!-- 可配置android:process参数将PushService放在其他进程中 -->
         <service
             android:name="cn.jpush.android.service.PushService"
@@ -484,13 +472,12 @@
                 <action android:name="cn.jpush.android.intent.PUSH_TIME" />
             </intent-filter>
         </service>
-        <!-- since 3.0.9 Required SDK 核心功能-->
+        <!-- since 3.0.9 Required SDK 核心功能 -->
         <provider
             android:name="cn.jpush.android.service.DataProvider"
             android:authorities="${applicationId}.DataProvider"
             android:exported="false" />
 
-
         <!-- since 1.8.0 option 可选项。用于同一设备中不同应用的JPush服务相互拉起的功能。 -->
         <!-- 若不启用该功能可删除该组件,将不拉起其他应用也不能被其他应用拉起 -->
         <service
@@ -499,22 +486,22 @@
             android:exported="true">
             <intent-filter>
                 <action android:name="cn.jpush.android.intent.DaemonService" />
+
                 <category android:name="${applicationId}" />
             </intent-filter>
-
         </service>
-        <!-- since 3.1.0 Required SDK 核心功能-->
+        <!-- since 3.1.0 Required SDK 核心功能 -->
         <provider
             android:name="cn.jpush.android.service.DownloadProvider"
             android:authorities="${applicationId}.DownloadProvider"
             android:exported="true" />
-        <!-- Required SDK核心功能-->
+        <!-- Required SDK核心功能 -->
         <receiver
             android:name="cn.jpush.android.service.PushReceiver"
             android:enabled="true"
             android:exported="false">
             <intent-filter android:priority="1000">
-                <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" />   <!--Required  显示通知栏 -->
+                <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" /> <!-- Required  显示通知栏 -->
                 <category android:name="${applicationId}" />
             </intent-filter>
             <intent-filter>
@@ -530,30 +517,31 @@
             </intent-filter>
         </receiver>
 
-        <!-- Required SDK核心功能-->
+        <!-- Required SDK核心功能 -->
         <receiver
             android:name="cn.jpush.android.service.AlarmReceiver"
             android:exported="false" />
 
-        <!-- User defined.  For test only  用户自定义的广播接收器-->
+        <!-- User defined.  For test only  用户自定义的广播接收器 -->
         <receiver
             android:name="com.sheep.gamegroup.receiver.SheepJpushReceiver"
             android:enabled="true"
             android:exported="false">
             <intent-filter>
-                <action android:name="cn.jpush.android.intent.REGISTRATION" /> <!--Required  用户注册SDK的intent-->
-                <action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED" /> <!--Required  用户接收SDK消息的intent-->
-                <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED" /> <!--Required  用户接收SDK通知栏信息的intent-->
-                <action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED" /> <!--Required  用户打开自定义通知栏的intent-->
-                <action android:name="cn.jpush.android.intent.CONNECTION" /><!-- 接收网络变化 连接/断开 since 1.6.3 -->
+                <action android:name="cn.jpush.android.intent.REGISTRATION" /> <!-- Required  用户注册SDK的intent -->
+                <action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED" /> <!-- Required  用户接收SDK消息的intent -->
+                <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED" /> <!-- Required  用户接收SDK通知栏信息的intent -->
+                <action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED" /> <!-- Required  用户打开自定义通知栏的intent -->
+                <action android:name="cn.jpush.android.intent.CONNECTION" /> <!-- 接收网络变化 连接/断开 since 1.6.3 -->
                 <category android:name="${applicationId}" />
             </intent-filter>
         </receiver>
 
-        <!-- User defined.  For test only  用户自定义接收消息器,3.0.7开始支持,目前新tag/alias接口设置结果会在该广播接收器对应的方法中回调-->
+        <!-- User defined.  For test only  用户自定义接收消息器,3.0.7开始支持,目前新tag/alias接口设置结果会在该广播接收器对应的方法中回调 -->
         <receiver android:name="com.sheep.gamegroup.receiver.SheepJpushMessageReceiver">
             <intent-filter>
                 <action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" />
+
                 <category android:name="${applicationId}" />
             </intent-filter>
         </receiver>
@@ -564,10 +552,11 @@
             android:value="developer-default" />
         <meta-data
             android:name="JPUSH_APPKEY"
-            android:value="${jpush_appkey}" /> <!--  </>值来自开发者平台取得的AppKey-->
-        <!--极光推送end-->
+            android:value="${jpush_appkey}" /> <!-- </>值来自开发者平台取得的AppKey -->
+        <!-- 极光推送end -->
+
 
-        <!-- div start-->
+        <!-- div start -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.RechargeAct"
             android:screenOrientation="portrait" />
@@ -577,7 +566,8 @@
         <activity
             android:name="com.sheep.gamegroup.view.activity.RechargeResultAct"
             android:screenOrientation="portrait" />
-        <!-- div end-->
+        <!-- div end -->
+
 
         <!-- alipay 支付宝 sdk begin -->
         <activity
@@ -585,19 +575,21 @@
             android:configChanges="orientation|keyboardHidden|navigation|screenSize"
             android:exported="false"
             android:screenOrientation="behind"
-            android:windowSoftInputMode="adjustResize|stateHidden"></activity>
+            android:windowSoftInputMode="adjustResize|stateHidden" />
 
         <!-- alipay 支付宝 sdk end -->
 
-        <!--  百度定位 sdk start -->
+
+        <!-- 百度定位 sdk start -->
         <meta-data
             android:name="com.baidu.lbsapi.API_KEY"
-            android:value="gXD6RhE7ncVIcl1crk5SeUoVm7ceNtkL"></meta-data>
+            android:value="gXD6RhE7ncVIcl1crk5SeUoVm7ceNtkL" />
+
         <service
             android:name="com.baidu.location.f"
             android:enabled="true"
-            android:process=":remote"></service>
-        <!--  百度定位 sdk end -->
+            android:process=":remote" />
+        <!-- 百度定位 sdk end -->
 
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActNotice"
@@ -672,7 +664,13 @@
             android:name="com.sheep.gamegroup.view.activity.ActModifyThird"
             android:screenOrientation="portrait" />
         <activity
-            android:name="com.sheep.gamegroup.view.activity.ActEverydayPlayGame"
+            android:name="com.sheep.gamegroup.view.activity.ActPlayGameList"
+            android:screenOrientation="portrait" />
+        <activity
+            android:name="com.sheep.gamegroup.view.activity.ActPlayGameUserLikeList"
+            android:screenOrientation="portrait" />
+        <activity
+            android:name="com.sheep.gamegroup.view.activity.ActPlayGameRecommendList"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActPlayGameDetail"
@@ -684,7 +682,7 @@
             android:name="com.sheep.gamegroup.view.activity.ActInvitation"
             android:screenOrientation="portrait" />
 
-        <!--start幂动科技-->
+        <!-- start幂动科技 -->
 
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActMiDong"
@@ -693,7 +691,8 @@
             android:name="com.sheep.gamegroup.view.activity.GameCertificationActivity"
             android:exported="true"
             android:screenOrientation="portrait" />
-        <activity android:name="com.sheep.gamegroup.view.activity.ActPay"
+        <activity
+            android:name="com.sheep.gamegroup.view.activity.ActPay"
             android:exported="true"
             android:screenOrientation="user" />
 
@@ -702,7 +701,6 @@
             android:enabled="true"
             android:priority="1000" />
 
-
         <receiver
             android:name="com.mdad.sdk.mdsdk.AppInstallReceiver"
             android:enabled="true"
@@ -715,7 +713,6 @@
                 <data android:scheme="package" />
             </intent-filter>
         </receiver>
-
         <receiver
             android:name="com.mdad.sdk.mdsdk.DownloadCompleteReceiver"
             android:enabled="true"
@@ -725,8 +722,28 @@
                 <action android:name="android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED" />
             </intent-filter>
         </receiver>
-        <!--end幂动科技-->
-    </application>
+        <!-- end幂动科技 -->
+        <!-- start 有米科技 -->
 
+        <activity
+            android:name="com.youmi.android.offerdemo.PermissionCheckActivity"
+            android:screenOrientation="portrait" />
+        <activity
+            android:name="com.youmi.android.offerdemo.YoumiOffersAdsDemo"
+            android:screenOrientation="portrait" />
+        <!-- end 有米科技 -->
+        <!-- 搜索界面 -->
+        <activity
+            android:name=".ui.activity.SearchActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoTitleBar.AlphaStatusBar"
+            android:windowSoftInputMode="stateHidden" />
+        <!-- 签到 -->
+        <activity
+            android:name=".ui.activity.SignActivity"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoTitleBar.AlphaStatusBar" />
+    </application>
 
 </manifest>

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

@@ -3,7 +3,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.AddPublicParamsIntercept;
 import com.sheep.gamegroup.model.util.CacheInterceptor;
 import com.sheep.gamegroup.model.util.EntityUtils;
 import com.sheep.gamegroup.model.util.LogInterceptor;
@@ -37,7 +37,7 @@ public class NetModule {
                 .connectTimeout(5, TimeUnit.SECONDS)
                 .readTimeout(20,TimeUnit.SECONDS)
                 .cookieJar(new CookieManager(SheepApp.getInstance()))
-                .addInterceptor(new AddPuplicParameIntercept())
+                .addInterceptor(new AddPublicParamsIntercept())
                 .addInterceptor(new CacheInterceptor())
                 .addInterceptor(loggingInterceptor)
                 .build();

+ 12 - 9
app/src/main/java/com/sheep/gamegroup/greendao/DDProviderHelper.java

@@ -42,6 +42,18 @@ public class DDProviderHelper {
 
     private DDProviderHelper() {
     }
+    private DaoMaster.DevOpenHelper openHelper;
+    private DaoSession daoSession;
+
+    private synchronized DaoSession getDaossion(Context context) {
+        if(daoSession == null) {
+            if (openHelper == null) {
+                openHelper = new DaoMaster.DevOpenHelper(context, "dd.db");
+            }
+            daoSession = new DaoMaster(openHelper.getReadableDb()).newSession();
+        }
+        return daoSession;
+    }
 
     /**
      * 获取下载任务列表
@@ -125,15 +137,6 @@ public class DDProviderHelper {
         }
     }
 
-    private DaoMaster.DevOpenHelper openHelper;
-
-    private synchronized DaoSession getDaossion(Context context) {
-        if (openHelper == null) {
-            openHelper = new DaoMaster.DevOpenHelper(context, "dd.db");
-        }
-        return new DaoMaster(openHelper.getReadableDb()).newSession();
-    }
-
     /**
      * 获取下载中的任务;
      *

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

@@ -17,6 +17,7 @@ import retrofit2.http.POST;
 import retrofit2.http.PUT;
 import retrofit2.http.Path;
 import retrofit2.http.Query;
+import retrofit2.http.QueryMap;
 import retrofit2.http.Streaming;
 import rx.Observable;
 
@@ -1001,7 +1002,36 @@ public interface ApiService {
      * type: 1002:快发出包 1003:腾讯出包 1004:小米出包 1099:其他
      */
     @GET("app/find")
-    Observable<BaseMessage> playgameDailyOrHotOrTypePlay(@Query("page") int page, @Query("per_page") int per_page, @Query("is_hot") int is_hot, @Query("daily_play") int daily_play, @Query("type") int type);
+    Observable<BaseMessage> getPlayGameList(@Query("page") int page, @Query("per_page") int per_page, @QueryMap Map<String, Object> map);
+
+    /**
+     * 玩转游戏-获取主页游戏数据 猜你喜欢
+     */
+    @GET("app/find/recommend/user_like")
+    Observable<BaseMessage> getUserLikeList();
+    /**
+     * 玩转游戏-获取主页游戏数据 1:天天更新 2:重点推荐
+     * display_type
+     * integer
+     * (query)
+     * 1:天天更新 2:重点推荐
+     */
+    @GET("app/find/recommend")
+    Observable<BaseMessage> getRecommendList(@Query("display_type") int display_type);
+    /**
+     * 玩转游戏-获取主页游戏数据 1:天天更新 2:重点推荐 更多
+     * display_type
+     * integer
+     * (query)
+     * 1:天天更新 2:重点推荐
+     */
+    @GET("app/find/recommend/list")
+    Observable<BaseMessage> getRecommendListMore(@Query("display_type") int display_type);
+    /**
+     * 玩转游戏-获取主页 获取标签列表
+     */
+    @GET("app/find/game/tags")
+    Observable<BaseMessage> getGameTagList();
     /**
      *
      * type: 1002:快发出包 1003:腾讯出包 1004:小米出包
@@ -1017,6 +1047,12 @@ public interface ApiService {
     Observable<BaseMessage> gameBanner(@Query("platform") int platform);
     /**
      * platform 平台 1:andriod 2:ios
+     * 获取游戏中心主页活动数据
+     */
+    @GET("app/game_banner/activity?platform=1")
+    Observable<BaseMessage> gameBannerAct();
+    /**
+     * platform 平台 1:andriod 2:ios
      * @return
      */
     @GET("app/find/{id}")
@@ -1067,8 +1103,7 @@ public interface ApiService {
 
 
 
-//---------------------------下面是sdk相关接口-------------------------------------
-
+//---------------------------start 游戏sdk相关接口-------------------------------------
     /**
      * 请求授权
      * @return
@@ -1085,4 +1120,14 @@ public interface ApiService {
      */
     @POST("app/sdk/pay/order")
     Observable<BaseMessage> sdkPayOrder(@Header("Authorization") String token, @Query("order_no") String out_trade_no);
+//---------------------------end 游戏sdk相关接口-------------------------------------
+
+//---------------------------start 有米科技相关接口-------------------------------------
+    /**
+     * 获取有米积分余额
+     * @return
+     */
+    @GET("youmi/youmi_total_price")
+    Observable<BaseMessage> getYmTotalPrice();
+//---------------------------end 有米科技相关接口-------------------------------------
 }

+ 11 - 4
app/src/main/java/com/sheep/gamegroup/model/entity/GameEntityList.java

@@ -3,18 +3,25 @@ package com.sheep.gamegroup.model.entity;
 import com.sheep.gamegroup.util.ListUtil;
 
 import java.util.List;
-
 /**
- * Created by ljy on 2018/9/4.
+ * Created by realicing on 2018/10/30.
+ * realicing@sina.com
  */
-
 public class GameEntityList{
     private List<GameEntity> list;
-
+    private GameListType gameListType;
+    public GameEntityList(GameListType gameListType, List<GameEntity> list) {
+        this.gameListType = gameListType;
+        this.list = list;
+    }
     public GameEntityList(List<GameEntity> list) {
         this.list = list;
     }
 
+    public GameListType getGameListType() {
+        return gameListType;
+    }
+
     public List<GameEntity> getList() {
         return list;
     }

+ 72 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/GameListTag.java

@@ -0,0 +1,72 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by realicing on 2018/10/30.
+ * realicing@sina.com
+ * 游戏列表标签
+ */
+public class GameListTag {
+    private int Id;
+
+    private String Name;
+
+    private String Icon;
+
+    private int Status;
+
+    private int Sort;
+
+    private int CreateTime;
+
+    private int UpdateTime;
+
+    public void setId(int Id){
+        this.Id = Id;
+    }
+    public int getId(){
+        return this.Id;
+    }
+    public void setName(String Name){
+        this.Name = Name;
+    }
+    public String getName(){
+        return this.Name;
+    }
+    public void setIcon(String Icon){
+        this.Icon = Icon;
+    }
+    public String getIcon(){
+        return this.Icon;
+    }
+    public void setStatus(int Status){
+        this.Status = Status;
+    }
+    public int getStatus(){
+        return this.Status;
+    }
+    public void setSort(int Sort){
+        this.Sort = Sort;
+    }
+    public int getSort(){
+        return this.Sort;
+    }
+    public void setCreateTime(int CreateTime){
+        this.CreateTime = CreateTime;
+    }
+    public int getCreateTime(){
+        return this.CreateTime;
+    }
+    public void setUpdateTime(int UpdateTime){
+        this.UpdateTime = UpdateTime;
+    }
+    public int getUpdateTime(){
+        return this.UpdateTime;
+    }
+
+    public GameListType toGameListType() {
+        GameListType gameListType = new GameListType();
+        gameListType.setTag_id(Id);
+        gameListType.setTitle(Name);
+        return gameListType;
+    }
+}

+ 98 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/GameListType.java

@@ -0,0 +1,98 @@
+package com.sheep.gamegroup.model.entity;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by realicing on 2018/10/30.
+ * realicing@sina.com
+ */
+public class GameListType implements Serializable {
+    private String title;
+    private int daily_play;
+    private int is_hot;
+    private int per_page;
+    private int download_type;
+    private int tag_id;
+    private int type;
+    private int display_type;
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getDaily_play() {
+        return daily_play;
+    }
+
+    public void setDaily_play(int daily_play) {
+        this.daily_play = daily_play;
+    }
+
+    public int getIs_hot() {
+        return is_hot;
+    }
+
+    public void setIs_hot(int is_hot) {
+        this.is_hot = is_hot;
+    }
+
+    public int getPer_page() {
+        return per_page;
+    }
+
+    public void setPer_page(int per_page) {
+        this.per_page = per_page;
+    }
+
+    public int getDownload_type() {
+        return download_type;
+    }
+
+    public void setDownload_type(int download_type) {
+        this.download_type = download_type;
+    }
+
+    public int getTag_id() {
+        return tag_id;
+    }
+
+    public void setTag_id(int tag_id) {
+        this.tag_id = tag_id;
+    }
+
+    public int getType() {
+        return type;
+    }
+
+    public void setType(int type) {
+        this.type = type;
+    }
+
+    public int getDisplay_type() {
+        return display_type;
+    }
+
+    public void setDisplay_type(int display_type) {
+        this.display_type = display_type;
+    }
+
+    public Map<String, Object> getMap() {
+        Map<String, Object> map = new HashMap<>();
+        if(download_type > 0){
+            map.put("download_type", download_type);
+        } else if(tag_id > 0){
+            map.put("tag_id", tag_id);
+        } else {
+            map.put("is_hot", is_hot);
+            map.put("daily_play", daily_play);
+            map.put("type", type);
+        }
+        return map;
+    }
+}

+ 25 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/GameListTypeList.java

@@ -0,0 +1,25 @@
+package com.sheep.gamegroup.model.entity;
+
+import java.util.List;
+
+/**
+ * Created by realicing on 2018/10/30.
+ * realicing@sina.com
+ */
+public class GameListTypeList<T> {
+    private List<T> list;
+    private GameListType gameListType;
+    public GameListTypeList(GameListType gameListType, List<T> list) {
+        this.gameListType = gameListType;
+        this.list = list;
+    }
+
+    public GameListType getGameListType() {
+        return gameListType;
+    }
+
+    public List<T> getList() {
+        return list;
+    }
+
+}

+ 161 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/GameRecommend.java

@@ -0,0 +1,161 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by realicing on 2018/10/31.
+ * realicing@sina.com
+ * EndTime:	integer ($int64)
+ * 结束时间
+ * CreateTime:	integer ($int64)
+ * Order:	integer ($int64)
+ * 排序序号:倒序
+ * Url:	string
+ * 背景图地址
+ * StartTime:	integer ($int64)
+ * 开始时间
+ * Status:	integer ($int64)
+ * 1 已经下线 2 已上线 3 即将上线
+ * Platform:	integer ($int32)
+ * 平台 1:android 2:ios
+ * UpdateTime:	integer ($int64)
+ * IsDisplay:	integer ($int32)
+ * 状态 1显示 0不显示
+ * Title:	string
+ * 标题
+ * Id:	integer ($int64)
+ * AppId:	integer ($int64)
+ * 关联 application表id
+ * DisplayType:	integer ($int32)
+ * 1:天天更新 2:重点推荐
+ */
+public class GameRecommend {
+    private int Id;
+
+    private String Url;
+
+    private int Platform;
+
+    private int AppId;
+
+    private int IsDisplay;
+
+    private int UpdateTime;
+
+    private int CreateTime;
+
+    private String Title;
+
+    private int StartTime;
+
+    private int EndTime;
+
+    private int Status;
+
+    private int Order;
+
+    private int DisplayType;
+
+    public void setId(int Id) {
+        this.Id = Id;
+    }
+
+    public int getId() {
+        return this.Id;
+    }
+
+    public void setUrl(String Url) {
+        this.Url = Url;
+    }
+
+    public String getUrl() {
+        return this.Url;
+    }
+
+    public void setPlatform(int Platform) {
+        this.Platform = Platform;
+    }
+
+    public int getPlatform() {
+        return this.Platform;
+    }
+
+    public void setAppId(int AppId) {
+        this.AppId = AppId;
+    }
+
+    public int getAppId() {
+        return this.AppId;
+    }
+
+    public void setIsDisplay(int IsDisplay) {
+        this.IsDisplay = IsDisplay;
+    }
+
+    public int getIsDisplay() {
+        return this.IsDisplay;
+    }
+
+    public void setUpdateTime(int UpdateTime) {
+        this.UpdateTime = UpdateTime;
+    }
+
+    public int getUpdateTime() {
+        return this.UpdateTime;
+    }
+
+    public void setCreateTime(int CreateTime) {
+        this.CreateTime = CreateTime;
+    }
+
+    public int getCreateTime() {
+        return this.CreateTime;
+    }
+
+    public void setTitle(String Title) {
+        this.Title = Title;
+    }
+
+    public String getTitle() {
+        return this.Title;
+    }
+
+    public void setStartTime(int StartTime) {
+        this.StartTime = StartTime;
+    }
+
+    public int getStartTime() {
+        return this.StartTime;
+    }
+
+    public void setEndTime(int EndTime) {
+        this.EndTime = EndTime;
+    }
+
+    public int getEndTime() {
+        return this.EndTime;
+    }
+
+    public void setStatus(int Status) {
+        this.Status = Status;
+    }
+
+    public int getStatus() {
+        return this.Status;
+    }
+
+    public void setOrder(int Order) {
+        this.Order = Order;
+    }
+
+    public int getOrder() {
+        return this.Order;
+    }
+
+    public void setDisplayType(int DisplayType) {
+        this.DisplayType = DisplayType;
+    }
+
+    public int getDisplayType() {
+        return this.DisplayType;
+    }
+
+}

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

@@ -0,0 +1,19 @@
+package com.sheep.gamegroup.model.util;
+
+import rx.Subscriber;
+
+/**
+ * Created by realicing on 2018/10/30.
+ * realicing@sina.com
+ */
+public abstract class AbsSubscriber<T> extends Subscriber<T> {
+    @Override
+    public void onCompleted() {
+
+    }
+
+    @Override
+    public void onError(Throwable e) {
+
+    }
+}

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/model/util/AddPuplicParameIntercept.java

@@ -23,7 +23,7 @@ import okio.Buffer;
  * Created by ljy on 2018/3/18.
  */
 
-public class AddPuplicParameIntercept implements Interceptor {
+public class AddPublicParamsIntercept implements Interceptor {
     @Override
     public Response intercept(Chain chain) throws IOException {
         Request oldRequest = chain.request();

+ 19 - 12
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -456,6 +456,7 @@ public class CommonUtil {
     public static final int JUMP_XIAO_MI = 15;//小米游戏列表
     //TODO 这里移动积分兑换的id需要替换
     public static final int JUMP_EXCHANGE_CMCC = 1000025;//移动积分兑换
+    public static final int JUMP_YM = 1000026;//有米积分
     public static final int JUMP_GMAE = 16;//游戏
     public static final int JUMP_FIND_RECOMMEND = 17;//推荐
     public static final int JUMP_WATCH_FOCUS = 18;//看点
@@ -526,6 +527,9 @@ public class CommonUtil {
             case JUMP_EXCHANGE_CMCC://移动积分兑换
                 Jump2View.getInstance().goActExchangeCMCC(context);
                 break;
+            case JUMP_YM://有米积分
+                Jump2View.getInstance().goYm((Activity) context);
+                break;
             default:
                 String url = entity.getUrl();
                 if (TextUtils.isEmpty(url))
@@ -2302,20 +2306,23 @@ public class CommonUtil {
     }
 
     public void clickBanner(Activity activity, int position, List<SlideshowEty> slideshowEtyLists) {
-        SlideshowEty clickedGameObj = ListUtil.getItem(slideshowEtyLists, position);
-        if (clickedGameObj == null) {
+        clickBanner(activity, ListUtil.getItem(slideshowEtyLists, position));
+    }
+
+    public void clickBanner(Activity activity, SlideshowEty item) {
+        if (item == null) {
             return;
         }
         UMConfigUtils.onEvent(UMConfigUtils.Event.BANNER_CLICK_HORIZONTAL);
-        UMConfigUtils.IdEvent.BANNER.commit(clickedGameObj.getId());
+        UMConfigUtils.IdEvent.BANNER.commit(item.getId());
         Ext ext;
-        switch (clickedGameObj.getType()) {// 0,类型 1跳转试玩赚钱、2单个任务详情、3信用卡办理、4 H5页面、5 微信二维码任务
+        switch (item.getType()) {// 0,类型 1跳转试玩赚钱、2单个任务详情、3信用卡办理、4 H5页面、5 微信二维码任务
             case 1:
                 Jump2View.getInstance()
                         .goTryplayView(activity, null);
                 break;
             case 2:
-                ext = EntityUtils.getExtInfo(clickedGameObj.getExt());
+                ext = EntityUtils.getExtInfo(item.getExt());
                 if (ext == null) {
                     G.showToast(R.string.error_data);
                     return;
@@ -2327,8 +2334,8 @@ public class CommonUtil {
                         .goCreditCardTaskList(activity, 3);
                 break;
             case 4:
-                if (!TextUtils.isEmpty(clickedGameObj.getObjects())) {
-                    ext = EntityUtils.getExtInfo(clickedGameObj.getExt());
+                if (!TextUtils.isEmpty(item.getObjects())) {
+                    ext = EntityUtils.getExtInfo(item.getExt());
                     if (ext == null) {
                         G.showToast(R.string.error_data);
                         return;
@@ -2341,8 +2348,8 @@ public class CommonUtil {
 
                 break;
             case 5:
-                if (!TextUtils.isEmpty(clickedGameObj.getObjects())) {
-                    Jump2View.getInstance().goWeb(activity, clickedGameObj.getObjects(), "微信二维码辅助好友注册任务");
+                if (!TextUtils.isEmpty(item.getObjects())) {
+                    Jump2View.getInstance().goWeb(activity, item.getObjects(), "微信二维码辅助好友注册任务");
                 }
 
                 break;
@@ -2372,7 +2379,7 @@ public class CommonUtil {
                 Jump2View.getInstance().goXiaomiGameList(activity, null);
                 break;
             case JUMP_GMAE://游戏详情
-                ext = EntityUtils.getExtInfo(clickedGameObj.getExt());
+                ext = EntityUtils.getExtInfo(item.getExt());
                 if (ext == null) {
                     G.showToast(R.string.error_data);
                     return;
@@ -2383,7 +2390,7 @@ public class CommonUtil {
             case JUMP_FIND_ACT://发现--活动
             case JUMP_FIND_INFORMATION://webView资讯
             case JUMP_FIND_GMAE://发现中的游戏详情
-                ext = EntityUtils.getExtInfo(clickedGameObj.getExt());
+                ext = EntityUtils.getExtInfo(item.getExt());
                 if (ext == null) {
                     G.showToast(R.string.error_data);
                     return;
@@ -2391,7 +2398,7 @@ public class CommonUtil {
                 Jump2View.getInstance().goFindItem(activity, ext.getId());
                 break;
             case JUMP_WATCH_FOCUS://看点
-                ext = EntityUtils.getExtInfo(clickedGameObj.getExt());
+                ext = EntityUtils.getExtInfo(item.getExt());
                 if (ext == null) {
                     G.showToast(R.string.error_data);
                     return;

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

@@ -50,7 +50,8 @@ public enum ConnectAddress {
         @Override
         public String getAppUrl() {
 //            return "http://10.8.210.229:8080/";
-            return "http://10.8.210.243:8080/";
+//            return "http://10.8.210.243:8080/";
+            return "http://10.8.210.235:8080/";
         }
         @Override
         public String getName() {

+ 11 - 3
app/src/main/java/com/sheep/gamegroup/util/DataUtil.java

@@ -9,6 +9,7 @@ import android.text.TextUtils;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.sheep.gamegroup.model.api.BaseMessageConverter;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.ScreenShotConfig;
@@ -261,17 +262,24 @@ public class DataUtil {
     //-----------------------------------------缓存数据部分-----------------------------------------------------结束
 
     //-----------------------------------------其它数据部分-----------------------------------------------------开始
+    public static int getAsInt(String key, int defaultValue) {
+        String result = aCache.getAsString(key);
+        return NumberFormatUtils.parseInteger(result, defaultValue);
+    }
+    public static void putAsInt(String key, int value) {
+        aCache.put(key, String.valueOf(value));
+    }
     public static String getAsString(String key, String defaultValue) {
         String result = aCache.getAsString(key);
         return result == null ? defaultValue : result;
     }
+    public static void putAsString(String key, String value) {
+        aCache.put(key, value);
+    }
     public static boolean getAsBoolean(String key, boolean defaultValue) {
         String result = aCache.getAsString(key);
         return result == null ? defaultValue : TextUtils.equals(result, "true");
     }
-    public static void putAsString(String key, String value) {
-        aCache.put(key, value);
-    }
     public static void putAsBoolean(String key, boolean value) {
         aCache.put(key, Boolean.toString(value));
     }

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

@@ -12,7 +12,6 @@ import android.text.TextUtils;
 import android.view.Gravity;
 import android.view.View;
 
-import com.liulishuo.okdownload.DownloadTask;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.model.entity.Advertising;
@@ -26,6 +25,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.GameListType;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
 import com.sheep.gamegroup.model.entity.LoginEntity;
 import com.sheep.gamegroup.model.entity.NewbieTask;
@@ -44,7 +44,7 @@ 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.ActEverydayPlayGame;
+import com.sheep.gamegroup.view.activity.ActExchangeCMCC;
 import com.sheep.gamegroup.view.activity.ActFindGame;
 import com.sheep.gamegroup.view.activity.ActFindInformation;
 import com.sheep.gamegroup.view.activity.ActGameAccount;
@@ -67,6 +67,9 @@ import com.sheep.gamegroup.view.activity.ActNewbieTaskList;
 import com.sheep.gamegroup.view.activity.ActNotice;
 import com.sheep.gamegroup.view.activity.ActPay;
 import com.sheep.gamegroup.view.activity.ActPlayGameDetail;
+import com.sheep.gamegroup.view.activity.ActPlayGameList;
+import com.sheep.gamegroup.view.activity.ActPlayGameRecommendList;
+import com.sheep.gamegroup.view.activity.ActPlayGameUserLikeList;
 import com.sheep.gamegroup.view.activity.ActReservation;
 import com.sheep.gamegroup.view.activity.ActSearchApp;
 import com.sheep.gamegroup.view.activity.ActSearchGame;
@@ -79,7 +82,6 @@ import com.sheep.gamegroup.view.activity.ActUserLabelList;
 import com.sheep.gamegroup.view.activity.ActWeb;
 import com.sheep.gamegroup.view.activity.ActXiaomiGame;
 import com.sheep.gamegroup.view.activity.ActXinwanWeb;
-import com.sheep.gamegroup.view.activity.ActExchangeCMCC;
 import com.sheep.gamegroup.view.activity.AskGetMoneyAct;
 import com.sheep.gamegroup.view.activity.BindOrChangeWeixinAct;
 import com.sheep.gamegroup.view.activity.ChangeTelAct;
@@ -122,7 +124,11 @@ import com.sheep.jiuyan.samllsheep.service.ListenerShotNewService;
 import com.sheep.jiuyan.samllsheep.service.ListenerShotService;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+import com.youmi.android.offer.BaseActYmPermissionCheck;
+import com.youmi.android.offer.YmConfig;
+import com.youmi.android.offerdemo.PermissionCheckActivity;
 
+import org.afinal.simplecache.DataKey;
 import org.xutils.ex.DbException;
 
 import java.io.File;
@@ -275,7 +281,7 @@ public class Jump2View {
                         @Override
                         public void onNext(BaseMessage baseMessage) {
                             CommendApp result = baseMessage.getData(CommendApp.class);
-                            if(!result.getNeed()){//不需要展示
+                            if (!result.getNeed()) {//不需要展示
                                 DataUtil.putAsBoolean(ActMain.FIRST_SHOW_MAIN, false);
                             }
                             goHomePageView(context, object);
@@ -292,6 +298,7 @@ public class Jump2View {
         }
         goHomePageView(context, object);
     }
+
     /**
      * 跳到首页面
      *
@@ -1793,19 +1800,39 @@ public class Jump2View {
     }
 
     /**
-     * 每日必做、近期最热
+     * 每日必做、近期最热
      */
-    public void goEverydayOrCurrentHotGame(Activity activity, int type) {
-        Intent intent = new Intent(activity, ActEverydayPlayGame.class);
-        intent.putExtra("type", type);
+    public void goActPlayGameList(Activity activity, GameListType gameListType) {
+//        Intent intent = new Intent(activity, TextUtils.equals("猜你喜欢", gameListType.getTitle()) ? ActPlayGameUserLikeList.class : ActPlayGameList.class);
+        Intent intent;
+        switch (gameListType.getTitle()) {
+            case "天天更新":
+            case "重点推荐":
+                intent = new Intent(activity, ActPlayGameRecommendList.class);
+                break;
+            case "猜你喜欢":
+                intent = new Intent(activity, ActPlayGameUserLikeList.class);
+                break;
+            default:
+                intent = new Intent(activity, ActPlayGameList.class);
+                break;
+        }
+        DataUtil.putObject(intent, gameListType);
         activity.startActivity(intent);
-        GAME_EVERY_DAY_MORE.onEvent("type", type);
+        GAME_EVERY_DAY_MORE.onEvent("title", gameListType.getTitle());
     }
 
     /**
      * 游戏详情
      */
     public void goPlayGameDetail(Activity activity, int id) {
+        if (activity == null) {
+            activity = ActivityManager.getInstance().currentActivity();
+        }
+        if (activity == null) {
+            G.showToast(R.string.coming_soon);
+            return;
+        }
         Intent intent = new Intent(activity, ActPlayGameDetail.class);
         intent.putExtra("id", id);
         activity.startActivity(intent);
@@ -2007,17 +2034,57 @@ public class Jump2View {
      */
     public void goActPay(Activity activity, String order_no, String token) {
         activity.startActivityForResult(new Intent(activity, ActPay.class)
-                .putExtra("order_no", order_no)
-                .putExtra("token", token),
+                        .putExtra("order_no", order_no)
+                        .putExtra("token", token),
                 ActPay.RESULT_CODE);
     }
 
     /**
      * 启动下载后台服务进行下载
+     *
      * @param context
      * @param downLoadInfo
      */
     public void startDownloadService(Context context, DownLoadInfo downLoadInfo) {
         context.startService(new Intent(context, DownloadService.class).putExtra("download_url", downLoadInfo.getMDownloadUrl()).putExtra("file_path", downLoadInfo.getMApkPath()));
     }
+
+    /**
+     * 有米科技
+     *
+     * @param activity
+     */
+    public void goTestYm(Activity activity) {
+        activity.startActivity(new Intent(activity, PermissionCheckActivity.class));
+    }
+
+    /**
+     * 有米科技
+     *
+     * @param activity
+     */
+    public void goYm(final Activity activity) {
+        if (activity instanceof BaseActYmPermissionCheck) {
+            if (YmConfig.isToastTotalPrice()) {
+                //获取总积分
+                SheepApp.getInstance().getNetComponent().getApiService().getYmTotalPrice()
+                        .subscribeOn(Schedulers.io())
+                        .observeOn(AndroidSchedulers.mainThread())
+                        .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                            @Override
+                            public void onNext(BaseMessage baseMessage) {
+                                DataUtil.putAsInt(DataKey.YM_TOTAL_PRICE, baseMessage.getData(Integer.class));
+                                ((BaseActYmPermissionCheck) activity).checkOrShowYmOffersAds();
+                            }
+
+                            @Override
+                            public void onError(BaseMessage baseMessage) {
+                                G.showToast(baseMessage);
+                            }
+                        });
+            } else {
+                ((BaseActYmPermissionCheck) activity).checkOrShowYmOffersAds();
+            }
+        }
+    }
 }

+ 23 - 0
app/src/main/java/com/sheep/gamegroup/util/ObservableUtil.java

@@ -0,0 +1,23 @@
+package com.sheep.gamegroup.util;
+
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.GameListType;
+
+import rx.Observable;
+
+/**
+ * Created by realicing on 2018/10/31.
+ * realicing@sina.com
+ */
+public class ObservableUtil {
+    //根据游戏列表类型来获取Observable
+    public static Observable<BaseMessage> getObservable(ApiService apiService, GameListType gameListType) {
+        switch (gameListType.getTitle()) {
+            case "猜你喜欢":
+                return apiService.getUserLikeList();
+            default:
+                return apiService.getPlayGameList(1, 20, gameListType.getMap());
+        }
+    }
+}

+ 12 - 0
app/src/main/java/com/sheep/gamegroup/util/StringUtils.java

@@ -16,6 +16,7 @@ import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.GregorianCalendar;
 import java.util.Hashtable;
+import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -291,4 +292,15 @@ public class StringUtils {
         }
         return message;
     }
+
+    //组装参数
+    public static String addParams(Map<String, Object> map) {
+        StringBuilder stringBuilder = new StringBuilder();
+        for (Map.Entry<String, Object> stringObjectEntry : map.entrySet()) {
+            stringBuilder.append(stringObjectEntry.getKey());
+            stringBuilder.append("=");
+            stringBuilder.append(stringObjectEntry.getValue());
+        }
+        return stringBuilder.toString();
+    }
 }

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

@@ -223,7 +223,7 @@ public class TestUtil {
      */
     public static void test(final Activity activity) {
         final String[] items = {"复制token","复制打点数据","从jenkins下载小绵羊安装包","龙猫竞猜","龙猫竞猜-scheme",
-                "手机型号测试","测试通知栏", "测试自定义通知栏","测试自定义通知栏2",
+                "有米科技测试","有米科技","手机型号测试","测试通知栏", "测试自定义通知栏","测试自定义通知栏2",
                 "开启通知栏权限0","开启通知栏权限1","开启通知栏权限2","开启通知栏权限3",
                 "开启通知栏权限","通知栏权限1","通知栏权限2","通知栏权限8.0","测试支付","测试内部h5", "测试外部h5",
                 "会长推广游戏","移动积分兑换","审核中心","检查正版","crc32","loading","progress","查看截图",
@@ -269,6 +269,12 @@ public class TestUtil {
                                 bdIntent2.putExtras(bundle2);
                                 activity.sendBroadcast(bdIntent2);
                                 break;
+                            case "有米科技测试":
+                                Jump2View.getInstance().goTestYm(activity);
+                                break;
+                            case "有米科技":
+                                Jump2View.getInstance().goYm(activity);
+                                break;
                             case "手机型号测试":
                                 G.showToast(android.os.Build.BRAND);
                                 break;
@@ -604,4 +610,8 @@ public class TestUtil {
 //        return BuildConfig.DEBUG;//测试充值与绑定微信和身份信息逻辑
         return false;
     }
+    //开启后可跳转各种广告与升级
+    public static boolean isDev() {
+        return BuildConfig.DEBUG;
+    }
 }

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

@@ -1648,7 +1648,7 @@ public class ViewUtil {
     }
 
     /**
-     * 标签类型(0无,1热门,2最新,3现金,4活跃,5福利)
+     * 标签类型(0无,1热门,2最新,3现金,4活跃,5福利,6红包
      * homepage item statues
      */
     public void showGridviewStatues(Context context, TextView textView, HomeListEntity entity) {
@@ -1669,8 +1669,8 @@ public class ViewUtil {
                 break;
             case 2:
                 textView.setVisibility(View.VISIBLE);
-                textView.setBackgroundResource(R.drawable.shape_red_stroke_rectangle_no_lb);
-                textView.setTextColor(context.getResources().getColor(R.color.red_FD2D54));
+                textView.setBackgroundResource(R.drawable.shape_f07422_stroke_retangle_no_lb);
+                textView.setTextColor(context.getResources().getColor(R.color.red_F07422));
                 textView.setText("最新");
                 textView.setPadding(padding2, padding1, padding2, padding1);
                 break;
@@ -1695,6 +1695,13 @@ public class ViewUtil {
                 textView.setText("福利");
                 textView.setPadding(padding2, padding1, padding2, padding1);
                 break;
+            case 6:
+                textView.setVisibility(View.VISIBLE);
+                textView.setBackgroundResource(R.drawable.shape_red_stroke_rectangle_no_lb);
+                textView.setTextColor(context.getResources().getColor(R.color.red_FD2D54));
+                textView.setText("红包");
+                textView.setPadding(padding2, padding1, padding2, padding1);
+                break;
         }
 
     }

+ 0 - 54
app/src/main/java/com/sheep/gamegroup/view/activity/ActEverydayPlayGame.java

@@ -1,54 +0,0 @@
-package com.sheep.gamegroup.view.activity;
-
-import android.support.v7.widget.RecyclerView;
-
-import com.sheep.gamegroup.model.api.ApiService;
-import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.GameEntity;
-import com.sheep.gamegroup.model.entity.PlayGameEntity;
-import com.sheep.gamegroup.view.adapter.PlayGameItemAdapter;
-import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
-
-import java.util.Locale;
-
-import rx.Observable;
-
-/**
- * 每日必做和热门
- * Created by ljy on 2018/9/3.
- */
-
-public class ActEverydayPlayGame extends BaseListActivity<GameEntity> {
-    private int type;
-    @Override
-    protected RecyclerView.Adapter getAdapter() {
-        return new PlayGameItemAdapter(activity, list);
-    }
-
-    @Override
-    protected String getKey(int page, int per_page) {
-        return type == 0 ?String.format(Locale.CHINA, "app/find?page=%d&per_page=%d&is_hot=%d&daily_play=%d&type=%d", page, per_page, 0, 1, 0)
-                :String.format(Locale.CHINA, "app/find?page=%d&per_page=%d&is_hot=%d&daily_play=%d&type=%d", page, per_page, 1, 0, 0);
-    }
-
-    @Override
-    protected Observable<BaseMessage> getApi(ApiService apiService) {
-        return type == 0 ? apiService.playgameDailyOrHotOrTypePlay(page, per_page, 0, 1, 0)
-                : apiService.playgameDailyOrHotOrTypePlay(page, per_page, 1, 0, 0);
-    }
-
-    @Override
-    protected Class<GameEntity> getTClass() {
-            return GameEntity.class;
-    }
-
-    @Override
-    protected int getType() {
-        type = getIntent().getIntExtra("type", 0);
-        TitleBarUtils
-                .getInstance()
-                .setTitle(activity, type==0?"每日必做":"近期最热")
-                .setTitleFinish(activity);
-        return type;
-    }
-}

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

@@ -17,7 +17,6 @@ import android.widget.TextView;
 
 import com.kfzs.duanduan.utils.StatusBarUtils;
 import com.kfzs.duanduan.view.DialogStorageLow;
-import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.helper.DownloadHelper;
@@ -43,6 +42,7 @@ import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+import com.youmi.android.offer.BaseActYmPermissionCheck;
 
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
@@ -67,7 +67,7 @@ import static com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp.PUBLIC_TAG_PREFIX
  * Created by realicing on 2018/9/6.
  * realicing@sina.com
  */
-public class ActMain extends BaseActivity {
+public class ActMain extends BaseActYmPermissionCheck  {
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         StatusBarUtils.setTranslucent(this);
@@ -335,7 +335,7 @@ public class ActMain extends BaseActivity {
                 DataUtil.putAsBoolean("tryShowHalfScreenAd", true);
             }
         } else {
-            if (onResumeCount == 0) {
+            if (onResumeCount == 0 && !TestUtil.isDev()) {
                 SysAppUtil.showVersionInfo(this, SpUtils.getIgnoreMd5(), new Action1<Integer>() {
                     @Override
                     public void call(Integer integer) {

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

@@ -1,7 +1,6 @@
 package com.sheep.gamegroup.view.activity;
 
 import android.app.Activity;
-import android.app.Fragment;
 import android.os.Bundle;
 import android.support.design.widget.TabLayout;
 import android.support.v4.view.ViewPager;
@@ -60,7 +59,7 @@ public class ActMiDong extends BaseActivity {
     public void initView() {
         activity = this;
         TitleBarUtils.getInstance()
-                .setTitle(activity, "简单任务")
+                .setTitle(activity, "简单奖励")
                 .setTitleFinish(activity)
                 .setRightImgBotton(activity, R.mipmap.question_black_img, new View.OnClickListener() {
                     @Override
@@ -83,9 +82,9 @@ public class ActMiDong extends BaseActivity {
         fgtMiDongList.add(new FgtMiDongAdTskList());
         fgtMiDongList.add(new FgtMiDongSignTskList());
         fgtMiDongList.add(new FgtMiDongWeChatTaskList());
-        mAdapter.add(fgtMiDongList.get(0), "普通任务");
-        mAdapter.add(fgtMiDongList.get(1), "签到任务");
-        mAdapter.add(fgtMiDongList.get(2), "小程序任务");
+        mAdapter.add(fgtMiDongList.get(0), "普通奖励");
+        mAdapter.add(fgtMiDongList.get(1), "签到奖励");
+        mAdapter.add(fgtMiDongList.get(2), "小程序奖励");
         pager.setAdapter(mAdapter);
         indicator.setupWithViewPager(pager);
         pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {

+ 53 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActPlayGameList.java

@@ -0,0 +1,53 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.support.v7.widget.RecyclerView;
+
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.GameEntity;
+import com.sheep.gamegroup.model.entity.GameListType;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.StringUtils;
+import com.sheep.gamegroup.view.adapter.PlayGameItemAdapter;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import java.util.Locale;
+
+import rx.Observable;
+/**
+ * Created by realicing on 2018/10/31.
+ * realicing@sina.com
+ * 游戏列表
+ */
+public class ActPlayGameList extends BaseListActivity2<GameEntity> {
+    private GameListType gameListType;
+
+    @Override
+    public void initView() {
+        gameListType = DataUtil.getObject(getIntent(), GameListType.class);
+        TitleBarUtils
+                .getInstance()
+                .setTitle(this, gameListType.getTitle())
+                .setTitleFinish(this);
+    }
+    @Override
+    protected RecyclerView.Adapter getAdapter() {
+        return new PlayGameItemAdapter(this, list);
+    }
+
+    @Override
+    protected String getKey(int page, int per_page) {
+        return String.format(Locale.CHINA, "app/find?page=%d&per_page=%d&%s", page, per_page, StringUtils.addParams(gameListType.getMap()));
+    }
+
+    @Override
+    protected Observable<BaseMessage> getApi(ApiService apiService) {
+        return apiService.getPlayGameList(page, per_page, gameListType.getMap());
+    }
+
+    @Override
+    protected Class<GameEntity> getTClass() {
+            return GameEntity.class;
+    }
+
+}

+ 59 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActPlayGameRecommendList.java

@@ -0,0 +1,59 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.support.v7.widget.RecyclerView;
+
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.GameEntity;
+import com.sheep.gamegroup.model.entity.GameListType;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.view.adapter.PlayGameItemAdapter;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import java.util.Locale;
+
+import rx.Observable;
+
+/**
+ * Created by realicing on 2018/10/31.
+ * realicing@sina.com
+ * 猜你喜欢游戏列表
+ */
+public class ActPlayGameRecommendList extends BaseListActivity2<GameEntity> {
+
+    private GameListType gameListType;
+    @Override
+    public void initView() {
+        gameListType = DataUtil.getObject(getIntent(), GameListType.class);
+        TitleBarUtils
+                .getInstance()
+                .setTitle(this, gameListType.getTitle())
+                .setTitleFinish(this);
+    }
+    @Override
+    protected RecyclerView.Adapter getAdapter() {
+        return new PlayGameItemAdapter(this, list);
+    }
+
+    @Override
+    protected String getKey(int page, int per_page) {
+        return String.format(Locale.CHINA, "app/find/recommend/list?display_type=%d", gameListType.getDisplay_type());
+    }
+
+    @Override
+    protected Observable<BaseMessage> getApi(ApiService apiService) {
+        return apiService.getRecommendListMore(gameListType.getDisplay_type());
+    }
+
+    @Override
+    protected Class<GameEntity> getTClass() {
+            return GameEntity.class;
+    }
+
+    @Override
+    public void notifyDataSetChanged() {
+        if(!list.isEmpty())
+            setNoMore(true);
+        super.notifyDataSetChanged();
+    }
+}

+ 59 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActPlayGameUserLikeList.java

@@ -0,0 +1,59 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.support.v7.widget.RecyclerView;
+
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.GameEntity;
+import com.sheep.gamegroup.model.entity.GameListType;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.StringUtils;
+import com.sheep.gamegroup.view.adapter.PlayGameItemAdapter;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import java.util.Locale;
+
+import rx.Observable;
+
+/**
+ * Created by realicing on 2018/10/31.
+ * realicing@sina.com
+ * 猜你喜欢游戏列表
+ */
+public class ActPlayGameUserLikeList extends BaseListActivity2<GameEntity> {
+
+    @Override
+    public void initView() {
+        GameListType gameListType = DataUtil.getObject(getIntent(), GameListType.class);
+        TitleBarUtils
+                .getInstance()
+                .setTitle(this, gameListType.getTitle())
+                .setTitleFinish(this);
+    }
+    @Override
+    protected RecyclerView.Adapter getAdapter() {
+        return new PlayGameItemAdapter(this, list);
+    }
+
+    @Override
+    protected String getKey(int page, int per_page) {
+        return "app/find/recommend/user_like";
+    }
+
+    @Override
+    protected Observable<BaseMessage> getApi(ApiService apiService) {
+        return apiService.getUserLikeList();
+    }
+
+    @Override
+    protected Class<GameEntity> getTClass() {
+            return GameEntity.class;
+    }
+
+    @Override
+    public void notifyDataSetChanged() {
+        if(!list.isEmpty())
+            setNoMore(true);
+        super.notifyDataSetChanged();
+    }
+}

+ 127 - 114
app/src/main/java/com/sheep/gamegroup/view/activity/BaseListActivity.java

@@ -1,10 +1,7 @@
 package com.sheep.gamegroup.view.activity;
 
-import android.app.Activity;
-import android.os.Bundle;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
-import android.util.Log;
 import android.view.View;
 
 import com.jcodecraeer.xrecyclerview.XRecyclerView;
@@ -29,45 +26,51 @@ import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
 /**
- * Created by ljy on 2018/9/3.
+ * Created by realicing on 2018/9/3.
+ * realicing@sina.com
+ * 自己可以进行刷新与加载更多,使用com.jcodecraeer.xrecyclerview.XRecyclerView来实现,子类提供网络接口相关
  */
-
-public abstract class BaseListActivity<T> extends BaseActivity {
-
-    @BindView(R.id.title)
-    View title;
-    @BindView(R.id.empty_view)
-    View empty_view;
-    @BindView(R.id.check_net_ll)
-    View check_net_ll;
-    @BindView(R.id.view_list)
-    XRecyclerView view_list;
-    protected Activity activity;
-
+public abstract class BaseListActivity2<T> extends BaseActivity {
     @Override
-    protected int getLayoutId() {
+    public int getLayoutId() {
         return R.layout.net_empty_xrecycler;
     }
 
     @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        activity = this;
-        getType();
-        initView();
-        initListener();
-        if(!refreshDataAfterOnResume())
-            ViewUtil.refreshXrv(view_list);
+    public void initData() {
+        switch (refreshDataType()) {
+            case REFRESH_ON_CREATE:
+                ViewUtil.refreshXrv(view_list);
+                break;
+            case REFRESH_ON_RESUME:
+                break;
+            case REFRESH_ON_YOURSELF:
+            default:
+                notifyDataSetChanged();
+                break;
+        }
     }
 
+    public static final int REFRESH_ON_CREATE = 0;
+    public static final int REFRESH_ON_RESUME = 1;
+    public static final int REFRESH_ON_YOURSELF = -1;
+    @BindView(R.id.title)
+    protected View title;
+    @BindView(R.id.empty_view)
+    protected View empty_view;
+    @BindView(R.id.check_net_ll)
+    protected View check_net_ll;
+    @BindView(R.id.view_list)
+    protected XRecyclerView view_list;
+
+    protected BaseMessage lastMessage;//最后一个网络获取的结果
     protected int page = 1;//页数
     protected int per_page = DataUtil.PER_PAGE;
-    protected BaseMessage lastMessage;//最后一个网络获取的结果
-    private boolean noMore = false;
-    public void initView() {
-//        title.setVisibility(View.GONE);
-    }
-    private View bottomLine;
+    private boolean loadMore;
+
+    protected View bottomLine;
+
+    @Override
     public void initListener() {
         view_list.setLoadingListener(new XRecyclerView.LoadingListener() {
             @Override
@@ -77,71 +80,45 @@ public abstract class BaseListActivity<T> extends BaseActivity {
 
             @Override
             public void onLoadMore() {
-                if(ListUtil.size(list) >= per_page*page){
-                    page += 1;
-                    initData();
-                }else {
-                    view_list.setNoMore(true);
-                    setNoMore(true);
-                }
+                loadMoreData();
+
             }
         });
-        bottomLine = ViewUtil.setBottomLine(view_list);
+        bottomLine = ViewUtil.setBottomLine(view_list, getNoMoreCallBack());
         view_list.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
         view_list.setAdapter(getAdapter());
-        view_list.addOnScrollListener(new RecyclerView.OnScrollListener() {
-            boolean isSlidingToLast;
-            @Override
-            public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
-                super.onScrollStateChanged(recyclerView, newState);
-
-                RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
-
-                if(layoutManager instanceof LinearLayoutManager){
-                    LinearLayoutManager linearLayoutManager = (LinearLayoutManager) layoutManager;
-
-                    //获取最后一个完全显示的item的position
-                    int lastVisibleItem = linearLayoutManager.findLastCompletelyVisibleItemPosition();
-                    int totalCount = linearLayoutManager.getItemCount();
-                    Log.e("lastvisi_item_-----", lastVisibleItem+","+totalCount);
-
-                    if(newState == RecyclerView.SCROLL_STATE_IDLE && isSlidingToLast){//滑动到了底部
-                        if(ListUtil.size(list) >= per_page*page){
-
-
-                        }
-
-                    }
-                }
-            }
-
-            @Override
-            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
-                super.onScrolled(recyclerView, dx, dy);
-                Log.e("dx-----", dx+","+dy);
-                if (dy > 0) {
-                    //大于0表示正在向下滚动
-                    isSlidingToLast = true;
-                } else {
-                    //小于等于0表示停止或向上滚动
-                    isSlidingToLast = false;
-                }
+    }
 
+    protected void loadMoreData() {
+        if (!loadMore) {
+            loadMore = true;
+            if (ListUtil.size(list) >= per_page * page) {
+                page += 1;
+                mInitData();
+            } else {
+                view_list.setNoMore(true);
+                setNoMore(true);
             }
-        });
-
+        } else {
+            view_list.loadMoreComplete();
+        }
     }
 
+    public void setNoMore(boolean noMore) {
+        this.noMore = noMore;
+    }
 
     protected List<T> list = ListUtil.emptyList();
     protected List<T> lastCacheList = ListUtil.emptyList();
+
     //默认先获取缓存
-    protected boolean isFirstGetACache(){
+    protected boolean isFirstGetACache() {
         return true;
     }
-    public void initData() {
+
+    public void mInitData() {
         final String urlKey = getKey(page, per_page);
-        if(isFirstGetACache()) {
+        if (isFirstGetACache()) {
             //先尝试获取缓存数据
             lastCacheList = DataUtil.getInstance().getCacheList(urlKey, getTClass());
             loadList(lastCacheList);
@@ -149,11 +126,11 @@ public abstract class BaseListActivity<T> extends BaseActivity {
         SysAppUtil.checkNet(new Action1<Integer>() {
             @Override
             public void call(Integer result) {
-                if(result != 0){//无网络
-                    if(check_net_ll != null)
+                if (result != 0) {//无网络
+                    if (check_net_ll != null)
                         check_net_ll.setVisibility(View.VISIBLE);
                 } else {
-                    if(check_net_ll != null)
+                    if (check_net_ll != null)
                         check_net_ll.setVisibility(View.GONE);
                 }
             }
@@ -166,12 +143,12 @@ public abstract class BaseListActivity<T> extends BaseActivity {
                     public void onNext(BaseMessage baseMessage) {
                         lastMessage = baseMessage;
                         boolean isNewData = DataUtil.getInstance().isNewData(urlKey);
-                        if(isNewData || !isFirstGetACache()) {
-                            if(isFirstGetACache())
+                        if (isNewData || !isFirstGetACache()) {
+                            if (isFirstGetACache())
                                 ListUtil.removeAll(list, lastCacheList);
                             List<T> newList = baseMessage.getDatas(getTClass());
                             loadList(newList);
-                        }else {
+                        } else {
                             notifyDataSetChanged();
                         }
                     }
@@ -183,52 +160,88 @@ public abstract class BaseListActivity<T> extends BaseActivity {
                 });
     }
 
-    public void refreshData(){
+    public Action1<String> getNoMoreCallBack() {
+        return null;
+    }
+
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        if (refreshDataType() == REFRESH_ON_RESUME) {
+            ViewUtil.refreshXrv(view_list);
+        }
+    }
+
+    /**
+     * 在哪里初始化数据:0 onViewCreated后, 1 onResume后, -1 不初始化
+     *
+     * @return
+     */
+    public int refreshDataType() {
+        return REFRESH_ON_CREATE;
+    }
+
+    public void clear() {
         lastMessage = null;
         setNoMore(false);
         empty_view.setVisibility(View.INVISIBLE);
         list.clear();
-        view_list.getAdapter().notifyDataSetChanged();
         page = 1;
-        initData();
     }
-    private void loadList(List<T> newList){
-        ListUtil.addAllItem(list, newList);
+
+    public void refreshData() {
+        clear();
+        view_list.getAdapter().notifyDataSetChanged();
+        mInitData();
+    }
+
+    protected List<T> newList;
+
+    protected void loadList(List<T> addList) {
+        ListUtil.addAllItem(list, addList);
+        newList = addList;
         notifyDataSetChanged();
     }
-    protected void notifyDataSetChanged(){
 
-        if(view_list == null)
+    public void notifyDataSetChanged() {
+        if (view_list == null)
             view_list = findViewById(R.id.view_list);
-        if(empty_view == null)
-            empty_view = findViewById(R.id.empty_view);
-        if(empty_view == null)
+        if (empty_view == null)
             empty_view = findViewById(R.id.empty_view);
-        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
-        bottomLine.setVisibility(list.isEmpty() ? View.INVISIBLE : View.VISIBLE);
-        if(page == 1){
+        loadMore = false;
+        updateEmptyView();
+        if (page == 1) {
             view_list.refreshComplete();
         } else {
             view_list.loadMoreComplete();
         }
         view_list.getAdapter().notifyDataSetChanged();
+        notifyData();
+        view_list.getFootView().setVisibility(view_list.getAdapter().getItemCount() == 0 ? View.GONE : View.VISIBLE);
     }
 
-    /**
-     * 每次都在onResume方法中进行更新数据
-     * @return
-     */
-    public boolean refreshDataAfterOnResume() {
-        return false;
+    protected void updateEmptyView() {
+        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
     }
+
     @Override
-    public void onResume() {
-        super.onResume();
-        if(refreshDataAfterOnResume()){
-            ViewUtil.refreshXrv(view_list);
+    protected void onDestroy() {
+        super.onDestroy();
+        // any time,when you finish your activity or fragment,call this below
+        if (view_list != null) {
+            view_list.destroy(); // this will totally release XR's memory
+            view_list = null;
         }
     }
 
+
+    private boolean noMore = false;
+
+    public boolean isNoMore() {
+        return noMore;
+    }
+
     protected abstract RecyclerView.Adapter getAdapter();
 
     protected abstract String getKey(int page, int per_page);
@@ -237,8 +250,8 @@ public abstract class BaseListActivity<T> extends BaseActivity {
 
     protected abstract Class<T> getTClass();
 
-    protected abstract int getType();
-    public void setNoMore(boolean noMore) {
-        this.noMore = noMore;
+    //刷新数据的回调,子类可以实现自己的需求
+    public void notifyData() {
+
     }
 }

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

@@ -31,6 +31,8 @@ import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.RxjavaCountDownTimer;
 import com.sheep.gamegroup.util.SysAppUtil;
+import com.sheep.gamegroup.util.TestUtil;
+import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 
@@ -134,7 +136,7 @@ public class SplashAct extends BaseActivity implements EasyPermissions.Permissio
                         sendHandlerMessages(100);
                     break;
                 case 1:
-                    if(SysAppUtil.isNewSmallSheep()){//新版本只显示引导页面,不展示弹窗和开屏广告
+                    if(SysAppUtil.isNewSmallSheep() || TestUtil.isDev()){//新版本只显示引导页面,不展示弹窗和开屏广告
                         isLoadingData = false;
                         sendHandlerMessages(200);
                     } else {

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

@@ -51,9 +51,9 @@ public class TryMakeMoneyact extends BaseActivity {
         is_succession = getIntent()
                 .getIntExtra(
                         "is_succession", 0);
-        if(is_succession == 1){
-            title = "连续任务";
-        }else {
+        if (is_succession == 1) {
+            title = "连续奖励";
+        } else {
             title = "试玩赚钱";
         }
         TitleBarUtils
@@ -97,7 +97,7 @@ public class TryMakeMoneyact extends BaseActivity {
     /**
      * 获取is_succession,是否是连续任务
      */
-    public int getIsSuccession(){
+    public int getIsSuccession() {
         return is_succession;
     }
 

+ 76 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameCenter1_2List.java

@@ -0,0 +1,76 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.app.Activity;
+import android.content.Context;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
+import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
+import com.sheep.gamegroup.model.entity.GameEntity;
+import com.sheep.gamegroup.model.entity.GameEntityList;
+import com.sheep.gamegroup.model.entity.GameListTypeList;
+import com.sheep.gamegroup.model.entity.GameRecommend;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+
+import java.util.List;
+
+
+/**
+ * Created by realicing on 2018/10/30.
+ * realicing@sina.com
+ * 游戏主页上每一屏显示有1.2个元素
+ */
+public class AdpGameCenter1_2List extends RecyclerViewAdapter<GameListTypeList<GameRecommend>> {
+    public AdpGameCenter1_2List(Context context, List<GameListTypeList<GameRecommend>> gameListTypeLists) {
+        super(context, R.layout.item_play_game_list, gameListTypeLists);
+    }
+
+    @Override
+    public void convert(ViewHolder viewHolder, final GameListTypeList<GameRecommend> gameListTypeList, int position) {
+        TextView item_play_game_list_tv = viewHolder.itemView.findViewById(R.id.item_play_game_list_tv);
+        TextView item_play_game_list_more_tv = viewHolder.itemView.findViewById(R.id.item_play_game_list_more_tv);
+        ViewUtil.setText(item_play_game_list_tv, gameListTypeList.getGameListType().getTitle());
+        item_play_game_list_more_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                if(mContext instanceof Activity)
+                    Jump2View.getInstance().goActPlayGameList((Activity) mContext, gameListTypeList.getGameListType());
+            }
+        });
+        RecyclerView recyclerView = viewHolder.itemView.findViewById(R.id.item_play_game_list_rv);
+        LinearLayoutManager playHotManager = new LinearLayoutManager(SheepApp.getInstance(), LinearLayoutManager.HORIZONTAL, false);
+        recyclerView.setHasFixedSize(true);
+        recyclerView.setNestedScrollingEnabled(false);
+        recyclerView.setLayoutManager(playHotManager);
+        recyclerView.setAdapter(new AdbCommonRecycler<GameRecommend>(SheepApp.getInstance(), gameListTypeList.getList()) {
+            @Override
+            public int getViewIdByType(int type) {
+                return R.layout.item_play_game;
+            }
+
+            @Override
+            public void convert(com.sheep.gamegroup.util.ViewHolder holder, GameRecommend item) {
+                int index = holder.getAdapterPosition();
+                TextView item_play_game_name =  holder.itemView.findViewById(R.id.item_play_game_name);
+                View item_play_game_start =  holder.itemView.findViewById(R.id.item_play_game_start);
+                View item_play_game_end =  holder.itemView.findViewById(R.id.item_play_game_end);
+                ImageView item_play_game_iv =  holder.itemView.findViewById(R.id.item_play_game_iv);
+                ViewUtil.setVisibility(item_play_game_start, index == 0 );
+                ViewUtil.setVisibility(item_play_game_end, index + 1 == listData.size());
+                if(item == null){
+                    ViewUtil.setDefaultText(item_play_game_name);
+                } else {
+                    ViewUtil.setText(item_play_game_name, item.getTitle());
+                    ViewUtil.setImage(item_play_game_iv, item.getUrl(), mContext.getResources().getDimensionPixelSize(R.dimen.content_padding_3));
+                }
+            }
+        });
+    }
+}

+ 85 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameCenter3_3List.java

@@ -0,0 +1,85 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.app.Activity;
+import android.content.Context;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
+import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
+import com.sheep.gamegroup.model.entity.GameEntity;
+import com.sheep.gamegroup.model.entity.GameEntityList;
+import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+
+import java.util.List;
+
+import static com.sheep.gamegroup.view.adapter.PlayGameListAdapter.setOnClickGameEntity;
+
+
+/**
+ * Created by realicing on 2018/10/30.
+ * realicing@sina.com
+ * 游戏主页上每一屏显示有3.3个元素
+ */
+public class AdpGameCenter3_3List extends RecyclerViewAdapter<GameEntityList> {
+    public AdpGameCenter3_3List(Context context, List<GameEntityList> datas) {
+        super(context, R.layout.item_play_game_list, datas);
+    }
+
+    public AdpGameCenter3_3List setShowFirstTop(boolean showFirstTop) {
+        isShowFirstTop = showFirstTop;
+        return this;
+    }
+
+    private boolean isShowFirstTop = true;
+
+    @Override
+    public void convert(ViewHolder viewHolder, final GameEntityList gameEntityList, int position) {
+        View item_play_game_list_top = viewHolder.itemView.findViewById(R.id.item_play_game_list_top);
+        TextView item_play_game_list_tv = viewHolder.itemView.findViewById(R.id.item_play_game_list_tv);
+        TextView item_play_game_list_more_tv = viewHolder.itemView.findViewById(R.id.item_play_game_list_more_tv);
+        if(!isShowFirstTop)//不显示第一项的线
+            ViewUtil.setVisibility(item_play_game_list_top, position != 0);
+        ViewUtil.setText(item_play_game_list_tv, gameEntityList.getGameListType().getTitle());
+        item_play_game_list_more_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                if(mContext instanceof Activity)
+                    Jump2View.getInstance().goActPlayGameList((Activity) mContext, gameEntityList.getGameListType());
+            }
+        });
+        RecyclerView recyclerView = viewHolder.itemView.findViewById(R.id.item_play_game_list_rv);
+        LinearLayoutManager playHotManager = new LinearLayoutManager(SheepApp.getInstance(), LinearLayoutManager.HORIZONTAL, false);
+        recyclerView.setHasFixedSize(true);
+        recyclerView.setNestedScrollingEnabled(false);
+        recyclerView.setLayoutManager(playHotManager);
+        recyclerView.setAdapter(new AdbCommonRecycler<GameEntity>(SheepApp.getInstance(), gameEntityList.getList()) {
+            @Override
+            public int getViewIdByType(int type) {
+                return R.layout.item_hot_welfare;
+            }
+
+            @Override
+            public void convert(com.sheep.gamegroup.util.ViewHolder holder, GameEntity item) {
+                ImageView item_hot_welfare_iv =  holder.itemView.findViewById(R.id.item_hot_welfare_iv);
+                TextView item_hot_welfare_tv = holder.itemView.findViewById(R.id.item_hot_welfare_tv);
+                if(item == null){
+                    ViewUtil.setDefaultText(item_hot_welfare_tv);
+                } else {
+                    // 加载数据
+                    ViewUtil.setText(item_hot_welfare_tv, item.getApp().getName());
+                    GlideImageLoader.setGameImage(item_hot_welfare_iv, item.getApp().getIcon());
+                    if(mContext instanceof Activity)
+                        setOnClickGameEntity((Activity) mContext, holder.itemView, item);
+                }
+            }
+        });
+    }
+}

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

@@ -19,7 +19,6 @@ import com.kfzs.duanduan.utils.ApkUtils;
 import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.event.EventTypes;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
-import com.sheep.gamegroup.helper.TaskHelper;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GameAgencyRechargePlatformEntity;
 import com.sheep.gamegroup.model.entity.OrienteeringDetail;
@@ -633,7 +632,7 @@ public class TryMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
                         detail_task_tv.setEnabled(true);
                         viewHolder.itemView.setEnabled(true);
                     } else {
-                        detail_task_tv.setText("领取任务");
+                        detail_task_tv.setText("开始赚钱");
                         detail_task_tv.setBackground(context.getResources().getDrawable(R.drawable.sp_bg_gradient_rectangle_blue));
                         detail_task_tv.setEnabled(true);
                         viewHolder.itemView.setEnabled(true);

+ 266 - 224
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPlayGame.java

@@ -3,8 +3,6 @@ package com.sheep.gamegroup.view.fragment;
 import android.app.Activity;
 import android.content.Context;
 import android.support.annotation.NonNull;
-import android.support.design.widget.TabLayout;
-import android.support.v4.view.ViewPager;
 import android.support.v4.widget.NestedScrollView;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
@@ -15,24 +13,28 @@ import android.widget.TextView;
 
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.RequestOptions;
+import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
 import com.scwang.smartrefresh.layout.api.RefreshLayout;
-import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
+import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.FindTag;
 import com.sheep.gamegroup.model.entity.GameEntity;
+import com.sheep.gamegroup.model.entity.GameEntityList;
+import com.sheep.gamegroup.model.entity.GameListTag;
+import com.sheep.gamegroup.model.entity.GameListType;
+import com.sheep.gamegroup.model.entity.GameListTypeList;
+import com.sheep.gamegroup.model.entity.GameRecommend;
 import com.sheep.gamegroup.model.entity.SlideshowEty;
+import com.sheep.gamegroup.model.util.AbsSubscriber;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
-import com.sheep.gamegroup.util.GlideImageLoader;
-import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.ObservableUtil;
 import com.sheep.gamegroup.util.RefreshUtil;
-import com.sheep.gamegroup.util.ViewHolder;
 import com.sheep.gamegroup.util.ViewUtil;
-import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
-import com.sheep.gamegroup.view.adapter.TitleFragmentListAdapter;
+import com.sheep.gamegroup.view.adapter.AdpGameCenter1_2List;
+import com.sheep.gamegroup.view.adapter.AdpGameCenter3_3List;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseFragment;
@@ -48,36 +50,27 @@ import java.util.ArrayList;
 import java.util.List;
 
 import butterknife.BindView;
-import butterknife.OnClick;
 import butterknife.Unbinder;
+import rx.Observable;
 import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Func1;
 import rx.schedulers.Schedulers;
 
-import static com.sheep.gamegroup.model.entity.TaskEty.TASK_TYPE_GAME_OTHER;
-import static com.sheep.gamegroup.model.entity.TaskEty.TASK_TYPE_GAME_SHEEP;
-import static com.sheep.gamegroup.model.entity.TaskEty.TASK_TYPE_GAME_TECENT;
-import static com.sheep.gamegroup.model.entity.TaskEty.TASK_TYPE_GAME_XIAO_MI;
-import static com.sheep.gamegroup.view.adapter.PlayGameListAdapter.setOnClickGameEntity;
-
 /**
- * Created by ljy on 2018/9/3.
+ * Created by realicing on 2018/10/30.
+ * realicing@sina.com
  */
-
 public class FgtPlayGame extends BaseFragment {
     @BindView(R.id.banner)
     Banner banner;
-    @BindView(R.id.every_day_more_tv)
-    TextView everyDayMoreTv;
-    @BindView(R.id.every_day_play_list)
-    RecyclerView everyDayPlayList;
-    @BindView(R.id.recent_hot_more_tv)
-    TextView recentHotMoreTv;
-    @BindView(R.id.recent_hoe_list)
-    RecyclerView recentHoeList;
-    @BindView(R.id.tabLayout)
-    TabLayout indicator;
-    @BindView(R.id.viewpager_act_game_details)
-    ViewPager pager;
+    @BindView(R.id.play_game_act)
+    RecyclerView play_game_act;
+    @BindView(R.id.play_game_list_3_rv)
+    RecyclerView play_game_list_3_rv;
+    @BindView(R.id.play_game_list_2_rv)
+    RecyclerView play_game_list_2_rv;
+    @BindView(R.id.play_game_list_x_rv)
+    RecyclerView play_game_list_x_rv;
     @BindView(R.id.refresh)
     SmartRefreshLayout refresh;
     @BindView(R.id.scrollView)
@@ -85,21 +78,27 @@ public class FgtPlayGame extends BaseFragment {
     Unbinder unbinder;
 
     private Activity activity;
-    private List<GameEntity> everyDayPlayListData = new ArrayList<>();
-    private List<GameEntity> hotListData = new ArrayList<>();
-
+    //游戏首页活动列表
+    private List<SlideshowEty> gameActList = new ArrayList<>();
+    //每日必玩", "近期最热", "猜你喜欢
+    private List<GameListType> gameListTypeList3 = new ArrayList<>();
+    private List<GameEntityList> gameEntityList3 = new ArrayList<>();
+    //天天更新与重点推荐
+    private List<GameListType> gameListTypeList2 = new ArrayList<>();
+    private List<GameListTypeList<GameRecommend>> gameListTypeList2List = new ArrayList<>();
+    //预下载和tag列表的数据
+    private List<GameEntityList> gameEntityListx = new ArrayList<>();
     private List<SlideshowEty> slideshowEtyLists = new ArrayList<>();
     private List<String> slideshowTitleList = new ArrayList<>();
 
-    private List<FindTag> list = ListUtil.emptyList();
-    private TitleFragmentListAdapter mAdapter;
-    private int curPosition = 0;
 
     @Override
     public int getLayoutId() {
         return R.layout.fgt_play_game;
     }
 
+    public static final int[] gameActBgIds = {R.drawable.shape_purple_gradient_solid_rectangle_5, R.drawable.shape_orange_gradient_solid_rectangle_5, R.drawable.shape_light_blue_gradient_solid_rectangle_5};
+
     @Override
     public void onViewCreated() {
         activity = getActivity();
@@ -109,136 +108,205 @@ public class FgtPlayGame extends BaseFragment {
         bannerLayoutParams.height = G.WIDTH * 25 / 72;
         banner.setLayoutParams(bannerLayoutParams);
 
-        //每日必玩、近期最热
-        LinearLayoutManager playHotManager = new LinearLayoutManager(SheepApp.getInstance(), LinearLayoutManager.HORIZONTAL, false);
-        //每日必玩
-        everyDayPlayList.setHasFixedSize(true);
-        everyDayPlayList.setNestedScrollingEnabled(false);
-        everyDayPlayList.setLayoutManager(playHotManager);
-        everyDayPlayList.setAdapter(new AdbCommonRecycler<GameEntity>(SheepApp.getInstance(), everyDayPlayListData) {
+        //游戏首页活动列表
+        LinearLayoutManager playGameActManager = new LinearLayoutManager(SheepApp.getInstance(), LinearLayoutManager.HORIZONTAL, false);
+        play_game_act.setHasFixedSize(true);
+        play_game_act.setNestedScrollingEnabled(false);
+        play_game_act.setLayoutManager(playGameActManager);
+        play_game_act.setAdapter(new RecyclerViewAdapter<SlideshowEty>(SheepApp.getInstance(), R.layout.item_game_act, gameActList) {
             @Override
-            public int getViewIdByType(int type) {
-                return R.layout.item_hot_welfare;
-            }
-
-            @Override
-            public void convert(ViewHolder holder, GameEntity welfareCenter) {
-                ImageView item_hot_welfare_iv =  holder.itemView.findViewById(R.id.item_hot_welfare_iv);
-                TextView item_hot_welfare_tv = holder.itemView.findViewById(R.id.item_hot_welfare_tv);
-                if(welfareCenter == null){
-                    ViewUtil.setDefaultText(item_hot_welfare_tv);
+            public void convert(com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder viewHolder, final SlideshowEty item, int position) {
+                View item_game_act_start = viewHolder.itemView.findViewById(R.id.item_game_act_start);
+                View item_game_act_content = viewHolder.itemView.findViewById(R.id.item_game_act_content);
+                View item_game_act_end = viewHolder.itemView.findViewById(R.id.item_game_act_end);
+                ImageView item_game_act_iv = viewHolder.itemView.findViewById(R.id.item_game_act_iv);
+                TextView item_game_act_tv = viewHolder.itemView.findViewById(R.id.item_game_act_tv);
+                ViewUtil.setVisibility(item_game_act_start, position == 0);
+                ViewUtil.setVisibility(item_game_act_end, position + 1 == gameActList.size());
+                item_game_act_content.setBackgroundResource(gameActBgIds[position % gameActBgIds.length]);
+                if (item == null) {
+                    ViewUtil.setDefaultText(item_game_act_tv);
                 } else {
-                    // 加载数据
-                    ViewUtil.setText(item_hot_welfare_tv, welfareCenter.getApp().getName());
-                    GlideImageLoader.setGameImage(item_hot_welfare_iv, welfareCenter.getApp().getIcon());
-                    setOnClickGameEntity(activity, holder.itemView, welfareCenter);
+                    ViewUtil.setImage(item_game_act_iv, item.getUrl());
+                    ViewUtil.setText(item_game_act_tv, item.getTitle());
                 }
-            }
-        });
-        //近期最热
-        LinearLayoutManager hotManager = new LinearLayoutManager(SheepApp.getInstance(), LinearLayoutManager.HORIZONTAL, false);
-        recentHoeList.setHasFixedSize(true);
-        recentHoeList.setNestedScrollingEnabled(false);
-        recentHoeList.setLayoutManager(hotManager);
-        recentHoeList.setAdapter(new AdbCommonRecycler<GameEntity>(SheepApp.getInstance(), hotListData) {
-            @Override
-            public int getViewIdByType(int type) {
-                return R.layout.item_hot_welfare;
-            }
+                viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        try {
+                            CommonUtil.getInstance().clickBanner(activity, item);
+                        } catch (Exception e) {
+                            G.showToast(e.getMessage());
+                        }
+                    }
+                });
 
-            @Override
-            public void convert(ViewHolder holder, GameEntity welfareCenter) {
-                ImageView item_hot_welfare_iv = holder.itemView.findViewById(R.id.item_hot_welfare_iv);
-                TextView item_hot_welfare_tv = holder.itemView.findViewById(R.id.item_hot_welfare_tv);
-                if(welfareCenter == null){
-                    ViewUtil.setDefaultText(item_hot_welfare_tv);
-                } else {
-                    // 加载数据
-                    ViewUtil.setText(item_hot_welfare_tv, welfareCenter.getApp().getName());
-                    GlideImageLoader.setGameImage(item_hot_welfare_iv, welfareCenter.getApp().getIcon());
-                    setOnClickGameEntity(activity, holder.itemView, welfareCenter);
-                }
             }
         });
-        refresh.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
-            @Override
-            public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
-                FgtPlayGameSon item = (FgtPlayGameSon) mAdapter.getItem(curPosition);
-                if (item == null) {
-                    notifyDataSetChanged();
-                    return;
-                }
-                item.loadMoreData();
-                notifyDataSetChanged();
-            }
+
+        //每日必玩、近期最热、猜你喜欢
+        play_game_list_3_rv.setHasFixedSize(true);
+        play_game_list_3_rv.setNestedScrollingEnabled(false);
+        play_game_list_3_rv.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
+        play_game_list_3_rv.setAdapter(new AdpGameCenter3_3List(activity, gameEntityList3).setShowFirstTop(false));
+        //天天更新、重点推荐
+        play_game_list_2_rv.setHasFixedSize(true);
+        play_game_list_2_rv.setNestedScrollingEnabled(false);
+        play_game_list_2_rv.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
+        play_game_list_2_rv.setAdapter(new AdpGameCenter1_2List(activity, gameListTypeList2List));
+        //预下载与其它列表
+        play_game_list_x_rv.setHasFixedSize(true);
+        play_game_list_x_rv.setNestedScrollingEnabled(false);
+        play_game_list_x_rv.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
+        play_game_list_x_rv.setAdapter(new AdpGameCenter3_3List(activity, gameEntityListx));
+
+        refresh.setOnRefreshListener(new OnRefreshListener() {
 
             @Override
             public void onRefresh(@NonNull RefreshLayout refreshLayout) {
                 initData();
             }
         });
-        RefreshUtil.newInstance().publicParameterRefresh(refresh, activity);
-
-        mAdapter = new TitleFragmentListAdapter(getChildFragmentManager());
-
-        //tab
-        initTab();
-        initData();
+        RefreshUtil.newInstance().publicParameter(refresh, activity);
+        initGameListType3List();
+        initGameListType2List();
+        refresh.autoRefresh();
     }
 
-    @Override
-    public void onStart() {
-        super.onStart();
-        //结束轮播
-        banner.startAutoPlay();
+    public static final String[] gameListType3Titles = {"每日必玩", "近期最热", "猜你喜欢"};
+    public static final int[] gameListType3IsHots = {1, 0, 0};
+    public static final int[] gameListType3DailyPlays = {0, 1, 0};
+
+    private void initGameListType3List() {
+        //每日必玩", "近期最热", "猜你喜欢
+        for (int i = 0; i < gameListType3Titles.length; i++) {
+            GameListType gameListType = new GameListType();
+            gameListType.setTitle(gameListType3Titles[i]);
+            gameListType.setPer_page(20);
+            gameListType.setIs_hot(gameListType3IsHots[i]);
+            gameListType.setDaily_play(gameListType3DailyPlays[i]);
+            gameListTypeList3.add(gameListType);
+        }
     }
 
-    @Override
-    public void onStop() {
-        super.onStop();
-        //结束轮播
-        banner.stopAutoPlay();
+    public static final String[] gameListType2Titles = {"天天更新", "重点推荐"};
+    public static final int[] gameListType2DisplayTypes = {1, 2};
+
+    private void initGameListType2List() {
+        //天天更新", "重点推荐
+        for (int i = 0; i < gameListType2Titles.length; i++) {
+            GameListType gameListType = new GameListType();
+            gameListType.setTitle(gameListType2Titles[i]);
+            gameListType.setDisplay_type(gameListType2DisplayTypes[i]);
+            gameListTypeList2.add(gameListType);
+        }
     }
 
-    @Override
-    public void onResume() {
-        super.onResume();
-        initData();
+    private void initData() {
+        initBanner();
+        initBannerAct();
+        initGameList3();
+        initRecommendList();
+        initGameTagList();
     }
 
-    private void bindBanner() {
-        //结束轮播
-        banner.stopAutoPlay();
-        banner.setVisibility(View.VISIBLE);
-        //设置图片加载器
-        banner.setImageLoader(new ImageLoader() {
-            @Override
-            public void displayImage(Context context, Object o, ImageView imageView) {
-                if (o instanceof SlideshowEty)
-                    Glide.with(context).load(((SlideshowEty) o).getUrl()).apply(new RequestOptions().dontAnimate()).into(imageView);
-            }
-        })
-                .setDelayTime(4000)
-                .setBannerStyle(BannerConfig.CIRCLE_INDICATOR_TITLE_INSIDE)
-                //设置图片集合
-                .setImages(slideshowEtyLists).setBannerTitles(slideshowTitleList)
-                .setOnBannerListener(new OnBannerListener() {
+    private void initBannerAct() {
+        SheepApp.getInstance().getNetComponent().getApiService().gameBannerAct()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
-                    public void OnBannerClick(int i) {
-                        try {
-                            CommonUtil.getInstance().clickBanner(activity, i, slideshowEtyLists);
-                        } catch (Exception e) {
-                            G.showToast(e.getMessage());
+                    public void onNext(BaseMessage baseMessage) {
+                        ArrayList<SlideshowEty> newList = baseMessage.getDataList(SlideshowEty.class);
+                        gameActList.clear();
+                        if (ListUtil.isEmpty(newList)) {
+                            gameActList.addAll(newList);
                         }
+                        play_game_act.getAdapter().notifyDataSetChanged();
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        notifyDataSetChanged();
                     }
                 });
+    }
 
-        //banner设置方法全部调用完毕时最后调用
-        banner.start();
+    //天天更新、重点推荐
+    private void initRecommendList() {
+        Observable.from(gameListTypeList2)
+                .subscribe(new AbsSubscriber<GameListType>() {
+                    @Override
+                    public void onNext(final GameListType gameListType) {
+                        SheepApp.getInstance().getNetComponent().getApiService().getRecommendList(gameListType.getDisplay_type())
+                                .subscribeOn(Schedulers.io())
+                                .observeOn(AndroidSchedulers.mainThread())
+                                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                                    @Override
+                                    public void onNext(BaseMessage baseMessage) {
+                                        List<GameRecommend> newList = baseMessage.getDatas(GameRecommend.class);
+                                        if (!ListUtil.isEmpty(newList)) {
+                                            gameListTypeList2List.add(new GameListTypeList<>(gameListType, newList));
+                                            play_game_list_2_rv.getAdapter().notifyDataSetChanged();
+                                            notifyDataSetChanged();
+                                        }
+                                    }
+
+                                    @Override
+                                    public void onError(BaseMessage baseMessage) {
+                                        notifyDataSetChanged();
+                                    }
+                                });
+                    }
+                });
     }
 
-    private void initData(){
+    //预下载下面的tagList
+    private void initGameTagList() {
+        gameEntityListx.clear();
+        //预下载
+        GameListType gameListType = new GameListType();
+        gameListType.setTitle("预下载");
+        gameListType.setDownload_type(1);
+        initGameList(play_game_list_x_rv, gameEntityListx, gameListType);
+        //其它tag
+        SheepApp.getInstance().getNetComponent().getApiService().getGameTagList()
+                .subscribeOn(Schedulers.io())
+                .map(new Func1<BaseMessage, List<GameListTag>>() {
+                    @Override
+                    public List<GameListTag> call(BaseMessage baseMessage) {
+                        return baseMessage.getDataList(GameListTag.class);
+                    }
+                })
+                .filter(new Func1<List<GameListTag>, Boolean>() {
+                    @Override
+                    public Boolean call(List<GameListTag> gameListTags) {
+                        return !ListUtil.isEmpty(gameListTags);
+                    }
+                })
+                .flatMap(new Func1<List<GameListTag>, Observable<GameListTag>>() {
+                    @Override
+                    public Observable<GameListTag> call(List<GameListTag> gameListTagList) {
+                        return Observable.from(gameListTagList);
+                    }
+                })
+                .filter(new Func1<GameListTag, Boolean>() {
+                    @Override
+                    public Boolean call(GameListTag gameListTag) {
+                        return gameListTag != null;
+                    }
+                })
+                .subscribe(new AbsSubscriber<GameListTag>() {
+
+                    @Override
+                    public void onNext(GameListTag gameListTag) {
+                        initGameList(play_game_list_x_rv, gameEntityListx, gameListTag.toGameListType());
+                    }
+                });
+    }
 
+    //刷新banner数据
+    private void initBanner() {
         //轮播
         List<SlideshowEty> cacheSlideshowEtyList = DataUtil.getInstance().getCacheList(ApiKey.slideshowGame, SlideshowEty.class);
         if (ListUtil.isEmpty(cacheSlideshowEtyList)) {
@@ -284,41 +352,79 @@ public class FgtPlayGame extends BaseFragment {
                         notifyDataSetChanged();
                     }
                 });
+    }
 
-        //每日必玩
-        SheepApp.getInstance().getNetComponent().getApiService().playgameDailyOrHotOrTypePlay(1, 10, 0,1,0)
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+    private void bindBanner() {
+        //结束轮播
+        banner.stopAutoPlay();
+        banner.setVisibility(View.VISIBLE);
+        //设置图片加载器
+        banner.setImageLoader(new ImageLoader() {
+            @Override
+            public void displayImage(Context context, Object o, ImageView imageView) {
+                if (o instanceof SlideshowEty)
+                    Glide.with(context).load(((SlideshowEty) o).getUrl()).apply(new RequestOptions().dontAnimate()).into(imageView);
+            }
+        })
+                .setDelayTime(4000)
+                .setBannerStyle(BannerConfig.CIRCLE_INDICATOR_TITLE_INSIDE)
+                //设置图片集合
+                .setImages(slideshowEtyLists).setBannerTitles(slideshowTitleList)
+                .setOnBannerListener(new OnBannerListener() {
                     @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        List<GameEntity> newList = baseMessage.getDatas(GameEntity.class);
-                        if(!ListUtil.isEmpty(newList)) {//有缓存时不会加载,没有缓存时获取到数据会加载
-                            everyDayPlayListData.clear();
-                            everyDayPlayListData.addAll(newList);
-                            everyDayPlayList.getAdapter().notifyDataSetChanged();
-                            notifyDataSetChanged();
+                    public void OnBannerClick(int i) {
+                        try {
+                            CommonUtil.getInstance().clickBanner(activity, i, slideshowEtyLists);
+                        } catch (Exception e) {
+                            G.showToast(e.getMessage());
                         }
                     }
+                });
+
+        //banner设置方法全部调用完毕时最后调用
+        banner.start();
+    }
+
+    @Override
+    public void onStart() {
+        super.onStart();
+        //结束轮播
+        banner.startAutoPlay();
+    }
+
+    @Override
+    public void onStop() {
+        super.onStop();
+        //结束轮播
+        banner.stopAutoPlay();
+    }
+
+    //刷新每日必玩、近期最热、猜你喜欢的数据
+    private void initGameList3() {
+        gameEntityList3.clear();
+        Observable.from(gameListTypeList3)
+                .subscribe(new AbsSubscriber<GameListType>() {
 
                     @Override
-                    public void onError(BaseMessage baseMessage) {
-                        notifyDataSetChanged();
+                    public void onNext(final GameListType gameListType) {
+                        initGameList(play_game_list_3_rv, gameEntityList3, gameListType);
                     }
                 });
+    }
 
-        //近期最热
-        SheepApp.getInstance().getNetComponent().getApiService().playgameDailyOrHotOrTypePlay(1, 10, 1,0,0)
-                .subscribeOn(Schedulers.io())
+    private void initGameList(final RecyclerView playGameListRv, final List<GameEntityList> gameEntityListList, final GameListType gameListType) {
+        if (gameListType == null) {
+            return;
+        }
+        ObservableUtil.getObservable(SheepApp.getInstance().getNetComponent().getApiService(), gameListType).subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
                         List<GameEntity> newList = baseMessage.getDatas(GameEntity.class);
-                        if(!ListUtil.isEmpty(newList)) {//有缓存时不会加载,没有缓存时获取到数据会加载
-                            hotListData.clear();
-                            hotListData.addAll(newList);
-                            recentHoeList.getAdapter().notifyDataSetChanged();
+                        if (!ListUtil.isEmpty(newList)) {
+                            gameEntityListList.add(new GameEntityList(gameListType, newList));
+                            playGameListRv.getAdapter().notifyDataSetChanged();
                             notifyDataSetChanged();
                         }
                     }
@@ -328,75 +434,11 @@ public class FgtPlayGame extends BaseFragment {
                         notifyDataSetChanged();
                     }
                 });
-        if (!isFirst) {
-            for (int i = 0; i < mAdapter.getCount(); i++) {
-                FgtPlayGameSon item = (FgtPlayGameSon) mAdapter.getItem(i);
-                item.refreshData();
-            }
-        }
-        isFirst = false;
     }
 
-    private boolean isFirst = true;
     private void notifyDataSetChanged() {
-        if(refresh != null) {
+        if (refresh != null) {
             refresh.finishRefresh();
-            refresh.finishLoadMore();
-        }
-    }
-
-    /**
-     * tab
-     * @param
-     */
-    private void initTab(){
-        List<FindTag> newList = new ArrayList<>();
-        newList.add(new FindTag(TASK_TYPE_GAME_SHEEP, "平台游戏"));
-        newList.add(new FindTag(TASK_TYPE_GAME_XIAO_MI, "小米游戏"));
-        newList.add(new FindTag(TASK_TYPE_GAME_TECENT, "腾讯游戏"));
-        newList.add(new FindTag(TASK_TYPE_GAME_OTHER, "其他"));
-        if (!ListUtil.isEmpty(newList)) {
-            list.clear();
-            ListUtil.addAll(list, newList);
-            for(FindTag findTag:list){
-                FgtPlayGameSon item = FgtPlayGameSon.newInstance(findTag.getId());
-                item.setViewPager(pager);
-                item.setSmartRefreshLayout(refresh);
-                mAdapter.add(item, findTag.getName());
-            }
-            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) {
-                    curPosition = i;
-                }
-
-                @Override
-                public void onPageScrollStateChanged(int i) {
-
-                }
-            });
-            CommonUtil.getInstance().reflex(indicator, activity);
-            pager.setOffscreenPageLimit(list.size());
-            notifyDataSetChanged();
-        }
-    }
-
-    @OnClick({R.id.every_day_more_tv, R.id.recent_hot_more_tv})
-    public void onViewClicked(View view) {
-        switch (view.getId()) {
-            case R.id.every_day_more_tv:
-                Jump2View.getInstance().goEverydayOrCurrentHotGame(activity, 0);
-                break;
-            case R.id.recent_hot_more_tv:
-                Jump2View.getInstance().goEverydayOrCurrentHotGame(activity, 1);
-                break;
         }
     }
 }

+ 112 - 89
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPlayGameSon.java

@@ -1,89 +1,112 @@
-package com.sheep.gamegroup.view.fragment;
-
-import android.os.Bundle;
-import android.support.v7.widget.RecyclerView;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.sheep.gamegroup.event.BigEvent;
-import com.sheep.gamegroup.model.api.ApiService;
-import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.GameEntity;
-import com.sheep.gamegroup.model.entity.GameEntityList;
-import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.gamegroup.util.ListUtil;
-import com.sheep.gamegroup.view.adapter.PlayGameListAdapter;
-import com.sheep.jiuyan.samllsheep.R;
-
-import org.greenrobot.eventbus.Subscribe;
-
-import java.util.List;
-import java.util.Locale;
-
-import rx.Observable;
-
-/**
- * Created by ljy on 2018/9/3.
- */
-
-public class FgtPlayGameSon extends BaseListFragment3<GameEntity> {
-    private int type;
-
-    public static FgtPlayGameSon newInstance(int type){
-        FgtPlayGameSon fgt = new FgtPlayGameSon();
-        Bundle bundle = new Bundle();
-        bundle.putInt("type", type);
-        fgt.setArguments(bundle);
-        return fgt;
-    }
-
-    @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-        View rootView = super.onCreateView(inflater, container, savedInstanceState);
-        Bundle bundle = getArguments();
-        if(bundle != null){
-            type = bundle.getInt("type", 1002);
-        }
-        return rootView;
-    }
-
-    private GameEntityList gameEntityList = new GameEntityList(list);
-    private List<GameEntityList> gameEntityListList = ListUtil.emptyList();
-    @Override
-    protected RecyclerView.Adapter getAdapter() {
-        if(gameEntityListList.isEmpty())
-            gameEntityListList.add(gameEntityList);
-        return new PlayGameListAdapter(activity, gameEntityListList);
-    }
-
-    @Override
-    protected String getKey(int page, int per_page) {
-        return String.format(Locale.CHINA, "app/find?page=%d&per_page=%d&is_hot=%d&daily_play=%d&type=%d", page, per_page, 0, 0, type);
-    }
-
-    @Override
-    protected Observable<BaseMessage> getApi(ApiService apiService) {
-        return apiService.playgameDailyOrHotOrTypePlay(page, per_page, 0, 0, type);
-    }
-
-    @Override
-    protected Class<GameEntity> getTClass() {
-        return GameEntity.class;
-    }
-
-    @Subscribe
-    public void onEventMainThread(BigEvent event){
-        CommonUtil.getInstance().setEventResultViewStatus(event, view_list);
-    }
-
-    @Override
-    protected boolean isFirstGetACache() {
-        return false;
-    }
-
-    @Override
-    protected int getItemHeight() {
-        return getResources().getDimensionPixelSize(R.dimen.content_padding_96);
-    }
-}
+//package com.sheep.gamegroup.view.fragment;
+//
+//import android.os.Bundle;
+//import android.support.v7.widget.RecyclerView;
+//import android.view.LayoutInflater;
+//import android.view.View;
+//import android.view.ViewGroup;
+//
+//import com.sheep.gamegroup.event.BigEvent;
+//import com.sheep.gamegroup.model.api.ApiService;
+//import com.sheep.gamegroup.model.entity.BaseMessage;
+//import com.sheep.gamegroup.model.entity.GameEntity;
+//import com.sheep.gamegroup.model.entity.GameEntityList;
+//import com.sheep.gamegroup.util.CommonUtil;
+//import com.sheep.gamegroup.util.ListUtil;
+//import com.sheep.gamegroup.view.adapter.PlayGameListAdapter;
+//import com.sheep.jiuyan.samllsheep.R;
+//
+//import org.greenrobot.eventbus.Subscribe;
+//
+//import java.util.List;
+//import java.util.Locale;
+//
+//import rx.Observable;
+//
+///**
+// * Created by ljy on 2018/9/3.
+// */
+//
+//public class FgtPlayGameSon extends BaseListFragment3<GameEntity> {
+//    private int type;
+//
+//    //第一次就展示在viewpager中的页面
+//    public boolean firstPage = false;
+//
+//    public void setFirstPage(boolean firstPage) {
+//        this.firstPage = firstPage;
+//    }
+//    @Override
+//    protected void initDataOnVisibleToUser() {
+//        if(activity == null)
+//            onViewCreated();
+//        if(!firstPage && firstVisibleToUser) {
+//            refreshData();
+//        }
+//    }
+//
+//    @Override
+//    public int refreshDataType() {
+//        if(firstPage){
+//            return REFRESH_ON_CREATE;
+//        }
+//        return REFRESH_ON_YOURSELF;
+//    }
+//
+//    public static FgtPlayGameSon newInstance(int type){
+//        FgtPlayGameSon fgt = new FgtPlayGameSon();
+//        Bundle bundle = new Bundle();
+//        bundle.putInt("type", type);
+//        fgt.setArguments(bundle);
+//        return fgt;
+//    }
+//
+//    @Override
+//    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+//        View rootView = super.onCreateView(inflater, container, savedInstanceState);
+//        Bundle bundle = getArguments();
+//        if(bundle != null){
+//            type = bundle.getInt("type", 1002);
+//        }
+//        return rootView;
+//    }
+//
+//    private GameEntityList gameEntityList = new GameEntityList(list);
+//    private List<GameEntityList> gameEntityListList = ListUtil.emptyList();
+//    @Override
+//    protected RecyclerView.Adapter getAdapter() {
+//        if(gameEntityListList.isEmpty())
+//            gameEntityListList.add(gameEntityList);
+//        return new PlayGameListAdapter(activity, gameEntityListList);
+//    }
+//
+//    @Override
+//    protected String getKey(int page, int per_page) {
+//        return String.format(Locale.CHINA, "app/find?page=%d&per_page=%d&is_hot=%d&daily_play=%d&type=%d", page, per_page, 0, 0, type);
+//    }
+//
+//    @Override
+//    protected Observable<BaseMessage> getApi(ApiService apiService) {
+//        return apiService.getPlayGameList(page, per_page, 0, 0, type);
+//    }
+//
+//    @Override
+//    protected Class<GameEntity> getTClass() {
+//        return GameEntity.class;
+//    }
+//
+//    @Subscribe
+//    public void onEventMainThread(BigEvent event){
+//        CommonUtil.getInstance().setEventResultViewStatus(event, view_list);
+//    }
+//
+//    @Override
+//    protected boolean isFirstGetACache() {
+//        return false;
+//    }
+//
+//    @Override
+//    protected int getItemHeight() {
+//        return getResources().getDimensionPixelSize(R.dimen.content_padding_96);
+//    }
+//}

+ 17 - 2
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java

@@ -7,6 +7,7 @@ import android.content.ClipData;
 import android.content.ClipboardManager;
 import android.content.Context;
 import android.content.DialogInterface;
+import android.content.Intent;
 import android.graphics.Color;
 import android.graphics.drawable.BitmapDrawable;
 import android.os.Build;
@@ -95,6 +96,7 @@ import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+import com.sheep.jiuyan.samllsheep.ui.activity.SearchActivity;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sunfusheng.marqueeview.MarqueeView;
@@ -353,7 +355,11 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
                 popupWindow.dismiss();
             }
         });
+    }
 
+    @OnClick(R.id.to_search_but)
+    public void toSearchActivity() {
+        startActivity(new Intent(getActivity(), SearchActivity.class));
     }
 
     /**
@@ -596,6 +602,10 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
         initTitleCardLayout(activity.getApplicationContext());
         TestUtil.testChange(activity, test_change);
         TestUtil.testChangeUser(activity, test_change_user);
+        ymHomeListEty = new HomeListEntity();
+        ymHomeListEty.setTitle("有米积分");
+        ymHomeListEty.setIcon(ViewUtil.getNetImgByName("homepage_xinshourw"));
+        ymHomeListEty.setJump(String.valueOf(CommonUtil.JUMP_YM));
         if (pagePresenter != null) {
             initData();
         }
@@ -604,6 +614,8 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
         isShowRedPackage();
     }
 
+    private HomeListEntity ymHomeListEty;
+
 
     public void initView() {
         try {
@@ -784,8 +796,9 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
         });
         RefreshUtil.newInstance().publicParameterRefresh(refresh, activity);
     }
+
     private void notifyDataSetChanged() {
-        if(refresh != null) {
+        if (refresh != null) {
             refresh.finishRefresh();
             refresh.finishLoadMore();
         }
@@ -856,6 +869,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
         } else {
             home_list_gridview_layout.setVisibility(View.VISIBLE);
             fullHomeList.clear();
+            homeListEntitys.add(ymHomeListEty);
             CommonUtil.getInstance().splitHomeList(cacheHomeListEtyList, homeListEntitys, fullHomeList);
             full_home_list_rv.setVisibility(fullHomeList.isEmpty() ? View.GONE : View.VISIBLE);
             boolean isShowQB = false;
@@ -1233,6 +1247,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
                 homeListEntitysGridview.clear();
                 homeListEntitysListview.clear();
                 fullHomeList.clear();
+                homeListEntitys.add(ymHomeListEty);
                 CommonUtil.getInstance().splitHomeList(homeListEntityList, homeListEntitys, fullHomeList);
                 full_home_list_rv.setVisibility(fullHomeList.isEmpty() ? View.GONE : View.VISIBLE);
                 boolean isShowQB = false;
@@ -1312,7 +1327,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
 
     @Override
     public void onPause() {
-        if(titleCardLayout != null){
+        if (titleCardLayout != null) {
             titleCardLayout.setVisibility(View.GONE);
         }
         super.onPause();

+ 10 - 7
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWelfareCenter.java

@@ -149,23 +149,26 @@ public class FgtWelfareCenter extends BaseFragment{
         refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
             @Override
             public void onRefresh() {
-                refreshHotWelfare = true;
-                refreshDownloadWelfare = true;
-                refreshGiftCenter = true;
-                refreshData();
+                initData();
             }
         });
     }
 
     @Override
-    public void onResume() {
-        super.onResume();
-        //每次强制刷新
+    protected void initDataOnVisibleToUser() {
+        if(activity == null){
+            onViewCreated();
+        }
+        initData();
+    }
+
+    public void initData() {
         refreshHotWelfare = true;
         refreshDownloadWelfare = true;
         refreshGiftCenter = true;
         refreshData();
     }
+
     private boolean refreshHotWelfare = true;
     private boolean refreshDownloadWelfare = true;
     private boolean refreshGiftCenter = true;

+ 6 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java

@@ -47,6 +47,7 @@ import com.tencent.smtt.sdk.QbSdk;
 import com.umeng.commonsdk.UMConfigure;
 import com.umeng.socialize.PlatformConfig;
 import com.umeng.socialize.UMShareAPI;
+import com.youmi.android.offer.YmConfig;
 
 import org.xutils.x;
 
@@ -383,6 +384,8 @@ public class SheepApp extends MultiDexApplication {
             ActivityManager.getInstance().pushActivity(activity);
             if (/*activity instanceof SplashAct || */activity instanceof LoginAct) {
                 SysAppUtil.showVersionInfo(activity, SpUtils.getIgnoreMd5());
+            } else if(YmConfig.isAvf(activity)){
+                YmConfig.showTipDialog(activity, YmConfig.TYPE_ADD_VIEW);
             }
 
             if (mActivityCount == 0) {
@@ -444,6 +447,9 @@ public class SheepApp extends MultiDexApplication {
 
         @Override
         public void onActivityDestroyed(Activity activity) {
+            if(YmConfig.isAvf(activity)){
+                YmConfig.disTipDialog();
+            }
             if (!TextUtils.isEmpty(gamePackgeName) && isGameFlag() && (activity instanceof GameCertificationActivity || activity instanceof LoginAct)) {
                 setGameFlag(false);
                 CertificationUtil.newInstance().doCertification(activity, null, gamePackgeName, "delete");

+ 1 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/base/BaseFragment.java

@@ -117,7 +117,7 @@ public abstract class BaseFragment extends Fragment {
     @Override
     public void setUserVisibleHint(boolean isVisibleToUser) {
         super.setUserVisibleHint(isVisibleToUser);
-        if(isVisibleToUser) {
+        if(isVisibleToUser && mView != null) {
             if(firstVisibleToUser) {
                 initViewOnVisibleToUser();
             }

+ 63 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/net/Network.java

@@ -0,0 +1,63 @@
+package com.sheep.jiuyan.samllsheep.net;
+
+import com.sheep.gamegroup.model.cookie.CookieManager;
+import com.sheep.gamegroup.model.util.AddPublicParamsIntercept;
+import com.sheep.gamegroup.model.util.CacheInterceptor;
+import com.sheep.gamegroup.model.util.LogInterceptor;
+import com.sheep.gamegroup.util.TestUtil;
+import com.sheep.jiuyan.samllsheep.BuildConfig;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.net.map.ApiService;
+
+import java.util.concurrent.TimeUnit;
+
+import okhttp3.OkHttpClient;
+import retrofit2.Retrofit;
+import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
+import retrofit2.converter.gson.GsonConverterFactory;
+
+import static com.sheep.jiuyan.samllsheep.net.map.ApiService.BASE_URL;
+import static com.sheep.jiuyan.samllsheep.net.map.ApiService.TIME_OUT;
+
+/**
+ * Created by: zhoujuncai.
+ * Created date: 2018/10/30.
+ * Description: 网络访问工具类
+ */
+public class Network {
+
+    /* 网络接口 */
+    private static ApiService api;
+
+    /**
+     * 初始化
+     */
+    public static void init() {
+        LogInterceptor loggingInterceptor = new LogInterceptor(BuildConfig.XXTEA_ENCRYPT);
+        loggingInterceptor.setLevel(TestUtil.isSheep() ? LogInterceptor.ELevel.NONE : LogInterceptor.ELevel.BODY);
+        OkHttpClient.Builder builder = new OkHttpClient.Builder()
+                .connectTimeout(TIME_OUT, TimeUnit.SECONDS)
+                .readTimeout(TIME_OUT, TimeUnit.SECONDS)
+                .writeTimeout(TIME_OUT, TimeUnit.SECONDS)
+                .cookieJar(new CookieManager(SheepApp.getInstance()))
+                .addInterceptor(new AddPublicParamsIntercept())
+                .addInterceptor(new CacheInterceptor())
+                .addInterceptor(loggingInterceptor);
+        api = new Retrofit.Builder()
+                .baseUrl(BASE_URL)
+                .client(builder.build())
+                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
+                .addConverterFactory(GsonConverterFactory.create())
+                .build()
+                .create(ApiService.class);
+    }
+
+    /**
+     * 获取网路接口
+     *
+     * @return 返回一个ApiService接口对象
+     */
+    public static ApiService api() {
+        return api;
+    }
+}

+ 49 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/net/Scheduler.java

@@ -0,0 +1,49 @@
+package com.sheep.jiuyan.samllsheep.net;
+
+import com.trello.rxlifecycle2.LifecycleTransformer;
+
+import io.reactivex.Observable;
+import io.reactivex.ObservableSource;
+import io.reactivex.ObservableTransformer;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
+/**
+ * Created by: zhoujuncai.
+ * Created date: 2018/10/30.
+ * Description: 线程调度封装
+ */
+public class Scheduler<T> implements ObservableTransformer<T, T> {
+
+    /* 生命周期管理 */
+    private LifecycleTransformer<T> provider;
+
+    /**
+     * 构造方法
+     *
+     * @param provider 生命周期管理
+     */
+    private Scheduler(LifecycleTransformer<T> provider) {
+        this.provider = provider;
+    }
+
+    @Override
+    public ObservableSource<T> apply(Observable<T> upstream) {
+        return upstream
+                .subscribeOn(Schedulers.io())
+                .unsubscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .compose(provider);
+    }
+
+    /**
+     * 应用线程调度并绑定生命周期管理
+     *
+     * @param provider 生命周期管理
+     * @param <T>      泛型
+     * @return 返回转换操作
+     */
+    public static <T> ObservableTransformer<T, T> apply(LifecycleTransformer<T> provider) {
+        return new Scheduler<>(provider);
+    }
+}

+ 14 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/net/map/ApiService.java

@@ -0,0 +1,14 @@
+package com.sheep.jiuyan.samllsheep.net.map;
+
+/**
+ * Created by: zhoujuncai.
+ * Created date: 2018/10/30.
+ * Description: 服务器接口映射
+ */
+public interface ApiService {
+
+    /* 服务器地址 */
+    String BASE_URL = "http://test.sheep.kfzs.com/v1/";
+    /* 超时 */
+    int TIME_OUT = 15;
+}

+ 58 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/ui/activity/SearchActivity.java

@@ -0,0 +1,58 @@
+package com.sheep.jiuyan.samllsheep.ui.activity;
+
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.ui.base.BaseActivity;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+
+/**
+ * Created by: zhoujuncai.
+ * Created date: 2018/10/30.
+ * Description: 搜索界面
+ */
+public class SearchActivity extends BaseActivity {
+
+    @BindView(R.id.search_but_back)
+    ImageView searchButBack;
+    @BindView(R.id.search_input_txt)
+    EditText searchInputTxt;
+    @BindView(R.id.search_but_search)
+    TextView searchButSearch;
+    @BindView(R.id.search_bar)
+    LinearLayout searchBar;
+
+    @Override
+    protected int onLayout() {
+        return R.layout.activity_search;
+    }
+
+    @Override
+    protected void onObject() {
+
+    }
+
+    @Override
+    protected void onView() {
+
+    }
+
+    @Override
+    protected void onData() {
+
+    }
+
+    @OnClick(R.id.search_but_back)
+    public void onSearchButBackClicked() {
+        this.finish();
+    }
+
+    @OnClick(R.id.search_but_search)
+    public void onSearchButSearchClicked() {
+    }
+}

+ 32 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/ui/activity/SignActivity.java

@@ -0,0 +1,32 @@
+package com.sheep.jiuyan.samllsheep.ui.activity;
+
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.ui.base.BaseActivity;
+
+/**
+ * Created by: zhoujuncai.
+ * Created date: 2018/10/31.
+ * Description: 签到
+ */
+public class SignActivity extends BaseActivity {
+
+    @Override
+    protected int onLayout() {
+        return R.layout.activity_sign;
+    }
+
+    @Override
+    protected void onObject() {
+
+    }
+
+    @Override
+    protected void onView() {
+
+    }
+
+    @Override
+    protected void onData() {
+
+    }
+}

+ 25 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/ui/adapter/SearchAdapter.java

@@ -0,0 +1,25 @@
+package com.sheep.jiuyan.samllsheep.ui.adapter;
+
+import android.support.annotation.Nullable;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+
+import java.util.List;
+
+/**
+ * Created by: zhoujuncai.
+ * Created date: 2018/10/31.
+ * Description: 搜索列表适配器
+ */
+public class SearchAdapter extends BaseQuickAdapter<Object, BaseViewHolder> {
+
+    public SearchAdapter(int layoutResId, @Nullable List<Object> data) {
+        super(layoutResId, data);
+    }
+
+    @Override
+    protected void convert(BaseViewHolder helper, Object item) {
+
+    }
+}

+ 64 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/ui/base/BaseActivity.java

@@ -0,0 +1,64 @@
+package com.sheep.jiuyan.samllsheep.ui.base;
+
+import android.annotation.SuppressLint;
+import android.os.Bundle;
+import android.support.annotation.LayoutRes;
+import android.support.annotation.Nullable;
+
+import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+/**
+ * Created by: zhoujuncai.
+ * Created date: 2018/10/30.
+ * Description: Activity父类
+ */
+@SuppressLint("Registered")
+public abstract class BaseActivity extends RxAppCompatActivity {
+
+    private Unbinder unbinder;
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(onLayout());
+        unbinder = ButterKnife.bind(this);
+        onObject();
+        onView();
+        onData();
+    }
+
+    /**
+     * 初始化布局
+     *
+     * @return 返回布局资源id
+     */
+    protected abstract @LayoutRes
+    int onLayout();
+
+    /**
+     * 初始化对象
+     */
+    protected abstract void onObject();
+
+    /**
+     * 初始化视图
+     */
+    protected abstract void onView();
+
+    /**
+     * 初始化数据
+     */
+    protected abstract void onData();
+
+    @Override
+    protected void onDestroy() {
+        if (unbinder != null) {
+            unbinder.unbind();
+            unbinder = null;
+        }
+        super.onDestroy();
+    }
+}

+ 67 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/ui/base/BaseFragment.java

@@ -0,0 +1,67 @@
+package com.sheep.jiuyan.samllsheep.ui.base;
+
+import android.os.Bundle;
+import android.support.annotation.LayoutRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.trello.rxlifecycle2.components.support.RxFragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+/**
+ * Created by: zhoujuncai.
+ * Created date: 2018/10/30.
+ * Description: Fragment父类
+ */
+public abstract class BaseFragment extends RxFragment {
+
+    private Unbinder unbinder;
+
+    @Nullable
+    @Override
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+        View view = inflater.inflate(onLayout(), container, false);
+        unbinder = ButterKnife.bind(this, view);
+        onObject();
+        onView();
+        onData();
+        return view;
+    }
+
+    /**
+     * 初始化布局
+     *
+     * @return 返回布局资源id
+     */
+    protected abstract @LayoutRes
+    int onLayout();
+
+    /**
+     * 初始化对象
+     */
+    protected abstract void onObject();
+
+    /**
+     * 初始化视图
+     */
+    protected abstract void onView();
+
+    /**
+     * 初始化数据
+     */
+    protected abstract void onData();
+
+    @Override
+    public void onDestroyView() {
+        if (unbinder != null) {
+            unbinder.unbind();
+            unbinder = null;
+        }
+        super.onDestroyView();
+    }
+}

+ 62 - 0
app/src/main/java/com/youmi/android/offer/BaseActYmPermissionCheck.java

@@ -0,0 +1,62 @@
+package com.youmi.android.offer;
+
+import android.os.Build;
+import android.support.annotation.NonNull;
+
+import com.sheep.gamegroup.absBase.BaseActivity;
+
+/**
+ * Android 6.0 上权限分为<b>正常</b>和<b>危险</b>级别
+ * <ul>
+ * <li>正常级别权限:开发者仅仅需要在AndroidManifext.xml上声明,那么应用就会被允许拥有该权限,如:android.permission.INTERNET</li>
+ * <li>危险级别权限:开发者需要在AndroidManifext.xml上声明,并且在运行时进行申请,而且用户允许了,应用才会被允许拥有该权限,如:android.permission.WRITE_EXTERNAL_STORAGE</li>
+ * </ul>
+ * 有米的以下权限需要在Android6.0上被允许,有米广告sdk才能正常工作,开发者需要在调用有米的任何代码之前,提前让用户允许权限
+ * <ul>
+ * <li>必须申请的权限
+ * <ul>
+ * <li>android.permission.READ_PHONE_STATE</li>
+ * <li>android.permission.WRITE_EXTERNAL_STORAGE</li>
+ * </ul>
+ * </li>
+ * </ul>
+ *
+ * @since 2015-12-10 16:36
+ */
+public abstract class BaseActYmPermissionCheck extends BaseActivity {
+
+    //检查权限并启动有米积分墙界面
+    public void checkOrShowYmOffersAds() {
+        ymPermissionUtil = new YmPermissionUtil(this);
+        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
+            ymPermissionUtil.showYmOffersAds();
+            return;
+        }
+
+        ymPermissionUtil.checkPermissions();
+
+    }
+
+    private YmPermissionUtil ymPermissionUtil;
+
+
+    @Override
+    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+        if (ymPermissionUtil != null)
+            ymPermissionUtil.onRequestPermissionsResult(requestCode, permissions, grantResults);
+    }
+
+
+    /**
+     * 退出时回收资源
+     */
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        if (ymPermissionUtil != null)
+            ymPermissionUtil.onDestroy();
+
+    }
+
+}

+ 174 - 0
app/src/main/java/com/youmi/android/offer/YmConfig.java

@@ -0,0 +1,174 @@
+package com.youmi.android.offer;
+
+import android.app.Activity;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.support.annotation.IntDef;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.PopupWindow;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.util.LogUtil;
+import com.sheep.gamegroup.util.TestUtil;
+import com.sheep.jiuyan.samllsheep.BuildConfig;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.util.concurrent.TimeUnit;
+
+import rx.Observable;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by realicing on 2018/10/29.
+ * realicing@sina.com
+ */
+public class YmConfig {
+    public static final String getAppId(){
+     return "35fdb087478a19f7";
+    }
+    public static final String getAppSecret(){
+        return "7322d8d028c29a99";
+    }
+    public static final boolean isShowLog(){
+        return TestUtil.isTest();
+    }
+    //是否在进入有米任务界面时提示用户总的有米积分
+    public static final boolean isToastTotalPrice(){
+        return false;
+    }
+    //通过设置TextView的方式来添加提示
+    public static final int TYPE_POP = 1;
+    public static final int TYPE_ADD_VIEW = 2;
+    public static final int TYPE_SET_TV = 3;
+    @IntDef({TYPE_POP, TYPE_ADD_VIEW, TYPE_SET_TV})
+    @Retention(RetentionPolicy.SOURCE)
+    public @interface SHOW_YM_TIP_TYPE {
+    }
+    private static PopupWindow popupWindow;
+    //显示有米积分兑换率:100积分等于1绵羊币
+    public static void showTipDialog(final Activity activity, @SHOW_YM_TIP_TYPE final int showYmTipType) {
+        Observable.just(1).delay(1, TimeUnit.SECONDS)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new Action1<Integer>(){
+                    @Override
+                    public void call(Integer integer) {
+                        View contentView = activity.findViewById(android.R.id.content);
+                        try {
+                            switch (showYmTipType){
+                                case TYPE_ADD_VIEW:
+                                    addTipViewToYmAvf(activity, contentView);
+                                    break;
+                                case TYPE_SET_TV:
+                                    setTipViewInYmAvf(activity, contentView);
+                                    break;
+                                case TYPE_POP:
+                                    popTipViewOnYmAvf(activity, contentView);
+                                    break;
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            if(BuildConfig.DEBUG) G.showToast(e.getMessage());
+                        }
+                    }
+                });
+    }
+    //通过popWindow的方式显示提示:注:100积分等于1绵羊币
+    private static void popTipViewOnYmAvf(Activity activity, View contentView) {
+        View popView = LayoutInflater.from(activity).inflate(R.layout.ym_tip, null);
+        View titleBar;
+        if(contentView instanceof ViewGroup){
+            titleBar = ((ViewGroup) contentView).getChildAt(0);
+            if(titleBar instanceof ViewGroup){
+                titleBar = ((ViewGroup) titleBar).getChildAt(0);
+            }
+        } else {
+            titleBar = contentView;
+        }
+        // 创建PopupWindow对象,其中:
+        // 第一个参数是用于PopupWindow中的View,第二个参数是PopupWindow的宽度,
+        // 第三个参数是PopupWindow的高度,第四个参数指定PopupWindow能否获得焦点
+        PopupWindow popupWindow=new PopupWindow(popView, WindowManager.LayoutParams.MATCH_PARENT, titleBar.getHeight(), false);
+        // 设置PopupWindow的背景
+        popupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+        // 设置PopupWindow是否能响应外部点击事件
+        popupWindow.setOutsideTouchable(false);
+        // 设置PopupWindow是否能响应点击事件
+        popupWindow.setTouchable(false);
+        // 显示PopupWindow,其中:
+        // 第一个参数是PopupWindow的锚点,第二和第三个参数分别是PopupWindow相对锚点的x、y偏移
+        popupWindow.showAsDropDown(titleBar, 0, -titleBar.getHeight());
+        // 或者也可以调用此方法显示PopupWindow,其中:
+        // 第一个参数是PopupWindow的父View,第二个参数是PopupWindow相对父View的位置,
+        // 第三和第四个参数分别是PopupWindow相对父View的x、y偏移
+        // window.showAtLocation(parent, gravity, x, y);
+    }
+
+    //通过修改TextView的方式显示提示:注:100积分等于1绵羊币
+    private static void setTipViewInYmAvf(Activity activity, View contentView) {
+        if(contentView instanceof ViewGroup){
+            showChildView((ViewGroup)contentView, 0);
+        }
+    }
+
+    //通过添加view的方式显示提示:注:100积分等于1绵羊币
+    private static void addTipViewToYmAvf(Activity activity, View contentView) {
+        if(contentView instanceof ViewGroup){
+            View rootView = ((ViewGroup) contentView).getChildAt(0);
+            if(rootView instanceof RelativeLayout){
+                View child = LayoutInflater.from(activity).inflate(R.layout.ym_tip, null);
+                RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, ((RelativeLayout) rootView).getChildAt(0).getHeight());
+                ((RelativeLayout) rootView).addView(child, layoutParams);
+            }
+        }
+    }
+
+    private static void showChildView(ViewGroup contentView, int cj) {
+        int count = contentView.getChildCount();
+        for (int i = 0; i < count; i++) {
+            View view = contentView.getChildAt(i);
+            if(view instanceof ViewGroup)
+                showChildView((ViewGroup) view, cj +1);
+            else if(view instanceof TextView) {
+                String text = ((TextView) view).getText().toString();
+//                if(TextUtils.equals(text, "0")){//显示在标题栏有米积分的右边的logo的位置,有背景,字较小
+                if(TextUtils.equals(text, "积分")){//显示在标题栏右边
+                    view.setVisibility(View.VISIBLE);
+                    ((TextView) view).setText(R.string.ym_tip);
+                }
+                LogUtil.println("showChildView", cj, i, contentView, view.getId(), view.getClass().getSimpleName(), text);
+            } else {
+                LogUtil.println("showChildView", cj, i, contentView, view.getId(), view.getClass().getSimpleName());
+            }
+        }
+    }
+
+
+    //取消弹出框
+    public static void disTipDialog() {
+        try {
+            if(popupWindow != null){
+                popupWindow.dismiss();
+                popupWindow = null;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            if(BuildConfig.DEBUG) G.showToast(e.getMessage());
+        }
+    }
+
+    public static boolean isAvf(Activity activity) {
+        return activity instanceof cde.ewd.adw.AVF;
+//        return activity instanceof ActMyMoney;
+    }
+}

+ 300 - 0
app/src/main/java/com/youmi/android/offer/YmPermissionUtil.java

@@ -0,0 +1,300 @@
+package com.youmi.android.offer;
+
+import android.Manifest;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.graphics.Color;
+import android.net.Uri;
+import android.provider.Settings;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.content.ContextCompat;
+import android.util.Log;
+import android.widget.Toast;
+
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import org.afinal.simplecache.DataKey;
+
+import java.util.Locale;
+
+import cde.ewd.adw.AdManager;
+import cde.ewd.adw.os.EarnPointsOrderInfo;
+import cde.ewd.adw.os.EarnPointsOrderList;
+import cde.ewd.adw.os.OffersBrowserConfig;
+import cde.ewd.adw.os.OffersManager;
+import cde.ewd.adw.os.PointsChangeNotify;
+import cde.ewd.adw.os.PointsEarnNotify;
+import cde.ewd.adw.os.PointsManager;
+
+/**
+ * Created by realicing on 2018/10/29.
+ * realicing@sina.com
+ */
+public class YmPermissionUtil implements PointsChangeNotify, PointsEarnNotify {
+    private Activity activity;
+
+    public YmPermissionUtil(Activity activity) {
+        this.activity = activity;
+    }
+
+    /**
+     * 小tips:这里的int数值不能太大,否则不会弹出请求权限提示,测试的时候,改到1000就不会弹出请求了
+     */
+    private final static int READ_PHONE_STATE_CODE = 101;
+
+    private final static int WRITE_EXTERNAL_STORAGE_CODE = 102;
+    /**
+     * 有米 Android SDK 所需要向用户申请的权限列表
+     */
+    private PermissionModel[] models = new PermissionModel[]{
+            new PermissionModel(Manifest.permission.READ_PHONE_STATE, "我们需要读取手机信息的权限来标识您的身份", READ_PHONE_STATE_CODE),
+            new PermissionModel(Manifest.permission.WRITE_EXTERNAL_STORAGE,
+                    "我们需要您允许我们读写你的存储卡,以方便我们临时保存一些数据",
+                    WRITE_EXTERNAL_STORAGE_CODE
+            ),
+    };
+
+    /**
+     * 这里我们演示如何在Android 6.0+上运行时申请权限
+     */
+    public void checkPermissions() {
+        try {
+
+            for (PermissionModel model : models) {
+                if (PackageManager.PERMISSION_GRANTED != ContextCompat.checkSelfPermission(activity, model.permission)) {
+                    ActivityCompat.requestPermissions(activity, new String[]{model.permission}, model.requestCode);
+                    return;
+                }
+            }
+
+            // 到这里就表示有米所有需要的权限已经通过申请,权限已经申请就打开demo
+            showYmOffersAds();
+        } catch (Throwable e) {
+            Log.e("YoumiSdk", "", e);
+        }
+    }
+
+    public void showYmOffersAds() {
+        initYoumi();
+        OffersManager.getInstance(activity).showOffersWall();
+    }
+
+    private void initYoumi() {
+        // 自v6.3.0起,所有其他代码必须在初始化接口调用之后才能生效
+        // 初始化接口,应用启动的时候调用,参数:appId, appSecret, isEnableYoumiLog
+        AdManager.getInstance(activity).init(YmConfig.getAppId(), YmConfig.getAppSecret(), YmConfig.isShowLog());
+
+        // 有米android 积分墙sdk 5.0.0之后支持定制浏览器顶部标题栏的部分UI
+         setOfferBrowserConfig();
+
+        // 如果开发者使用积分墙的服务器回调,
+        // 1.需要告诉sdk,现在采用服务器回调
+        // 2.建议开发者传入自己系统中用户id(如:邮箱账号之类的)(请限制在50个字符串以内)
+        // 3.务必在下面的OffersManager.getInstance(this).onAppLaunch();代码之前声明使用服务器回调
+//        如果使用了服务器订单回调,则上文所述的客户端积分功能
+//                积分管理
+//        监听积分余额变动
+//                监听积分订单到账通知
+//        配置积分到账提醒
+//        将不再适用,即SDK将不会通知客户端应用订单到账,所有积分流程只能通过服务器实现,可以极大地提高积分 安全性
+        OffersManager.getInstance(activity).setUsingServerCallBack(true);
+         OffersManager.getInstance(activity).setCustomUserId(DataUtil.getInstance().getUserId());
+
+        // 如果使用积分广告,请务必调用积分广告的初始化接口:
+        OffersManager.getInstance(activity).onAppLaunch();
+
+        // (可选)注册积分监听-随时随地获得积分的变动情况
+
+        PointsManager.getInstance(activity).registerNotify(this);
+
+        // (可选)注册积分订单赚取监听(sdk v4.10版本新增功能)
+        PointsManager.getInstance(activity).registerPointsEarnNotify(this);
+
+        // (可选)设置是否在通知栏显示下载相关提示。默认为true,标识开启;设置为false则关闭。(sdk v4.10版本新增功能)
+        // AdManager.getInstance(this).setIsDownloadTipsDisplayOnNotification(false);
+
+        // (可选)设置安装完成后是否在通知栏显示已安装成功的通知。默认为true,标识开启;设置为false则关闭。(sdk v4.10版本新增功能)
+        // AdManager.getInstance(this).setIsInstallationSuccessTipsDisplayOnNotification(false);
+
+        // (可选)设置是否在通知栏显示积分赚取提示。默认为true,标识开启;设置为false则关闭。
+        // 如果开发者采用了服务器回调积分的方式,那么本方法将不会生效
+        // PointsManager.getInstance(this).setEnableEarnPointsNotification(false);
+
+        // (可选)设置是否开启积分赚取的Toast提示。默认为true,标识开启;设置为false这关闭。
+        // 如果开发者采用了服务器回调积分的方式,那么本方法将不会生效
+        // PointsManager.getInstance(this).setEnableEarnPointsToastTips(false);
+
+        // 查询积分余额
+        // 从5.3.0版本起,客户端积分托管将由 int 转换为 float
+//        float pointsBalance = PointsManager.getInstance(activity).queryPoints();
+        if(YmConfig.isToastTotalPrice())
+            G.showToast("积分余额:" + DataUtil.getAsInt(DataKey.YM_TOTAL_PRICE, 0));
+    }
+
+    /**
+     * 设置积分墙浏览器标题栏样式
+     */
+    private void setOfferBrowserConfig() {
+
+        // 设置标题栏——标题
+        OffersBrowserConfig.getInstance(activity).setBrowserTitleText("有米积分");
+
+        // 设置标题栏——背景颜色(ps:积分墙标题栏默认背景颜色为#FFBB34)
+        OffersBrowserConfig.getInstance(activity).setBrowserTitleBackgroundColor(Color.parseColor("#29d6fd"));
+
+        // 设置标题栏——是否显示积分墙右上角积分余额区域 true:是 false:否
+        OffersBrowserConfig.getInstance(activity).setPointsLayoutVisibility(true);
+
+        // 设置标题栏——是否显示有米的logo
+        OffersBrowserConfig.getInstance(activity).setLogoVisibility(false);
+
+    }
+
+    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
+        switch (requestCode) {
+            case READ_PHONE_STATE_CODE:
+            case WRITE_EXTERNAL_STORAGE_CODE:
+                // 如果用户不允许,我们视情况发起二次请求或者引导用户到应用页面手动打开
+                if (PackageManager.PERMISSION_GRANTED != grantResults[0]) {
+
+                    // 二次请求,表现为:以前请求过这个权限,但是用户拒接了
+                    // 在二次请求的时候,会有一个“不再提示的”checkbox
+                    // 因此这里需要给用户解释一下我们为什么需要这个权限,否则用户可能会永久不在激活这个申请
+                    // 方便用户理解我们为什么需要这个权限
+                    if (ActivityCompat.shouldShowRequestPermissionRationale(activity, permissions[0])) {
+                        new AlertDialog.Builder(activity).setTitle("权限申请")
+                                .setMessage(findPermissionExplain(permissions[0]))
+                                .setPositiveButton("确定", new DialogInterface.OnClickListener() {
+
+                                    @Override
+                                    public void onClick(DialogInterface dialog, int which) {
+                                        checkPermissions();
+                                    }
+                                })
+                                .show();
+                    }
+                    // 到这里就表示已经是第3+次请求,而且此时用户已经永久拒绝了,这个时候,我们引导用户到应用权限页面,让用户自己手动打开
+                    else {
+                        Toast.makeText(activity, "部分权限被拒绝获取,将会会影响后续功能的使用,建议重新打开", Toast.LENGTH_LONG).show();
+                        openAppPermissionSetting();
+                    }
+                    return;
+                }
+
+                // 到这里就表示用户允许了本次请求,我们继续检查是否还有待申请的权限没有申请
+                if (isAllRequestedPermissionGranted()) {
+                    showYmOffersAds();
+                } else {
+                    checkPermissions();
+                }
+                break;
+            default:
+                break;
+        }
+    }
+
+    private String findPermissionExplain(String permission) {
+        if (models != null) {
+            for (PermissionModel model : models) {
+                if (model != null && model.permission != null && model.permission.equals(permission)) {
+                    return model.explain;
+                }
+            }
+        }
+        return null;
+    }
+
+    private boolean isAllRequestedPermissionGranted() {
+        for (final PermissionModel model : models) {
+            if (PackageManager.PERMISSION_GRANTED != ContextCompat.checkSelfPermission(activity, model.permission)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    private void openAppPermissionSetting() {
+        try {
+            Intent intent =
+                    new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + activity.getPackageName()));
+            intent.addCategory(Intent.CATEGORY_DEFAULT);
+
+            // Android L 之后Activity的启动模式发生了一些变化
+            // 如果用了下面的 Intent.FLAG_ACTIVITY_NEW_TASK ,并且是 startActivityForResult
+            // 那么会在打开新的activity的时候就会立即回调 onActivityResult
+            // intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
+            activity.startActivityForResult(intent, 123456789);
+        } catch (Throwable e) {
+            Log.e("YoumiSdk", "", e);
+        }
+    }
+
+    /**
+     * 积分余额发生变动时,就会回调本方法(本回调方法执行在UI线程中)
+     * <p/>
+     * 从5.3.0版本起,客户端积分托管将由 int 转换为 float
+     */
+    @Override
+    public void onPointBalanceChange(float pointsBalance) {
+        G.showToast("积分余额:" + pointsBalance);
+    }
+
+    /**
+     * 积分订单赚取时会回调本方法(本回调方法执行在UI线程中)
+     */
+    @Override
+    public void onPointEarn(Context context, EarnPointsOrderList list) {
+        if (list == null || list.isEmpty()) {
+            return;
+        }
+        // 遍历订单并且toast提示
+        for (int i = 0; i < list.size(); ++i) {
+            EarnPointsOrderInfo info = list.get(i);
+            Toast.makeText(activity, info.getMessage(), Toast.LENGTH_LONG).show();
+        }
+    }
+
+    public void onDestroy() {
+
+        // (可选)注销积分监听
+        // 如果在onCreate调用了PointsManager.getInstance(this).registerNotify(this)进行积分余额监听器注册,那这里必须得注销
+        PointsManager.getInstance(activity).unRegisterNotify(this);
+
+        // (可选)注销积分订单赚取监听
+        // 如果在onCreate调用了PointsManager.getInstance(this).registerPointsEarnNotify(this)进行积分订单赚取监听器注册,那这里必须得注销
+        PointsManager.getInstance(activity).unRegisterPointsEarnNotify(this);
+
+        // 回收积分广告占用的资源
+        OffersManager.getInstance(activity).onAppExit();
+    }
+
+    private static class PermissionModel {
+
+        /**
+         * 请求的权限
+         */
+        String permission;
+
+        /**
+         * 解析为什么请求这个权限
+         */
+        String explain;
+
+        /**
+         * 请求代码
+         */
+        int requestCode;
+
+        PermissionModel(String permission, String explain, int requestCode) {
+            this.permission = permission;
+            this.explain = explain;
+            this.requestCode = requestCode;
+        }
+    }
+}

+ 222 - 0
app/src/main/java/com/youmi/android/offerdemo/PermissionCheckActivity.java

@@ -0,0 +1,222 @@
+package com.youmi.android.offerdemo;
+
+import android.Manifest;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.content.ContextCompat;
+import android.util.Log;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.sheep.jiuyan.samllsheep.R;
+
+/**
+ * Android 6.0 上权限分为<b>正常</b>和<b>危险</b>级别
+ * <ul>
+ * <li>正常级别权限:开发者仅仅需要在AndroidManifext.xml上声明,那么应用就会被允许拥有该权限,如:android.permission.INTERNET</li>
+ * <li>危险级别权限:开发者需要在AndroidManifext.xml上声明,并且在运行时进行申请,而且用户允许了,应用才会被允许拥有该权限,如:android.permission.WRITE_EXTERNAL_STORAGE</li>
+ * </ul>
+ * 有米的以下权限需要在Android6.0上被允许,有米广告sdk才能正常工作,开发者需要在调用有米的任何代码之前,提前让用户允许权限
+ * <ul>
+ * <li>必须申请的权限
+ * <ul>
+ * <li>android.permission.READ_PHONE_STATE</li>
+ * <li>android.permission.WRITE_EXTERNAL_STORAGE</li>
+ * </ul>
+ * </li>
+ * </ul>
+ *
+ * @since 2015-12-10 16:36
+ */
+public class PermissionCheckActivity extends FragmentActivity {
+	
+	/**
+	 * 小tips:这里的int数值不能太大,否则不会弹出请求权限提示,测试的时候,改到1000就不会弹出请求了
+	 */
+	private final static int READ_PHONE_STATE_CODE = 101;
+	
+	private final static int WRITE_EXTERNAL_STORAGE_CODE = 102;
+	
+	/**
+	 * 有米 Android SDK 所需要向用户申请的权限列表
+	 */
+	private PermissionModel[] models = new PermissionModel[] {
+			new PermissionModel(Manifest.permission.READ_PHONE_STATE, "我们需要读取手机信息的权限来标识您的身份", READ_PHONE_STATE_CODE),
+			new PermissionModel(Manifest.permission.WRITE_EXTERNAL_STORAGE,
+					"我们需要您允许我们读写你的存储卡,以方便我们临时保存一些数据",
+					WRITE_EXTERNAL_STORAGE_CODE
+			),
+	};
+	
+	@Override
+	protected void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		if (Build.VERSION.SDK_INT < 23) {
+			openDemo();
+			return;
+		}
+		
+		setContentView(R.layout.ym_activity_main);
+		((TextView) findViewById(R.id.tv_api)).setText("当前Android api level : " + Build.VERSION.SDK_INT);
+		checkPermissions();
+	}
+	
+	private void openDemo() {
+		startActivity(new Intent(this, YoumiOffersAdsDemo.class));
+		this.finish();
+	}
+	
+	/**
+	 * 这里我们演示如何在Android 6.0+上运行时申请权限
+	 */
+	private void checkPermissions() {
+		try {
+			
+			for (PermissionModel model : models) {
+				if (PackageManager.PERMISSION_GRANTED != ContextCompat.checkSelfPermission(this, model.permission)) {
+					ActivityCompat.requestPermissions(this, new String[] { model.permission }, model.requestCode);
+					return;
+				}
+			}
+			
+			// 到这里就表示有米所有需要的权限已经通过申请,权限已经申请就打开demo
+			openDemo();
+		} catch (Throwable e) {
+			Log.e("YoumiSdk", "", e);
+		}
+	}
+	
+	@Override
+	public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
+		super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+		switch (requestCode) {
+		
+		case READ_PHONE_STATE_CODE:
+		case WRITE_EXTERNAL_STORAGE_CODE:
+			// 如果用户不允许,我们视情况发起二次请求或者引导用户到应用页面手动打开
+			if (PackageManager.PERMISSION_GRANTED != grantResults[0]) {
+				
+				// 二次请求,表现为:以前请求过这个权限,但是用户拒接了
+				// 在二次请求的时候,会有一个“不再提示的”checkbox
+				// 因此这里需要给用户解释一下我们为什么需要这个权限,否则用户可能会永久不在激活这个申请
+				// 方便用户理解我们为什么需要这个权限
+				if (ActivityCompat.shouldShowRequestPermissionRationale(this, permissions[0])) {
+					new AlertDialog.Builder(this).setTitle("权限申请")
+					                             .setMessage(findPermissionExplain(permissions[0]))
+					                             .setPositiveButton("确定", new DialogInterface.OnClickListener() {
+						
+						                             @Override
+						                             public void onClick(DialogInterface dialog, int which) {
+							                             checkPermissions();
+						                             }
+					                             })
+					                             .show();
+				}
+				// 到这里就表示已经是第3+次请求,而且此时用户已经永久拒绝了,这个时候,我们引导用户到应用权限页面,让用户自己手动打开
+				else {
+					Toast.makeText(this, "部分权限被拒绝获取,将会会影响后续功能的使用,建议重新打开", Toast.LENGTH_LONG).show();
+					openAppPermissionSetting(123456789);
+				}
+				return;
+			}
+			
+			// 到这里就表示用户允许了本次请求,我们继续检查是否还有待申请的权限没有申请
+			if (isAllRequestedPermissionGranted()) {
+				openDemo();
+			} else {
+				checkPermissions();
+			}
+			break;
+		default:
+			break;
+		}
+	}
+	
+	private String findPermissionExplain(String permission) {
+		if (models != null) {
+			for (PermissionModel model : models) {
+				if (model != null && model.permission != null && model.permission.equals(permission)) {
+					return model.explain;
+				}
+			}
+		}
+		return null;
+	}
+	
+	private boolean isAllRequestedPermissionGranted() {
+		for (final PermissionModel model : models) {
+			if (PackageManager.PERMISSION_GRANTED != ContextCompat.checkSelfPermission(this, model.permission)) {
+				return false;
+			}
+		}
+		return true;
+	}
+	
+	@Override
+	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+		switch (requestCode) {
+		
+		case 123456789:
+			if (isAllRequestedPermissionGranted()) {
+				openDemo();
+			} else {
+				Toast.makeText(this, "部分权限被拒绝获取,退出", Toast.LENGTH_LONG).show();
+				this.finish();
+			}
+			break;
+		default:
+			super.onActivityResult(requestCode, resultCode, data);
+		}
+	}
+	
+	private boolean openAppPermissionSetting(int requestCode) {
+		try {
+			Intent intent =
+					new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + this.getPackageName()));
+			intent.addCategory(Intent.CATEGORY_DEFAULT);
+			
+			// Android L 之后Activity的启动模式发生了一些变化
+			// 如果用了下面的 Intent.FLAG_ACTIVITY_NEW_TASK ,并且是 startActivityForResult
+			// 那么会在打开新的activity的时候就会立即回调 onActivityResult
+			// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+			
+			startActivityForResult(intent, requestCode);
+			return true;
+		} catch (Throwable e) {
+			Log.e("YoumiSdk", "", e);
+		}
+		return false;
+	}
+	
+	private static class PermissionModel {
+		
+		/**
+		 * 请求的权限
+		 */
+		String permission;
+		
+		/**
+		 * 解析为什么请求这个权限
+		 */
+		String explain;
+		
+		/**
+		 * 请求代码
+		 */
+		int requestCode;
+		
+		PermissionModel(String permission, String explain, int requestCode) {
+			this.permission = permission;
+			this.explain = explain;
+			this.requestCode = requestCode;
+		}
+	}
+}

+ 378 - 0
app/src/main/java/com/youmi/android/offerdemo/YoumiOffersAdsDemo.java

@@ -0,0 +1,378 @@
+package com.youmi.android.offerdemo;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.sheep.jiuyan.samllsheep.R;
+import com.youmi.android.offer.YmConfig;
+
+import cde.ewd.adw.AdManager;
+import cde.ewd.adw.listener.Interface_ActivityListener;
+import cde.ewd.adw.listener.OffersWallDialogListener;
+import cde.ewd.adw.os.EarnPointsOrderInfo;
+import cde.ewd.adw.os.EarnPointsOrderList;
+import cde.ewd.adw.os.OffersBrowserConfig;
+import cde.ewd.adw.os.OffersManager;
+import cde.ewd.adw.os.PointsChangeNotify;
+import cde.ewd.adw.os.PointsEarnNotify;
+import cde.ewd.adw.os.PointsManager;
+import cde.ewd.adw.onlineconfig.OnlineConfigCallBack;
+import cde.ewd.adw.onlineconfig.ntp.NtpResultListener;
+
+import java.util.Locale;
+
+public class YoumiOffersAdsDemo extends Activity
+		implements OnClickListener, PointsChangeNotify, PointsEarnNotify {
+	
+	/**
+	 * 显示积分余额的控件
+	 */
+	TextView mTextViewPoints;
+	
+	@Override
+	protected void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.ym_activity_offers);
+		
+		mTextViewPoints = (TextView) findViewById(R.id.pointsBalance);
+		findViewById(R.id.btn_show_offerswall).setOnClickListener(this);
+		findViewById(R.id.btn_show_offerswall_dialog).setOnClickListener(this);
+		findViewById(R.id.btn_award_points).setOnClickListener(this);
+		findViewById(R.id.btn_spend_points).setOnClickListener(this);
+		findViewById(R.id.btn_get_online_config).setOnClickListener(this);
+		findViewById(R.id.btn_check_reach_ntp_time).setOnClickListener(this);
+		findViewById(R.id.btn_check_ad_config).setOnClickListener(this);
+		
+		showDemoInfo();
+		
+		initYoumi();
+	}
+	
+	private void initYoumi() {
+		// 自v6.3.0起,所有其他代码必须在初始化接口调用之后才能生效
+		// 初始化接口,应用启动的时候调用,参数:appId, appSecret, isEnableYoumiLog
+		AdManager.getInstance(this).init(YmConfig.getAppId(), YmConfig.getAppSecret(), YmConfig.isShowLog());
+		
+		// 有米android 积分墙sdk 5.0.0之后支持定制浏览器顶部标题栏的部分UI
+		// setOfferBrowserConfig();
+		
+		// 如果开发者使用积分墙的服务器回调,
+		// 1.需要告诉sdk,现在采用服务器回调
+		// 2.建议开发者传入自己系统中用户id(如:邮箱账号之类的)(请限制在50个字符串以内)
+		// 3.务必在下面的OffersManager.getInstance(this).onAppLaunch();代码之前声明使用服务器回调
+		
+		// OffersManager.getInstance(this).setUsingServerCallBack(true);
+		// OffersManager.getInstance(this).setCustomUserId("user_id");
+		
+		// 如果使用积分广告,请务必调用积分广告的初始化接口:
+		OffersManager.getInstance(this).onAppLaunch();
+		
+		// (可选)注册积分监听-随时随地获得积分的变动情况
+		PointsManager.getInstance(this).registerNotify(this);
+		
+		// (可选)注册积分订单赚取监听(sdk v4.10版本新增功能)
+		PointsManager.getInstance(this).registerPointsEarnNotify(this);
+		
+		// (可选)设置是否在通知栏显示下载相关提示。默认为true,标识开启;设置为false则关闭。(sdk v4.10版本新增功能)
+		// AdManager.getInstance(this).setIsDownloadTipsDisplayOnNotification(false);
+		
+		// (可选)设置安装完成后是否在通知栏显示已安装成功的通知。默认为true,标识开启;设置为false则关闭。(sdk v4.10版本新增功能)
+		// AdManager.getInstance(this).setIsInstallationSuccessTipsDisplayOnNotification(false);
+		
+		// (可选)设置是否在通知栏显示积分赚取提示。默认为true,标识开启;设置为false则关闭。
+		// 如果开发者采用了服务器回调积分的方式,那么本方法将不会生效
+		// PointsManager.getInstance(this).setEnableEarnPointsNotification(false);
+		
+		// (可选)设置是否开启积分赚取的Toast提示。默认为true,标识开启;设置为false这关闭。
+		// 如果开发者采用了服务器回调积分的方式,那么本方法将不会生效
+		// PointsManager.getInstance(this).setEnableEarnPointsToastTips(false);
+		
+		// 查询积分余额
+		// 从5.3.0版本起,客户端积分托管将由 int 转换为 float
+		float pointsBalance = PointsManager.getInstance(this).queryPoints();
+		mTextViewPoints.setText("积分余额:" + pointsBalance);
+	}
+	
+	/**
+	 * 退出时回收资源
+	 */
+	@Override
+	protected void onDestroy() {
+		super.onDestroy();
+		
+		// (可选)注销积分监听
+		// 如果在onCreate调用了PointsManager.getInstance(this).registerNotify(this)进行积分余额监听器注册,那这里必须得注销
+		PointsManager.getInstance(this).unRegisterNotify(this);
+		
+		// (可选)注销积分订单赚取监听
+		// 如果在onCreate调用了PointsManager.getInstance(this).registerPointsEarnNotify(this)进行积分订单赚取监听器注册,那这里必须得注销
+		PointsManager.getInstance(this).unRegisterPointsEarnNotify(this);
+		
+		// 回收积分广告占用的资源
+		OffersManager.getInstance(this).onAppExit();
+	}
+	
+	/**
+	 * 积分余额发生变动时,就会回调本方法(本回调方法执行在UI线程中)
+	 * <p/>
+	 * 从5.3.0版本起,客户端积分托管将由 int 转换为 float
+	 */
+	@Override
+	public void onPointBalanceChange(float pointsBalance) {
+		mTextViewPoints.setText("积分余额:" + pointsBalance);
+	}
+	
+	/**
+	 * 积分订单赚取时会回调本方法(本回调方法执行在UI线程中)
+	 */
+	@Override
+	public void onPointEarn(Context context, EarnPointsOrderList list) {
+		if (list == null || list.isEmpty()) {
+			return;
+		}
+		// 遍历订单并且toast提示
+		for (int i = 0; i < list.size(); ++i) {
+			EarnPointsOrderInfo info = list.get(i);
+			Toast.makeText(this, info.getMessage(), Toast.LENGTH_LONG).show();
+		}
+	}
+	
+	@Override
+	public void onClick(View arg0) {
+		switch (arg0.getId()) {
+		
+		// 展示全屏的积分墙界面
+		case R.id.btn_show_offerswall:
+			
+			// 调用方式一:直接打开全屏积分墙
+			// OffersManager.getInstance(this).showOffersWall();
+			
+			// 调用方式二:直接打开全屏积分墙,并且监听积分墙退出的事件onDestory
+			OffersManager.getInstance(this).showOffersWall(new Interface_ActivityListener() {
+				
+				/**
+				 * 当积分墙销毁的时候,即积分墙的Activity调用了onDestory的时候回调
+				 */
+				@Override
+				public void onActivityDestroy(Context context) {
+					Toast.makeText(context, "全屏积分墙退出了", Toast.LENGTH_SHORT).show();
+				}
+			});
+			
+			break;
+		
+		// 展示对话框的积分墙界面(本方法支持多种重载格式,开发者可以参考文档或者使用代码提示快捷键来了解)
+		case R.id.btn_show_offerswall_dialog:
+			OffersManager.getInstance(this).showOffersWallDialog(this, new OffersWallDialogListener() {
+				
+				@Override
+				public void onDialogClose() {
+					Toast.makeText(YoumiOffersAdsDemo.this, "积分墙对话框关闭了", Toast.LENGTH_SHORT).show();
+				}
+			});
+			break;
+		
+		// 奖励10积分, 注:调用本方法后,积分余额马上变更,可留意onPointBalanceChange是不是被调用了
+		// 从5.3.0版本起,客户端积分托管将由 int 转换为 float
+		case R.id.btn_award_points:
+			PointsManager.getInstance(this).awardPoints(10.0f);
+			break;
+		
+		// 消费20积分, 注:调用本方法后,积分余额马上变更,可留意onPointBalanceChange是不是被调用了
+		// 从5.3.0版本起,客户端积分托管将由 int 转换为 float
+		case R.id.btn_spend_points:
+			PointsManager.getInstance(this).spendPoints(20.0f);
+			break;
+		
+		// 获取在线参数
+		case R.id.btn_get_online_config:
+			Toast.makeText(this, "获取在线参数中...", Toast.LENGTH_LONG).show();
+			
+			// 注意:这里获取的在线参数的key为 :isOpen,为演示的key , 开发者需要将key替换为开发者在自己有米后台上面设置的key
+			AdManager.getInstance(this).asyncGetOnlineConfig("isOpen", new OnlineConfigCallBack() {
+				/**
+				 * 获取在线参数成功就会回调本方法(本回调方法执行在UI线程中)
+				 */
+				@Override
+				public void onGetOnlineConfigSuccessful(String key, String value) {
+					// 获取在线参数成功
+					Toast.makeText(YoumiOffersAdsDemo.this,
+							String.format("在线参数获取结果:\nkey=%s, value=%s", key, value),
+							Toast.LENGTH_LONG
+					)
+					     .show();
+					
+					// //
+					// 开发者在这里可以判断一下获取到的value值,然后设置一个boolean值并将其保存在文件中,每次调用广告之前从文件中获取boolean
+					// 值并判断一下是否可以展示广告
+					// if (key.equals("isOpen")) {
+					// if (value.equals("1")) {
+					// // 如果满足开发者自己的定义:如示例中如果key=isOpen value=1 则定义为开启广告
+					// // 则将flag(boolean值)设置为true,然后每次调用广告代码之前都判断一下flag,如果flag为true则执行展示广告的代码
+					// flag = true;
+					// // 写入文件 ...
+					// }
+					// }
+					
+				}
+				
+				/**
+				 * 获取在线参数失败就会回调本方法(本回调方法执行在UI线程中)
+				 */
+				@Override
+				public void onGetOnlineConfigFailed(String key) {
+					// 获取在线参数失败,可能原因有:键值未设置或为空、网络异常、服务器异常
+					Toast.makeText(YoumiOffersAdsDemo.this,
+							String.format("在线参数获取结果:\n获取在线key=%s失败!\n具体失败原因请查看Log,Log标签:YoumiSdk", key),
+							Toast.LENGTH_LONG
+					).show();
+				}
+			});
+			break;
+		
+		// 检查是否达到指定的网络时间——ntp
+		// 使用场合:开发者可以指定一个日期,然后到达该日期之后才开启广告
+		// 具体做法:当获取到结果的时候,可以把结果(boolean)保存在文件中,然后每次启动的时候获取文件的内容,然后根据内容来判断是否开启广告
+		case R.id.btn_check_reach_ntp_time:
+			
+			// 检查现在是否到达2014年11月12号 GTM+8
+			final int targetYear = 2014;
+			final int targetMonth = 11;
+			final int targetMonthDay = 15;
+			
+			// 这里演示异步方法的使用,同步方法的的使用请查看文档
+			AdManager.getInstance(this)
+			                  .asyncCheckIsReachNtpTime(targetYear,
+					                  targetMonth,
+					                  targetMonthDay,
+					                  new NtpResultListener() {
+						
+						                  /**
+						                   * 当获取到网络时间时,会回调本方法(本方法执行在UI线程中)
+						                   */
+						                  @Override
+						                  public void onCheckNtpFinish(boolean result) {
+							                  String logText = String.format(Locale.getDefault(),
+									                  "是否到达日期: %d-%d-%d " + "%s",
+									                  targetYear,
+									                  targetMonth,
+									                  targetMonthDay,
+									                  result ? "是" : "否"
+							                  );
+							                  Log.i("ntp_", logText);
+							                  Toast.makeText(YoumiOffersAdsDemo.this, logText, Toast.LENGTH_LONG).show();
+						                  }
+					                  }
+			                  );
+			
+			break;
+		
+		// 检查积分墙广告配置
+		case R.id.btn_check_ad_config:
+			checkConfig();
+			break;
+		
+		default:
+			break;
+		}
+	}
+	
+	/**
+	 * 检查广告配置
+	 */
+	private void checkConfig() {
+		StringBuilder sb = new StringBuilder();
+		
+		addTextToSb(sb,
+				OffersManager.getInstance(this).checkOffersAdConfig() ? "广告配置结果:正常" :
+						"广告配置结果:异常,具体异常请查看Log,Log标签:YoumiSdk"
+		);
+		addTextToSb(sb, "%s服务器回调", OffersManager.getInstance(this).isUsingServerCallBack() ? "已经开启" : "没有开启");
+		addTextToSb(sb,
+				"%s通知栏下载相关的通知",
+				AdManager.getInstance(this).isDownloadTipsDisplayOnNotification() ? "已经开启" : "没有开启"
+		);
+		addTextToSb(sb,
+				"%s通知栏安装成功的通知",
+				AdManager.getInstance(this).isInstallationSuccessTipsDisplayOnNotification() ? "已经开启" : "没有开启"
+		);
+		addTextToSb(sb,
+				"%s通知栏赚取积分的提示",
+				PointsManager.getInstance(this).isEnableEarnPointsNotification() ? "已经开启" : "没有开启"
+		);
+		addTextToSb(sb,
+				"%s积分赚取的Toast提示",
+				PointsManager.getInstance(this).isEnableEarnPointsToastTips() ? "已经开启" : "没有开启"
+		);
+		
+		new AlertDialog.Builder(this).setTitle("检查结果")
+		                             .setMessage(sb.toString())
+		                             .setPositiveButton("确定", new DialogInterface.OnClickListener() {
+			
+			                             @Override
+			                             public void onClick(DialogInterface dialog, int which) {
+				                             dialog.dismiss();
+			                             }
+			
+		                             })
+		                             .create()
+		                             .show();
+	}
+	
+	/**
+	 * 格式化字符串
+	 */
+	private void addTextToSb(StringBuilder sb, String format, Object... args) {
+		sb.append(String.format(format, args));
+		sb.append(System.getProperty("line.separator"));
+	}
+	
+	/**
+	 * 设置积分墙浏览器标题栏样式
+	 */
+	private void setOfferBrowserConfig() {
+		
+		// 设置标题栏——标题
+		OffersBrowserConfig.getInstance(this).setBrowserTitleText("秒取积分");
+		
+		// 设置标题栏——背景颜色(ps:积分墙标题栏默认背景颜色为#FFBB34)
+		OffersBrowserConfig.getInstance(this).setBrowserTitleBackgroundColor(Color.BLUE);
+		
+		// 设置标题栏——是否显示积分墙右上角积分余额区域 true:是 false:否
+		OffersBrowserConfig.getInstance(this).setPointsLayoutVisibility(true);
+		
+		// 设置标题栏——是否显示有米的logo
+		OffersBrowserConfig.getInstance(this).setLogoVisibility(false);
+		
+	}
+	
+	/**
+	 * 显示demo的一些详细信息
+	 */
+	private void showDemoInfo() {
+		try {
+			PackageInfo packageInfo = getPackageManager().getPackageInfo(this.getPackageName(), 0);
+			String message = String.format(Locale.getDefault(),
+					"vc: %d, vn: %s, install time: %3$tY-%3$tm-%3$td %3$tH:%3$tM:%3$tS",
+					packageInfo.versionCode,
+					packageInfo.versionName,
+					packageInfo.firstInstallTime
+			);
+			((TextView) findViewById(R.id.tv_version)).setText(message);
+		} catch (PackageManager.NameNotFoundException e) {
+			e.printStackTrace();
+		}
+		
+	}
+}

+ 11 - 0
app/src/main/java/org/afinal/simplecache/DataKey.java

@@ -0,0 +1,11 @@
+package org.afinal.simplecache;
+
+/**
+ * Created by realicing on 2018/10/29.
+ * realicing@sina.com
+ * 缓存数据的key
+ */
+public class DataKey {
+    //有米积分总余额的key
+    public static final String YM_TOTAL_PRICE = "ym_total_price";
+}

+ 9 - 0
app/src/main/res/drawable/shape_black_solid_rectangle_tl_br_12.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners
+        android:bottomRightRadius="12dp"
+        android:topLeftRadius="12dp" />
+    <solid android:color="#000000" />
+
+</shape>

+ 5 - 0
app/src/main/res/drawable/shape_input_background_radius.xml

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

+ 17 - 0
app/src/main/res/drawable/shape_light_blue_gradient_solid_rectangle_5.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="#ff32a5f9" />
+    <gradient
+        android:angle="-90"
+        android:centerColor="#ff49bde9"
+        android:endColor="#ff2ea1fa"
+        android:startColor="#ff6be2da"
+        android:type="linear"
+        android:useLevel="true" />
+    <corners
+        android:bottomLeftRadius="5dp"
+        android:bottomRightRadius="5dp"
+        android:topLeftRadius="5dp"
+        android:topRightRadius="5dp" />
+</shape>

+ 5 - 0
app/src/main/res/drawable/shape_main_search_bar_radius.xml

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

+ 17 - 0
app/src/main/res/drawable/shape_orange_gradient_solid_rectangle_5.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="#ff32a5f9" />
+    <gradient
+        android:angle="-90"
+        android:centerColor="#fffd9797"
+        android:endColor="#fffd7697"
+        android:startColor="#ffffc296"
+        android:type="linear"
+        android:useLevel="true" />
+    <corners
+        android:bottomLeftRadius="5dp"
+        android:bottomRightRadius="5dp"
+        android:topLeftRadius="5dp"
+        android:topRightRadius="5dp" />
+</shape>

+ 17 - 0
app/src/main/res/drawable/shape_purple_gradient_solid_rectangle_5.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="#ff32a5f9" />
+    <gradient
+        android:angle="-90"
+        android:centerColor="#ffb870fc"
+        android:endColor="#ff9d57fb"
+        android:startColor="#ffbf83f6"
+        android:type="linear"
+        android:useLevel="true" />
+    <corners
+        android:bottomLeftRadius="5dp"
+        android:bottomRightRadius="5dp"
+        android:topLeftRadius="5dp"
+        android:topRightRadius="5dp" />
+</shape>

+ 9 - 0
app/src/main/res/drawable/shape_round_rect_bg.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <corners
+        android:bottomLeftRadius="25dp"
+        android:topLeftRadius="25dp" />
+    <gradient
+        android:endColor="#0060FB"
+        android:startColor="#51C2FE" />
+</shape>

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

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android" >
+    <item android:state_pressed="true" android:drawable="@android:color/darker_gray" />
+	<item android:state_focused="true" android:drawable="@android:color/darker_gray" />
+	<item android:drawable="@android:color/white" />
+</selector>

+ 58 - 0
app/src/main/res/layout/activity_search.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#ffffff"
+    tools:context=".ui.activity.SearchActivity">
+
+    <LinearLayout
+        android:id="@+id/search_bar"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentTop="true"
+        android:gravity="center"
+        android:orientation="horizontal"
+        android:padding="5dp">
+
+        <ImageView
+            android:id="@+id/search_but_back"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:contentDescription="@string/image_des"
+            android:padding="10dp"
+            android:src="@drawable/narrow_back_black" />
+
+        <EditText
+            android:id="@+id/search_input_txt"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_marginLeft="8dp"
+            android:layout_marginRight="8dp"
+            android:layout_weight="1"
+            android:background="@drawable/shape_input_background_radius"
+            android:hint="@string/search_hint_txt"
+            android:inputType="text"
+            android:paddingLeft="5dp"
+            android:paddingRight="5dp"
+            android:textColor="#666666"
+            android:textColorHint="#aaaaaa"
+            android:textSize="14sp" />
+
+        <TextView
+            android:id="@+id/search_but_search"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center"
+            android:paddingLeft="8dp"
+            android:paddingRight="8dp"
+            android:text="@string/search_but_text" />
+    </LinearLayout>
+
+    <android.support.v7.widget.RecyclerView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_below="@+id/search_bar"
+        android:layout_alignParentStart="true" />
+
+</RelativeLayout>

+ 47 - 0
app/src/main/res/layout/activity_sign.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <RelativeLayout
+        android:id="@+id/title_bar"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="#ffffff"
+        android:gravity="center_vertical"
+        android:paddingLeft="16dp"
+        android:paddingRight="16dp">
+
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:contentDescription="@string/image_des"
+            android:padding="10dp"
+            android:src="@drawable/narrow_back_black" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:gravity="center"
+            android:text="签到"
+            android:textColor="#333333"
+            android:textSize="17sp" />
+    </RelativeLayout>
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/title_bar"
+        android:layout_alignParentEnd="true"
+        android:layout_marginTop="15dp"
+        android:background="@drawable/shape_round_rect_bg"
+        android:gravity="center"
+        android:paddingLeft="15dp"
+        android:paddingTop="5dp"
+        android:paddingRight="15dp"
+        android:paddingBottom="5dp"
+        android:text="活动规则"
+        android:textColor="#ffffff"
+        android:textSize="12sp" />
+</RelativeLayout>

+ 10 - 47
app/src/main/res/layout/fgt_play_game.xml

@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <com.scwang.smartrefresh.layout.SmartRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:id="@+id/refresh"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
@@ -10,10 +9,7 @@
         android:id="@+id/scrollView"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_gravity="fill_vertical"
-        android:fillViewport="true"
-        android:scrollbars="none"
-        app:layout_behavior="@string/appbar_scrolling_view_behavior">
+        android:scrollbars="none">
 
         <LinearLayout
             android:layout_width="match_parent"
@@ -24,59 +20,26 @@
 
             <include layout="@layout/homepage_item_banner" />
 
-            <View
-                android:layout_width="match_parent"
-                android:layout_height="10dp"
-                android:background="#fff5f5f5" />
-
-            <RelativeLayout style="@style/style_wc_rl">
-
-                <TextView
-                    style="@style/style_wc_line_title"
-                    android:text="每日必玩" />
-
-                <TextView
-                    android:id="@+id/every_day_more_tv"
-                    style="@style/style_wc_more"
-                    android:text="更多" />
-            </RelativeLayout>
-
             <android.support.v7.widget.RecyclerView
-                android:id="@+id/every_day_play_list"
+                android:id="@+id/play_game_act"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content" />
 
-            <View
+            <android.support.v7.widget.RecyclerView
+                android:id="@+id/play_game_list_3_rv"
                 android:layout_width="match_parent"
-                android:layout_height="10dp"
-                android:background="#fff5f5f5" />
-
-            <RelativeLayout style="@style/style_wc_rl">
-
-                <TextView
-                    style="@style/style_wc_line_title"
-                    android:text="近期最热" />
-
-                <TextView
-                    android:id="@+id/recent_hot_more_tv"
-                    style="@style/style_wc_more"
-                    android:text="更多" />
-            </RelativeLayout>
+                android:layout_height="wrap_content" />
 
             <android.support.v7.widget.RecyclerView
-                android:id="@+id/recent_hoe_list"
+                android:id="@+id/play_game_list_2_rv"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:paddingBottom="4dp"
-                android:paddingTop="4dp" />
+                android:layout_height="wrap_content" />
 
-            <View
+            <android.support.v7.widget.RecyclerView
+                android:id="@+id/play_game_list_x_rv"
                 android:layout_width="match_parent"
-                android:layout_height="10dp"
-                android:background="#fff5f5f5" />
+                android:layout_height="wrap_content" />
 
-            <!--选项卡-->
-            <include layout="@layout/tablayout_viewpager_layout" />
         </LinearLayout>
 
     </android.support.v4.widget.NestedScrollView>

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

@@ -5,6 +5,7 @@
     android:layout_height="match_parent"
     android:background="@color/white"
     android:clipChildren="true">
+
     <com.scwang.smartrefresh.layout.SmartRefreshLayout
         android:id="@+id/refresh"
         android:layout_width="match_parent"
@@ -176,4 +177,33 @@
     <include
         layout="@layout/view_float_title_card"
         android:visibility="visible" />
+
+    <LinearLayout
+        android:id="@+id/to_search_but"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentTop="true"
+        android:layout_marginLeft="10dp"
+        android:layout_marginTop="@dimen/nav_title_size"
+        android:layout_marginRight="10dp"
+        android:background="@drawable/shape_main_search_bar_radius"
+        android:gravity="center"
+        android:orientation="horizontal"
+        android:padding="10dp">
+
+        <TextView
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="@string/search_hint_txt"
+            android:textColor="#666666"
+            android:textSize="12sp" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/search_but_text"
+            android:textColor="#666666"
+            android:textSize="14sp" />
+    </LinearLayout>
 </RelativeLayout>

+ 43 - 0
app/src/main/res/layout/item_game_act.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginTop="20dp">
+
+    <View
+        android:id="@+id/item_game_act_start"
+        android:layout_width="16dp"
+        android:layout_height="62dp" />
+
+    <RelativeLayout
+        android:id="@+id/item_game_act_content"
+        android:layout_width="117dp"
+        android:layout_height="62dp"
+        android:layout_marginEnd="14dp"
+        android:background="@drawable/shape_purple_gradient_solid_rectangle_5"
+        android:paddingStart="10dp"
+        android:paddingEnd="10dp">
+
+        <TextView
+            android:id="@+id/item_game_act_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:text="@string/default_game_act_name"
+            android:textColor="@color/white"
+            android:textSize="12sp" />
+
+        <ImageView
+            android:id="@+id/item_game_act_iv"
+            android:layout_width="35dp"
+            android:layout_height="30dp"
+            android:layout_alignParentEnd="true"
+            android:layout_centerVertical="true"
+            android:src="@drawable/icon" />
+    </RelativeLayout>
+
+    <View
+        android:id="@+id/item_game_act_end"
+        android:layout_width="2dp"
+        android:layout_height="62dp" />
+</LinearLayout>

+ 14 - 13
app/src/main/res/layout/item_hot_welfare.xml

@@ -3,30 +3,31 @@
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_gravity="center"
-    android:paddingStart="16dp"
-    android:paddingEnd="6dp"
+    android:orientation="vertical"
+    android:paddingStart="10dp"
     android:paddingTop="20dp"
-    android:paddingBottom="20dp"
-    android:orientation="vertical">
+    android:paddingBottom="20dp">
 
     <ImageView
         android:id="@+id/item_hot_welfare_iv"
-        android:layout_width="62dp"
-        android:layout_height="62dp"
+        android:layout_width="83dp"
+        android:layout_height="83dp"
+        android:layout_marginStart="6dp"
+        android:layout_marginEnd="6dp"
         android:layout_gravity="center"
-        android:src="@drawable/icon_lj"/>
+        android:src="@drawable/icon_lj" />
 
     <TextView
         android:id="@+id/item_hot_welfare_tv"
-        android:layout_width="wrap_content"
-        android:maxEms="5"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_gravity="center_horizontal"
         android:layout_marginTop="12dp"
         android:ellipsize="end"
-        android:textColor="#333333"
-        android:textSize="12sp"
         android:gravity="center"
-        android:lines="2"
-        android:text=""/>
+        android:maxEms="5"
+        android:maxLines="1"
+        android:text=""
+        android:textColor="#333333"
+        android:textSize="12sp" />
 </LinearLayout>

+ 49 - 0
app/src/main/res/layout/item_play_game.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+
+    <View
+        android:id="@+id/item_play_game_start"
+        android:layout_width="11dp"
+        android:layout_height="146dp" />
+
+    <RelativeLayout
+        android:layout_width="270dp"
+        android:layout_height="146dp"
+        android:layout_marginTop="16dp"
+        android:layout_marginBottom="16dp"
+        android:layout_marginStart="5dp"
+        android:layout_marginEnd="5dp">
+
+        <ImageView
+            android:id="@+id/item_play_game_iv"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:scaleType="centerCrop"
+            android:src="@mipmap/home_blue_bg" />
+
+        <TextView
+            android:id="@+id/item_play_game_name"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentStart="true"
+            android:layout_alignParentBottom="true"
+            android:layout_marginStart="5dp"
+            android:layout_marginBottom="5dp"
+            android:background="@drawable/shape_black_solid_rectangle_tl_br_12"
+            android:text="战舰世界闪击战"
+            android:paddingTop="5dp"
+            android:paddingBottom="5dp"
+            android:paddingStart="10dp"
+            android:paddingEnd="10dp"
+            android:textColor="#ffffffff"
+            android:textSize="13sp"
+            />
+    </RelativeLayout>
+
+    <View
+        android:id="@+id/item_play_game_end"
+        android:layout_width="11dp"
+        android:layout_height="146dp" />
+</LinearLayout>

+ 32 - 0
app/src/main/res/layout/item_play_game_list.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+
+    <View
+        android:id="@+id/item_play_game_list_top"
+        android:layout_width="match_parent"
+        android:layout_height="10dp"
+        android:background="#fff5f5f5" />
+
+    <RelativeLayout style="@style/style_wc_rl">
+
+        <TextView
+            android:id="@+id/item_play_game_list_tv"
+            style="@style/style_wc_line_title"
+            android:text="猜你喜欢" />
+
+        <TextView
+            android:id="@+id/item_play_game_list_more_tv"
+            style="@style/style_wc_more"
+            android:text="更多" />
+    </RelativeLayout>
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/item_play_game_list_rv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingTop="4dp"
+        android:paddingBottom="4dp" />
+</LinearLayout>

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

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView android:id="@+id/offersTestItems"
+            xmlns:android="http://schemas.android.com/apk/res/android"
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent"
+            android:background="@color/global_bg"
+	>
+
+	<LinearLayout
+		android:layout_width="match_parent"
+		android:layout_height="wrap_content"
+		android:orientation="vertical"
+		>
+
+		<TextView
+			android:id="@+id/tv_api"
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:layout_margin="10dp"
+			android:textAppearance="?android:attr/textAppearanceSmall"
+			android:textColor="@android:color/darker_gray"
+			/>
+	</LinearLayout >
+
+</ScrollView >

+ 73 - 0
app/src/main/res/layout/ym_activity_offers.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView android:id="@+id/offersTestItems"
+            xmlns:android="http://schemas.android.com/apk/res/android"
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent"
+            android:background="@color/global_bg"
+	>
+
+	<LinearLayout
+		android:layout_width="match_parent"
+		android:layout_height="wrap_content"
+		android:orientation="vertical"
+		>
+
+		<TextView
+			android:id="@+id/pointsBalance"
+			style="@style/TextViewStyle"
+			android:textColor="@color/points"
+			/>
+
+		<Button
+			android:id="@+id/btn_show_offerswall"
+			style="@style/BtnStyle"
+			android:text="@string/btn_show_offerswall"
+			/>
+
+		<Button
+			android:id="@+id/btn_show_offerswall_dialog"
+			style="@style/BtnStyle"
+			android:text="@string/btn_show_offerswall_dialog"
+			/>
+
+		<Button
+			android:id="@+id/btn_award_points"
+			style="@style/BtnStyle"
+			android:text="@string/btn_award_points"
+			/>
+
+		<Button
+			android:id="@+id/btn_spend_points"
+			style="@style/BtnStyle"
+			android:text="@string/btn_spend_points"
+			/>
+
+		<Button
+			android:id="@+id/btn_get_online_config"
+			style="@style/BtnStyle"
+			android:text="@string/btn_get_online_config"
+			/>
+
+		<Button
+			android:id="@+id/btn_check_reach_ntp_time"
+			style="@style/BtnStyle"
+			android:text="@string/btn_check_reach_ntp_time"
+			/>
+
+		<Button
+			android:id="@+id/btn_check_ad_config"
+			style="@style/BtnStyle"
+			android:text="@string/btn_check_ad_config"
+			/>
+
+		<TextView
+			android:id="@+id/tv_version"
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:layout_margin="10dp"
+			android:textAppearance="?android:attr/textAppearanceSmall"
+			android:textColor="@android:color/darker_gray"
+			/>
+	</LinearLayout >
+
+</ScrollView >

+ 15 - 0
app/src/main/res/layout/ym_tip.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentEnd="true"
+        android:layout_centerVertical="true"
+        android:paddingStart="10dp"
+        android:paddingEnd="10dp"
+        android:text="@string/ym_tip"
+        android:textColor="@color/white"
+        android:textSize="15sp"/>
+</RelativeLayout>

+ 4 - 0
app/src/main/res/values/strings.xml

@@ -108,4 +108,8 @@
     <string name="gift_bag_code">礼包码:%s</string>
 
     <string name="change_login_ing">登录授权中&#8230;</string>
+    <string name="default_game_act_name">万圣节\n抽奖活动</string>
+    <string name="image_des">icon</string>
+    <string name="search_but_text">搜索</string>
+    <string name="search_hint_txt">搜索任务名称/游戏名称</string>
 </resources>

+ 8 - 0
app/src/main/res/values/styles.xml

@@ -14,6 +14,14 @@
         <item name="android:windowFullscreen">true</item>
         <item name="android:windowNoTitle">true</item>
     </style>
+
+    <!-- 全屏 -->
+    <style name="AppTheme.NoTitleBar.AlphaStatusBar" parent="Trans">
+        <item name="windowActionBar">false</item>
+        <item name="windowNoTitle">true</item>
+        <item name="android:windowContentOverlay">@null</item>
+    </style>
+
     <!--透明,有任务栏电量时间等-->
 
     <!--快速启动app主题,告别app启动黑白屏-->

+ 5 - 0
app/src/main/res/values/ym_colors.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources >
+	<color name="global_bg">#5a5a5a</color>
+	<color name="points">#87cefa</color>
+</resources >

+ 14 - 0
app/src/main/res/values/ym_strings.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <string name="action_settings">设置</string>
+    <string name="btn_show_offerswall">展示积分墙(全屏)</string>
+    <string name="btn_show_offerswall_dialog">展示积分墙(对话框)</string>
+    <string name="btn_award_points">奖励10积分</string>
+    <string name="btn_spend_points">消费20积分</string>
+    <string name="btn_get_online_config">获取有米在线参数</string>
+    <string name="btn_check_reach_ntp_time">是否达到指定网络时间</string>
+    <string name="btn_check_ad_config">检查广告配置</string>
+    <string name="ym_tip">注:100积分等于1绵羊币</string>
+
+</resources>

+ 16 - 0
app/src/main/res/values/ym_styles.xml

@@ -0,0 +1,16 @@
+<resources >
+
+	<style name="TextViewStyle" >
+		<item name="android:layout_width" >fill_parent</item >
+		<item name="android:layout_height" >wrap_content</item >
+		<item name="android:layout_margin" >10dp</item >
+		<item name="android:textAppearance" >?android:attr/textAppearanceLarge</item >
+	</style >
+
+	<style name="BtnStyle"
+	       parent="TextViewStyle" >
+		<item name="android:background" >@drawable/ym_buttonbg</item >
+		<item name="android:textAppearance" >?android:attr/textAppearanceMedium</item >
+	</style >
+
+</resources >

+ 10 - 0
app/src/main/res/xml/file_paths.xml

@@ -7,4 +7,14 @@
     <external-path path="." name="external_storage_root"/>
     <external-path path="" name="Download"/>
     <external-path name="download" path="."/>
+    <!--
+    有米sdk会将apk优先下载在sd卡中,如果sd卡不能使用,则会使用应用私有缓存目录context.getCache()
+    因此需要开发者配置下面两个路径方便有米sdk在下载完apk之后启动apk的安装页面
+    <cache-path
+        name="apk1"
+        path="." />
+    -->
+    <external-path
+        name="apk2"
+        path="." />
 </resources>

+ 1 - 0
view/src/main/res/values/colors.xml

@@ -57,6 +57,7 @@
     <color name="title">#ff333333</color>
     <color name="topic_bg">#ff009fd3</color>
     <color name="translucent">#e0000000</color>
+    <color name="app_translucent">#00000000</color>
     <color name="transparent">#00000000</color>
     <color name="umeng_fb_color_btn_normal">#ff333333</color>
     <color name="umeng_fb_color_btn_pressed">#ff1495f7</color>