Bläddra i källkod

添加搜索页面

zhoujuncai 7 år sedan
förälder
incheckning
295534b332

+ 5 - 1
app/build.gradle

@@ -283,6 +283,10 @@ dependencies {
     // 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(name: 'YoumiSdk_v8.3.0_2018-09-20', ext: 'aar')
 }
 
@@ -299,4 +303,4 @@ android.applicationVariants.all {
                 }
 
         }
-}
+}

+ 101 - 106
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"
@@ -684,7 +676,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 +685,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 +695,6 @@
             android:enabled="true"
             android:priority="1000" />
 
-
         <receiver
             android:name="com.mdad.sdk.mdsdk.AppInstallReceiver"
             android:enabled="true"
@@ -715,7 +707,6 @@
                 <data android:scheme="package" />
             </intent-filter>
         </receiver>
-
         <receiver
             android:name="com.mdad.sdk.mdsdk.DownloadCompleteReceiver"
             android:enabled="true"
@@ -725,8 +716,8 @@
                 <action android:name="android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED" />
             </intent-filter>
         </receiver>
-        <!--end幂动科技-->
-        <!--start 有米科技-->
+        <!-- end幂动科技 -->
+        <!-- start 有米科技 -->
 
         <activity
             android:name="com.youmi.android.offerdemo.PermissionCheckActivity"
@@ -734,8 +725,12 @@
         <activity
             android:name="com.youmi.android.offerdemo.YoumiOffersAdsDemo"
             android:screenOrientation="portrait" />
-        <!--end 有米科技-->
+        <!-- end 有米科技 -->
+        <!-- 搜索界面 -->
+        <activity
+            android:name=".ui.activity.SearchActivity"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoTitleBar.AlphaStatusBar" />
     </application>
 
-
 </manifest>

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

+ 32 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/ui/activity/SearchActivity.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/30.
+ * Description: 搜索界面
+ */
+public class SearchActivity extends BaseActivity {
+
+    @Override
+    protected int onLayout() {
+        return R.layout.activity_search;
+    }
+
+    @Override
+    protected void onObject() {
+
+    }
+
+    @Override
+    protected void onView() {
+
+    }
+
+    @Override
+    protected void onData() {
+
+    }
+}

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

@@ -0,0 +1,104 @@
+package com.sheep.jiuyan.samllsheep.ui.base;
+
+import android.annotation.SuppressLint;
+import android.os.Build;
+import android.os.Bundle;
+import android.support.annotation.LayoutRes;
+import android.support.annotation.Nullable;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+
+import com.sheep.jiuyan.samllsheep.R;
+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);
+        alphaStatusBar();
+        setContentView(onLayout());
+        unbinder = ButterKnife.bind(this);
+        onObject();
+        onView();
+        onData();
+    }
+
+    /**
+     * 初始化透明状态栏,透明导航栏
+     */
+    private void alphaStatusBar() {
+        Window window = getWindow();
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
+                    | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
+            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+            window.setStatusBarColor(getResources().getColor(R.color.app_translucent));
+            window.setNavigationBarColor(getResources().getColor(R.color.app_translucent));
+        } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+            window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+            window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
+        }
+    }
+
+    @Override
+    public void onWindowFocusChanged(boolean hasFocus) {
+        super.onWindowFocusChanged(hasFocus);
+        if (hasFocus && Build.VERSION.SDK_INT >= 19) {
+            View decorView = getWindow().getDecorView();
+            decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
+        }
+    }
+
+    /**
+     * 初始化布局
+     *
+     * @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(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();
+    }
+}

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

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".ui.activity.SearchActivity">
+
+</android.support.constraint.ConstraintLayout>

+ 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启动黑白屏-->

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