Browse Source

1.修改包名等
2.增加一键登录

FailedToRead 3 years ago
parent
commit
7cc4f9c566
100 changed files with 3457 additions and 1164 deletions
  1. 109 25
      .idea/codeStyles/Project.xml
  2. 9 3
      .idea/gradle.xml
  3. 50 0
      .idea/jarRepositories.xml
  4. 12 6
      app/build.gradle
  5. BIN
      app/libs/crashshield-release.aar
  6. BIN
      app/libs/phoneNumber-L-AuthSDK-2.10.1.aar
  7. 95 72
      app/src/main/AndroidManifest.xml
  8. 7 7
      app/src/main/java/com/edufound/mobile/xxt/activity/IJKPlayerActivity.java
  9. 434 0
      app/src/main/java/com/edufound/android/xyyf/activity/MainActivity.java
  10. 6 6
      app/src/main/java/com/edufound/mobile/xxt/activity/VideoActivity.java
  11. 251 0
      app/src/main/java/com/edufound/android/xyyf/adapter/WindowVideoAdapter.java
  12. 5 5
      app/src/main/java/com/edufound/mobile/xxt/application/EApplication.java
  13. 15 8
      app/src/main/java/com/edufound/mobile/xxt/base/BaseActivity.java
  14. 1 1
      app/src/main/java/com/edufound/mobile/xxt/base/BaseModel.java
  15. 1 1
      app/src/main/java/com/edufound/mobile/xxt/base/BasePersenter.java
  16. 1 1
      app/src/main/java/com/edufound/mobile/xxt/base/BaseView.java
  17. 1 1
      app/src/main/java/com/edufound/mobile/xxt/bean/FunPayDataBean.java
  18. 1 1
      app/src/main/java/com/edufound/mobile/xxt/bean/MessageDialogBean.java
  19. 1 1
      app/src/main/java/com/edufound/mobile/xxt/bean/NotificationBean.java
  20. 1 1
      app/src/main/java/com/edufound/mobile/xxt/bean/UpgradeBean.java
  21. 12 0
      app/src/main/java/com/edufound/android/xyyf/bean/WindowVideoParams.java
  22. 45 0
      app/src/main/java/com/edufound/android/xyyf/config/AppUtils.java
  23. 19 0
      app/src/main/java/com/edufound/android/xyyf/config/AuthPageConfig.java
  24. 88 0
      app/src/main/java/com/edufound/android/xyyf/config/BaseUIConfig.java
  25. 122 0
      app/src/main/java/com/edufound/android/xyyf/config/DialogLandConfig.java
  26. 106 0
      app/src/main/java/com/edufound/android/xyyf/config/DialogLandConfigNoUI.java
  27. 167 0
      app/src/main/java/com/edufound/android/xyyf/fragment/VideoFragment.java
  28. 2 2
      app/src/main/java/com/edufound/mobile/xxt/ijkplayer/application/Settings.java
  29. 1 1
      app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/FileMediaDataSource.java
  30. 1 1
      app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/IMediaController.java
  31. 1 1
      app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/IRenderView.java
  32. 8 6
      app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/IjkVideoView.java
  33. 1 1
      app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/MeasureHelper.java
  34. 1 1
      app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/SurfaceRenderView.java
  35. 1 1
      app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/TextureRenderView.java
  36. 1 1
      app/src/main/java/com/edufound/mobile/xxt/ijkplayer/services/MediaPlayerService.java
  37. 3 3
      app/src/main/java/com/edufound/mobile/xxt/interfaces/EfunboxPayInterfaces.java
  38. 107 18
      app/src/main/java/com/edufound/mobile/xxt/interfaces/JsInterfaces.java
  39. 4 4
      app/src/main/java/com/edufound/mobile/xxt/main/MainModel.java
  40. 657 0
      app/src/main/java/com/edufound/android/xyyf/main/MainPersenter.java
  41. 53 0
      app/src/main/java/com/edufound/android/xyyf/main/MainView.java
  42. 4 4
      app/src/main/java/com/edufound/mobile/xxt/pay/PayActivity.java
  43. 2 2
      app/src/main/java/com/edufound/mobile/xxt/pay/PayInit.java
  44. 8 8
      app/src/main/java/com/edufound/mobile/xxt/pay/PayPersenter.java
  45. 1 0
      app/src/main/java/com/edufound/android/xyyf/pay/ali/PayResult.java
  46. 4 4
      app/src/main/java/com/edufound/mobile/xxt/push/MipushTestActivity.java
  47. 2 2
      app/src/main/java/com/edufound/mobile/xxt/receiver/HomeKeyEventReceiver.java
  48. 5 5
      app/src/main/java/com/edufound/mobile/xxt/receiver/NetworkChangeReceiver.java
  49. 1 1
      app/src/main/java/com/edufound/mobile/xxt/util/AesUtil.java
  50. 1 1
      app/src/main/java/com/edufound/mobile/xxt/util/ContextUtil.java
  51. 1 1
      app/src/main/java/com/edufound/mobile/xxt/util/DeviceUtil.java
  52. 1 1
      app/src/main/java/com/edufound/mobile/xxt/util/DeviceUuidFactory.java
  53. 1 1
      app/src/main/java/com/edufound/mobile/xxt/util/DrawableUtil.java
  54. 2 2
      app/src/main/java/com/edufound/mobile/xxt/util/EduFoundUtil.java
  55. 1 1
      app/src/main/java/com/edufound/mobile/xxt/util/LiuHaiScreenUtil.java
  56. 1 1
      app/src/main/java/com/edufound/mobile/xxt/util/Logger.java
  57. 1 1
      app/src/main/java/com/edufound/mobile/xxt/util/NotificationUtil.java
  58. 701 0
      app/src/main/java/com/edufound/android/xyyf/util/OKHttpUtil.java
  59. 1 1
      app/src/main/java/com/edufound/mobile/xxt/util/PlayerGestureListener.java
  60. 1 1
      app/src/main/java/com/edufound/mobile/xxt/util/SPutil.java
  61. 3 3
      app/src/main/java/com/edufound/mobile/xxt/util/ShowDebugUrl.java
  62. 2 2
      app/src/main/java/com/edufound/mobile/xxt/util/ShowDevice.java
  63. 2 2
      app/src/main/java/com/edufound/mobile/xxt/util/ShowSetting.java
  64. 1 1
      app/src/main/java/com/edufound/mobile/xxt/util/ToastUtil.java
  65. 2 2
      app/src/main/java/com/edufound/mobile/xxt/util/UpdateUtil.java
  66. 2 2
      app/src/main/java/com/edufound/mobile/xxt/video/VideoAView.java
  67. 2 2
      app/src/main/java/com/edufound/mobile/xxt/video/VideoModel.java
  68. 21 20
      app/src/main/java/com/edufound/mobile/xxt/video/VideoPersenter.java
  69. 50 0
      app/src/main/java/com/edufound/android/xyyf/view/CusVideoView.java
  70. 4 4
      app/src/main/java/com/edufound/mobile/xxt/view/ErrorView.java
  71. 8 8
      app/src/main/java/com/edufound/mobile/xxt/wxapi/WXEntryActivity.java
  72. 5 5
      app/src/main/java/com/edufound/mobile/xxt/wxapi/WXPayEntryActivity.java
  73. 0 223
      app/src/main/java/com/edufound/mobile/xxt/activity/MainActivity.java
  74. 0 436
      app/src/main/java/com/edufound/mobile/xxt/main/MainPersenter.java
  75. 0 37
      app/src/main/java/com/edufound/mobile/xxt/main/MainView.java
  76. 0 1
      app/src/main/java/com/edufound/mobile/xxt/pay/ali/PayResult.java
  77. 0 147
      app/src/main/java/com/edufound/mobile/xxt/util/OKHttpUtil.java
  78. BIN
      app/src/main/res/drawable/date_bg.png
  79. BIN
      app/src/main/res/drawable/ic_launcher.jpg
  80. BIN
      app/src/main/res/drawable/icon_close.png
  81. 16 17
      app/src/main/res/layout/activity_main.xml
  82. 23 0
      app/src/main/res/layout/custom_land_dialog.xml
  83. 34 0
      app/src/main/res/layout/custom_port_dialog_action_bar.xml
  84. 107 0
      app/src/main/res/layout/date_view.xml
  85. 25 0
      app/src/main/res/layout/fragment_video.xml
  86. 1 1
      app/src/main/res/values/projectstring.xml
  87. 1 1
      app/src/main/res/xml/apk_file_paths.xml
  88. 2 2
      build.gradle
  89. 1 1
      gradle.properties
  90. 2 2
      gradle/wrapper/gradle-wrapper.properties
  91. 1 0
      push/build/.transforms/91413793ec6afb3f93b934e923b343e2.bin
  92. BIN
      push/build/.transforms/91413793ec6afb3f93b934e923b343e2/classes/classes.dex
  93. 1 0
      push/build/.transforms/ba7e55be106422172a4df981ed71154e.bin
  94. BIN
      push/build/.transforms/ba7e55be106422172a4df981ed71154e/classes/classes.dex
  95. 1 0
      push/build/.transforms/c00258f670a4fca9ef20a5f72fe3e1bf.bin
  96. BIN
      push/build/.transforms/c00258f670a4fca9ef20a5f72fe3e1bf/classes/classes.dex
  97. 1 0
      push/build/.transforms/f8d0101894b2bc9df78d9a43679efe0f.bin
  98. BIN
      push/build/.transforms/f8d0101894b2bc9df78d9a43679efe0f/classes/classes.dex
  99. 0 29
      push/build/generated/not_namespaced_r_class_sources/debug/generateDebugRFile/out/com/umeng/message/lib/R.java
  100. 0 0
      push/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/com/umeng/message/lib/R.java

+ 109 - 25
.idea/codeStyles/Project.xml

@@ -1,29 +1,113 @@
 <component name="ProjectCodeStyleConfiguration">
   <code_scheme name="Project" version="173">
-    <Objective-C-extensions>
-      <file>
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
-      </file>
-      <class>
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
-      </class>
-      <extensions>
-        <pair source="cpp" header="h" fileNamingConvention="NONE" />
-        <pair source="c" header="h" fileNamingConvention="NONE" />
-      </extensions>
-    </Objective-C-extensions>
+    <codeStyleSettings language="XML">
+      <arrangement>
+        <rules>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>xmlns:android</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>xmlns:.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*:id</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*:name</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>name</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>style</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>ANDROID_ATTRIBUTE_ORDER</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>.*</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+        </rules>
+      </arrangement>
+    </codeStyleSettings>
   </code_scheme>
 </component>

+ 9 - 3
.idea/gradle.xml

@@ -1,13 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>
-        <compositeConfiguration>
-          <compositeBuild compositeDefinitionSource="SCRIPT" />
-        </compositeConfiguration>
+        <option name="testRunner" value="PLATFORM" />
         <option name="distributionType" value="DEFAULT_WRAPPED" />
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
+        <option name="modules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/app" />
+            <option value="$PROJECT_DIR$/push" />
+          </set>
+        </option>
         <option name="resolveModulePerSourceSet" value="false" />
       </GradleProjectSettings>
     </option>

+ 50 - 0
.idea/jarRepositories.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="MavenRepo" />
+      <option name="name" value="MavenRepo" />
+      <option name="url" value="https://repo.maven.apache.org/maven2/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven" />
+      <option name="name" value="maven" />
+      <option name="url" value="https://dl.bintray.com/umsdk/release" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="BintrayJCenter" />
+      <option name="name" value="BintrayJCenter" />
+      <option name="url" value="https://jcenter.bintray.com/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="Google" />
+      <option name="name" value="Google" />
+      <option name="url" value="https://dl.google.com/dl/android/maven2/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="G:\AndroidStudio\sdk\extras\android\m2repository" />
+      <option name="name" value="G:\AndroidStudio\sdk\extras\android\m2repository" />
+      <option name="url" value="file:/G:/AndroidStudio/sdk/extras/android/m2repository/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="G:\AndroidStudio\sdk\extras\m2repository" />
+      <option name="name" value="G:\AndroidStudio\sdk\extras\m2repository" />
+      <option name="url" value="file:/G:/AndroidStudio/sdk/extras/m2repository/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="G:\AndroidStudio\sdk\extras\google\m2repository" />
+      <option name="name" value="G:\AndroidStudio\sdk\extras\google\m2repository" />
+      <option name="url" value="file:/G:/AndroidStudio/sdk/extras/google/m2repository/" />
+    </remote-repository>
+  </component>
+</project>

+ 12 - 6
app/build.gradle

@@ -17,7 +17,7 @@ android {
     }
     compileSdkVersion 28
     defaultConfig {
-        applicationId "com.edufound.mobile.xxt"
+        applicationId "com.edufound.android.xyyf"
         minSdkVersion 16
         targetSdkVersion 28
         versionCode 10000
@@ -50,14 +50,10 @@ allprojects {
 }
 dependencies {
     implementation fileTree(dir: "libs", include: ["*.jar"])
+    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
     implementation "com.android.support:appcompat-v7:28.0.0"
     implementation "android.arch.navigation:navigation-fragment:1.0.0"
     implementation "android.arch.navigation:navigation-ui:1.0.0"
-    implementation "com.android.support:design:28.0.0"
-    implementation "com.android.support.constraint:constraint-layout:1.1.3"
-    testImplementation "junit:junit:4.12"
-    androidTestImplementation "com.android.support.test:runner:1.0.2"
-    androidTestImplementation "com.android.support.test.espresso:espresso-core:3.0.2"
     // required, enough for most devices.
     api "tv.danmaku.ijk.media:ijkplayer-java:0.8.2"
     api "tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.2"
@@ -74,6 +70,7 @@ dependencies {
     api files("libs/commons-net-3.3.jar")
     api files("libs/bcprov-jdk15-136.jar")
     api "com.google.code.gson:gson:2.8.6"
+    implementation 'com.alibaba:fastjson:1.2.73'
     //微信登录、微信支付等
     implementation "com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+"
     //支付宝支付
@@ -106,5 +103,14 @@ dependencies {
     //Oppo Push通道
     implementation "com.umeng.umsdk:oppo-push:1.0.1"
     implementation "com.umeng.umsdk:oppo-umengaccs:1.0.3"
+    //cardView
+    implementation 'com.android.support:cardview-v7:28.0.0'
+    //recyclerview
+    implementation 'com.android.support:recyclerview-v7:28.0.0'
+    //wheelview
+    implementation 'com.cncoderx.wheelview:library:1.2.5'
+    //阿里一键登录和校验
+    implementation(name: 'crashshield-release', ext: 'aar')
+    implementation(name: 'phoneNumber-L-AuthSDK-2.10.1', ext: 'aar')
 }
 

BIN
app/libs/crashshield-release.aar


BIN
app/libs/phoneNumber-L-AuthSDK-2.10.1.aar


+ 95 - 72
app/src/main/AndroidManifest.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    package="com.edufound.mobile.xxt">
+        xmlns:tools="http://schemas.android.com/tools"
+        package="com.edufound.android.xyyf">
 
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.INTERNET" />
@@ -18,33 +18,33 @@
 
 
     <application
-        android:name=".application.EApplication"
-        android:allowBackup="false"
-        android:icon="@drawable/icon_mobile_256_v8"
-        android:label="@string/app_name"
-        android:networkSecurityConfig="@xml/network_security_config"
-        android:resizeableActivity="true"
-        android:supportsRtl="true"
-        android:theme="@style/NoTitle"
-        tools:replace="allowBackup">
+            android:name="com.edufound.android.xyyf.application.EApplication"
+            android:allowBackup="false"
+            android:icon="@drawable/ic_launcher"
+            android:label="@string/app_name"
+            android:networkSecurityConfig="@xml/network_security_config"
+            android:resizeableActivity="true"
+            android:supportsRtl="true"
+            android:theme="@style/NoTitle"
+            tools:replace="allowBackup">
 
         <meta-data
-            android:name="android.notch_support"
-            android:value="true" />
+                android:name="android.notch_support"
+                android:value="true" />
         <meta-data
-            android:name="android.max_aspect"
-            android:value="2.1" />
+                android:name="android.max_aspect"
+                android:value="2.1" />
         <meta-data
-            android:name="notch.config"
-            android:value="portrait|landscape" />
+                android:name="notch.config"
+                android:value="portrait|landscape" />
 
         <activity
-            android:name=".activity.MainActivity"
-            android:configChanges="orientation|keyboardHidden|screenSize"
-            android:maxAspectRatio="2.1"
-            android:resizeableActivity="true"
-            android:screenOrientation="landscape"
-            android:theme="@style/AppStartTheme">
+                android:name="com.edufound.android.xyyf.activity.MainActivity"
+                android:configChanges="orientation|keyboardHidden|screenSize"
+                android:maxAspectRatio="2.1"
+                android:resizeableActivity="true"
+                android:screenOrientation="landscape"
+                android:theme="@style/AppStartTheme">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 
@@ -53,89 +53,112 @@
 
         </activity>
         <activity
-            android:name=".activity.IJKPlayerActivity"
-            android:configChanges="orientation|screenSize"
-            android:screenOrientation="landscape"
-            android:theme="@style/NoTitle"></activity>
+                android:name="com.edufound.android.xyyf.activity.IJKPlayerActivity"
+                android:configChanges="orientation|screenSize"
+                android:screenOrientation="landscape"
+                android:theme="@style/NoTitle"></activity>
         <activity
-            android:name=".activity.VideoActivity"
-            android:configChanges="orientation|screenSize"
-            android:screenOrientation="landscape"
-            android:theme="@style/NoTitle"></activity>
+                android:name="com.edufound.android.xyyf.activity.VideoActivity"
+                android:configChanges="orientation|screenSize"
+                android:screenOrientation="landscape"
+                android:theme="@style/NoTitle"></activity>
 
 
         <!--友盟start-->
         <meta-data
-            android:name="UMENG_APPKEY"
-            android:value="" />
+                android:name="UMENG_APPKEY"
+                android:value="" />
         <meta-data
-            android:name="UMENG_CHANNEL"
-            android:value="@string/app_code_yf" />
+                android:name="UMENG_CHANNEL"
+                android:value="@string/app_code_yf" />
         <!--友盟end-->
 
         <activity
-            android:name=".pay.PayActivity"
-            android:configChanges="orientation|screenSize"
-            android:screenOrientation="portrait"
-            android:theme="@style/NoTitle"></activity>
+                android:name="com.edufound.android.xyyf.pay.PayActivity"
+                android:configChanges="orientation|screenSize"
+                android:screenOrientation="portrait"
+                android:theme="@style/NoTitle"></activity>
 
         <provider
-            android:name="android.support.v4.content.FileProvider"
-            android:authorities="com.edufound.mobile.xxt.fileprovider"
-            android:exported="false"
-            android:grantUriPermissions="true">
+                android:name="android.support.v4.content.FileProvider"
+                android:authorities="com.edufound.android.xyyf.fileprovider"
+                android:exported="false"
+                android:grantUriPermissions="true">
             <meta-data
-                android:name="android.support.FILE_PROVIDER_PATHS"
-                android:resource="@xml/apk_file_paths" />
+                    android:name="android.support.FILE_PROVIDER_PATHS"
+                    android:resource="@xml/apk_file_paths" />
         </provider>
 
         <activity
-            android:name=".wxapi.WXEntryActivity"
-            android:exported="true"
-            android:screenOrientation="landscape"
-            android:theme="@style/transcutestyle"></activity>
+                android:name="com.edufound.android.xyyf.wxapi.WXEntryActivity"
+                android:exported="true"
+                android:screenOrientation="landscape"
+                android:theme="@style/transcutestyle"></activity>
 
         <activity
-            android:name=".wxapi.WXPayEntryActivity"
-            android:exported="true"
-            android:screenOrientation="landscape"
-            android:theme="@style/transcutestyle">
+                android:name="com.edufound.android.xyyf.wxapi.WXPayEntryActivity"
+                android:exported="true"
+                android:screenOrientation="landscape"
+                android:theme="@style/transcutestyle">
 
         </activity>
 
         <activity
-            android:name="com.alipay.sdk.app.H5PayActivity"
-            android:configChanges="orientation|keyboardHidden|navigation|screenSize"
-            android:exported="false"
-            android:screenOrientation="behind"
-            android:windowSoftInputMode="adjustResize|stateHidden"></activity>
+                android:name="com.alipay.sdk.app.H5PayActivity"
+                android:configChanges="orientation|keyboardHidden|navigation|screenSize"
+                android:exported="false"
+                android:screenOrientation="behind"
+                android:windowSoftInputMode="adjustResize|stateHidden"></activity>
         <activity
-            android:name="com.alipay.sdk.app.H5AuthActivity"
-            android:configChanges="orientation|keyboardHidden|navigation"
-            android:exported="false"
-            android:screenOrientation="behind"
-            android:windowSoftInputMode="adjustResize|stateHidden"></activity>
+                android:name="com.alipay.sdk.app.H5AuthActivity"
+                android:configChanges="orientation|keyboardHidden|navigation"
+                android:exported="false"
+                android:screenOrientation="behind"
+                android:windowSoftInputMode="adjustResize|stateHidden"></activity>
 
 
         <activity
-            android:name=".push.MipushTestActivity"
-            android:exported="true"
-            android:launchMode="singleTask" />
+                android:name="com.edufound.android.xyyf.push.MipushTestActivity"
+                android:exported="true"
+                android:launchMode="singleTask" />
 
 
         <meta-data
-            android:name="com.huawei.hms.client.appid"
-            android:value="appid=xxxxxx" />
+                android:name="com.huawei.hms.client.appid"
+                android:value="appid=xxxxxx" />
 
         <!--vivo push参数声明 -->
         <!-- vivo start-->
         <meta-data
-            android:name="com.vivo.push.api_key"
-            android:value="xxxxxx" />
+                android:name="com.vivo.push.api_key"
+                android:value="xxxxxx" />
         <meta-data
-            android:name="com.vivo.push.app_id"
-            android:value="xxxxxx" />
+                android:name="com.vivo.push.app_id"
+                android:value="xxxxxx" />
         <!-- VIVO end-->
+
+
+        <!--联通电信授权页-->
+        <activity
+                android:name="com.mobile.auth.gatewayauth.LoginAuthActivity"
+                android:configChanges="orientation|keyboardHidden|screenSize"
+                android:exported="false"
+                android:launchMode="singleTop"
+                android:theme="@style/authsdk_activity_dialog" />
+        <!--协议页面webview-->
+        <activity
+                android:name="com.mobile.auth.gatewayauth.activity.AuthWebVeiwActivity"
+                android:configChanges="orientation|keyboardHidden|screenSize"
+                android:exported="false"
+                android:launchMode="singleTop"
+                android:screenOrientation="behind" />
+        <!--移动授权页-->
+        <activity
+                android:name="com.cmic.sso.sdk.activity.LoginAuthActivity"
+                android:configChanges="orientation|keyboardHidden|screenSize"
+                android:exported="false"
+                android:launchMode="singleTop" />
+
     </application>
 
 </manifest>

+ 7 - 7
app/src/main/java/com/edufound/mobile/xxt/activity/IJKPlayerActivity.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.activity;
+package com.edufound.android.xyyf.activity;
 
 import android.app.Activity;
 import android.net.Uri;
@@ -10,12 +10,12 @@ import android.view.ViewGroup;
 import android.view.WindowManager;
 import android.widget.FrameLayout;
 
-import com.edufound.mobile.xxt.R;
-import com.edufound.mobile.xxt.base.BaseActivity;
-import com.edufound.mobile.xxt.ijkplayer.media.IjkVideoView;
-import com.edufound.mobile.xxt.util.ContextUtil;
-import com.edufound.mobile.xxt.video.VideoAView;
-import com.edufound.mobile.xxt.video.VideoPersenter;
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.base.BaseActivity;
+import com.edufound.android.xyyf.ijkplayer.media.IjkVideoView;
+import com.edufound.android.xyyf.util.ContextUtil;
+import com.edufound.android.xyyf.video.VideoAView;
+import com.edufound.android.xyyf.video.VideoPersenter;
 
 import tv.danmaku.ijk.media.player.IMediaPlayer;
 import tv.danmaku.ijk.media.player.IjkMediaPlayer;

File diff suppressed because it is too large
+ 434 - 0
app/src/main/java/com/edufound/android/xyyf/activity/MainActivity.java


+ 6 - 6
app/src/main/java/com/edufound/mobile/xxt/activity/VideoActivity.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.activity;
+package com.edufound.android.xyyf.activity;
 
 import android.app.Activity;
 import android.media.MediaPlayer;
@@ -15,11 +15,11 @@ import android.view.WindowManager;
 import android.widget.FrameLayout;
 import android.widget.VideoView;
 
-import com.edufound.mobile.xxt.R;
-import com.edufound.mobile.xxt.base.BaseActivity;
-import com.edufound.mobile.xxt.util.ContextUtil;
-import com.edufound.mobile.xxt.video.VideoAView;
-import com.edufound.mobile.xxt.video.VideoPersenter;
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.base.BaseActivity;
+import com.edufound.android.xyyf.util.ContextUtil;
+import com.edufound.android.xyyf.video.VideoAView;
+import com.edufound.android.xyyf.video.VideoPersenter;
 
 public class VideoActivity extends BaseActivity implements VideoAView {
 

+ 251 - 0
app/src/main/java/com/edufound/android/xyyf/adapter/WindowVideoAdapter.java

@@ -0,0 +1,251 @@
+package com.edufound.android.xyyf.adapter;
+
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
+import android.media.MediaMetadataRetriever;
+import android.media.ThumbnailUtils;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Handler;
+import android.os.Message;
+import android.provider.MediaStore;
+import android.support.annotation.NonNull;
+import android.support.v7.widget.CardView;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.ijkplayer.media.IjkVideoView;
+import com.edufound.android.xyyf.util.Logger;
+import com.edufound.android.xyyf.video.VideoPersenter;
+
+import java.util.HashMap;
+
+import tv.danmaku.ijk.media.player.IMediaPlayer;
+
+public class WindowVideoAdapter extends RecyclerView.Adapter<WindowVideoAdapter.WindowVideoApapterHolder> {
+    private LayoutInflater mLayoutInflater;
+    private Context mContext;
+    private VideoPersenter.VideoJsonBean[] mVideoBean;
+    private HashMap<String, Drawable> mVideoBitmap;
+    Message holderMsg;
+
+    public WindowVideoAdapter(Context context, VideoPersenter.VideoJsonBean[] beans, HashMap<String, Drawable> map) {
+        mContext = context;
+        mVideoBean = beans;
+        mVideoBitmap = map;
+        mLayoutInflater = LayoutInflater.from(context);
+//        loadVideoBitmap();
+    }
+
+
+    @NonNull
+    @Override
+    public WindowVideoApapterHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+        Logger.e("WindowVideoApapterHolder");
+        return new WindowVideoApapterHolder(LayoutInflater.from(mContext).inflate(R.layout.fragment_video, viewGroup, false));
+    }
+
+    @Override
+    public void onViewAttachedToWindow(@NonNull WindowVideoApapterHolder holder) {
+        super.onViewAttachedToWindow(holder);
+        holder.showImage();
+        return;
+    }
+
+    @Override
+    public void onViewDetachedFromWindow(@NonNull WindowVideoApapterHolder holder) {
+        holder.mVideoView.stopPlayback();
+//        holder.mVideoView.seekTo(0);
+        return;
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull final WindowVideoApapterHolder holder, int i) {
+        try {
+            Logger.e("onBindViewHolder");
+//            String url = AesUtil.Decrypt(mVideoBean[i].videourl);
+            final String url = mVideoBean[i].videourl;
+//            String url = "http://efunimgs.ai160.com/ott/test/002tPr2Xlx07oP7B4ro40104120022hP0k010.mp4";
+//            String url = "https://www.apple.com/105/media/cn/iphone-x/2017/01df5b43-28e4-4848-bf20-490c34a926a7/films/feature/iphone-x-feature-cn-20170912_1280x720h.mp4";
+            holder.mVideoView.setVideoURI(Uri.parse(url));
+            Logger.e("url:" + url);
+            holder.mVideoName = mVideoBean[i].videoname;
+            holder.url = url;
+            holder.mImageFrame.setBackground(mVideoBitmap.get(mVideoBean[i].videoid));
+            holder.mImageFrame.setTag(mVideoBitmap.get(mVideoBean[i].videoid));
+//            if (holder.mImageFrame.getTag() != null) {
+//                holder.mImageFrame.setBackground((Drawable) holder.mImageFrame.getTag());
+//            } else {
+//                new Thread() {
+//                    @Override
+//                    public void run() {
+//                        super.run();
+//                        Drawable drawable = new BitmapDrawable(createVideoThumbnail(url, 200, 200));
+//                        holder.mImageFrame.setTag(drawable);
+//                        holderMsg = new Message();
+//                        holderMsg.what = 2;
+//                        holderMsg.obj = holder;
+//                        handler.sendMessage(holderMsg);
+//                    }
+//                }.start();
+//            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
+    public Bitmap createVideoThumbnail(String url, int width, int height) {
+        Bitmap bitmap = null;
+        MediaMetadataRetriever retriever = new MediaMetadataRetriever();
+        int kind = MediaStore.Video.Thumbnails.MINI_KIND;
+        try {
+            if (Build.VERSION.SDK_INT >= 14) {
+                retriever.setDataSource(url, new HashMap<String, String>());
+            } else {
+                retriever.setDataSource(url);
+            }
+            bitmap = retriever.getFrameAtTime(1000);
+        } catch (IllegalArgumentException ex) {
+            // Assume this is a corrupt video file
+        } catch (RuntimeException ex) {
+            // Assume this is a corrupt video file.
+        } finally {
+            try {
+                retriever.release();
+            } catch (RuntimeException ex) {
+                // Ignore failures while cleaning up.
+            }
+        }
+        if (kind == MediaStore.Images.Thumbnails.MICRO_KIND && bitmap != null) {
+            bitmap = ThumbnailUtils.extractThumbnail(bitmap, width, height,
+                    ThumbnailUtils.OPTIONS_RECYCLE_INPUT);
+        }
+        return bitmap;
+    }
+
+    Handler handler = new Handler(new Handler.Callback() {
+        @Override
+        public boolean handleMessage(Message msg) {
+            switch (msg.what) {
+                case 1:
+//                    WindowVideoApapterHolder holder = (WindowVideoApapterHolder) msg.obj;
+//                    if (holder.mImageFrame.getTag() != null) {
+//                        holder.mImageFrame.setBackground((Drawable) holder.mImageFrame.getTag());
+//                    } else {
+//                        Drawable drawable = new BitmapDrawable(createVideoThumbnail(holder.url, 200, 200));
+//                        holder.mImageFrame.setTag(drawable);
+//                        holder.mImageFrame.setBackground(drawable);
+//                    }
+                    break;
+                case 2:
+                    WindowVideoApapterHolder holder = (WindowVideoApapterHolder) msg.obj;
+                    Logger.e("设置--" + holder.mVideoName + "---图片");
+                    holder.mImageFrame.setBackground((Drawable) holder.mImageFrame.getTag());
+                    break;
+            }
+            return false;
+        }
+    });
+
+
+    @Override
+    public int getItemCount() {
+        return mVideoBean.length;
+    }
+
+    public class WindowVideoApapterHolder extends RecyclerView.ViewHolder {
+
+        String url;
+        CardView mVideoCardView;
+        IjkVideoView mVideoView;
+        ImageView mImageFrame;
+        String mVideoName;
+
+
+        WindowVideoApapterHolder(View itemView) {
+            super(itemView);
+            mVideoCardView = itemView.findViewById(R.id.fragment_cardview);
+            mVideoCardView.setRadius(50);
+            mVideoView = itemView.findViewById(R.id.fragment_video);
+            mVideoView.setRender(IjkVideoView.RENDER_TEXTURE_VIEW);
+            mImageFrame = itemView.findViewById(R.id.fragment_image_frame);
+            mImageFrame.setVisibility(View.GONE);
+            mVideoView.setOnPreparedListener(new IMediaPlayer.OnPreparedListener() {
+                @Override
+                public void onPrepared(IMediaPlayer mp) {
+                    Logger.e("加载--" + mVideoName + "--完成了");
+//                    showImage();
+//                    mVideoView.start();
+//                    mVideoView.pause();
+//                    handler.sendEmptyMessageDelayed(1, 0);
+                }
+            });
+            mVideoView.setOnErrorListener(new IMediaPlayer.OnErrorListener() {
+                @Override
+                public boolean onError(IMediaPlayer mp, int what, int extra) {
+                    Logger.e("WindowVideoAdapter---WindowVideoApapterHolder-onError");
+                    return false;
+                }
+            });
+            mVideoView.setOnCompletionListener(new IMediaPlayer.OnCompletionListener() {
+                @Override
+                public void onCompletion(IMediaPlayer mp) {
+                    Logger.e("WindowVideoAdapter---WindowVideoApapterHolder-onCompletion");
+                }
+            });
+        }
+
+        Handler handler = new Handler(new Handler.Callback() {
+            @Override
+            public boolean handleMessage(Message msg) {
+                switch (msg.what) {
+                    case 1:
+                        if (mVideoView.isPlaying() == false) {
+                            mVideoView.start();
+                        }
+                        if (mVideoView.getCurrentPosition() > 500) {
+                            mImageFrame.setVisibility(View.GONE);
+                        } else {
+                            handler.sendEmptyMessageDelayed(1, 0);
+                        }
+
+                        break;
+                }
+                return false;
+            }
+        });
+
+        public void sendHanlder(int what) {
+            handler.sendEmptyMessage(what);
+        }
+
+        public void start() {
+            Logger.e("WindowVideoAdapter---WindowVideoApapterHolder--start");
+            mVideoView.start();
+        }
+
+        public void stop() {
+            Logger.e("WindowVideoAdapter---WindowVideoApapterHolder--stop");
+            mVideoView.stopPlayback();
+        }
+
+        public void hideImage() {
+            Logger.e("WindowVideoAdapter---WindowVideoApapterHolder--hideImage");
+//            mImageFrame.setVisibility(View.GONE);
+            handler.sendEmptyMessageDelayed(1, 1000);
+        }
+
+        public void showImage() {
+            Logger.e("WindowVideoAdapter---WindowVideoApapterHolder--showImage");
+            mImageFrame.setVisibility(View.VISIBLE);
+        }
+    }
+}

+ 5 - 5
app/src/main/java/com/edufound/mobile/xxt/application/EApplication.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.application;
+package com.edufound.android.xyyf.application;
 
 import android.app.Activity;
 import android.app.ActivityManager;
@@ -7,10 +7,10 @@ import android.content.Context;
 import android.content.Intent;
 import android.support.annotation.Nullable;
 
-import com.edufound.mobile.xxt.R;
-import com.edufound.mobile.xxt.pay.PayInit;
-import com.edufound.mobile.xxt.util.ContextUtil;
-import com.edufound.mobile.xxt.util.SPutil;
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.pay.PayInit;
+import com.edufound.android.xyyf.util.ContextUtil;
+import com.edufound.android.xyyf.util.SPutil;
 import com.umeng.commonsdk.UMConfigure;
 
 import org.android.agoo.huawei.HuaWeiRegister;

+ 15 - 8
app/src/main/java/com/edufound/mobile/xxt/base/BaseActivity.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.base;
+package com.edufound.android.xyyf.base;
 
 import android.app.Activity;
 import android.app.ActivityManager;
@@ -13,13 +13,14 @@ import android.view.KeyEvent;
 import android.view.View;
 import android.view.Window;
 
-import com.edufound.mobile.xxt.receiver.HomeKeyEventReceiver;
-import com.edufound.mobile.xxt.receiver.NetworkChangeReceiver;
-import com.edufound.mobile.xxt.util.EduFoundUtil;
-import com.edufound.mobile.xxt.util.LiuHaiScreenUtil;
-import com.edufound.mobile.xxt.util.Logger;
-import com.edufound.mobile.xxt.util.ShowDevice;
-import com.edufound.mobile.xxt.util.ShowSetting;
+import com.edufound.android.xyyf.receiver.HomeKeyEventReceiver;
+import com.edufound.android.xyyf.receiver.NetworkChangeReceiver;
+import com.edufound.android.xyyf.util.EduFoundUtil;
+import com.edufound.android.xyyf.util.LiuHaiScreenUtil;
+import com.edufound.android.xyyf.util.Logger;
+import com.edufound.android.xyyf.util.ShowDevice;
+import com.edufound.android.xyyf.util.ShowSetting;
+import com.google.gson.Gson;
 import com.umeng.analytics.MobclickAgent;
 import com.umeng.message.PushAgent;
 
@@ -31,11 +32,13 @@ public class BaseActivity extends Activity implements BaseView {
     NetworkChangeReceiver mNetworkReceiver;
     Window mWindow;
     Activity activity;
+    Gson mGson;
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         activity = this;
+        mGson = new Gson();
         mWindow = getWindow();
         mWindow.getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
             @Override
@@ -51,6 +54,10 @@ public class BaseActivity extends Activity implements BaseView {
         initVew();
     }
 
+    public Gson getmGson() {
+        return mGson;
+    }
+
     @Override
     protected void onStart() {
         super.onStart();

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/base/BaseModel.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.base;
+package com.edufound.android.xyyf.base;
 
 public interface BaseModel {
 

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/base/BasePersenter.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.base;
+package com.edufound.android.xyyf.base;
 
 public interface BasePersenter {
     void loadData();

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/base/BaseView.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.base;
+package com.edufound.android.xyyf.base;
 
 import android.app.Activity;
 

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/bean/FunPayDataBean.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.bean;
+package com.edufound.android.xyyf.bean;
 
 public class FunPayDataBean {
     public String accountName;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/bean/MessageDialogBean.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.bean;
+package com.edufound.android.xyyf.bean;
 
 public class MessageDialogBean {
     public String title;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/bean/NotificationBean.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.bean;
+package com.edufound.android.xyyf.bean;
 
 public class NotificationBean {
     private String display_type;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/bean/UpgradeBean.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.bean;
+package com.edufound.android.xyyf.bean;
 
 public class UpgradeBean {
     public String title;

+ 12 - 0
app/src/main/java/com/edufound/android/xyyf/bean/WindowVideoParams.java

@@ -0,0 +1,12 @@
+package com.edufound.android.xyyf.bean;
+
+public class WindowVideoParams {
+    public int view_width;
+    public int view_height;
+    public int top;
+    public int left;
+    public String play_jsons;
+    public int play_index;
+    public int play_type;
+    public String moduleType;
+}

+ 45 - 0
app/src/main/java/com/edufound/android/xyyf/config/AppUtils.java

@@ -0,0 +1,45 @@
+package com.edufound.android.xyyf.config;
+
+import android.content.Context;
+import android.util.DisplayMetrics;
+import android.view.WindowManager;
+
+public class AppUtils {
+    public static int dp2px(Context context, float dipValue) {
+        try {
+            final float scale = context.getResources().getDisplayMetrics().density;
+            return (int) (dipValue * scale + 0.5f);
+        } catch (Exception e) {
+            return (int) dipValue;
+        }
+    }
+
+    public static int px2dp(Context context, float px) {
+        try {
+            final float scale = context.getResources().getDisplayMetrics().density;
+            return (int) (px / scale + 0.5f);
+        } catch (Exception e) {
+            return (int) px;
+        }
+    }
+
+    public static int getPhoneWidthPixels(Context context) {
+        WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
+        DisplayMetrics var2 = new DisplayMetrics();
+        if (wm != null) {
+            wm.getDefaultDisplay().getMetrics(var2);
+        }
+
+        return var2.widthPixels;
+    }
+
+    public static int getPhoneHeightPixels(Context context) {
+        WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
+        DisplayMetrics var2 = new DisplayMetrics();
+        if (wm != null) {
+            wm.getDefaultDisplay().getMetrics(var2);
+        }
+
+        return var2.heightPixels;
+    }
+}

+ 19 - 0
app/src/main/java/com/edufound/android/xyyf/config/AuthPageConfig.java

@@ -0,0 +1,19 @@
+package com.edufound.android.xyyf.config;
+
+public interface AuthPageConfig {
+
+    /**
+     * 配置授权页样式
+     */
+    void configAuthPage();
+
+    /**
+     * android8.0兼容
+     */
+    void onResume();
+
+    /**
+     * 释放sdk内部引用,防止内存泄漏
+     */
+    void release();
+}

+ 88 - 0
app/src/main/java/com/edufound/android/xyyf/config/BaseUIConfig.java

@@ -0,0 +1,88 @@
+package com.edufound.android.xyyf.config;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.pm.ActivityInfo;
+import android.graphics.Color;
+import android.util.TypedValue;
+import android.view.Surface;
+import android.view.View;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.edufound.android.xyyf.main.MainView;
+import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper;
+
+import static com.edufound.android.xyyf.config.AppUtils.dp2px;
+
+public abstract class BaseUIConfig implements AuthPageConfig {
+    public Activity mActivity;
+    public Context mContext;
+    public PhoneNumberAuthHelper mAuthHelper;
+    public int mScreenWidthDp;
+    public int mScreenHeightDp;
+
+    public static AuthPageConfig init(int type, Activity activity, PhoneNumberAuthHelper authHelper, MainView view) {
+        switch (type) {
+            case 0:
+                return new DialogLandConfig(activity, authHelper, view);
+            case 1:
+                return new DialogLandConfigNoUI(activity, authHelper, view);
+        }
+        return null;
+    }
+
+    public BaseUIConfig(Activity activity, PhoneNumberAuthHelper authHelper, MainView view) {
+        mActivity = activity;
+        mContext = activity.getApplicationContext();
+        mAuthHelper = authHelper;
+    }
+
+    protected void updateScreenSize(int authPageScreenOrientation) {
+        int screenHeightDp = AppUtils.px2dp(mContext, AppUtils.getPhoneHeightPixels(mContext));
+        int screenWidthDp = AppUtils.px2dp(mContext, AppUtils.getPhoneWidthPixels(mContext));
+        int rotation = mActivity.getWindowManager().getDefaultDisplay().getRotation();
+        if (authPageScreenOrientation == ActivityInfo.SCREEN_ORIENTATION_BEHIND) {
+            authPageScreenOrientation = mActivity.getRequestedOrientation();
+        }
+        if (authPageScreenOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
+                || authPageScreenOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
+                || authPageScreenOrientation == ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE) {
+            rotation = Surface.ROTATION_90;
+        } else if (authPageScreenOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
+                || authPageScreenOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT
+                || authPageScreenOrientation == ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT) {
+            rotation = Surface.ROTATION_180;
+        }
+        switch (rotation) {
+            case Surface.ROTATION_0:
+            case Surface.ROTATION_180:
+                mScreenWidthDp = screenWidthDp;
+                mScreenHeightDp = screenHeightDp;
+                break;
+            case Surface.ROTATION_90:
+            case Surface.ROTATION_270:
+                mScreenWidthDp = screenHeightDp;
+                mScreenHeightDp = screenWidthDp;
+                break;
+            default:
+                break;
+        }
+    }
+
+
+    /**
+     * 在横屏APP弹竖屏一键登录页面或者竖屏APP弹横屏授权页时处理特殊逻辑
+     * Android8.0只能启动SCREEN_ORIENTATION_BEHIND模式的Activity
+     */
+    public void onResume() {
+
+    }
+
+    public void release() {
+        mAuthHelper.setAuthListener(null);
+        mAuthHelper.setUIClickListener(null);
+        mAuthHelper.removeAuthRegisterViewConfig();
+        mAuthHelper.removeAuthRegisterXmlConfig();
+    }
+}

+ 122 - 0
app/src/main/java/com/edufound/android/xyyf/config/DialogLandConfig.java

@@ -0,0 +1,122 @@
+package com.edufound.android.xyyf.config;
+
+import android.app.Activity;
+import android.content.pm.ActivityInfo;
+import android.os.Build;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.View;
+import android.widget.FrameLayout;
+import android.widget.RelativeLayout;
+
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.interfaces.JsInterfaces;
+import com.edufound.android.xyyf.main.MainView;
+import com.mobile.auth.gatewayauth.AuthRegisterXmlConfig;
+import com.mobile.auth.gatewayauth.AuthUIConfig;
+import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper;
+import com.mobile.auth.gatewayauth.ui.AbstractPnsViewDelegate;
+
+public class DialogLandConfig extends BaseUIConfig {
+
+    private int mOldScreenOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;
+
+    MainView mView;
+
+    public DialogLandConfig(Activity activity, PhoneNumberAuthHelper authHelper, MainView view) {
+        super(activity, authHelper, view);
+        mView = view;
+    }
+
+    @Override
+    public void configAuthPage() {
+        mAuthHelper.removeAuthRegisterXmlConfig();
+        mAuthHelper.removeAuthRegisterViewConfig();
+        int authPageOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
+        if (Build.VERSION.SDK_INT == 26) {
+            mOldScreenOrientation = mActivity.getRequestedOrientation();
+            mActivity.setRequestedOrientation(authPageOrientation);
+            authPageOrientation = ActivityInfo.SCREEN_ORIENTATION_BEHIND;
+        }
+        updateScreenSize(authPageOrientation);
+        final int dialogWidth = (int) (mScreenWidthDp * 0.9);
+        final int dialogHeight = (int) (mScreenHeightDp * 0.4);
+
+        //sdk默认控件的区域是marginTop50dp
+        int designHeight = dialogHeight - 60;
+        int unit = designHeight / 10;
+        int logBtnHeight = (int) (unit * 1.2);
+        final int logBtnOffsetY = unit * 3;
+
+        mAuthHelper.addAuthRegisterXmlConfig(new AuthRegisterXmlConfig.Builder()
+                .setLayout(R.layout.custom_land_dialog, new AbstractPnsViewDelegate() {
+                    @Override
+                    public void onViewCreated(View view) {
+                        findViewById(R.id.tv_title).setVisibility(View.VISIBLE);
+                        View close = findViewById(R.id.btn_close);
+                        close.setOnClickListener(new View.OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                mAuthHelper.quitLoginPage();
+                            }
+                        });
+                        int iconTopMargin = AppUtils.dp2px(getContext(), logBtnOffsetY + 130);
+                        View iconContainer = findViewById(R.id.container_icon);
+                        RelativeLayout.LayoutParams iconLayout = (RelativeLayout.LayoutParams) iconContainer.getLayoutParams();
+                        iconLayout.topMargin = iconTopMargin;
+                        View phoneNumLogin = findViewById(R.id.changePhoneNumLogin);
+                        phoneNumLogin.setOnClickListener(new View.OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                Log.e("PhoneNumberAuthDemo", "-----------切换手机号登录------------");
+//                                mView.getPersenter().getJsInterfaces().NOUILOGIN();
+                                mView.loadJSMehtodPost("changePhoneLogin()");
+                                mAuthHelper.quitLoginPage();
+                            }
+                        });
+
+
+//                        iconLayout.width = AppUtils.dp2px(getContext(), dialogWidth / 2 - 60);
+                    }
+                }).build());
+        showAllUi(dialogWidth, dialogHeight, authPageOrientation);
+    }
+
+
+    void showAllUi(int dialogWidth, int dialogHeight, int authPageOrientation) {
+        mAuthHelper.setAuthUIConfig(new AuthUIConfig.Builder()
+                .setNavHidden(true)
+                .setCheckboxHidden(false)
+                .setLogoHidden(true)
+                .setSloganHidden(true)
+                .setSwitchAccHidden(true)
+//                .setNumberFieldOffsetX(60)
+                .setNumberLayoutGravity(Gravity.CENTER)
+                .setNumberSize(24)
+                .setNumFieldOffsetY(20)
+                .setLogBtnOffsetY(80)
+                .setPrivacyOffsetY_B(10)
+                .setLogBtnMarginLeftAndRight(20)
+                .setLogBtnWidth(300)
+                .setLogBtnLayoutGravity(Gravity.CENTER)
+                .setLogBtnHeight(51)
+//                .setLogBtnBackgroundPath("login_btn_bg")
+                .setDialogWidth(dialogWidth)
+                .setDialogHeight(dialogHeight)
+                .setDialogBottom(false)
+//                .setAuthPageActIn("in_activity", "out_activity")
+//                .setAuthPageActOut("in_activity", "out_activity")
+                .setProtocolGravity(Gravity.CENTER_VERTICAL)
+                .setScreenOrientation(authPageOrientation)
+                .create());
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        if (mOldScreenOrientation != mActivity.getRequestedOrientation()) {
+            mActivity.setRequestedOrientation(mOldScreenOrientation);
+        }
+    }
+
+}

+ 106 - 0
app/src/main/java/com/edufound/android/xyyf/config/DialogLandConfigNoUI.java

@@ -0,0 +1,106 @@
+package com.edufound.android.xyyf.config;
+
+import android.app.Activity;
+import android.content.pm.ActivityInfo;
+import android.os.Build;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.View;
+import android.widget.FrameLayout;
+import android.widget.RelativeLayout;
+
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.main.MainView;
+import com.mobile.auth.gatewayauth.AuthRegisterXmlConfig;
+import com.mobile.auth.gatewayauth.AuthUIConfig;
+import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper;
+import com.mobile.auth.gatewayauth.ui.AbstractPnsViewDelegate;
+
+public class DialogLandConfigNoUI extends BaseUIConfig {
+
+    private int mOldScreenOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;
+    MainView mView;
+
+    public DialogLandConfigNoUI(Activity activity, PhoneNumberAuthHelper authHelper, MainView view) {
+        super(activity, authHelper, view);
+        mView = view;
+    }
+
+
+    @Override
+    public void configAuthPage() {
+        mAuthHelper.removeAuthRegisterXmlConfig();
+        mAuthHelper.removeAuthRegisterViewConfig();
+        int authPageOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
+        if (Build.VERSION.SDK_INT == 26) {
+            mOldScreenOrientation = mActivity.getRequestedOrientation();
+            mActivity.setRequestedOrientation(authPageOrientation);
+            authPageOrientation = ActivityInfo.SCREEN_ORIENTATION_BEHIND;
+        }
+        updateScreenSize(authPageOrientation);
+        final int dialogWidth = (int) (mScreenWidthDp * 0.9);
+        final int dialogHeight = (int) (mScreenHeightDp * 0.4);
+
+        //sdk默认控件的区域是marginTop50dp
+        int designHeight = dialogHeight - 60;
+        int unit = designHeight / 10;
+        int logBtnHeight = (int) (unit * 1.2);
+        final int logBtnOffsetY = unit * 3;
+
+        mAuthHelper.addAuthRegisterXmlConfig(new AuthRegisterXmlConfig.Builder()
+                .setLayout(R.layout.custom_land_dialog, new AbstractPnsViewDelegate() {
+                    @Override
+                    public void onViewCreated(View view) {
+                        findViewById(R.id.tv_title).setVisibility(View.VISIBLE);
+                        findViewById(R.id.btn_close).setOnClickListener(new View.OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                mAuthHelper.quitLoginPage();
+                            }
+                        });
+                        int iconTopMargin = AppUtils.dp2px(getContext(), logBtnOffsetY + 130);
+                        View iconContainer = findViewById(R.id.container_icon);
+                        RelativeLayout.LayoutParams iconLayout = (RelativeLayout.LayoutParams) iconContainer.getLayoutParams();
+                        iconLayout.topMargin = iconTopMargin;
+                        View phoneNumLogin = findViewById(R.id.changePhoneNumLogin);
+//                        final FrameLayout changePhoneUi = (FrameLayout) findViewById(R.id.changePhoneFrame);
+//                        phoneNumLogin.setOnClickListener(new View.OnClickListener() {
+//                            @Override
+//                            public void onClick(View v) {
+//                                Log.e("PhoneNumberAuthDemo", "-----------NOUI---切换手机号登录------------");
+//                                mAuthHelper.quitLoginPage();
+//
+//                            }
+//                        });
+
+
+//                        iconLayout.width = AppUtils.dp2px(getContext(), dialogWidth / 2 - 60);
+                    }
+                }).build());
+        mAuthHelper.setAuthUIConfig(new AuthUIConfig.Builder()
+                .setNavHidden(true)
+                .setCheckboxHidden(true)
+                .setLogoHidden(true)
+                .setSloganHidden(true)
+                .setNavReturnHidden(true)
+                .setStatusBarHidden(true)
+                .setSwitchAccHidden(true)
+                .setLogBtnToastHidden(true)
+                .setDialogWidth(dialogWidth)
+                .setDialogHeight(dialogHeight)
+                .setDialogBottom(false)
+                .setNumberSize(0)
+                .setPrivacyTextSize(0)
+                .create());
+    }
+
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        if (mOldScreenOrientation != mActivity.getRequestedOrientation()) {
+            mActivity.setRequestedOrientation(mOldScreenOrientation);
+        }
+    }
+
+}

+ 167 - 0
app/src/main/java/com/edufound/android/xyyf/fragment/VideoFragment.java

@@ -0,0 +1,167 @@
+package com.edufound.android.xyyf.fragment;
+
+import android.app.Fragment;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v7.widget.CardView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.video.VideoAView;
+import com.edufound.android.xyyf.video.VideoPersenter;
+import com.edufound.android.xyyf.view.CusVideoView;
+import com.google.gson.Gson;
+
+public class VideoFragment extends Fragment implements VideoAView {
+
+    FrameLayout mFragmentView;
+    CusVideoView mVideoView;
+    CardView mCardView;
+    VideoPersenter mPersenter;
+    private Gson mGson;
+    int mPlayIndex;
+    int mPlayType;
+    String mPlayingId;
+    String mPlayNeedPost;
+    String mPlayerModuleType;
+    private VideoPersenter.VideoJsonBean[] mVideoBean;
+    int mPlayStartTime;
+    //单独播放,播放完成直接关闭
+    final int TYPE_SEPARATELY_PLAY = 0;
+    //单独循环播放,一直循环
+    final int TYPE_SINGLECYCLE_PLAY = 1;
+    //列表播放,播放完列表关闭
+    final int TYPE_LIST_PLAY = 2;
+    String SINGLECYCLE_URL = "";
+
+    @Override
+    public void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        initOther();
+    }
+
+    @Nullable
+    @Override
+    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
+        mFragmentView = (FrameLayout) inflater.inflate(R.layout.fragment_video, null);
+        mCardView = mFragmentView.findViewById(R.id.fragment_cardview);
+        mVideoView = mFragmentView.findViewById(R.id.fragment_video);
+        mVideoView.setVideoURI(Uri.parse("https://www.apple.com/105/media/cn/iphone-x/2017/01df5b43-28e4-4848-bf20-490c34a926a7/films/feature/iphone-x-feature-cn-20170912_1280x720h.mp4"));
+        mVideoView.start();
+        try {
+//            initVideo();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return mFragmentView;
+    }
+
+    @Nullable
+    @Override
+    public View getView() {
+        return mFragmentView;
+    }
+
+    void initOther() {
+        mGson = new Gson();
+        mPersenter = new VideoPersenter(this);
+    }
+
+    public CardView getmCardView() {
+        return mCardView;
+    }
+
+    void initVideo() throws Exception {
+        Bundle bundle = getArguments();
+        Intent intent = new Intent();
+        intent.putExtra("play_jsons", bundle.getString("play_jsons"));
+        intent.putExtra("play_index", bundle.getInt("play_index", 0));
+        intent.putExtra("play_type", bundle.getInt("play_type", 0));
+        intent.putExtra("play_moduletype", bundle.getString("play_moduletype"));
+        mPersenter.loadVideo(intent);
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        mFragmentView = null;
+        mVideoView.stopPlayback();
+        mVideoView.resume();
+        mVideoView = null;
+    }
+
+    @Override
+    public void setVideoUri(Uri uri) {
+
+    }
+
+    @Override
+    public void start() {
+
+    }
+
+    @Override
+    public void pause() {
+
+    }
+
+    @Override
+    public void stop() {
+
+    }
+
+    @Override
+    public void releaseVideo() {
+
+    }
+
+    @Override
+    public void seek(int seek) {
+
+    }
+
+    @Override
+    public boolean isPlaying() {
+        return false;
+    }
+
+    @Override
+    public int getDuration() {
+        return 0;
+    }
+
+    @Override
+    public int getCurrent() {
+        return 0;
+    }
+
+    @Override
+    public void activityFinish() {
+
+    }
+
+    @Override
+    public void showData(String text) {
+
+    }
+
+    @Override
+    public void DisconnNetWork() {
+
+    }
+
+    @Override
+    public void ConnNeWork() {
+
+    }
+}

+ 2 - 2
app/src/main/java/com/edufound/mobile/xxt/ijkplayer/application/Settings.java

@@ -15,13 +15,13 @@
  * limitations under the License.
  */
 
-package com.edufound.mobile.xxt.ijkplayer.application;
+package com.edufound.android.xyyf.ijkplayer.application;
 
 import android.content.Context;
 import android.content.SharedPreferences;
 import android.preference.PreferenceManager;
 
-import com.edufound.mobile.xxt.R;
+import com.edufound.android.xyyf.R;
 
 public class Settings {
     private Context mAppContext;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/FileMediaDataSource.java

@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package com.edufound.mobile.xxt.ijkplayer.media;
+package com.edufound.android.xyyf.ijkplayer.media;
 
 import java.io.File;
 import java.io.IOException;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/IMediaController.java

@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package com.edufound.mobile.xxt.ijkplayer.media;
+package com.edufound.android.xyyf.ijkplayer.media;
 
 import android.view.View;
 import android.widget.MediaController;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/IRenderView.java

@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package com.edufound.mobile.xxt.ijkplayer.media;
+package com.edufound.android.xyyf.ijkplayer.media;
 
 import android.graphics.SurfaceTexture;
 import android.support.annotation.NonNull;

+ 8 - 6
app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/IjkVideoView.java

@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package com.edufound.mobile.xxt.ijkplayer.media;
+package com.edufound.android.xyyf.ijkplayer.media;
 
 import android.annotation.TargetApi;
 import android.content.Context;
@@ -37,9 +37,9 @@ import android.widget.MediaController;
 import android.widget.TextView;
 import android.widget.Toast;
 
-import com.edufound.mobile.xxt.R;
-import com.edufound.mobile.xxt.ijkplayer.application.Settings;
-import com.edufound.mobile.xxt.ijkplayer.services.MediaPlayerService;
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.ijkplayer.application.Settings;
+import com.edufound.android.xyyf.ijkplayer.services.MediaPlayerService;
 
 import java.io.File;
 import java.io.IOException;
@@ -150,6 +150,7 @@ public class IjkVideoView extends FrameLayout implements MediaController.MediaPl
     // REMOVED: onInitializeAccessibilityNodeInfo
     // REMOVED: resolveAdjustedSize
 
+
     private void initVideoView(Context context) {
         mAppContext = context.getApplicationContext();
         mSettings = new Settings(mAppContext);
@@ -919,11 +920,12 @@ public class IjkVideoView extends FrameLayout implements MediaController.MediaPl
             IRenderView.AR_ASPECT_FIT_PARENT,
             IRenderView.AR_ASPECT_FILL_PARENT,
             IRenderView.AR_ASPECT_WRAP_CONTENT,
-            // IRenderView.AR_MATCH_PARENT,
+            IRenderView.AR_MATCH_PARENT,
             IRenderView.AR_16_9_FIT_PARENT,
             IRenderView.AR_4_3_FIT_PARENT};
     private int mCurrentAspectRatioIndex = 0;
-    private int mCurrentAspectRatio = s_allAspectRatio[0];
+    //設置渲染模式为全屏比例
+    private int mCurrentAspectRatio = s_allAspectRatio[3];
 
     public int toggleAspectRatio() {
         mCurrentAspectRatioIndex++;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/MeasureHelper.java

@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package com.edufound.mobile.xxt.ijkplayer.media;
+package com.edufound.android.xyyf.ijkplayer.media;
 
 import android.view.View;
 

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/SurfaceRenderView.java

@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package com.edufound.mobile.xxt.ijkplayer.media;
+package com.edufound.android.xyyf.ijkplayer.media;
 
 import android.annotation.TargetApi;
 import android.content.Context;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/ijkplayer/media/TextureRenderView.java

@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package com.edufound.mobile.xxt.ijkplayer.media;
+package com.edufound.android.xyyf.ijkplayer.media;
 
 import android.annotation.TargetApi;
 import android.content.Context;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/ijkplayer/services/MediaPlayerService.java

@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package com.edufound.mobile.xxt.ijkplayer.services;
+package com.edufound.android.xyyf.ijkplayer.services;
 
 import android.app.Service;
 import android.content.Context;

+ 3 - 3
app/src/main/java/com/edufound/mobile/xxt/interfaces/EfunboxPayInterfaces.java

@@ -1,10 +1,10 @@
-package com.edufound.mobile.xxt.interfaces;
+package com.edufound.android.xyyf.interfaces;
 
 import android.content.Intent;
 import android.webkit.JavascriptInterface;
 
-import com.edufound.mobile.xxt.main.MainView;
-import com.edufound.mobile.xxt.pay.PayActivity;
+import com.edufound.android.xyyf.main.MainView;
+import com.edufound.android.xyyf.pay.PayActivity;
 
 public class EfunboxPayInterfaces {
     public static final int START_PAY_DB = 0x3211;

+ 107 - 18
app/src/main/java/com/edufound/mobile/xxt/interfaces/JsInterfaces.java

@@ -1,30 +1,38 @@
-package com.edufound.mobile.xxt.interfaces;
+package com.edufound.android.xyyf.interfaces;
 
 import android.app.AlertDialog;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.media.MediaPlayer;
-import android.text.TextUtils;
 import android.view.KeyEvent;
 import android.webkit.JavascriptInterface;
 
-import com.edufound.mobile.xxt.R;
-import com.edufound.mobile.xxt.activity.IJKPlayerActivity;
-import com.edufound.mobile.xxt.activity.VideoActivity;
-import com.edufound.mobile.xxt.application.EApplication;
-import com.edufound.mobile.xxt.bean.MessageDialogBean;
-import com.edufound.mobile.xxt.bean.UpgradeBean;
-import com.edufound.mobile.xxt.main.MainView;
-import com.edufound.mobile.xxt.pay.PayInit;
-import com.edufound.mobile.xxt.util.ContextUtil;
-import com.edufound.mobile.xxt.util.Logger;
-import com.edufound.mobile.xxt.util.SPutil;
-import com.edufound.mobile.xxt.util.ShowDebugUrl;
-import com.edufound.mobile.xxt.util.ShowDevice;
-import com.edufound.mobile.xxt.util.ShowSetting;
-import com.edufound.mobile.xxt.util.ToastUtil;
-import com.edufound.mobile.xxt.util.UpdateUtil;
+import com.alibaba.fastjson.JSON;
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.activity.IJKPlayerActivity;
+import com.edufound.android.xyyf.activity.VideoActivity;
+import com.edufound.android.xyyf.application.EApplication;
+import com.edufound.android.xyyf.bean.MessageDialogBean;
+import com.edufound.android.xyyf.bean.UpgradeBean;
+import com.edufound.android.xyyf.config.AppUtils;
+import com.edufound.android.xyyf.config.AuthPageConfig;
+import com.edufound.android.xyyf.config.BaseUIConfig;
+import com.edufound.android.xyyf.main.MainView;
+import com.edufound.android.xyyf.pay.PayInit;
+import com.edufound.android.xyyf.util.ContextUtil;
+import com.edufound.android.xyyf.util.Logger;
+import com.edufound.android.xyyf.util.OKHttpUtil;
+import com.edufound.android.xyyf.util.SPutil;
+import com.edufound.android.xyyf.util.ShowDebugUrl;
+import com.edufound.android.xyyf.util.ShowDevice;
+import com.edufound.android.xyyf.util.ShowSetting;
+import com.edufound.android.xyyf.util.ToastUtil;
+import com.edufound.android.xyyf.util.UpdateUtil;
 import com.google.gson.Gson;
+import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper;
+import com.mobile.auth.gatewayauth.ResultCode;
+import com.mobile.auth.gatewayauth.TokenResultListener;
+import com.mobile.auth.gatewayauth.model.TokenRet;
 import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram;
 import com.tencent.mm.opensdk.modelmsg.SendAuth;
 
@@ -33,6 +41,8 @@ import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
 
+import okhttp3.Request;
+
 public class JsInterfaces {
 
     Gson mGson;
@@ -40,6 +50,9 @@ public class JsInterfaces {
     MediaPlayer mediaPlayer;
     AlertDialog.Builder mMessageDialogBuilder;
     MessageDialogBean mMessageBean;
+    PhoneNumberAuthHelper mPhoneNumberAuthHelperl;
+    String mSecret = "RCV62WOrD1Dcypp4qiwqlLWsPf9jGQ9SzBKaUms/VuDvggYsJBmeFvQqkc6ptBBmTbKfRsB2zhXUQP+6meKyA/7TQbde3uLfVnhihmKahXTpaKYhjwZRT4R4VCZtq8umnzZTQPENjUiz/Hdd45EKA/OhTtXodbfEo+j6o79xukkjApKaF3qlSqPylppOAavtiGOKEVhZSLhPyQQDOdqTre4EfWJ07T4reo2oObslQqlZamXqzHkp/K+5M+xIPsxk6c14Oypu/EEJMCjzIP8aHdqa01PWcycKFz9Fbn0Q9/tFJ7yWNfHkuJQH/w6JV41q";
+    public final String GET_USER_PHONENUMBER_URL = "http://ott80test-api.efunbox.cn:81/member/getMobile";
 
     public JsInterfaces(MainView view) {
         mGson = new Gson();
@@ -49,6 +62,8 @@ public class JsInterfaces {
             mediaPlayer.reset();
             mediaPlayer = MediaPlayer.create(mView.getActivity(), R.raw.click_music);
         }
+        mPhoneNumberAuthHelperl = PhoneNumberAuthHelper.getInstance(mView.getActivity(), tokenResultListener);
+        mPhoneNumberAuthHelperl.setAuthSDKInfo(mSecret);
     }
 
     Map<String, String> jsMap = new HashMap<>();
@@ -112,6 +127,7 @@ public class JsInterfaces {
         jsMap.clear();
     }
 
+
     /*
      * 播放视频方法
      * */
@@ -312,4 +328,77 @@ public class JsInterfaces {
         ToastUtil.showToast(message);
     }
 
+
+    ///-----------------------小窗口播放方法
+    @JavascriptInterface
+    public void setWindowVideoParams(String params_json) {
+//        mView.setVideoFragment(params_json);
+    }
+
+    @JavascriptInterface
+    public void showDateView(final int show_type) {
+        mView.getPersenter().showDateView(show_type);
+    }
+
+
+    public int getdp(int num) {
+        return AppUtils.dp2px(mView.getActivity(), num);
+    }
+
+    @JavascriptInterface
+    public void showPhoneNumberLogin() {
+        AuthPageConfig mUIConfig = BaseUIConfig.init(0, mView.getActivity(), mPhoneNumberAuthHelperl, mView);
+        mUIConfig.configAuthPage();
+        mPhoneNumberAuthHelperl.getLoginToken(mView.getActivity(), 5000);
+    }
+
+    public void NOUILOGIN() {
+//        AuthPageConfig mUIConfig = BaseUIConfig.init(1, mView.getActivity(), mPhoneNumberAuthHelperl,mView);
+//        mUIConfig.configAuthPage();
+//        mPhoneNumberAuthHelperl.getLoginToken(mView.getActivity(), 5000);
+    }
+
+    TokenResultListener tokenResultListener = new TokenResultListener() {
+        @Override
+        public void onTokenSuccess(String s) {
+            TokenRet tokenRet = null;
+            try {
+                tokenRet = JSON.parseObject(s, TokenRet.class);
+                if (ResultCode.CODE_START_AUTHPAGE_SUCCESS.equals(tokenRet.getCode())) {
+//                    Logger.e("唤起授权页成功:" + s);
+                    mPhoneNumberAuthHelperl.hideLoginLoading();
+//                    ToastUtil.showToast(s);
+                }
+                if (ResultCode.CODE_GET_TOKEN_SUCCESS.equals(tokenRet.getCode())) {
+//                    Logger.e("获取token成功:" + s);
+//                    ToastUtil.showToast(s);
+                    mPhoneNumberAuthHelperl.hideLoginLoading();
+                    mPhoneNumberAuthHelperl.quitLoginPage();
+                    String token = JSON.parseObject(s).get("token").toString();
+                    OKHttpUtil.postDataAsync(GET_USER_PHONENUMBER_URL, new OKHttpUtil.ResultCallback() {
+                        @Override
+                        public void onError(Request request, Exception e) {
+                            Logger.e("error-------------");
+                        }
+
+                        @Override
+                        public void onResponse(Object response) {
+                            String a = JSON.parseObject(response.toString()).getString("data").toString();
+//                            ToastUtil.showToast(a);
+                            mView.loadJsMehtod("phoneLogin('" + a + "')");
+                        }
+                    }, new OKHttpUtil.Param("accessToken", token));
+//
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        @Override
+        public void onTokenFailed(String s) {
+            Logger.e("失败了:" + s);
+            ToastUtil.showToast("失败了:" + s);
+        }
+    };
 }

+ 4 - 4
app/src/main/java/com/edufound/mobile/xxt/main/MainModel.java

@@ -1,8 +1,8 @@
-package com.edufound.mobile.xxt.main;
+package com.edufound.android.xyyf.main;
 
-import com.edufound.mobile.xxt.R;
-import com.edufound.mobile.xxt.base.BaseModel;
-import com.edufound.mobile.xxt.util.ContextUtil;
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.base.BaseModel;
+import com.edufound.android.xyyf.util.ContextUtil;
 
 //做请求操作之类的
 public class MainModel implements BaseModel {

+ 657 - 0
app/src/main/java/com/edufound/android/xyyf/main/MainPersenter.java

@@ -0,0 +1,657 @@
+package com.edufound.android.xyyf.main;
+
+import android.annotation.SuppressLint;
+import android.annotation.TargetApi;
+import android.app.Activity;
+import android.app.Dialog;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.Color;
+import android.media.MediaMetadataRetriever;
+import android.media.ThumbnailUtils;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.os.Process;
+import android.provider.MediaStore;
+import android.support.annotation.Nullable;
+import android.view.Display;
+import android.view.Gravity;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.WindowManager;
+import android.webkit.JsResult;
+import android.webkit.WebChromeClient;
+import android.webkit.WebResourceRequest;
+import android.webkit.WebResourceResponse;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.widget.FrameLayout;
+import android.widget.TextView;
+
+import com.cncoderx.wheelview.OnWheelChangedListener;
+import com.cncoderx.wheelview.WheelView;
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.application.EApplication;
+import com.edufound.android.xyyf.base.BaseModel;
+import com.edufound.android.xyyf.base.BasePersenter;
+import com.edufound.android.xyyf.interfaces.EfunboxPayInterfaces;
+import com.edufound.android.xyyf.interfaces.JsInterfaces;
+import com.edufound.android.xyyf.util.ContextUtil;
+import com.edufound.android.xyyf.util.DeviceUtil;
+import com.edufound.android.xyyf.util.DeviceUuidFactory;
+import com.edufound.android.xyyf.util.Logger;
+import com.edufound.android.xyyf.util.OKHttpUtil;
+import com.edufound.android.xyyf.util.SPutil;
+import com.edufound.android.xyyf.util.ToastUtil;
+import com.edufound.android.xyyf.view.ErrorView;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.Response;
+
+public class MainPersenter implements MainIPersenter {
+
+    public static final int WECHAT_LOGIN = 0x76761;
+    public static final int PAY_RESULT = 0x76762;
+    private static MainView mView = null;
+    private MainModel mModel = null;
+    private JsInterfaces mJsInterfaces = null;
+    private EfunboxPayInterfaces mPayInterfaces = null;
+    private String mLoadUrl;
+    ErrorView mErrorView;
+    Dialog mErrorViewDialog;
+    private DeviceUtil deviceUtil;
+
+
+    public MainPersenter(MainView view) {
+        mView = view;
+        mModel = new MainModel();
+        deviceUtil = new DeviceUtil();
+        mJsInterfaces = new JsInterfaces(mView);
+        mPayInterfaces = new EfunboxPayInterfaces(mView);
+    }
+
+    @Override
+    public void loadData() {
+        mModel.LoadData(new BaseModel.LoadDataBack() {
+            @Override
+            public void success(String datajson) {
+                Logger.e("datajson:" + datajson);
+                mView.showData(datajson);
+            }
+
+            @Override
+            public void failure() {
+                Logger.e("failure");
+            }
+        });
+    }
+
+    // 设置WebView
+    @SuppressLint("JavascriptInterface")
+    @Override
+    public void initWebView(final WebView webview) {
+        if (Build.VERSION.SDK_INT >= 19) {
+            webview.getSettings().setLoadsImagesAutomatically(true);
+        } else {
+            webview.getSettings().setLoadsImagesAutomatically(false);
+        }
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            webview.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
+        }
+        webview.requestFocus(View.FOCUS_DOWN);
+        webview.getSettings().setJavaScriptEnabled(true);
+        webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);//允许js弹出窗口
+        webview.getSettings().setDomStorageEnabled(true);
+//        webview.getSettings().setMediaPlaybackRequiresUserGesture(false);
+        webview.getSettings().setBlockNetworkImage(false);
+        // webview.getSettings().set
+        webview.setBackgroundColor(Color.TRANSPARENT);
+//       webview.setBackgroundResource();
+        webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
+        webview.getSettings().setUseWideViewPort(true);
+        webview.getSettings().setLoadWithOverviewMode(true);
+        webview.getSettings().setTextZoom(100);
+        webview.setWebChromeClient(new WebChromeClient() {
+
+            @Override
+            public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
+
+                return super.onJsAlert(view, url, message, result);
+            }
+
+            @Override
+            public void onShowCustomView(View view, CustomViewCallback callback) {
+
+                super.onShowCustomView(view, callback);
+            }
+
+            @Override
+            public void onProgressChanged(WebView view, int newProgress) {
+
+                if (newProgress >= 100) {
+                }
+                super.onProgressChanged(view, newProgress);
+            }
+
+        });
+
+        webview.setWebViewClient(new WebViewClient() {
+
+            @Override
+            public boolean shouldOverrideUrlLoading(WebView view, String url) {
+//                webview.removeAllViews();
+                view.loadUrl(url);
+                return true;
+            }
+
+            @Override
+            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
+                super.onReceivedError(view, errorCode, description, failingUrl);
+                view.loadUrl("");
+                showDisConnNeWorkWindow();
+            }
+
+            @Override
+            public void onReceivedHttpError(WebView view, WebResourceRequest request, WebResourceResponse errorResponse) {
+                super.onReceivedHttpError(view, request, errorResponse);
+//                int statusCode = 0;
+//                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
+//                    statusCode = errorResponse.getStatusCode();
+//                }
+//                System.out.println("onReceivedHttpError code = " + statusCode);
+//                if (404 == statusCode) {
+//                    view.loadUrl("about:blank");// 避免出现默认的错误界面
+//                    showDisConnNeWorkWindow();
+//                }
+
+            }
+
+            @Override
+            public void onPageStarted(WebView view, String url, Bitmap favicon) {
+                super.onPageStarted(view, url, favicon);
+            }
+
+            @Override
+            public void onPageFinished(WebView view, String url) {
+                if (!webview.getSettings().getLoadsImagesAutomatically()) {
+                    webview.getSettings().setLoadsImagesAutomatically(true);
+                }
+                mView.hideLoading();
+                super.onPageFinished(view, url);
+            }
+
+        });
+        webview.addJavascriptInterface(mJsInterfaces, "efunboxJS");
+        webview.addJavascriptInterface(mPayInterfaces, "efunboxPay");
+
+    }
+
+    public int dip2px(Context context, float dpValue) {
+        final float scale = context.getResources().getDisplayMetrics().density;
+        return (int) (dpValue * scale + 0.5f);
+    }
+
+    @Override
+    public JsInterfaces getJsInterfaces() {
+        return mJsInterfaces;
+    }
+
+    @Override
+    public EfunboxPayInterfaces getPayInterfaces() {
+        return mPayInterfaces;
+    }
+
+    @Override
+    public void openWeb(Intent intent) {
+        mView.loadUrl("");
+        mLoadUrl = mModel.getDefaultLoadUrl();
+        String intent_url = intent.getStringExtra("url");
+        Logger.e("-----------------------------");
+        Logger.e("intent_url:" + intent_url);
+        Logger.e("-----------------------------");
+        if (intent_url != null && !intent_url.isEmpty()) {
+            mLoadUrl = intent_url;
+        }
+        String preuuid = SPutil.getPrefString(ContextUtil.getContext(), DeviceUuidFactory.UUID_SPKEY, "");
+        if (preuuid.equals("")) {
+            preuuid = DeviceUuidFactory.getUuid().toString();
+        }
+
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("appCode=" + EApplication.getAppCode());
+        buffer.append("&uuid=" + preuuid);
+        buffer.append("&width=" + deviceUtil.getWidth(mView.getActivity()));
+        buffer.append("&height=" + deviceUtil.getHeight(mView.getActivity()));
+        buffer.append("&version=" + deviceUtil.getVersionCode(mView.getActivity()));
+        mLoadUrl += buffer.toString();
+        Logger.DebugE("LOADURL=" + mLoadUrl);
+        mView.loadUrl(mLoadUrl);
+    }
+
+    @Override
+    public boolean onKeyDown(int keycode, KeyEvent event) {
+        switch (keycode) {
+            case KeyEvent.KEYCODE_DPAD_CENTER:
+            case KeyEvent.KEYCODE_ENTER:
+                mView.loadJsMehtod("boxEventHandler('key_down','KEY_SELECT')");
+                break;
+            case KeyEvent.KEYCODE_BACK:
+            case KeyEvent.KEYCODE_ESCAPE:
+                mView.loadJsMehtod("boxEventHandler('key_down','KEY_BACK')");
+                return true;
+            case KeyEvent.KEYCODE_HOME:
+                // Home键 -,- P.S:不一定能监听到
+                Logger.DebugE("click home");
+                EApplication.exitApp();
+                break;
+            case KeyEvent.KEYCODE_DPAD_UP:
+                // 上
+                mView.loadJsMehtod("boxEventHandler('key_down','KEY_UP')");
+                break;
+            case KeyEvent.KEYCODE_DPAD_RIGHT:
+                // 右
+                mView.loadJsMehtod("boxEventHandler('key_down','KEY_RIGHT')");
+                break;
+            case KeyEvent.KEYCODE_DPAD_DOWN:
+                // 下
+                mView.loadJsMehtod("boxEventHandler('key_down','KEY_DOWN')");
+                break;
+            case KeyEvent.KEYCODE_DPAD_LEFT:
+                // 左
+                mView.loadJsMehtod("boxEventHandler('key_down','KEY_LEFT')");
+                break;
+        }
+        return false;
+    }
+
+    @Override
+    public boolean onKeyUp(int keycode, KeyEvent event) {
+//        getJsInterfaces().clickMusic("1", "1");
+        if (mView.getActivityPay()) {
+            return true;
+        }
+        switch (keycode) {
+            case KeyEvent.KEYCODE_DPAD_CENTER:
+            case KeyEvent.KEYCODE_ENTER:
+                // 确认键
+                mView.loadJsMehtod("boxEventHandler('key_up','KEY_SELECT')");
+                break;
+            case KeyEvent.KEYCODE_BACK:
+            case KeyEvent.KEYCODE_ESCAPE:
+                // 返回键
+                mView.loadJsMehtod("boxEventHandler('key_up','KEY_BACK')");
+//                mJsInterfaces.closeApp();
+                return true;
+            case KeyEvent.KEYCODE_DPAD_UP:
+                // 上
+                mView.loadJsMehtod("boxEventHandler('key_up','KEY_UP')");
+                break;
+            case KeyEvent.KEYCODE_DPAD_RIGHT:
+                // 右
+                mView.loadJsMehtod("boxEventHandler('key_up','KEY_RIGHT')");
+                break;
+            case KeyEvent.KEYCODE_DPAD_DOWN:
+                // 下
+                mView.loadJsMehtod("boxEventHandler('key_up','KEY_DOWN')");
+                break;
+            case KeyEvent.KEYCODE_DPAD_LEFT:
+                // 左
+                mView.loadJsMehtod("boxEventHandler('key_up','KEY_LEFT')");
+                break;
+        }
+        return false;
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
+        switch (requestCode) {
+            case EfunboxPayInterfaces.START_PAY_DB:
+                if (resultCode == Activity.RESULT_OK) {
+                    Bundle bundle = data.getExtras();
+                    int back = bundle.getInt("back");
+                    //back为返回值
+                    String Out_trade_no = bundle.getString("Out_trade_no");
+                    // Out_trade_no为订单号
+                } else if (requestCode == Activity.RESULT_CANCELED) {
+                }
+                break;
+            case EfunboxPayInterfaces.START_PAY_HUANWANG:
+                break;
+            case EfunboxPayInterfaces.START_PAY_SKYWORTH:
+//                ToastUtil.showToast("START_PAY_SKYWORTH");
+                break;
+            case EfunboxPayInterfaces.START_PAY_XIAOMI:
+//                ToastUtil.showToast("START_PAY_XIAOMI");
+                break;
+
+        }
+        mView.acPostDelayed(new Runnable() {
+            @Override
+            public void run() {
+                mView.setActivityPay(false);
+            }
+        }, 1000);
+    }
+
+    @Override
+    public void postUserTime(long time) {
+        try {
+            OKHttpUtil.getInstance().doGetSync("?time=" + time, new Callback() {
+                @Override
+                public void onFailure(Call call, IOException e) {
+                    Logger.e("postUserTime---onFailure---");
+                }
+
+                @Override
+                public void onResponse(Call call, Response response) throws IOException {
+                    Logger.e("postUserTime---onResponse---");
+                    EApplication.clearActivity();
+                    android.os.Process.killProcess(Process.myPid());
+                }
+            });
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    @Override
+    public void onDisConnNetWork() {
+//        ToastUtil.showToast("断网了。。");
+        mView.stopWebView();
+        showDisConnNeWorkWindow();
+    }
+
+    @Override
+    public void onConnNetWork() {
+        Logger.e("onConnNetWork");
+//        if (mErrorViewDialog != null) {
+//            mErrorViewDialog.dismiss();
+//            mView.resumeWebView();
+//        }
+    }
+
+    void showDisConnNeWorkWindow() {
+        if (mErrorView == null) {
+            mErrorViewDialog = new Dialog(mView.getActivity());
+            try {
+                int dividerID = mView.getActivity().getResources().getIdentifier("android:id/titleDivider", null, null);
+                View divider = mErrorViewDialog.findViewById(dividerID);
+                divider.setBackgroundColor(Color.TRANSPARENT);
+            } catch (Exception e) {
+                //上面的代码,是用来去除Holo主题的蓝色线条
+                e.printStackTrace();
+            }
+            mErrorView = new ErrorView(mView);
+            mErrorView.setViewBgColor(Color.TRANSPARENT);
+            mErrorView.setBtnClickListener(new ErrorView.BtnClickListener() {
+                @Override
+                public void clickRelase() {
+                    //重新加载
+                    if (ContextUtil.getNetWorkState()) {
+                        mView.destroyWeb();
+                        mErrorViewDialog.dismiss();
+                        mView.resumeWebView();
+                        openWeb(mView.getActivity().getIntent());
+                    } else {
+                        ToastUtil.showToast("请检查网络连接状况");
+                    }
+                }
+
+                @Override
+                public void clickExit() {
+                    //退出
+                    mErrorViewDialog.dismiss();
+                    mView.getActivity().finish();
+                    EApplication.clearActivity();
+                }
+            });
+            mErrorViewDialog.setCancelable(false);
+            mErrorViewDialog.setContentView(mErrorView);
+            Window dialogWindow = mErrorViewDialog.getWindow();
+            dialogWindow.setGravity(Gravity.CENTER);
+            dialogWindow.getDecorView().setPadding(0, 0, 0, 0);
+            dialogWindow.getDecorView().setBackgroundColor(Color.TRANSPARENT);
+            WindowManager m = mView.getActivity().getWindowManager();
+            Display d = m.getDefaultDisplay(); // 获取屏幕宽、高用
+            WindowManager.LayoutParams p = dialogWindow.getAttributes(); // 获取对话框当前的参数值
+            p.height = (int) (d.getHeight() * 1);
+            p.width = WindowManager.LayoutParams.MATCH_PARENT;
+            p.horizontalMargin = 0;
+            dialogWindow.setAttributes(p);
+        }
+        if (!mErrorViewDialog.isShowing()) {
+            mErrorViewDialog.show();
+        }
+    }
+
+
+    public static Handler mPersenterHandler = new Handler(new Handler.Callback() {
+        @Override
+        public boolean handleMessage(Message msg) {
+            switch (msg.what) {
+                case WECHAT_LOGIN:
+//                    Logger.e("微信用户信息:" + msg.obj.toString());
+                    mView.loadJsMehtod("WeChatLoginSuccess('" + msg.obj.toString() + "')");
+                    break;
+                case PAY_RESULT:
+                    mView.loadJsMehtod("commonPayResult(" + msg.obj.toString() + ")");
+                    Intent intent_restart = new Intent(ContextUtil.CLOSE_ACTIVITY_PAY);
+                    mView.getActivity().sendBroadcast(intent_restart);
+                    break;
+            }
+            return false;
+        }
+    });
+
+    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
+    public Bitmap createVideoThumbnail(String url, int width, int height) {
+        Bitmap bitmap = null;
+        MediaMetadataRetriever retriever = new MediaMetadataRetriever();
+        int kind = MediaStore.Video.Thumbnails.MINI_KIND;
+        try {
+            if (Build.VERSION.SDK_INT >= 14) {
+                retriever.setDataSource(url, new HashMap<String, String>());
+            } else {
+                retriever.setDataSource(url);
+            }
+            bitmap = retriever.getFrameAtTime(1000);
+        } catch (IllegalArgumentException ex) {
+            // Assume this is a corrupt video file
+        } catch (RuntimeException ex) {
+            // Assume this is a corrupt video file.
+        } finally {
+            try {
+                retriever.release();
+            } catch (RuntimeException ex) {
+                // Ignore failures while cleaning up.
+            }
+        }
+        if (kind == MediaStore.Images.Thumbnails.MICRO_KIND && bitmap != null) {
+            bitmap = ThumbnailUtils.extractThumbnail(bitmap, width, height,
+                    ThumbnailUtils.OPTIONS_RECYCLE_INPUT);
+        }
+        return bitmap;
+    }
+
+    int getYear = 0;
+    int getMonth = 0;
+    int getDay = 0;
+    int year_index = 0;
+    List<String> view_y_list = new ArrayList<>();
+    List<String> view_m_list = new ArrayList<>();
+    List<String> view_d_list1 = new ArrayList<>();
+    List<String> view_d_list2 = new ArrayList<>();
+    List<String> view_d_list3 = new ArrayList<>();
+    List<String> view_d_list4 = new ArrayList<>();
+
+    @Override
+    public void showDateView(final int show_type) {
+        mView.getRootView().post(new Runnable() {
+            @Override
+            public void run() {
+                Calendar selectedDate = Calendar.getInstance();
+                // 获取年
+                int year = selectedDate.get(Calendar.YEAR);
+
+                // 获取月
+                int month = selectedDate.get(Calendar.MONTH);
+                // 获取日
+                int date = selectedDate.get(Calendar.DATE);
+                if (view_y_list.size() == 0) {
+                    for (int i = year - 50; i < year + 150; i++) {
+                        year_index++;
+                        if (i < year) {
+                            year_index++;
+                        }
+                        view_y_list.add(String.valueOf(i) + "年");
+                    }
+
+                    for (int i = 0; i < 12; i++) {
+                        view_m_list.add(String.valueOf(i + 1) + "月");
+                    }
+
+                    for (int i = 0; i < 31; i++) {
+                        view_d_list1.add(String.valueOf(i + 1) + "日");
+                    }
+
+                    for (int i = 0; i < 30; i++) {
+                        view_d_list2.add(String.valueOf(i + 1) + "日");
+                    }
+
+                    for (int i = 0; i < 28; i++) {
+                        view_d_list3.add(String.valueOf(i + 1) + "日");
+                    }
+                    for (int i = 0; i < 29; i++) {
+                        view_d_list4.add(String.valueOf(i + 1) + "日");
+                    }
+                }
+                final FrameLayout layout = (FrameLayout) LayoutInflater.from(mView.getActivity()).inflate(R.layout.date_view, null);
+                layout.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
+                TextView cancel = layout.findViewById(R.id.date_cancel);
+                TextView ok = layout.findViewById(R.id.date_ok);
+                TextView title = layout.findViewById(R.id.date_title);
+                cancel.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        mView.getRootView().removeView(layout);
+                    }
+                });
+                ok.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        mView.loadJSMehtodPost("getAndroidDate('" + getYear + "','" + getMonth + "','" + getDay + "')");
+                        mView.getRootView().removeView(layout);
+                    }
+                });
+                WheelView view_y = layout.findViewById(R.id.date_whell_y);
+                WheelView view_m = layout.findViewById(R.id.date_whell_m);
+                final WheelView view_d = layout.findViewById(R.id.date_whell_d);
+                if (show_type != 1) {
+                    view_y.setVisibility(View.GONE);
+                    title.setVisibility(View.GONE);
+                }
+                view_y.setEntries(view_y_list);
+                view_m.setEntries(view_m_list);
+                view_y.setOnWheelChangedListener(new OnWheelChangedListener() {
+                    @Override
+                    public void onChanged(WheelView view, int oldIndex, int newIndex) {
+                        CharSequence text = view.getItem(newIndex);
+//                        Logger.e("WheelView:" + String.format("index: %d, text: %s", newIndex, text));
+                        getYear = Integer.valueOf(text.subSequence(0, text.toString().indexOf("年")).toString());
+                        changeDay(view_d);
+                    }
+                });
+                view_m.setOnWheelChangedListener(new OnWheelChangedListener() {
+                    @Override
+                    public void onChanged(WheelView view, int oldIndex, int newIndex) {
+                        CharSequence text = view.getItem(newIndex);
+//                        Logger.e("WheelView:" + String.format("index: %d, text: %s", newIndex, text));
+                        getMonth = Integer.valueOf(text.subSequence(0, text.toString().indexOf("月")).toString());
+                        changeDay(view_d);
+                    }
+                });
+                view_d.setOnWheelChangedListener(new OnWheelChangedListener() {
+                    @Override
+                    public void onChanged(WheelView view, int oldIndex, int newIndex) {
+                        CharSequence text = view.getItem(newIndex);
+//                        Logger.e("WheelView:" + String.format("index: %d, text: %s", newIndex, text));
+                        getDay = Integer.valueOf(text.subSequence(0, text.toString().indexOf("日")).toString());
+                    }
+                });
+                view_y.setCurrentIndex(year_index);
+                view_m.setCurrentIndex(month);
+                view_d.setCurrentIndex(date - 1);
+                mView.getRootView().addView(layout);
+
+            }
+        });
+    }
+
+    void changeDay(WheelView view_d) {
+        switch (getMonth) {
+            case 1:
+            case 3:
+            case 5:
+            case 7:
+            case 8:
+            case 10:
+            case 12:
+                view_d.setEntries(view_d_list1);
+                break;
+            case 4:
+            case 6:
+            case 9:
+            case 11:
+                view_d.setEntries(view_d_list2);
+                break;
+            case 2:
+                //平年
+                if ((getYear % 4 == 0 && getYear % 100 != 0)
+                        || (getYear % 400 == 0)) {
+//                            System.out.println(input + "年闰年");
+                    view_d.setEntries(view_d_list4);
+                } else {
+//                            System.out.println(input + "年平年");
+                    view_d.setEntries(view_d_list3);
+                }
+                break;
+        }
+    }
+
+}
+
+
+interface MainIPersenter extends BasePersenter {
+    void initWebView(WebView webview);
+
+    JsInterfaces getJsInterfaces();
+
+    EfunboxPayInterfaces getPayInterfaces();
+
+    void openWeb(Intent intent);
+
+    boolean onKeyDown(int keycode, KeyEvent event);
+
+    boolean onKeyUp(int keycode, KeyEvent event);
+
+    void onActivityResult(int requestCode, int resultCode, @Nullable Intent data);
+
+    void postUserTime(long time);
+
+    void showDateView(int type);
+}

+ 53 - 0
app/src/main/java/com/edufound/android/xyyf/main/MainView.java

@@ -0,0 +1,53 @@
+package com.edufound.android.xyyf.main;
+
+import android.app.Activity;
+import android.widget.FrameLayout;
+
+import com.edufound.android.xyyf.base.BaseView;
+import com.google.gson.Gson;
+
+
+public interface MainView extends BaseView {
+    //把View拋出給Presenter調用
+
+    void loadUrl(String url);
+
+    @Override
+    void DisconnNetWork();
+
+    @Override
+    void ConnNeWork();
+
+    void loadJsMehtod(String method);
+
+    Activity getActivity();
+
+    void setActivityPay(boolean bool);
+
+    boolean getActivityPay();
+
+    void acPostDelayed(Runnable runnable, int time);
+
+    void destroyWeb();
+
+    void hideLoading();
+
+    void stopWebView();
+
+    void resumeWebView();
+
+    void loadJSMehtodPost(String method);
+//    void setVideoFragment(String params_json);
+//
+//    void setVideoLayout(String params_json);
+//
+//    void removeFragmentVideo();
+//
+//    void changeVideoRadius(int radius);
+
+    Gson getGson();
+
+    FrameLayout getRootView();
+
+    MainPersenter getPersenter();
+}

+ 4 - 4
app/src/main/java/com/edufound/mobile/xxt/pay/PayActivity.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.pay;
+package com.edufound.android.xyyf.pay;
 
 import android.app.Activity;
 import android.content.BroadcastReceiver;
@@ -7,9 +7,9 @@ import android.content.Intent;
 import android.content.IntentFilter;
 import android.os.Bundle;
 
-import com.edufound.mobile.xxt.R;
-import com.edufound.mobile.xxt.base.BaseView;
-import com.edufound.mobile.xxt.util.ContextUtil;
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.base.BaseView;
+import com.edufound.android.xyyf.util.ContextUtil;
 
 public class PayActivity extends Activity implements BaseView {
 

+ 2 - 2
app/src/main/java/com/edufound/mobile/xxt/pay/PayInit.java

@@ -1,8 +1,8 @@
-package com.edufound.mobile.xxt.pay;
+package com.edufound.android.xyyf.pay;
 
 import android.app.Application;
 
-import com.edufound.mobile.xxt.util.ContextUtil;
+import com.edufound.android.xyyf.util.ContextUtil;
 import com.tencent.mm.opensdk.openapi.IWXAPI;
 import com.tencent.mm.opensdk.openapi.WXAPIFactory;
 

+ 8 - 8
app/src/main/java/com/edufound/mobile/xxt/pay/PayPersenter.java

@@ -1,17 +1,17 @@
-package com.edufound.mobile.xxt.pay;
+package com.edufound.android.xyyf.pay;
 
 import android.os.Handler;
 import android.os.Message;
 import android.text.TextUtils;
 
 import com.alipay.sdk.app.PayTask;
-import com.edufound.mobile.xxt.base.BasePersenter;
-import com.edufound.mobile.xxt.base.BaseView;
-import com.edufound.mobile.xxt.interfaces.EfunboxPayInterfaces;
-import com.edufound.mobile.xxt.main.MainPersenter;
-import com.edufound.mobile.xxt.pay.ali.PayResult;
-import com.edufound.mobile.xxt.util.Logger;
-import com.edufound.mobile.xxt.util.ToastUtil;
+import com.edufound.android.xyyf.base.BasePersenter;
+import com.edufound.android.xyyf.base.BaseView;
+import com.edufound.android.xyyf.interfaces.EfunboxPayInterfaces;
+import com.edufound.android.xyyf.main.MainPersenter;
+import com.edufound.android.xyyf.pay.ali.PayResult;
+import com.edufound.android.xyyf.util.Logger;
+import com.edufound.android.xyyf.util.ToastUtil;
 import com.tencent.mm.opensdk.modelpay.PayReq;
 
 import org.json.JSONObject;

File diff suppressed because it is too large
+ 1 - 0
app/src/main/java/com/edufound/android/xyyf/pay/ali/PayResult.java


+ 4 - 4
app/src/main/java/com/edufound/mobile/xxt/push/MipushTestActivity.java

@@ -1,11 +1,11 @@
-package com.edufound.mobile.xxt.push;
+package com.edufound.android.xyyf.push;
 
 import android.content.Intent;
 import android.os.Bundle;
 
-import com.edufound.mobile.xxt.activity.MainActivity;
-import com.edufound.mobile.xxt.bean.NotificationBean;
-import com.edufound.mobile.xxt.util.Logger;
+import com.edufound.android.xyyf.activity.MainActivity;
+import com.edufound.android.xyyf.bean.NotificationBean;
+import com.edufound.android.xyyf.util.Logger;
 import com.google.gson.Gson;
 import com.umeng.message.UmengNotifyClickActivity;
 

+ 2 - 2
app/src/main/java/com/edufound/mobile/xxt/receiver/HomeKeyEventReceiver.java

@@ -1,11 +1,11 @@
-package com.edufound.mobile.xxt.receiver;
+package com.edufound.android.xyyf.receiver;
 
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.text.TextUtils;
 
-import com.edufound.mobile.xxt.util.Logger;
+import com.edufound.android.xyyf.util.Logger;
 
 public class HomeKeyEventReceiver extends BroadcastReceiver {
 

+ 5 - 5
app/src/main/java/com/edufound/mobile/xxt/receiver/NetworkChangeReceiver.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.receiver;
+package com.edufound.android.xyyf.receiver;
 
 import android.content.BroadcastReceiver;
 import android.content.Context;
@@ -9,10 +9,10 @@ import android.os.Handler;
 import android.os.Message;
 import android.telephony.TelephonyManager;
 
-import com.edufound.mobile.xxt.base.BaseView;
-import com.edufound.mobile.xxt.util.ContextUtil;
-import com.edufound.mobile.xxt.util.Logger;
-import com.edufound.mobile.xxt.util.ToastUtil;
+import com.edufound.android.xyyf.base.BaseView;
+import com.edufound.android.xyyf.util.ContextUtil;
+import com.edufound.android.xyyf.util.Logger;
+import com.edufound.android.xyyf.util.ToastUtil;
 
 
 /**

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/util/AesUtil.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import org.bouncycastle.util.encoders.Base64;
 

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/util/ContextUtil.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.app.Application;
 import android.content.Context;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/util/DeviceUtil.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.app.Activity;
 import android.content.Context;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/util/DeviceUuidFactory.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.annotation.SuppressLint;
 import android.content.Context;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/util/DrawableUtil.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.app.Activity;
 import android.graphics.Bitmap;

+ 2 - 2
app/src/main/java/com/edufound/mobile/xxt/util/EduFoundUtil.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.app.Activity;
 import android.app.AlarmManager;
@@ -85,7 +85,7 @@ public class EduFoundUtil {
         Intent intent = new Intent(Intent.ACTION_VIEW);
         intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
-            Uri uri = FileProvider.getUriForFile(context, "com.edufound.mobile.fileprovider", file);
+            Uri uri = FileProvider.getUriForFile(context, "com.edufound.android.xyyf.fileprovider", file);
             intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
             intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
             intent.setDataAndType(uri, "application/vnd.android.package-archive");

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/util/LiuHaiScreenUtil.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.app.Activity;
 import android.view.DisplayCutout;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/util/Logger.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.util.Log;
 

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/util/NotificationUtil.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.app.Activity;
 import android.app.AlertDialog;

+ 701 - 0
app/src/main/java/com/edufound/android/xyyf/util/OKHttpUtil.java

@@ -0,0 +1,701 @@
+package com.edufound.android.xyyf.util;
+
+
+import android.os.Handler;
+import android.os.Looper;
+
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.FileNameMap;
+import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.Cookie;
+import okhttp3.CookieJar;
+import okhttp3.FormBody;
+import okhttp3.Headers;
+import okhttp3.HttpUrl;
+import okhttp3.Interceptor;
+import okhttp3.MediaType;
+import okhttp3.MultipartBody;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+import okio.Buffer;
+import okio.BufferedSource;
+import okio.ForwardingSource;
+import okio.Okio;
+
+public class OKHttpUtil {
+    private OkHttpClient okHttpClient;
+    private Handler handler;
+    private static OKHttpUtil mInstance;
+    private final HashMap<String, List<Cookie>> cookieStore = new HashMap<>();
+
+    private OKHttpUtil() {
+        //添加cookie
+        okHttpClient = new OkHttpClient.Builder().cookieJar(new CookieJar() {
+            @Override
+            public void saveFromResponse(HttpUrl url, List<Cookie> cookies) {
+                cookieStore.put(url.host(), cookies);
+
+            }
+
+            @Override
+            public List<Cookie> loadForRequest(HttpUrl url) {
+                List<Cookie> cookies = cookieStore.get(url.host());
+                return cookies != null ? cookies : new ArrayList<Cookie>();
+            }
+        }).build();
+        handler = new Handler(Looper.getMainLooper());
+    }
+
+    /**
+     * 单例模式创建OkHttpUtil
+     *
+     * @return mInstance
+     */
+    public static OKHttpUtil getInstance() {
+        if (mInstance == null) {
+            synchronized (OKHttpUtil.class) {
+                mInstance = new OKHttpUtil();
+            }
+        }
+        return mInstance;
+    }
+
+    /**
+     * get 同步请求
+     *
+     * @return response
+     */
+    private Response _getDataSync(String url) {
+        Request request = new Request.Builder()
+                .get()//默认get,可省略
+                .url(url)
+                .build();
+        Response response = null;
+        try {
+            response = okHttpClient.newCall(request).execute();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return response;
+    }
+
+    /**
+     * get 同步请求
+     *
+     * @return 字符串
+     */
+    private String _getDataString(String url) throws IOException {
+        Response response = _getDataSync(url);
+        if (response.body() != null) {
+            return response.body().string();
+        }
+        return null;
+    }
+
+    /**
+     * get 异步请求
+     */
+    private void _getDataAsync(String url, final ResultCallback callback) {
+        final Request request = new Request.Builder()
+                .url(url)
+                .build();
+        deliveryResult(callback, request);
+    }
+
+    /**
+     * post 同步请求
+     *
+     * @return response
+     */
+    private Response _postDataSync(String url, Param... params) throws IOException {
+        Request request = buildPostRequest(url, params);
+        return okHttpClient.newCall(request).execute();
+
+    }
+
+    /**
+     * post 同步请求
+     *
+     * @return 字符串
+     */
+    private String _postDataString(String url, Param... params) throws IOException {
+        Response response = _postDataSync(url, params);
+        return response.body().string();
+    }
+
+    /**
+     * post 异步请求
+     */
+    private void _postDataAsync(String url, final ResultCallback callback, Param... params) {
+        Request request = buildPostRequest(url, params);
+        deliveryResult(callback, request);
+
+    }
+
+    /**
+     * post 异步请求
+     */
+
+    private void _postDataAsync(String url, final ResultCallback callback, Map<String, String> params) {
+        Param[] paramsArr = map2Params(params);
+        Request request = buildPostRequest(url, paramsArr);
+        deliveryResult(callback, request);
+    }
+
+    /**
+     * post 同步文件上传
+     */
+    private Response _postDataFileSync(String url, File[] files, String[] fileKeys, Param... params) throws IOException {
+        Request request = buildMultipartFormRequest(url, files, fileKeys, params);
+        return okHttpClient.newCall(request).execute();
+    }
+
+    private Response _postDataFileSync(String url, File file, String fileKey) throws IOException {
+        Request request = buildMultipartFormRequest(url, new File[]{file}, new String[]{fileKey}, null);
+        return okHttpClient.newCall(request).execute();
+    }
+
+    private Response _postDataFileSync(String url, File file, String fileKey, Param... params) throws IOException {
+        Request request = buildMultipartFormRequest(url, new File[]{file}, new String[]{fileKey}, params);
+        return okHttpClient.newCall(request).execute();
+    }
+
+    /**
+     * 异步基于post的多文件上传
+     */
+    private void _postDataFileAsync(String url, final ResultCallback callback, File[] files, String[] fileKeys, Param... params) {
+        Request request = buildMultipartFormRequest(url, files, fileKeys, params);
+        deliveryResult(callback, request);
+    }
+
+    /**
+     * 异步基于post的文件上传,单文件不带参数上传
+     *
+     * @param url
+     * @param callback
+     * @param file
+     * @param fileKey
+     */
+    private void _postDataFileAsync(String url, ResultCallback callback, File file, String fileKey) {
+        Request request = buildMultipartFormRequest(url, new File[]{file}, new String[]{fileKey}, null);
+        deliveryResult(callback, request);
+    }
+
+    /**
+     * 异步基于post的文件上传,单文件且携带其他form参数上传
+     *
+     * @param url      接口地址
+     * @param callback callback
+     * @param file     file
+     * @param fileKey  fileKey
+     * @param params   params
+     */
+    private void _postDataFileAsync(String url, ResultCallback callback, File file, String fileKey, Param... params) {
+        Request request = buildMultipartFormRequest(url, new File[]{file}, new String[]{fileKey}, params);
+        deliveryResult(callback, request);
+    }
+
+    /**
+     * 同步 post上传json对象
+     *
+     * @param url     url;
+     * @param jsonStr json 字符串
+     * @return 字符串
+     * @throws IOException
+     */
+    private String _postJsonDataSync(String url, String jsonStr) throws IOException {
+        String result = null;
+        MediaType JSON = MediaType.parse("text/html;charset=utf-8");
+        RequestBody requestBody = RequestBody.create(JSON, jsonStr);
+        Request request = new Request.Builder().url(url).post(requestBody).build();
+        Response response = okHttpClient.newCall(request).execute();
+        result = response.body().string();
+        return result;
+    }
+
+    /**
+     * 异步 post上传json对象
+     *
+     * @param url      url
+     * @param jsonStr  json数据字符串
+     * @param callback callback
+     */
+    private void _postJsonDataAsync(String url, String jsonStr, final ResultCallback callback) {
+        MediaType JSON = MediaType.parse("text/html;charset=utf-8");
+        RequestBody requestBody = RequestBody.create(JSON, jsonStr);
+        Request request = new Request.Builder().url(url).post(requestBody).build();
+        deliveryResult(callback, request);
+    }
+
+    /**
+     * post 异步上传图片
+     *
+     * @param url      url
+     * @param callback callback
+     * @param file     file
+     * @param fileKey  fileKey
+     * @param map      map
+     */
+    private void _upLoadImg(String url, final ResultCallback callback, File file, String fileKey, Map<String, String> map) {
+        Param[] params = map2Params(map);
+        getInstance()._postDataFileAsync(url, callback, file, fileKey, params);
+    }
+
+    /**
+     * 创建 MultipartFormRequest
+     *
+     * @param url      接口地址
+     * @param files    files
+     * @param fileKeys file keys
+     * @param params   params
+     * @return MultipartFormRequest
+     */
+
+    private Request buildMultipartFormRequest(String url, File[] files,
+                                              String[] fileKeys, Param[] params) {
+        params = validateParam(params);
+
+        MultipartBody.Builder builder = new MultipartBody.Builder();
+        for (Param param : params) {
+            builder.addPart(Headers.of("Content-Disposition", "form-data; name=\"" + param.key + "\""),
+                    RequestBody.create(null, param.value));
+        }
+        if (files != null) {
+            RequestBody fileBody;
+            for (int i = 0; i < files.length; i++) {
+                File file = files[i];
+                String fileName = file.getName();
+                fileBody = RequestBody.create(MediaType.parse(guessMimeType(fileName)), file);
+                //TODO 根据文件名设置contentType
+                builder.addPart(Headers.of("Content-Disposition",
+                        "form-data; name=\"" + fileKeys[i] + "\"; filename=\"" + fileName + "\""),
+                        fileBody);
+            }
+        }
+
+        RequestBody requestBody = builder.build();
+        return new Request.Builder()
+                .url(url)
+                .post(requestBody)
+                .build();
+    }
+
+    private Param[] validateParam(Param[] params) {
+        if (params == null)
+            return new Param[0];
+        else
+            return params;
+    }
+
+    private String guessMimeType(String path) {
+        FileNameMap fileNameMap = URLConnection.getFileNameMap();
+        String contentTypeFor = fileNameMap.getContentTypeFor(path);
+        if (contentTypeFor == null) {
+            contentTypeFor = "application/octet-stream";
+        }
+        return contentTypeFor;
+    }
+
+    /**
+     * 异步下载文件
+     */
+    private void _downloadFileAsync(final String url, final String destFileDir,
+                                    final DownloadListener downloadListener) {
+        final Request request = new Request.Builder().url(url).build();
+        // 重写ResponseBody监听请求
+        Interceptor interceptor = new Interceptor() {
+            @Override
+            public Response intercept(Chain chain) throws IOException {
+                Response originalResponse = chain.proceed(chain.request());
+                return originalResponse.newBuilder()
+                        .body(new DownloadResponseBody(originalResponse, 0, downloadListener))
+                        .build();
+            }
+        };
+        OkHttpClient.Builder dlOkhttp = new OkHttpClient.Builder()
+                .addNetworkInterceptor(interceptor);
+        final Call call = dlOkhttp.build().newCall(request);
+        call.enqueue(new Callback() {
+
+            @Override
+            public void onFailure(Call call, IOException e) {
+                downloadListener.fail(e.getMessage());
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                long length = response.body().contentLength();
+                downloadListener.start(length);
+                InputStream is = null;
+                byte[] b = new byte[2048];
+                int len;
+                FileOutputStream fos = null;
+                try {
+                    is = response.body().byteStream();
+                    File file = new File(destFileDir, getFileName(url));
+                    fos = new FileOutputStream(file);
+                    while ((len = is.read(b)) != -1) {
+                        fos.write(b, 0, len);
+                    }
+                    fos.flush();
+                    // 如果下载文件成功,第一个参数为文件的绝对路径
+                    downloadListener.complete(file.getAbsolutePath());
+                } catch (Exception e) {
+                    downloadListener.loadfail(e.getMessage());
+                } finally {
+                    if (is != null) {
+                        is.close();
+                    }
+                    if (fos != null) {
+                        fos.close();
+                    }
+                }
+
+            }
+
+        });
+    }
+
+    private String getFileName(String path) {
+        int separatorIndex = path.lastIndexOf("/");
+        return (separatorIndex < 0) ? path : path.substring(separatorIndex + 1,
+                path.length());
+    }
+
+    /***************************************************************** 公共方法***************************************************/
+    /**
+     * get 同步请求
+     *
+     * @param url 接口地址
+     * @return response
+     */
+    public static Response getDataSync(String url) {
+        return getInstance()._getDataSync(url);
+    }
+
+    /**
+     * get 同步请求
+     *
+     * @param url 接口地址
+     * @return 字符串
+     * @throws IOException
+     */
+    public static String getDataString(String url) throws IOException {
+        return getInstance()._getDataString(url);
+    }
+
+    /**
+     * get 异步请求
+     *
+     * @param url 接口地址
+     */
+    public static void getDataAsync(String url, final ResultCallback callback) {
+        getInstance()._getDataAsync(url, callback);
+    }
+
+    /**
+     * post 同步请求
+     *
+     * @param url   url
+     * @param param param
+     * @return response
+     * @throws IOException
+     */
+    public static Response postDataSync(String url, Param... param) throws IOException {
+        return getInstance()._postDataSync(url, param);
+    }
+
+    /**
+     * post 同步请求
+     *
+     * @param url    url
+     * @param params param
+     * @return 字符串
+     * @throws IOException
+     */
+    public static String postDataString(String url, Param... params) throws IOException {
+        return getInstance()._postDataString(url, params);
+    }
+
+    /**
+     * post 异步请求
+     *
+     * @param url      url
+     * @param callback 异步回调
+     * @param params   params
+     */
+    public static void postDataAsync(String url, final ResultCallback callback, Param... params) {
+        getInstance()._postDataAsync(url, callback, params);
+    }
+
+    /**
+     * post map集合 异步请求
+     *
+     * @param url      url
+     * @param callback callback
+     * @param params   params
+     */
+    public static void postDataAsync(String url, final ResultCallback callback, Map<String, String> params) {
+        getInstance()._postDataAsync(url, callback, params);
+    }
+
+    /**
+     * post 异步上传图片
+     *
+     * @param url      url
+     * @param callback callback
+     * @param file     file
+     * @param fileKey  fileKey
+     * @param map      map
+     */
+    public static void upLoadImg(String url, final ResultCallback callback, File file, String fileKey, Map<String, String> map) {
+        getInstance()._upLoadImg(url, callback, file, fileKey, map);
+    }
+
+    /**
+     * @param url              下载地址
+     * @param destFileDir      保存地址
+     * @param downloadListener downloadListener
+     */
+    public static void downloadFileAsync(String url, String destFileDir, DownloadListener downloadListener) {
+        getInstance()._downloadFileAsync(url, destFileDir, downloadListener);
+    }
+
+
+    public void doGetSync(String url, Callback callback) throws IOException {
+        // 创建一个Request
+        Request request = new Request.Builder()
+                .url(url)
+                .build();
+        doAsync(request, callback);
+    }
+
+    /**
+     * 异步请求
+     */
+    public void doAsync(Request request, Callback callback) throws IOException {
+        //创建请求会话
+        Call call = okHttpClient.newCall(request);
+        //同步执行会话请求
+        call.enqueue(callback);
+    }
+
+    /**
+     * map 转换为 Param
+     *
+     * @param params map
+     * @return params
+     */
+    private Param[] map2Params(Map<String, String> params) {
+        if (params == null) {
+            return new Param[0];
+        }
+        int size = params.size();
+        Param[] res = new Param[size];
+        Set<Map.Entry<String, String>> entries = params.entrySet();
+        int i = 0;
+        for (Map.Entry<String, String> entry : entries) {
+            res[i++] = new Param(entry.getKey(), entry.getValue());
+        }
+        return res;
+    }
+
+    /**
+     * 创建 PostRequest
+     *
+     * @param url    url
+     * @param params params
+     * @return request
+     */
+    private Request buildPostRequest(String url, Param[] params) {
+        if (params == null) {
+            params = new Param[0];
+        }
+        FormBody.Builder builder = new FormBody.Builder();
+        for (Param param : params) {
+            builder.add(param.key, param.value);
+        }
+        RequestBody requestBody = builder.build();
+        return new Request.Builder()
+                .url(url)
+                .post(requestBody)
+                .build();
+    }
+
+
+    /**
+     * 抽象类,用于请求成功后的回调
+     *
+     * @param <T>
+     */
+    public static abstract class ResultCallback<T> {
+        //这是请求数据的返回类型,包含常见的(Bean,List等)
+
+        //失败回调
+        public abstract void onError(Request request, Exception e);
+
+        //成功的回调
+        public abstract void onResponse(T response);
+    }
+
+    private Map<String, String> mSessions = new HashMap<>();
+
+    /**
+     * 请求回调处理方法并传递返回值
+     *
+     * @param callback Map类型请求参数
+     * @param request  Request请求
+     */
+    private void deliveryResult(final ResultCallback callback, final Request request) {
+        okHttpClient.newCall(request).enqueue(new Callback() {
+            @Override
+            public void onFailure(Call call, IOException e) {
+                sendFailedStringCallback(request, e, callback);
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                try {
+                    final String string = response.body().string();
+                    sendSuccessResultCallback(string, callback);
+                } catch (IOException e) {
+                    sendFailedStringCallback(response.request(), e, callback);
+                }
+            }
+
+        });
+    }
+
+    /**
+     * 处理请求失败的回调信息方法
+     *
+     * @param e        错误信息
+     * @param callback 回调类
+     */
+    private void sendFailedStringCallback(final Request request, final Exception e, final ResultCallback callback) {
+        handler.post(new Runnable() {
+            @Override
+            public void run() {
+                if (callback != null)
+                    callback.onError(request, e);
+            }
+        });
+    }
+
+    /**
+     * 处理请求成功的回调信息方法
+     *
+     * @param object   服务器响应信息
+     * @param callback 回调类
+     */
+    private void sendSuccessResultCallback(final Object object, final ResultCallback callback) {
+        handler.post(new Runnable() {
+            @Override
+            public void run() {
+                if (callback != null) {
+                    callback.onResponse(object);
+                }
+            }
+        });
+    }
+
+    public static class Param {
+        public Param() {
+        }
+
+        public Param(String key, String value) {
+            this.key = key;
+            this.value = value;
+        }
+
+        String key;
+        String value;
+    }
+
+
+    public class DownloadResponseBody extends ResponseBody {
+
+        private Response originalResponse;
+        private DownloadListener downloadListener;
+        private long oldPoint = 0;
+
+        public DownloadResponseBody(Response originalResponse, long startsPoint, DownloadListener downloadListener) {
+            this.originalResponse = originalResponse;
+            this.downloadListener = downloadListener;
+            this.oldPoint = startsPoint;
+            Logger.e("DownloadResponseBody");
+        }
+
+        @Override
+        public MediaType contentType() {
+            return originalResponse.body().contentType();
+        }
+
+        @Override
+        public long contentLength() {
+            return originalResponse.body().contentLength();
+        }
+
+        @Override
+        public BufferedSource source() {
+            return Okio.buffer(new ForwardingSource(originalResponse.body().source()) {
+                private long bytesReaded = 0;
+
+                @Override
+                public long read(Buffer sink, long byteCount) throws IOException {
+                    long bytesRead = super.read(sink, byteCount);
+                    bytesReaded += bytesRead == -1 ? 0 : bytesRead;
+                    if (downloadListener != null) {
+                        downloadListener.loading((int) ((bytesReaded + oldPoint)));
+                    }
+                    return bytesRead;
+                }
+            });
+        }
+    }
+
+    public interface DownloadListener {
+
+        /**
+         * 开始下载
+         */
+        void start(long max);
+
+        /**
+         * 正在下载
+         */
+        void loading(int progress);
+
+        /**
+         * 下载完成
+         */
+        void complete(String path);
+
+        /**
+         * 请求失败
+         */
+        void fail(String message);
+
+        /**
+         * 下载过程中失败
+         */
+        void loadfail(String message);
+    }
+}
+
+

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/util/PlayerGestureListener.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.content.Context;
 import android.util.DisplayMetrics;

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/util/SPutil.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.content.Context;
 import android.content.SharedPreferences;

+ 3 - 3
app/src/main/java/com/edufound/mobile/xxt/util/ShowDebugUrl.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.app.Activity;
 import android.app.Dialog;
@@ -15,8 +15,8 @@ import android.view.WindowManager;
 import android.widget.Button;
 import android.widget.EditText;
 
-import com.edufound.mobile.xxt.R;
-import com.edufound.mobile.xxt.main.MainView;
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.main.MainView;
 
 public final class ShowDebugUrl implements Callback {
 

+ 2 - 2
app/src/main/java/com/edufound/mobile/xxt/util/ShowDevice.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.app.Activity;
 import android.app.Dialog;
@@ -15,7 +15,7 @@ import android.view.Window;
 import android.view.WindowManager;
 import android.widget.TextView;
 
-import com.edufound.mobile.xxt.R;
+import com.edufound.android.xyyf.R;
 
 public final class ShowDevice implements Callback {
 

+ 2 - 2
app/src/main/java/com/edufound/mobile/xxt/util/ShowSetting.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.app.Activity;
 import android.app.Dialog;
@@ -15,7 +15,7 @@ import android.view.WindowManager;
 import android.widget.RadioButton;
 import android.widget.RadioGroup;
 
-import com.edufound.mobile.xxt.R;
+import com.edufound.android.xyyf.R;
 
 public final class ShowSetting implements Callback {
 

+ 1 - 1
app/src/main/java/com/edufound/mobile/xxt/util/ToastUtil.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.widget.Toast;
 

+ 2 - 2
app/src/main/java/com/edufound/mobile/xxt/util/UpdateUtil.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.util;
+package com.edufound.android.xyyf.util;
 
 import android.app.Activity;
 import android.app.Dialog;
@@ -18,7 +18,7 @@ import android.widget.ProgressBar;
 import android.widget.TextView;
 import android.widget.Toast;
 
-import com.edufound.mobile.xxt.R;
+import com.edufound.android.xyyf.R;
 
 import java.io.File;
 import java.io.FileOutputStream;

+ 2 - 2
app/src/main/java/com/edufound/mobile/xxt/video/VideoAView.java

@@ -1,8 +1,8 @@
-package com.edufound.mobile.xxt.video;
+package com.edufound.android.xyyf.video;
 
 import android.net.Uri;
 
-import com.edufound.mobile.xxt.base.BaseView;
+import com.edufound.android.xyyf.base.BaseView;
 
 
 public interface VideoAView extends BaseView {

+ 2 - 2
app/src/main/java/com/edufound/mobile/xxt/video/VideoModel.java

@@ -1,6 +1,6 @@
-package com.edufound.mobile.xxt.video;
+package com.edufound.android.xyyf.video;
 
-import com.edufound.mobile.xxt.base.BaseModel;
+import com.edufound.android.xyyf.base.BaseModel;
 
 public class VideoModel implements BaseModel {
 

+ 21 - 20
app/src/main/java/com/edufound/mobile/xxt/video/VideoPersenter.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.video;
+package com.edufound.android.xyyf.video;
 
 import android.app.Dialog;
 import android.content.Context;
@@ -30,18 +30,18 @@ import android.widget.LinearLayout;
 import android.widget.SeekBar;
 import android.widget.TextView;
 
-import com.edufound.mobile.xxt.R;
-import com.edufound.mobile.xxt.application.EApplication;
-import com.edufound.mobile.xxt.base.BaseModel;
-import com.edufound.mobile.xxt.base.BasePersenter;
-import com.edufound.mobile.xxt.util.AesUtil;
-import com.edufound.mobile.xxt.util.ContextUtil;
-import com.edufound.mobile.xxt.util.DeviceUtil;
-import com.edufound.mobile.xxt.util.DrawableUtil;
-import com.edufound.mobile.xxt.util.EduFoundUtil;
-import com.edufound.mobile.xxt.util.Logger;
-import com.edufound.mobile.xxt.util.ToastUtil;
-import com.edufound.mobile.xxt.view.ErrorView;
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.application.EApplication;
+import com.edufound.android.xyyf.base.BaseModel;
+import com.edufound.android.xyyf.base.BasePersenter;
+import com.edufound.android.xyyf.util.AesUtil;
+import com.edufound.android.xyyf.util.ContextUtil;
+import com.edufound.android.xyyf.util.DeviceUtil;
+import com.edufound.android.xyyf.util.DrawableUtil;
+import com.edufound.android.xyyf.util.EduFoundUtil;
+import com.edufound.android.xyyf.util.Logger;
+import com.edufound.android.xyyf.util.ToastUtil;
+import com.edufound.android.xyyf.view.ErrorView;
 import com.google.gson.Gson;
 import com.warkiz.widget.IndicatorSeekBar;
 import com.warkiz.widget.TickMarkType;
@@ -856,6 +856,14 @@ public class VideoPersenter implements VideoIPersenter, GestureDetector.OnGestur
     public boolean onDoubleTapEvent(MotionEvent e) {
         return false;
     }
+
+    public class VideoJsonBean {
+        public String videourl;
+        public String videoname;
+        public String videoid;
+        public String videoplaytime;
+        public String videoneedpost;
+    }
 }
 
 
@@ -896,10 +904,3 @@ interface VideoIPersenter extends BasePersenter {
 
 }
 
-class VideoJsonBean {
-    public String videourl;
-    public String videoname;
-    public String videoid;
-    public String videoplaytime;
-    public String videoneedpost;
-}

+ 50 - 0
app/src/main/java/com/edufound/android/xyyf/view/CusVideoView.java

@@ -0,0 +1,50 @@
+package com.edufound.android.xyyf.view;
+
+import android.content.Context;
+import android.media.MediaPlayer;
+import android.util.AttributeSet;
+import android.view.KeyEvent;
+import android.widget.VideoView;
+
+import com.edufound.android.xyyf.util.Logger;
+
+public class CusVideoView extends VideoView {
+    public CusVideoView(Context context) {
+        super(context);
+    }
+
+    public CusVideoView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public CusVideoView(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        //super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+        int width = getDefaultSize(0, widthMeasureSpec);
+        int height = getDefaultSize(0, heightMeasureSpec);
+        setMeasuredDimension(width, height);
+
+    }
+
+
+    @Override
+    public void setOnPreparedListener(MediaPlayer.OnPreparedListener l) {
+        super.setOnPreparedListener(l);
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return super.onKeyDown(keyCode, event);
+    }
+
+    @Override
+    protected void onDetachedFromWindow() {
+        Logger.e("onDetachedFromWindow--onDetachedFromWindow--onDetachedFromWindow--onDetachedFromWindow--onDetachedFromWindow");
+        super.onDetachedFromWindow();
+    }
+
+}

+ 4 - 4
app/src/main/java/com/edufound/mobile/xxt/view/ErrorView.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.view;
+package com.edufound.android.xyyf.view;
 
 import android.content.Context;
 import android.graphics.Color;
@@ -7,9 +7,9 @@ import android.view.View;
 import android.widget.FrameLayout;
 import android.widget.TextView;
 
-import com.edufound.mobile.xxt.R;
-import com.edufound.mobile.xxt.base.BaseView;
-import com.edufound.mobile.xxt.util.ToastUtil;
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.base.BaseView;
+import com.edufound.android.xyyf.util.ToastUtil;
 
 public class ErrorView extends FrameLayout {
     BaseView mView;

+ 8 - 8
app/src/main/java/com/edufound/mobile/xxt/wxapi/WXEntryActivity.java

@@ -1,4 +1,4 @@
-package com.edufound.mobile.xxt.wxapi;
+package com.edufound.android.xyyf.wxapi;
 
 import android.os.Build;
 import android.os.Bundle;
@@ -6,11 +6,11 @@ import android.os.Message;
 import android.support.annotation.RequiresApi;
 import android.view.WindowManager;
 
-import com.edufound.mobile.xxt.base.BaseActivity;
-import com.edufound.mobile.xxt.main.MainPersenter;
-import com.edufound.mobile.xxt.pay.PayInit;
-import com.edufound.mobile.xxt.util.Logger;
-import com.edufound.mobile.xxt.util.OKHttpUtil;
+import com.edufound.android.xyyf.base.BaseActivity;
+import com.edufound.android.xyyf.main.MainPersenter;
+import com.edufound.android.xyyf.pay.PayInit;
+import com.edufound.android.xyyf.util.Logger;
+import com.edufound.android.xyyf.util.OKHttpUtil;
 import com.tencent.mm.opensdk.constants.ConstantsAPI;
 import com.tencent.mm.opensdk.modelbase.BaseReq;
 import com.tencent.mm.opensdk.modelbase.BaseResp;
@@ -89,7 +89,7 @@ public class WXEntryActivity extends BaseActivity implements IWXAPIEventHandler
                 .append(code)
                 .append("&grant_type=authorization_code");
         try {
-            OKHttpUtil.getInstance().getContentLength(loginUrl.toString(), new Callback() {
+            OKHttpUtil.getInstance().doGetSync(loginUrl.toString(), new Callback() {
                 @Override
                 public void onFailure(Call call, IOException e) {
 
@@ -108,7 +108,7 @@ public class WXEntryActivity extends BaseActivity implements IWXAPIEventHandler
                         e.printStackTrace();
                     }
                     String getUserInfo = "https://api.weixin.qq.com/sns/userinfo?access_token=" + access + "&openid=" + openId;
-                    OKHttpUtil.getInstance().getContentLength(getUserInfo, new Callback() {
+                    OKHttpUtil.getInstance().doGetSync(getUserInfo, new Callback() {
                         @Override
                         public void onFailure(Call call, IOException e) {
 

+ 5 - 5
app/src/main/java/com/edufound/mobile/xxt/wxapi/WXPayEntryActivity.java

@@ -1,14 +1,14 @@
-package com.edufound.mobile.xxt.wxapi;
+package com.edufound.android.xyyf.wxapi;
 
 import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.Message;
 
-import com.edufound.mobile.xxt.R;
-import com.edufound.mobile.xxt.main.MainPersenter;
-import com.edufound.mobile.xxt.pay.PayInit;
-import com.edufound.mobile.xxt.util.ContextUtil;
+import com.edufound.android.xyyf.R;
+import com.edufound.android.xyyf.main.MainPersenter;
+import com.edufound.android.xyyf.pay.PayInit;
+import com.edufound.android.xyyf.util.ContextUtil;
 import com.tencent.mm.opensdk.constants.ConstantsAPI;
 import com.tencent.mm.opensdk.modelbase.BaseReq;
 import com.tencent.mm.opensdk.modelbase.BaseResp;

+ 0 - 223
app/src/main/java/com/edufound/mobile/xxt/activity/MainActivity.java

@@ -1,223 +0,0 @@
-package com.edufound.mobile.xxt.activity;
-
-import android.app.Activity;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.graphics.drawable.AnimationDrawable;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.text.TextUtils;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.WindowManager;
-import android.webkit.WebView;
-import android.widget.FrameLayout;
-import android.widget.ImageView;
-
-import com.edufound.mobile.xxt.R;
-import com.edufound.mobile.xxt.application.EApplication;
-import com.edufound.mobile.xxt.base.BaseActivity;
-import com.edufound.mobile.xxt.main.MainPersenter;
-import com.edufound.mobile.xxt.main.MainView;
-import com.edufound.mobile.xxt.util.ContextUtil;
-import com.edufound.mobile.xxt.util.DeviceUuidFactory;
-import com.edufound.mobile.xxt.util.Logger;
-import com.edufound.mobile.xxt.util.NotificationUtil;
-import com.edufound.mobile.xxt.util.ShowDebugUrl;
-
-
-//调用Persenter里面的方法
-public class MainActivity extends BaseActivity implements MainView {
-
-    private Activity mActivity;
-    FrameLayout mRootView;
-    ImageView mLoading;
-    MainPersenter mPersenter;
-    WebView mWebView;
-    boolean activityPay;
-    AnimationDrawable mLoadingAnim;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        setContentView(R.layout.activity_main);
-        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
-        mActivity = this;
-        mPersenter = new MainPersenter(this);
-        initCloseMain();
-        super.onCreate(savedInstanceState);
-    }
-
-
-    @Override
-    protected void initVew() {
-        Logger.DebugE("initVew");
-        mRootView = findViewById(R.id.main_root);
-        mLoading = findViewById(R.id.main_webloading);
-        mLoadingAnim = (AnimationDrawable) mLoading.getBackground();
-        mLoadingAnim.start();
-//        为防止内存泄漏,用ContextUtil.getContext,但是不弹alert
-        mWebView = new WebView(ContextUtil.getContext());
-        //        //支持alert,但是容易内存泄漏
-//        mWebView = new WebView(MainActivity.this);
-        mPersenter.initWebView(mWebView);
-        mWebView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
-        mRootView.addView(mWebView);
-        mWebView.bringToFront();
-        mLoading.bringToFront();
-        new DeviceUuidFactory(ContextUtil.getContext());
-        mPersenter.openWeb(getIntent());
-    }
-
-
-    @Override
-    public boolean onKeyDown(int keyCode, KeyEvent event) {
-        ShowDebugUrl.dispatchKeyEvent(event, this);
-        super.onKeyDown(keyCode, event);
-        return mPersenter.onKeyDown(keyCode, event);
-    }
-
-    @Override
-    public boolean onKeyUp(int keyCode, KeyEvent event) {
-        return mPersenter.onKeyUp(keyCode, event);
-    }
-
-    @Override
-    protected void onDestroy() {
-        super.onDestroy();
-//        System.exit(0);
-        mPersenter.getJsInterfaces().desClickMusic();
-        unregisterReceiver(mainBroad);
-        mWebView.loadUrl("");
-        mWebView.removeAllViews();
-        mWebView.destroy();
-    }
-
-    @Override
-    protected void onResume() {
-        super.onResume();
-        NotificationUtil.choseNotification(mActivity);
-        if (!ContextUtil.getNetWorkState()) {
-            //断网状态
-            DisconnNetWork();
-        }
-    }
-
-    @Override
-    public void showData(String text) {
-//        Toast.makeText(ContextUtil.getContext(), text, Toast.LENGTH_SHORT).show();
-    }
-
-    @Override
-    public void loadUrl(String url) {
-        mWebView.loadUrl(url);
-    }
-
-
-    @Override
-    public void loadJsMehtod(String method) {
-        mWebView.loadUrl("javascript:" + method + "");
-    }
-
-
-    @Override
-    public void DisconnNetWork() {
-        super.DisconnNetWork();
-        if (getLocalPckClas().equals(getTopActivity(this))) {
-            mPersenter.onDisConnNetWork();
-        }
-    }
-
-    @Override
-    public void ConnNeWork() {
-        super.ConnNeWork();
-        if (getLocalPckClas().equals(getTopActivity(this))) {
-            mPersenter.onConnNetWork();
-        }
-    }
-
-    @Override
-    public Activity getActivity() {
-        if (mActivity == null) {
-            mActivity = this;
-        }
-        return mActivity;
-    }
-
-    @Override
-    public void setActivityPay(boolean bool) {
-        activityPay = bool;
-    }
-
-    @Override
-    public boolean getActivityPay() {
-        return activityPay;
-    }
-
-    @Override
-    public void acPostDelayed(Runnable runnable, int time) {
-        mWebView.postDelayed(runnable, time);
-    }
-
-    @Override
-    public void destroyWeb() {
-        mWebView.clearCache(true);
-        mWebView.removeAllViews();
-        mWebView.clearHistory();
-//        mWebView.destroy();
-    }
-
-    @Override
-    public void hideLoading() {
-        mLoading.setVisibility(View.GONE);
-    }
-
-    @Override
-    public void stopWebView() {
-        mWebView.pauseTimers();
-    }
-
-    @Override
-    public void resumeWebView() {
-        mWebView.resumeTimers();
-    }
-
-
-    @Override
-    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
-        super.onActivityResult(requestCode, resultCode, data);
-        mPersenter.onActivityResult(requestCode, resultCode, data);
-    }
-
-    void initCloseMain() {
-        IntentFilter intentFilter = new IntentFilter();
-        intentFilter.addAction(ContextUtil.CLOSE_ACTIVITY_MAIN);
-        intentFilter.addAction(ContextUtil.NOTIFICATION_WEB_PLAYERTIME);
-        registerReceiver(mainBroad, intentFilter);
-    }
-
-    BroadcastReceiver mainBroad = new BroadcastReceiver() {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            switch (intent.getAction()) {
-                case ContextUtil.CLOSE_ACTIVITY_MAIN:
-                    EApplication.clearActivity();
-                    Intent intent_restart = new Intent(ContextUtil.CLOSE_ACTIVITY_SPLASH);
-                    getActivity().sendBroadcast(intent_restart);
-                    break;
-                case ContextUtil.NOTIFICATION_WEB_PLAYERTIME:
-                    String time = intent.getStringExtra("over_time");
-                    String id = intent.getStringExtra("over_id");
-                    String neetpost = intent.getStringExtra("over_neetpost");
-                    String moduletype = intent.getStringExtra("over_moduletype");
-                    loadJsMehtod("videoTimeRecord(" + id + "," + time + "," + neetpost + ",'" + moduletype + "')");
-                    break;
-            }
-
-        }
-    };
-
-
-}

+ 0 - 436
app/src/main/java/com/edufound/mobile/xxt/main/MainPersenter.java

@@ -1,436 +0,0 @@
-package com.edufound.mobile.xxt.main;
-
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.app.Dialog;
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.graphics.Color;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.support.annotation.Nullable;
-import android.view.Display;
-import android.view.Gravity;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.Window;
-import android.view.WindowManager;
-import android.webkit.JsResult;
-import android.webkit.WebChromeClient;
-import android.webkit.WebResourceRequest;
-import android.webkit.WebResourceResponse;
-import android.webkit.WebSettings;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import com.edufound.mobile.xxt.application.EApplication;
-import com.edufound.mobile.xxt.base.BaseModel;
-import com.edufound.mobile.xxt.base.BasePersenter;
-import com.edufound.mobile.xxt.interfaces.EfunboxPayInterfaces;
-import com.edufound.mobile.xxt.interfaces.JsInterfaces;
-import com.edufound.mobile.xxt.util.ContextUtil;
-import com.edufound.mobile.xxt.util.DeviceUtil;
-import com.edufound.mobile.xxt.util.DeviceUuidFactory;
-import com.edufound.mobile.xxt.util.Logger;
-import com.edufound.mobile.xxt.util.SPutil;
-import com.edufound.mobile.xxt.util.ToastUtil;
-import com.edufound.mobile.xxt.view.ErrorView;
-
-public class MainPersenter implements MainIPersenter {
-
-    public static final int WECHAT_LOGIN = 0x76761;
-    public static final int PAY_RESULT = 0x76762;
-    private static MainView mView = null;
-    private MainModel mModel = null;
-    private JsInterfaces mJsInterfaces = null;
-    private EfunboxPayInterfaces mPayInterfaces = null;
-    private String mLoadUrl;
-    ErrorView mErrorView;
-    Dialog mErrorViewDialog;
-    private DeviceUtil deviceUtil;
-
-
-    public MainPersenter(MainView view) {
-        mView = view;
-        mModel = new MainModel();
-        deviceUtil = new DeviceUtil();
-        mJsInterfaces = new JsInterfaces(mView);
-        mPayInterfaces = new EfunboxPayInterfaces(mView);
-    }
-
-    @Override
-    public void loadData() {
-        mModel.LoadData(new BaseModel.LoadDataBack() {
-            @Override
-            public void success(String datajson) {
-                Logger.e("datajson:" + datajson);
-                mView.showData(datajson);
-            }
-
-            @Override
-            public void failure() {
-                Logger.e("failure");
-            }
-        });
-    }
-
-    // 设置WebView
-    @SuppressLint("JavascriptInterface")
-    @Override
-    public void initWebView(final WebView webview) {
-        if (Build.VERSION.SDK_INT >= 19) {
-            webview.getSettings().setLoadsImagesAutomatically(true);
-        } else {
-            webview.getSettings().setLoadsImagesAutomatically(false);
-        }
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-            webview.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
-        }
-        webview.requestFocus(View.FOCUS_DOWN);
-        webview.getSettings().setJavaScriptEnabled(true);
-        webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);//允许js弹出窗口
-        webview.getSettings().setDomStorageEnabled(true);
-//        webview.getSettings().setMediaPlaybackRequiresUserGesture(false);
-        webview.getSettings().setBlockNetworkImage(false);
-        // webview.getSettings().set
-        webview.setBackgroundColor(Color.TRANSPARENT);
-//       webview.setBackgroundResource();
-        webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
-        webview.getSettings().setUseWideViewPort(true);
-        webview.getSettings().setLoadWithOverviewMode(true);
-        webview.getSettings().setTextZoom(100);
-        webview.setWebChromeClient(new WebChromeClient() {
-
-            @Override
-            public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
-
-                return super.onJsAlert(view, url, message, result);
-            }
-
-            @Override
-            public void onShowCustomView(View view, CustomViewCallback callback) {
-
-                super.onShowCustomView(view, callback);
-            }
-
-            @Override
-            public void onProgressChanged(WebView view, int newProgress) {
-
-                if (newProgress >= 100) {
-                }
-                super.onProgressChanged(view, newProgress);
-            }
-
-        });
-
-        webview.setWebViewClient(new WebViewClient() {
-
-            @Override
-            public boolean shouldOverrideUrlLoading(WebView view, String url) {
-//                webview.removeAllViews();
-                view.loadUrl(url);
-                return true;
-            }
-
-            @Override
-            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
-                super.onReceivedError(view, errorCode, description, failingUrl);
-                view.loadUrl("");
-                showDisConnNeWorkWindow();
-            }
-
-            @Override
-            public void onReceivedHttpError(WebView view, WebResourceRequest request, WebResourceResponse errorResponse) {
-                super.onReceivedHttpError(view, request, errorResponse);
-//                int statusCode = 0;
-//                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
-//                    statusCode = errorResponse.getStatusCode();
-//                }
-//                System.out.println("onReceivedHttpError code = " + statusCode);
-//                if (404 == statusCode) {
-//                    view.loadUrl("about:blank");// 避免出现默认的错误界面
-//                    showDisConnNeWorkWindow();
-//                }
-
-            }
-
-            @Override
-            public void onPageStarted(WebView view, String url, Bitmap favicon) {
-                super.onPageStarted(view, url, favicon);
-            }
-
-            @Override
-            public void onPageFinished(WebView view, String url) {
-                if (!webview.getSettings().getLoadsImagesAutomatically()) {
-                    webview.getSettings().setLoadsImagesAutomatically(true);
-                }
-                mView.hideLoading();
-                super.onPageFinished(view, url);
-            }
-
-        });
-        webview.addJavascriptInterface(mJsInterfaces, "efunboxJS");
-        webview.addJavascriptInterface(mPayInterfaces, "efunboxPay");
-
-    }
-
-    public int dip2px(Context context, float dpValue) {
-        final float scale = context.getResources().getDisplayMetrics().density;
-        return (int) (dpValue * scale + 0.5f);
-    }
-
-    @Override
-    public JsInterfaces getJsInterfaces() {
-        return mJsInterfaces;
-    }
-
-    @Override
-    public EfunboxPayInterfaces getPayInterfaces() {
-        return mPayInterfaces;
-    }
-
-    @Override
-    public void openWeb(Intent intent) {
-        mView.loadUrl("");
-        mLoadUrl = mModel.getDefaultLoadUrl();
-        String intent_url = intent.getStringExtra("url");
-        Logger.e("-----------------------------");
-        Logger.e("intent_url:" + intent_url);
-        Logger.e("-----------------------------");
-        if (intent_url != null && !intent_url.isEmpty()) {
-            mLoadUrl = intent_url;
-        }
-        String preuuid = SPutil.getPrefString(ContextUtil.getContext(), DeviceUuidFactory.UUID_SPKEY, "");
-        if (preuuid.equals("")) {
-            preuuid = DeviceUuidFactory.getUuid().toString();
-        }
-
-        StringBuffer buffer = new StringBuffer();
-        buffer.append("appCode=" + EApplication.getAppCode());
-        buffer.append("&uuid=" + preuuid);
-        buffer.append("&width=" + deviceUtil.getWidth(mView.getActivity()));
-        buffer.append("&height=" + deviceUtil.getHeight(mView.getActivity()));
-        buffer.append("&version=" + deviceUtil.getVersionCode(mView.getActivity()));
-        mLoadUrl += buffer.toString();
-        Logger.DebugE("LOADURL=" + mLoadUrl);
-        mView.loadUrl(mLoadUrl);
-    }
-
-    @Override
-    public boolean onKeyDown(int keycode, KeyEvent event) {
-        switch (keycode) {
-            case KeyEvent.KEYCODE_DPAD_CENTER:
-            case KeyEvent.KEYCODE_ENTER:
-                mView.loadJsMehtod("boxEventHandler('key_down','KEY_SELECT')");
-                break;
-            case KeyEvent.KEYCODE_BACK:
-            case KeyEvent.KEYCODE_ESCAPE:
-                mView.loadJsMehtod("boxEventHandler('key_down','KEY_BACK')");
-                return true;
-            case KeyEvent.KEYCODE_HOME:
-                // Home键 -,- P.S:不一定能监听到
-                Logger.DebugE("click home");
-                EApplication.exitApp();
-                break;
-            case KeyEvent.KEYCODE_DPAD_UP:
-                // 上
-                mView.loadJsMehtod("boxEventHandler('key_down','KEY_UP')");
-                break;
-            case KeyEvent.KEYCODE_DPAD_RIGHT:
-                // 右
-                mView.loadJsMehtod("boxEventHandler('key_down','KEY_RIGHT')");
-                break;
-            case KeyEvent.KEYCODE_DPAD_DOWN:
-                // 下
-                mView.loadJsMehtod("boxEventHandler('key_down','KEY_DOWN')");
-                break;
-            case KeyEvent.KEYCODE_DPAD_LEFT:
-                // 左
-                mView.loadJsMehtod("boxEventHandler('key_down','KEY_LEFT')");
-                break;
-        }
-        return false;
-    }
-
-    @Override
-    public boolean onKeyUp(int keycode, KeyEvent event) {
-//        getJsInterfaces().clickMusic("1", "1");
-        if (mView.getActivityPay()) {
-            return true;
-        }
-        switch (keycode) {
-            case KeyEvent.KEYCODE_DPAD_CENTER:
-            case KeyEvent.KEYCODE_ENTER:
-                // 确认键
-                mView.loadJsMehtod("boxEventHandler('key_up','KEY_SELECT')");
-                break;
-            case KeyEvent.KEYCODE_BACK:
-            case KeyEvent.KEYCODE_ESCAPE:
-                // 返回键
-                mView.loadJsMehtod("boxEventHandler('key_up','KEY_BACK')");
-//                mJsInterfaces.closeApp();
-                return true;
-            case KeyEvent.KEYCODE_DPAD_UP:
-                // 上
-                mView.loadJsMehtod("boxEventHandler('key_up','KEY_UP')");
-                break;
-            case KeyEvent.KEYCODE_DPAD_RIGHT:
-                // 右
-                mView.loadJsMehtod("boxEventHandler('key_up','KEY_RIGHT')");
-                break;
-            case KeyEvent.KEYCODE_DPAD_DOWN:
-                // 下
-                mView.loadJsMehtod("boxEventHandler('key_up','KEY_DOWN')");
-                break;
-            case KeyEvent.KEYCODE_DPAD_LEFT:
-                // 左
-                mView.loadJsMehtod("boxEventHandler('key_up','KEY_LEFT')");
-                break;
-        }
-        return false;
-    }
-
-    @Override
-    public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
-        switch (requestCode) {
-            case EfunboxPayInterfaces.START_PAY_DB:
-                if (resultCode == Activity.RESULT_OK) {
-                    Bundle bundle = data.getExtras();
-                    int back = bundle.getInt("back");
-                    //back为返回值
-                    String Out_trade_no = bundle.getString("Out_trade_no");
-                    // Out_trade_no为订单号
-                } else if (requestCode == Activity.RESULT_CANCELED) {
-                }
-                break;
-            case EfunboxPayInterfaces.START_PAY_HUANWANG:
-                break;
-            case EfunboxPayInterfaces.START_PAY_SKYWORTH:
-//                ToastUtil.showToast("START_PAY_SKYWORTH");
-                break;
-            case EfunboxPayInterfaces.START_PAY_XIAOMI:
-//                ToastUtil.showToast("START_PAY_XIAOMI");
-                break;
-
-        }
-        mView.acPostDelayed(new Runnable() {
-            @Override
-            public void run() {
-                mView.setActivityPay(false);
-            }
-        }, 1000);
-    }
-
-
-    @Override
-    public void onDisConnNetWork() {
-//        ToastUtil.showToast("断网了。。");
-        mView.stopWebView();
-        showDisConnNeWorkWindow();
-    }
-
-    @Override
-    public void onConnNetWork() {
-        Logger.e("onConnNetWork");
-//        if (mErrorViewDialog != null) {
-//            mErrorViewDialog.dismiss();
-//            mView.resumeWebView();
-//        }
-    }
-
-    void showDisConnNeWorkWindow() {
-        if (mErrorView == null) {
-            mErrorViewDialog = new Dialog(mView.getActivity());
-            try {
-                int dividerID = mView.getActivity().getResources().getIdentifier("android:id/titleDivider", null, null);
-                View divider = mErrorViewDialog.findViewById(dividerID);
-                divider.setBackgroundColor(Color.TRANSPARENT);
-            } catch (Exception e) {
-                //上面的代码,是用来去除Holo主题的蓝色线条
-                e.printStackTrace();
-            }
-            mErrorView = new ErrorView(mView);
-            mErrorView.setViewBgColor(Color.TRANSPARENT);
-            mErrorView.setBtnClickListener(new ErrorView.BtnClickListener() {
-                @Override
-                public void clickRelase() {
-                    //重新加载
-                    if (ContextUtil.getNetWorkState()) {
-                        mView.destroyWeb();
-                        mErrorViewDialog.dismiss();
-                        mView.resumeWebView();
-                        openWeb(mView.getActivity().getIntent());
-                    } else {
-                        ToastUtil.showToast("请检查网络连接状况");
-                    }
-                }
-
-                @Override
-                public void clickExit() {
-                    //退出
-                    mErrorViewDialog.dismiss();
-                    mView.getActivity().finish();
-                    EApplication.clearActivity();
-                }
-            });
-            mErrorViewDialog.setCancelable(false);
-            mErrorViewDialog.setContentView(mErrorView);
-            Window dialogWindow = mErrorViewDialog.getWindow();
-            dialogWindow.setGravity(Gravity.CENTER);
-            dialogWindow.getDecorView().setPadding(0, 0, 0, 0);
-            dialogWindow.getDecorView().setBackgroundColor(Color.TRANSPARENT);
-            WindowManager m = mView.getActivity().getWindowManager();
-            Display d = m.getDefaultDisplay(); // 获取屏幕宽、高用
-            WindowManager.LayoutParams p = dialogWindow.getAttributes(); // 获取对话框当前的参数值
-            p.height = (int) (d.getHeight() * 1);
-            p.width = WindowManager.LayoutParams.MATCH_PARENT;
-            p.horizontalMargin = 0;
-            dialogWindow.setAttributes(p);
-        }
-        if (!mErrorViewDialog.isShowing()) {
-            mErrorViewDialog.show();
-        }
-    }
-
-
-    public static Handler mPersenterHandler = new Handler(new Handler.Callback() {
-        @Override
-        public boolean handleMessage(Message msg) {
-            switch (msg.what) {
-                case WECHAT_LOGIN:
-//                    Logger.e("微信用户信息:" + msg.obj.toString());
-                    mView.loadJsMehtod("WeChatLoginSuccess('" + msg.obj.toString() + "')");
-                    break;
-                case PAY_RESULT:
-                    mView.loadJsMehtod("commonPayResult(" + msg.obj.toString() + ")");
-                    Intent intent_restart = new Intent(ContextUtil.CLOSE_ACTIVITY_PAY);
-                    mView.getActivity().sendBroadcast(intent_restart);
-                    break;
-            }
-            return false;
-        }
-    });
-
-
-}
-
-
-interface MainIPersenter extends BasePersenter {
-    void initWebView(WebView webview);
-
-    JsInterfaces getJsInterfaces();
-
-    EfunboxPayInterfaces getPayInterfaces();
-
-    void openWeb(Intent intent);
-
-    boolean onKeyDown(int keycode, KeyEvent event);
-
-    boolean onKeyUp(int keycode, KeyEvent event);
-
-    void onActivityResult(int requestCode, int resultCode, @Nullable Intent data);
-
-}

+ 0 - 37
app/src/main/java/com/edufound/mobile/xxt/main/MainView.java

@@ -1,37 +0,0 @@
-package com.edufound.mobile.xxt.main;
-
-import android.app.Activity;
-
-import com.edufound.mobile.xxt.base.BaseView;
-
-
-public interface MainView extends BaseView {
-    //把View拋出給Presenter調用
-
-    void loadUrl(String url);
-
-    @Override
-    void DisconnNetWork();
-
-    @Override
-    void ConnNeWork();
-
-    void loadJsMehtod(String method);
-
-    Activity getActivity();
-
-    void setActivityPay(boolean bool);
-
-    boolean getActivityPay();
-
-    void acPostDelayed(Runnable runnable, int time);
-
-    void destroyWeb();
-
-    void hideLoading();
-
-    void stopWebView();
-
-    void resumeWebView();
-
-}

File diff suppressed because it is too large
+ 0 - 1
app/src/main/java/com/edufound/mobile/xxt/pay/ali/PayResult.java


+ 0 - 147
app/src/main/java/com/edufound/mobile/xxt/util/OKHttpUtil.java

@@ -1,147 +0,0 @@
-package com.edufound.mobile.xxt.util;
-
-import org.apache.http.conn.ssl.SSLSocketFactory;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.net.UnknownHostException;
-import java.security.KeyManagementException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.X509Certificate;
-import java.util.concurrent.TimeUnit;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-import okhttp3.Call;
-import okhttp3.Callback;
-import okhttp3.OkHttpClient;
-import okhttp3.Request;
-import okhttp3.Response;
-
-
-/**
- * Http网络工具,基于OkHttp
- * Created by Cheny on 2017/04/29.
- */
-
-public class OKHttpUtil {
-    private OkHttpClient mOkHttpClient;
-    private static OKHttpUtil mInstance;
-    private final static long CONNECT_TIMEOUT = 60;//超时时间,秒
-    private final static long READ_TIMEOUT = 60;//读取时间,秒
-    private final static long WRITE_TIMEOUT = 60;//写入时间,秒
-
-    /**
-     * @param url        下载链接
-     * @param startIndex 下载起始位置
-     * @param endIndex   结束为止
-     * @param callback   回调
-     * @throws IOException
-     */
-    public void downloadFileByRange(String url, long startIndex, long endIndex, Callback callback) throws IOException {
-        // 创建一个Request
-        // 设置分段下载的头信息。 Range:做分段数据请求,断点续传指示下载的区间。格式: Range bytes=0-1024或者bytes:0-1024
-        Request request = new Request.Builder().header("RANGE", "bytes=" + startIndex + "-" + endIndex)
-                .url(url)
-                .build();
-        doAsync(request, callback);
-    }
-
-    public void getContentLength(String url, Callback callback) throws IOException {
-        // 创建一个Request
-        Request request = new Request.Builder()
-                .url(url)
-                .build();
-        doAsync(request, callback);
-    }
-
-    /**
-     * 异步请求
-     */
-    public void doAsync(Request request, Callback callback) throws IOException {
-        //创建请求会话
-        Call call = mOkHttpClient.newCall(request);
-        //同步执行会话请求
-        call.enqueue(callback);
-    }
-
-    /**
-     * 同步请求
-     */
-    public Response doSync(Request request) throws IOException {
-
-        //创建请求会话
-        Call call = mOkHttpClient.newCall(request);
-        //同步执行会话请求
-        return call.execute();
-    }
-
-
-    /**
-     * @return HttpUtil实例对象
-     */
-    public static OKHttpUtil getInstance() {
-        if (null == mInstance) {
-            synchronized (OKHttpUtil.class) {
-                if (null == mInstance) {
-                    mInstance = new OKHttpUtil();
-                }
-            }
-        }
-        return mInstance;
-    }
-
-    /**
-     * 构造方法,配置OkHttpClient
-     */
-    public OKHttpUtil() {
-        //创建okHttpClient对象
-        OkHttpClient.Builder builder = new OkHttpClient.Builder()
-                .connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS)
-                .writeTimeout(READ_TIMEOUT, TimeUnit.SECONDS)
-                .readTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS);
-        mOkHttpClient = builder.build();
-    }
-
-
-    private static class SSLSocketFactoryEx extends SSLSocketFactory {
-
-        SSLContext sslContext = SSLContext.getInstance("TLS");
-
-        public SSLSocketFactoryEx(KeyStore truststore) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException {
-            super(truststore);
-
-            TrustManager tm = new X509TrustManager() {
-
-                public X509Certificate[] getAcceptedIssuers() {
-                    return null;
-                }
-
-                @Override
-                public void checkClientTrusted(X509Certificate[] chain, String authType) throws java.security.cert.CertificateException {
-                }
-
-                @Override
-                public void checkServerTrusted(X509Certificate[] chain, String authType) throws java.security.cert.CertificateException {
-                }
-            };
-
-            sslContext.init(null, new TrustManager[]{tm}, null);
-        }
-
-        @Override
-        public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException, UnknownHostException {
-            return sslContext.getSocketFactory().createSocket(socket, host, port, autoClose);
-        }
-
-        @Override
-        public Socket createSocket() throws IOException {
-            return sslContext.getSocketFactory().createSocket();
-        }
-    }
-}

BIN
app/src/main/res/drawable/date_bg.png


BIN
app/src/main/res/drawable/ic_launcher.jpg


BIN
app/src/main/res/drawable/icon_close.png


+ 16 - 17
app/src/main/res/layout/activity_main.xml

@@ -1,25 +1,24 @@
 <?xml version="1.0" encoding="utf-8"?>
 <FrameLayout 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:id="@+id/main_root"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="@color/black"
-    tools:context=".xxt.activity.MainActivity">
-
-    <WebView
-        android:id="@+id/myWebView"
+        xmlns:app="http://schemas.android.com/apk/res-auto"
+        xmlns:tools="http://schemas.android.com/tools"
+        android:id="@+id/main_root"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"></WebView>
+        android:layout_height="match_parent"
+        android:background="@color/black">
 
     <ImageView
-        android:id="@+id/main_webloading"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center"
-        android:layout_marginBottom="5dp"
-        android:background="@drawable/edufound_loading" />
+            android:id="@+id/main_webloading"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:layout_marginBottom="5dp"
+            android:background="@drawable/edufound_loading" />
 
 
+    <android.support.v7.widget.RecyclerView
+            android:id="@+id/main_recycler"
+            android:layout_width="500dp"
+            android:layout_height="200dp"
+            android:visibility="gone"></android.support.v7.widget.RecyclerView>
 </FrameLayout>

+ 23 - 0
app/src/main/res/layout/custom_land_dialog.xml

@@ -0,0 +1,23 @@
+<?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">
+
+    <include layout="@layout/custom_port_dialog_action_bar" />
+
+    <RelativeLayout
+            android:id="@+id/container_icon"
+            android:layout_width="match_parent"
+            android:layout_height="51dp"
+            android:gravity="center"
+            android:orientation="horizontal">
+
+        <TextView
+                android:id="@+id/changePhoneNumLogin"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:gravity="center"
+                android:text="切换手机号登录"></TextView>
+    </RelativeLayout>
+
+</RelativeLayout>

+ 34 - 0
app/src/main/res/layout/custom_port_dialog_action_bar.xml

@@ -0,0 +1,34 @@
+<?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="45dp"
+        android:background="@android:color/transparent">
+
+    <TextView
+            android:id="@+id/tv_title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="20dp"
+            android:gravity="center"
+            android:text="登录"
+            android:textColor="@android:color/holo_blue_light"
+            android:textSize="26sp"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+    <ImageView
+            android:id="@+id/btn_close"
+            android:layout_width="20dp"
+            android:layout_height="20dp"
+            android:layout_marginBottom="20dp"
+            android:paddingRight="10dp"
+            android:scaleType="fitCenter"
+            android:src="@drawable/icon_close"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+</android.support.constraint.ConstraintLayout>

+ 107 - 0
app/src/main/res/layout/date_view.xml

@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:app="http://schemas.android.com/apk/res-auto"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="#A6000000"
+        android:clickable="true">
+
+    <!--    <ImageView-->
+    <!--        android:id="@+id/date_back"-->
+    <!--        android:layout_width="31.5dp"-->
+    <!--        android:layout_height="31.5dp"-->
+    <!--        android:layout_marginLeft="41.5dp"-->
+    <!--        android:layout_marginTop="36dp"-->
+    <!--        android:src="@drawable/back"></ImageView>-->
+
+    <LinearLayout
+            android:layout_width="433.5dp"
+            android:layout_height="224.5dp"
+            android:layout_gravity="center"
+            android:background="@drawable/date_bg"
+            android:orientation="vertical">
+
+        <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="1">
+
+
+            <TextView
+                    android:id="@+id/date_cancel"
+                    android:layout_width="0dp"
+                    android:layout_height="match_parent"
+                    android:layout_weight="1"
+                    android:gravity="center"
+                    android:text="取消"
+                    android:textSize="20sp"></TextView>
+
+            <TextView
+                    android:id="@+id/date_title"
+                    android:layout_width="0dp"
+                    android:layout_height="match_parent"
+                    android:layout_weight="1"
+                    android:gravity="center"
+                    android:text="生日选择"
+                    android:textColor="#ff188ef7"
+                    android:textSize="22sp"></TextView>
+
+            <TextView
+                    android:id="@+id/date_ok"
+                    android:layout_width="0dp"
+                    android:layout_height="match_parent"
+                    android:layout_weight="1"
+                    android:gravity="center"
+                    android:text="确认"
+                    android:textColor="#ffff9a31"
+                    android:textSize="20sp"></TextView>
+        </LinearLayout>
+
+        <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_gravity="center"
+                android:layout_weight="1.8"
+                android:orientation="horizontal">
+
+
+            <com.cncoderx.wheelview.WheelView
+                    android:id="@+id/date_whell_y"
+                    android:layout_width="0dp"
+                    android:layout_height="match_parent"
+                    android:layout_weight="1"
+                    app:wheelCyclic="true"
+                    app:wheelItemCount="3"
+                    app:wheelSelectedTextColor="#000000"
+                    app:wheelTextColor="#9E9E9E" />
+
+            <com.cncoderx.wheelview.WheelView
+                    android:id="@+id/date_whell_m"
+                    android:layout_width="0dp"
+                    android:layout_height="match_parent"
+                    android:layout_weight="1"
+                    app:wheelCyclic="true"
+                    app:wheelItemCount="3"
+                    app:wheelSelectedTextColor="#000000"
+                    app:wheelTextColor="#9E9E9E" />
+
+
+            <com.cncoderx.wheelview.WheelView
+                    android:id="@+id/date_whell_d"
+                    android:layout_width="0dp"
+                    android:layout_height="match_parent"
+                    android:layout_weight="1"
+                    app:wheelCyclic="true"
+                    app:wheelItemCount="3"
+                    app:wheelSelectedTextColor="#000000"
+                    app:wheelTextColor="#9E9E9E" />
+        </LinearLayout>
+
+        <Space
+                android:layout_width="wrap_content"
+                android:layout_height="0dp"
+                android:layout_weight="0.2"></Space>
+    </LinearLayout>
+
+
+</FrameLayout>

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

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:clickable="true">
+
+    <android.support.v7.widget.CardView
+            android:id="@+id/fragment_cardview"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+        <com.edufound.android.xyyf.ijkplayer.media.IjkVideoView
+                android:id="@+id/fragment_video"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"></com.edufound.android.xyyf.ijkplayer.media.IjkVideoView>
+
+        <ImageView
+                android:id="@+id/fragment_image_frame"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:background="@color/colorPrimary"></ImageView>
+    </android.support.v7.widget.CardView>
+
+
+</FrameLayout>

+ 1 - 1
app/src/main/res/values/projectstring.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <!--8.0生产环境前端地址 http://ott80-web.ai160.com/stage/index/index.html-->
-    <string name="default_url">http://xxt-web.ai160.com/stage/index/index.html</string>
+    <string name="default_url">http://192.168.1.126:8080/efunbox-xyyf-web/1.0.0/stage/index/index.html</string>
     <!--义方渠道-->
     <string name="app_code_yf">2006</string>
     <!--应用宝-->

+ 1 - 1
app/src/main/res/xml/apk_file_paths.xml

@@ -2,7 +2,7 @@
 <paths>
     <root-path
         name="apk"
-        path="Android/data/com.edufound.mobile.xxt/" />
+        path="Android/data/com.edufound.android.xyyf/" />
     <root-path
         name="external_storage_root"
         path="." />

+ 2 - 2
build.gradle

@@ -7,8 +7,8 @@ buildscript {
         maven { url 'https://dl.bintray.com/umsdk/release' }
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.2.0'
-        
+        classpath 'com.android.tools.build:gradle:4.0.0'
+
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
     }

+ 1 - 1
gradle.properties

@@ -11,4 +11,4 @@ org.gradle.jvmargs=-Xmx1536m
 # This option should only be used with decoupled projects. More details, visit
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
 # org.gradle.parallel=true
-
+android.injected.testOnly=false

+ 2 - 2
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
-#Sat Feb 01 08:54:31 CST 2020
+#Fri Jul 03 15:58:12 CST 2020
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

+ 1 - 0
push/build/.transforms/91413793ec6afb3f93b934e923b343e2.bin

@@ -0,0 +1 @@
+o/classes

BIN
push/build/.transforms/91413793ec6afb3f93b934e923b343e2/classes/classes.dex


+ 1 - 0
push/build/.transforms/ba7e55be106422172a4df981ed71154e.bin

@@ -0,0 +1 @@
+o/classes

BIN
push/build/.transforms/ba7e55be106422172a4df981ed71154e/classes/classes.dex


+ 1 - 0
push/build/.transforms/c00258f670a4fca9ef20a5f72fe3e1bf.bin

@@ -0,0 +1 @@
+o/classes

BIN
push/build/.transforms/c00258f670a4fca9ef20a5f72fe3e1bf/classes/classes.dex


+ 1 - 0
push/build/.transforms/f8d0101894b2bc9df78d9a43679efe0f.bin

@@ -0,0 +1 @@
+o/classes

BIN
push/build/.transforms/f8d0101894b2bc9df78d9a43679efe0f/classes/classes.dex


+ 0 - 29
push/build/generated/not_namespaced_r_class_sources/debug/generateDebugRFile/out/com/umeng/message/lib/R.java

@@ -1,29 +0,0 @@
-/* AUTO-GENERATED FILE.  DO NOT MODIFY.
- *
- * This class was automatically generated by the
- * gradle plugin from the resource data it found. It
- * should not be modified by hand.
- */
-package com.umeng.message.lib;
-
-public final class R {
-    private R() {}
-
-    public static final class id {
-        private id() {}
-
-        public static int notification_bar_image = 0x7f0c0001;
-        public static int notification_large_icon1 = 0x7f0c0002;
-        public static int notification_large_icon2 = 0x7f0c0003;
-        public static int notification_text = 0x7f0c0004;
-        public static int notification_title = 0x7f0c0005;
-        public static int upush_notification1 = 0x7f0c0006;
-        public static int upush_notification2 = 0x7f0c0007;
-    }
-    public static final class layout {
-        private layout() {}
-
-        public static int upush_bar_image_notification = 0x7f0f0001;
-        public static int upush_notification = 0x7f0f0002;
-    }
-}

+ 0 - 0
push/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/com/umeng/message/lib/R.java


Some files were not shown because too many files changed in this diff