zhaofuxin il y a 4 ans
commit
c5bdf6f335
100 fichiers modifiés avec 4656 ajouts et 0 suppressions
  1. 21 0
      .gitignore
  2. 3 0
      .idea/.gitignore
  3. 1 0
      .idea/.name
  4. 6 0
      .idea/compiler.xml
  5. 25 0
      .idea/gradle.xml
  6. 30 0
      .idea/jarRepositories.xml
  7. 9 0
      .idea/misc.xml
  8. 7 0
      .idea/vcs.xml
  9. 0 0
      README.md
  10. 1 0
      app/.gitignore
  11. 181 0
      app/build.gradle
  12. 20 0
      app/debug/output.json
  13. BIN
      app/platform.jks
  14. 21 0
      app/proguard-rules.pro
  15. 24 0
      app/src/androidTest/java/com/jld/vod/ExampleInstrumentedTest.kt
  16. 122 0
      app/src/main/AndroidManifest.xml
  17. 121 0
      app/src/main/java/com/jld/vod/audio/AudioFocusManager.java
  18. 196 0
      app/src/main/java/com/jld/vod/audio/MediaSessionManager.java
  19. 130 0
      app/src/main/java/com/jld/vod/audio/MusicController.java
  20. 618 0
      app/src/main/java/com/jld/vod/audio/MusicControllerImp.java
  21. 259 0
      app/src/main/java/com/jld/vod/audio/MusicNotification.java
  22. 165 0
      app/src/main/java/com/jld/vod/base/BaseActivity.kt
  23. 309 0
      app/src/main/java/com/jld/vod/base/BaseFragment.java
  24. 81 0
      app/src/main/java/com/jld/vod/base/MyApplication.kt
  25. 12 0
      app/src/main/java/com/jld/vod/config/AudioFlag.kt
  26. 114 0
      app/src/main/java/com/jld/vod/config/AudioPlayerConstant.kt
  27. 18 0
      app/src/main/java/com/jld/vod/config/Config.kt
  28. 30 0
      app/src/main/java/com/jld/vod/dao/AboutDao.kt
  29. 30 0
      app/src/main/java/com/jld/vod/dao/BrowserDao.kt
  30. 31 0
      app/src/main/java/com/jld/vod/dao/CarInfoDao.kt
  31. 30 0
      app/src/main/java/com/jld/vod/dao/CarSiteAllDao.kt
  32. 30 0
      app/src/main/java/com/jld/vod/dao/CategoryFatherAllDao.kt
  33. 30 0
      app/src/main/java/com/jld/vod/dao/CategorySonAllDao.kt
  34. 30 0
      app/src/main/java/com/jld/vod/dao/GameDao.kt
  35. 30 0
      app/src/main/java/com/jld/vod/dao/LanguageDao.kt
  36. 33 0
      app/src/main/java/com/jld/vod/dao/ModularAllDao.kt
  37. 33 0
      app/src/main/java/com/jld/vod/dao/MusicByMidDao.kt
  38. 24 0
      app/src/main/java/com/jld/vod/dao/SettingDao.kt
  39. 17 0
      app/src/main/java/com/jld/vod/db/AboutDatabase.kt
  40. 17 0
      app/src/main/java/com/jld/vod/db/BrowserDatabase.kt
  41. 19 0
      app/src/main/java/com/jld/vod/db/CarInfoDatabase.kt
  42. 17 0
      app/src/main/java/com/jld/vod/db/CarSiteAllDatabase.kt
  43. 17 0
      app/src/main/java/com/jld/vod/db/CategoryFatherAllDatabase.kt
  44. 17 0
      app/src/main/java/com/jld/vod/db/CategorySonAllDatabase.kt
  45. 17 0
      app/src/main/java/com/jld/vod/db/GameDatabase.kt
  46. 17 0
      app/src/main/java/com/jld/vod/db/LanguageDatabase.kt
  47. 17 0
      app/src/main/java/com/jld/vod/db/ModularAllDatabase.kt
  48. 17 0
      app/src/main/java/com/jld/vod/db/MusicByMidDatabase.kt
  49. 13 0
      app/src/main/java/com/jld/vod/db/SettingDataBase.kt
  50. 18 0
      app/src/main/java/com/jld/vod/interfaces/IDownloadCallBack.java
  51. 311 0
      app/src/main/java/com/jld/vod/interfaces/remote/Apis.kt
  52. 75 0
      app/src/main/java/com/jld/vod/model/ProgressModel.java
  53. 8 0
      app/src/main/java/com/jld/vod/model/bean/AllModularRotateImgBean.kt
  54. 14 0
      app/src/main/java/com/jld/vod/model/bean/AppUpdateInfo.kt
  55. 219 0
      app/src/main/java/com/jld/vod/model/bean/Audio.java
  56. 24 0
      app/src/main/java/com/jld/vod/model/bean/BaseBean.kt
  57. 28 0
      app/src/main/java/com/jld/vod/model/bean/BrowserBean.kt
  58. 30 0
      app/src/main/java/com/jld/vod/model/bean/CarInfoBean.kt
  59. 32 0
      app/src/main/java/com/jld/vod/model/bean/CarRunInfoBean.kt
  60. 27 0
      app/src/main/java/com/jld/vod/model/bean/CarSiteAllBean.kt
  61. 26 0
      app/src/main/java/com/jld/vod/model/bean/CategoryFatherAllBean.kt
  62. 26 0
      app/src/main/java/com/jld/vod/model/bean/CategorySonAllBean.kt
  63. 17 0
      app/src/main/java/com/jld/vod/model/bean/DiskBean.kt
  64. 40 0
      app/src/main/java/com/jld/vod/model/bean/DownloadApkBean.java
  65. 26 0
      app/src/main/java/com/jld/vod/model/bean/FindAboutAllBean.kt
  66. 24 0
      app/src/main/java/com/jld/vod/model/bean/FindCarByUnboundBean.kt
  67. 24 0
      app/src/main/java/com/jld/vod/model/bean/FindGameByNoInstallBean.kt
  68. 30 0
      app/src/main/java/com/jld/vod/model/bean/GameBean.kt
  69. 24 0
      app/src/main/java/com/jld/vod/model/bean/GameResByNotUploaded.kt
  70. 7 0
      app/src/main/java/com/jld/vod/model/bean/HomePageImgBean.kt
  71. 23 0
      app/src/main/java/com/jld/vod/model/bean/LanguageBean.kt
  72. 19 0
      app/src/main/java/com/jld/vod/model/bean/LatLongBean.kt
  73. 27 0
      app/src/main/java/com/jld/vod/model/bean/ModelAllBean.kt
  74. 38 0
      app/src/main/java/com/jld/vod/model/bean/MovieByMidBean.kt
  75. 30 0
      app/src/main/java/com/jld/vod/model/bean/MovieResByNotUploaded.kt
  76. 32 0
      app/src/main/java/com/jld/vod/model/bean/MusicByMidBean.kt
  77. 8 0
      app/src/main/java/com/jld/vod/model/bean/MusicByMidBeans.kt
  78. 25 0
      app/src/main/java/com/jld/vod/model/bean/MusicResByNotUploaded.kt
  79. 10 0
      app/src/main/java/com/jld/vod/model/bean/NotificationInfoBean.kt
  80. 7 0
      app/src/main/java/com/jld/vod/model/bean/NuInstallGameBean.kt
  81. 11 0
      app/src/main/java/com/jld/vod/model/bean/ResultBean.kt
  82. 12 0
      app/src/main/java/com/jld/vod/model/bean/SettingBean.kt
  83. 3 0
      app/src/main/java/com/jld/vod/model/bean/TerminalInstall.kt
  84. 6 0
      app/src/main/java/com/jld/vod/model/bean/TerminalInstallBean.kt
  85. 14 0
      app/src/main/java/com/jld/vod/model/bean/UserBean.kt
  86. 19 0
      app/src/main/java/com/jld/vod/model/bean/findAllModularImgBean.kt
  87. 9 0
      app/src/main/java/com/jld/vod/model/event/MapsEvent.java
  88. 9 0
      app/src/main/java/com/jld/vod/model/event/SiteEvent.java
  89. 25 0
      app/src/main/java/com/jld/vod/model/event/UsbStatusChangeEvent.java
  90. 28 0
      app/src/main/java/com/jld/vod/receiver/BootBroadcastReceiver.kt
  91. 56 0
      app/src/main/java/com/jld/vod/receiver/UsbBroadcastReceiver.java
  92. 30 0
      app/src/main/java/com/jld/vod/repository/AboutPagingSource.kt
  93. 20 0
      app/src/main/java/com/jld/vod/repository/AboutRepository.kt
  94. 28 0
      app/src/main/java/com/jld/vod/repository/BrowserPagingSource.kt
  95. 19 0
      app/src/main/java/com/jld/vod/repository/BrowserRepository.kt
  96. 30 0
      app/src/main/java/com/jld/vod/repository/CategoryFatherAllPagingSource.kt
  97. 31 0
      app/src/main/java/com/jld/vod/repository/CategorySonAllPagingSource.kt
  98. 29 0
      app/src/main/java/com/jld/vod/repository/GamePagingSource.kt
  99. 18 0
      app/src/main/java/com/jld/vod/repository/GameRepository.kt
  100. 0 0
      app/src/main/java/com/jld/vod/repository/MovieAllPagingSource.kt

+ 21 - 0
.gitignore

@@ -0,0 +1,21 @@
+*.iml
+*.apk
+*.ap_
+.gradle
+gradle/
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+bin/
+gen/
+out/
+build/
+/captures
+.externalNativeBuild
+.cxx
+local.properties

+ 3 - 0
.idea/.gitignore

@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml

+ 1 - 0
.idea/.name

@@ -0,0 +1 @@
+Vod

+ 6 - 0
.idea/compiler.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <bytecodeTargetLevel target="1.8" />
+  </component>
+</project>

+ 25 - 0
.idea/gradle.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
+  <component name="GradleSettings">
+    <option name="linkedExternalProjectsSettings">
+      <GradleProjectSettings>
+        <option name="testRunner" value="PLATFORM" />
+        <option name="distributionType" value="DEFAULT_WRAPPED" />
+        <option name="externalProjectPath" value="$PROJECT_DIR$" />
+        <option name="gradleJvm" value="1.8 (2)" />
+        <option name="modules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/app" />
+            <option value="$PROJECT_DIR$/kprogresshud" />
+            <option value="$PROJECT_DIR$/library_zhy_CircleMenu" />
+            <option value="$PROJECT_DIR$/soundtouch" />
+          </set>
+        </option>
+        <option name="resolveModulePerSourceSet" value="false" />
+        <option name="useQualifiedModuleNames" value="true" />
+      </GradleProjectSettings>
+    </option>
+  </component>
+</project>

+ 30 - 0
.idea/jarRepositories.xml

@@ -0,0 +1,30 @@
+<?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="BintrayJCenter" />
+      <option name="name" value="BintrayJCenter" />
+      <option name="url" value="https://jcenter.bintray.com/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven" />
+      <option name="name" value="maven" />
+      <option name="url" value="https://jitpack.io" />
+    </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>
+  </component>
+</project>

+ 9 - 0
.idea/misc.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/build/classes" />
+  </component>
+  <component name="ProjectType">
+    <option name="id" value="Android" />
+  </component>
+</project>

+ 7 - 0
.idea/vcs.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 0 - 0
README.md


+ 1 - 0
app/.gitignore

@@ -0,0 +1 @@
+/build

+ 181 - 0
app/build.gradle

@@ -0,0 +1,181 @@
+apply plugin: 'com.android.application'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+//apply plugin: 'com.xuexiang.xrouter' //引用xrouter-plugin插件实现自动注册
+apply plugin: 'kotlin-kapt'
+def keystorePropertiesFile = rootProject.file("keystore.properties")
+def keystoreProperties = new Properties()
+keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
+android {
+    compileSdkVersion 29
+    buildToolsVersion "29.0.3"
+   // 签名配置
+    signingConfigs {
+        debug {
+            try {
+                storeFile file(keystoreProperties['storeFile'])
+                storePassword keystoreProperties['storePassWord']
+                keyAlias keystoreProperties['keyAlias']
+                keyPassword keystoreProperties['keyPassWord']
+            } catch (ex) {
+                throw new InvalidUserDataException(ex.toString())
+            }
+        }
+    }
+
+    defaultConfig {
+        applicationId "com.jld.vod"
+        minSdkVersion 23
+        targetSdkVersion 29
+        versionCode 193
+        versionName "1.0"
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+    }
+    compileOptions {
+        sourceCompatibility 1.8
+        targetCompatibility 1.8
+    }
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+        debug {
+            debuggable true
+            minifyEnabled false
+        }
+    }
+    kotlinOptions {
+        jvmTarget = '1.8'
+    }
+}
+
+dependencies {
+    implementation fileTree(dir: "libs", include: ["*.jar"])
+    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+    implementation 'androidx.core:core-ktx:1.3.0'
+    implementation 'androidx.appcompat:appcompat:1.1.0'
+    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+    implementation project(path: ':library_zhy_CircleMenu')
+    implementation project(path: ':soundtouch')
+    implementation project(path: ':kprogresshud')
+    implementation 'androidx.navigation:navigation-fragment-ktx:2.1.0'
+    implementation 'androidx.navigation:navigation-ui-ktx:2.1.0'
+    //google maps
+    implementation 'com.google.android.gms:play-services-maps:17.0.0'
+    testImplementation 'junit:junit:4.12'
+    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+    //xui
+    implementation 'com.github.xuexiangjys:XUI:1.1.4'
+    //XPage
+    implementation 'com.github.xuexiangjys.XPage:xpage-lib:2.2.8'
+    kapt 'com.github.xuexiangjys.XPage:xpage-compiler:2.2.8'
+    //XRouter
+//    implementation 'com.github.xuexiangjys.XRouter:xrouter-runtime:1.0.1'
+//    annotationProcessor 'com.github.xuexiangjys.XRouter:xrouter-compiler:1.0.1'
+    //XUtils
+    implementation 'com.github.xuexiangjys.XUtil:xutil-core:1.1.6'
+    implementation 'com.github.xuexiangjys.XUtil:xutil-sub:1.1.6'
+    //如果开启了内存泄漏监测leak,就需要加上这个依赖
+    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
+    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
+    testImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
+
+    //离线地图mapsforge
+    implementation 'com.caverock:androidsvg:1.4'
+    implementation 'org.mapsforge:mapsforge-map-reader:0.12.0'
+    implementation 'net.sf.kxml:kxml2:2.3.0'
+    implementation 'org.mapsforge:mapsforge-themes:0.12.0'
+    implementation 'org.mapsforge:mapsforge-core:0.12.0'
+    implementation 'org.mapsforge:mapsforge-map:0.12.0'
+    implementation 'org.mapsforge:mapsforge-map-android:0.12.0'
+    implementation 'org.mapsforge:mapsforge-poi:0.12.0'
+    implementation 'org.mapsforge:mapsforge-poi-android:0.12.0'
+    implementation 'org.mapsforge:sqlite-android:0.12.0'
+    implementation 'org.mapsforge:sqlite-android:0.12.0:natives-armeabi-v7a'
+    implementation 'org.mapsforge:sqlite-android:0.12.0:natives-arm64-v8a'
+    implementation 'org.mapsforge:sqlite-android:0.12.0:natives-x86'
+    implementation 'org.mapsforge:sqlite-android:0.12.0:natives-x86_64'
+    //请求权限
+    implementation 'com.github.tbruyelle:rxpermissions:0.10.2'
+    //rxjava
+    implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
+    implementation "io.reactivex.rxjava2:rxjava:2.2.5"
+    implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
+
+//    def paging_version = '2.1.1'
+//    //paging
+//    implementation "androidx.paging:paging-runtime:$paging_version"
+//    // For Kotlin use paging-runtime-ktx
+//    testImplementation "androidx.paging:paging-common:$paging_version"
+//    // For Kotlin use paging-common-ktx
+//    implementation "androidx.paging:paging-rxjava2:$paging_version"
+//    implementation 'androidx.paging:paging-runtime-ktx:2.1.1'
+
+    def paging_version = "3.0.0-alpha09"
+    implementation "androidx.paging:paging-runtime:$paging_version"
+    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
+    implementation 'com.google.code.gson:gson:2.8.6'
+    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"
+    implementation 'androidx.fragment:fragment-ktx:1.2.5'
+
+    def room_version = "2.2.5"
+    //room
+    implementation "android.arch.persistence.room:runtime:$room_version"
+    kapt "android.arch.persistence.room:compiler:$room_version"
+
+
+    //livedata
+    implementation 'android.arch.lifecycle:extensions:1.1.1'
+    implementation 'android.arch.lifecycle:livedata:1.1.1'
+
+    //md
+    implementation 'com.google.android.material:material:1.2.0-alpha05'
+
+    //glide
+    implementation 'com.github.bumptech.glide:glide:4.11.0'
+
+    //v4
+    implementation 'com.android.support:support-v4:28.0.0'
+
+    //jiaozivideo
+    implementation 'cn.jzvd:jiaozivideoplayer:7.4.2'
+
+    //WebView
+    implementation 'com.just.agentweb:agentweb:4.1.3' // (必选)
+    implementation 'com.just.agentweb:filechooser:4.1.3'// (可选)
+    implementation 'com.download.library:Downloader:4.1.3'// (可选)
+
+    //retrofit
+    implementation 'com.google.code.gson:gson:2.8.6'
+    implementation 'com.squareup.retrofit2:retrofit:2.7.1'
+    implementation 'com.squareup.retrofit2:converter-gson:2.7.1'
+    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.7.1'
+    implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
+    implementation "io.reactivex.rxjava2:rxjava:2.2.5"
+
+    //okhttp3
+    implementation 'com.squareup.okhttp3:okhttp:4.4.0'
+    implementation 'com.squareup.okhttp3:logging-interceptor:4.4.0'
+    implementation 'androidx.preference:preference:1.1.0'
+
+    //eventbus
+    implementation 'org.greenrobot:eventbus:3.0.0'
+    implementation 'com.github.mjdev:libaums:0.5.5'
+
+    //html
+    implementation 'com.zzhoujay.richtext:richtext:3.0.8'
+
+    //轮播图
+    implementation 'com.youth.banner:banner:1.4.10'
+
+    //fresco
+    implementation 'com.facebook.fresco:fresco:2.0.0'
+
+    //时间轴
+    implementation 'com.joketng:TimeLineStepView:1.0.1'
+    implementation 'com.wrbug:timelineview:1.0.0'
+}

+ 20 - 0
app/debug/output.json

@@ -0,0 +1,20 @@
+{
+  "version": 1,
+  "artifactType": {
+    "type": "APK",
+    "kind": "Directory"
+  },
+  "applicationId": "com.jld.vod",
+  "variantName": "debug",
+  "elements": [
+    {
+      "type": "SINGLE",
+      "filters": [],
+      "properties": [],
+      "versionCode": 193,
+      "versionName": "193",
+      "enabled": true,
+      "outputFile": "app-debug.apk"
+    }
+  ]
+}

BIN
app/platform.jks


+ 21 - 0
app/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 24 - 0
app/src/androidTest/java/com/jld/vod/ExampleInstrumentedTest.kt

@@ -0,0 +1,24 @@
+package com.jld.vod
+
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.ext.junit.runners.AndroidJUnit4
+
+import org.junit.Test
+import org.junit.runner.RunWith
+
+import org.junit.Assert.*
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+@RunWith(AndroidJUnit4::class)
+class ExampleInstrumentedTest {
+    @Test
+    fun useAppContext() {
+        // Context of the app under test.
+        val appContext = InstrumentationRegistry.getInstrumentation().targetContext
+        assertEquals("com.jld.vod", appContext.packageName)
+    }
+}

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

@@ -0,0 +1,122 @@
+<?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.jld.vod"
+    android:sharedUserId="android.uid.system"
+    android:process="system"
+    >
+    <!-- android:sharedUserId="android.uid.system" -->
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.WRITE_SETTINGS"
+        tools:ignore="ProtectedPermissions" />
+    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
+    <uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE"
+        tools:ignore="ProtectedPermissions" />
+    <uses-permission android:name="permission.CHANGE_CONFIGURATION"/>
+    <uses-permission android:name="android.permission.DELETE_PACKAGES" />
+    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
+    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
+
+    <application
+        android:name=".base.MyApplication"
+        android:allowBackup="true"
+        android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name"
+        android:roundIcon="@mipmap/ic_launcher_round"
+        android:sharedUserId="android.uid.system"
+        android:supportsRtl="true"
+        android:theme="@style/AppTheme"
+        android:largeHeap="true"
+        android:usesCleartextTraffic="true">
+        <activity android:name=".view.SplashActivity"
+
+            android:clearTaskOnLaunch="true"
+            android:configChanges="layoutDirection|locale"
+            android:excludeFromRecents="true"
+            android:hardwareAccelerated="true"
+            android:label="@string/app_name"
+            android:launchMode="singleTask"
+
+            >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <action android:name="com.owa.smartlauncher.Launcher" />
+                <category android:name="android.intent.category.HOME" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.MONKEY" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <activity
+            android:name=".view.SettingsActivity"
+            android:theme="@style/Theme.AppCompat.DayNight"
+            android:label="@string/title_activity_settings"/>
+        <activity android:name=".view.HomeActivity" />
+        <activity android:name=".view.MainActivity" />
+        <activity
+            android:name=".view.MapsActivity"
+            android:configChanges="keyboardHidden|orientation|screenSize" />
+        <activity android:name=".view.MusicPlayActivity"
+            android:configChanges="orientation|keyboard|keyboardHidden|screenSize|screenLayout|uiMode"
+            android:excludeFromRecents="true"
+            android:hardwareAccelerated="true"
+            android:launchMode="singleInstance"
+            android:screenOrientation="landscape"
+            />
+        <activity
+            android:name=".view.VideoPlayActivity"
+            android:configChanges="orientation|screenSize|keyboardHidden"
+            android:screenOrientation="landscape" />
+        <activity android:name=".view.WebActivity" />
+        <activity android:name=".view.PostFileActivity" />
+        <activity android:name=".view.SeatSettingsActivity"/>
+        <activity android:name=".view.AboutActivity"/>
+        <activity android:name=".view.LinkageSeatSettingsActivity"/>
+        <activity android:name=".view.SettingActivity"/>
+
+        <receiver
+            android:name="com.jld.face.receiver.BootBroadcastReceiver"
+            android:enabled="true"
+            android:exported="true">
+            <intent-filter>
+                <action android:name="android.intent.action.BOOT_COMPLETED" />
+            </intent-filter>
+        </receiver>
+        <receiver android:name=".receiver.UsbBroadcastReceiver">
+            <intent-filter>
+                <action android:name="android.intent.action.BOOT_COMPLETED" />
+                <action android:name="android.intent.action.MEDIA_REMOVED" />
+                <action android:name="android.intent.action.MEDIA_MOUNTED" />
+                <action android:name="android.intent.action.MEDIA_EJECT" />
+                <data android:scheme="file" />
+            </intent-filter>
+        </receiver>
+
+        <provider
+            android:name="androidx.core.content.FileProvider"
+            android:authorities="com.jld.vod.fileprovider"
+            android:exported="false"
+            android:grantUriPermissions="true">
+            <meta-data
+                android:name="android.support.FILE_PROVIDER_PATHS"
+                android:resource="@xml/filepaths" />
+        </provider>
+
+        <service android:name=".service.MusicPlayerService" />
+        <service android:name=".service.LatLongService"/>
+        <service
+            android:name=".service.MyAccessibilityService"
+            android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
+            <intent-filter>
+                <action android:name="android.accessibilityservice.AccessibilityService"/>
+            </intent-filter>
+        </service>
+    </application>
+
+</manifest>

+ 121 - 0
app/src/main/java/com/jld/vod/audio/AudioFocusManager.java

@@ -0,0 +1,121 @@
+package com.jld.vod.audio;
+
+import android.content.Context;
+import android.media.AudioManager;
+import com.jld.vod.config.AudioPlayerConstant;
+
+import static android.content.Context.AUDIO_SERVICE;
+
+/**
+ * Created by DuanJiaNing on 2017/8/19.
+ * 服务端调用
+ * * 参考文章 http://www.jianshu.com/p/bc2f779a5400;
+ */
+
+public class AudioFocusManager implements AudioManager.OnAudioFocusChangeListener {
+
+    private final Context context;
+    private final MusicController control;
+
+    private final AudioManager mAudioManager;
+
+    private boolean isPausedByFocusLossTransient;
+    private int mVolumeWhenFocusLossTransientCanDuck;
+
+    public AudioFocusManager(Context context, MusicController control) {
+        this.control = control;
+        this.context = context;
+        this.mAudioManager = (AudioManager) context.getSystemService(AUDIO_SERVICE);
+    }
+
+    /**
+     * 播放音乐前先请求音频焦点
+     */
+    public boolean requestAudioFocus() {
+        return mAudioManager.requestAudioFocus(this, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN)
+                == AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
+    }
+
+    /**
+     * 退出播放器后不再占用音频焦点
+     */
+    public void abandonAudioFocus() {
+        mAudioManager.abandonAudioFocus(this);
+    }
+
+    /**
+     * 音频焦点监听回调
+     */
+    @Override
+    public void onAudioFocusChange(int focusChange) {
+        int volume;
+        switch (focusChange) {
+            // 重新获得焦点
+            case AudioManager.AUDIOFOCUS_GAIN:
+                if (!willPlay() && isPausedByFocusLossTransient) {
+                    // 通话结束,恢复播放
+                    play();
+                }
+
+                volume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
+                if (mVolumeWhenFocusLossTransientCanDuck > 0 && volume == mVolumeWhenFocusLossTransientCanDuck / 2) {
+                    // 恢复音量
+                    mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, mVolumeWhenFocusLossTransientCanDuck,
+                            AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);
+                }
+
+                isPausedByFocusLossTransient = false;
+                mVolumeWhenFocusLossTransientCanDuck = 0;
+                break;
+            // 永久丢失焦点,如被其他播放器抢占
+            case AudioManager.AUDIOFOCUS_LOSS:
+                if (willPlay()) {
+                    forceStop();
+                }
+                break;
+            // 短暂丢失焦点,如来电
+            case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT:
+                if (willPlay()) {
+                    forceStop();
+                    isPausedByFocusLossTransient = true;
+                }
+                break;
+            // 瞬间丢失焦点,如通知
+            case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK:
+                // 音量减小为一半
+                volume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
+                if (willPlay() && volume > 0) {
+                    mVolumeWhenFocusLossTransientCanDuck = volume;
+                    mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, mVolumeWhenFocusLossTransientCanDuck / 2,
+                            AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);
+                }
+                break;
+        }
+    }
+
+    private void play() {
+        try {
+            control.resume();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void forceStop() {
+        try {
+            control.pause();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private boolean willPlay() {
+        try {
+            return control.getState() == AudioPlayerConstant.ACITION_AUDIO_PLAYER_PLAY;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+}

+ 196 - 0
app/src/main/java/com/jld/vod/audio/MediaSessionManager.java

@@ -0,0 +1,196 @@
+package com.jld.vod.audio;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.os.Build;
+import android.support.v4.media.MediaMetadataCompat;
+import android.support.v4.media.session.MediaSessionCompat;
+import android.support.v4.media.session.PlaybackStateCompat;
+import android.text.TextUtils;
+
+import com.jld.vod.R;
+import com.jld.vod.model.bean.Audio;
+
+import static com.jld.vod.config.AudioPlayerConstant.ACITION_AUDIO_PLAYER_PLAY;
+
+/**
+ * Created by DuanJiaNing on 2017/8/19.
+ * * 参考文章 http://www.jianshu.com/p/bc2f779a5400;
+ */
+
+public class MediaSessionManager {
+
+    private static final String TAG = "MediaSessionManager";
+
+    private static final long MEDIA_SESSION_ACTIONS =
+            PlaybackStateCompat.ACTION_PLAY
+                    | PlaybackStateCompat.ACTION_PAUSE
+                    | PlaybackStateCompat.ACTION_PLAY_PAUSE
+                    | PlaybackStateCompat.ACTION_SKIP_TO_NEXT
+                    | PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS
+                    | PlaybackStateCompat.ACTION_STOP
+                    | PlaybackStateCompat.ACTION_SEEK_TO;
+
+    private final MusicController control;
+    private final Context context;
+    private MediaSessionCompat mMediaSession;
+
+    public MediaSessionManager(Context context, MusicController control) {
+        this.context = context;
+        this.control = control;
+        setupMediaSession();
+    }
+
+    /**
+     * 初始化并激活MediaSession
+     */
+    private void setupMediaSession() {
+        mMediaSession = new MediaSessionCompat(context, TAG);
+        mMediaSession.setFlags(
+                MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS |
+                        MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS
+        );
+        //设置播放监听
+        mMediaSession.setCallback(callback);
+        mMediaSession.setActive(true);
+    }
+
+    /**
+     * 更新播放状态,播放/暂停/拖动进度条时调用
+     */
+    public void updatePlaybackState() {
+        int state = isPlaying() ? PlaybackStateCompat.STATE_PLAYING : PlaybackStateCompat.STATE_PAUSED;
+        mMediaSession.setPlaybackState(
+                new PlaybackStateCompat.Builder()
+                        .setActions(MEDIA_SESSION_ACTIONS)
+                        .setState(state, getCurrentPosition(), 1)
+                        .build());
+    }
+
+    private long getCurrentPosition() {
+        try {
+            return control.getPlayedDuration();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    private boolean isPlaying() {
+        try {
+            return control.getState() == ACITION_AUDIO_PLAYER_PLAY;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 更新正在播放的音乐信息,切换歌曲时调用
+     */
+    public void updateMetaData(Audio audio) {
+        if (audio == null) {
+            mMediaSession.setMetadata(null);
+            return;
+        }
+
+        Audio info = control.getAudio();
+        MediaMetadataCompat.Builder metaData = new MediaMetadataCompat.Builder()
+                .putString(MediaMetadataCompat.METADATA_KEY_TITLE, info.getName())
+                .putString(MediaMetadataCompat.METADATA_KEY_ARTIST, info.getArtist())
+                .putString(MediaMetadataCompat.METADATA_KEY_ALBUM, info.getAlbum())
+                .putString(MediaMetadataCompat.METADATA_KEY_ALBUM_ARTIST, info.getArtist())
+                .putLong(MediaMetadataCompat.METADATA_KEY_DURATION, control.getDuration())
+                .putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, getCoverBitmap(info));
+
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            metaData.putLong(MediaMetadataCompat.METADATA_KEY_NUM_TRACKS, getCount());
+        }
+
+        mMediaSession.setMetadata(metaData.build());
+    }
+
+    private long getCount() {
+        try {
+            return control.getPlayList() == null ? 0 : control.getPlayList().size();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    private Bitmap getCoverBitmap(Audio info) {
+        if (!TextUtils.isEmpty(info.getFaceUrl())) {
+            return BitmapFactory.decodeFile(info.getFaceUrl());
+        } else {
+            return BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher);
+        }
+    }
+
+    /**
+     * 释放MediaSession,退出播放器时调用
+     */
+    public void release() {
+        mMediaSession.setCallback(null);
+        mMediaSession.setActive(false);
+        mMediaSession.release();
+    }
+
+    private MediaSessionCompat.Callback callback = new MediaSessionCompat.Callback() {
+        @Override
+        public void onPlay() {
+            try {
+                control.resume();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        @Override
+        public void onPause() {
+            try {
+                control.pause();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        @Override
+        public void onSkipToNext() {
+            try {
+                control.next();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        @Override
+        public void onSkipToPrevious() {
+            try {
+                control.pre();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        @Override
+        public void onStop() {
+            try {
+                control.pause();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        @Override
+        public void onSeekTo(long pos) {
+            try {
+                control.seekTo((int) pos);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    };
+
+}

+ 130 - 0
app/src/main/java/com/jld/vod/audio/MusicController.java

@@ -0,0 +1,130 @@
+package com.jld.vod.audio;
+
+import com.jld.vod.model.bean.Audio;
+import com.smp.soundtouchandroid.MediaCallBack;
+import com.smp.soundtouchandroid.OnProgressChangedListener;
+import com.smp.soundtouchandroid.PreparedListener;
+
+import java.util.List;
+
+
+/**
+ * 音乐控制器
+ */
+public interface MusicController {
+    /**
+     * 播放
+     */
+    void play();
+
+    /**
+     * 播放
+     */
+    void play(Audio audio);
+
+    /**
+     * 停止
+     */
+    void stop();
+
+    /**
+     * 暂停
+     */
+    void pause();
+
+    boolean isPlaying();
+
+    boolean isPause();
+
+    void next();
+
+    void pre();
+
+    /**
+     * 设置音频路径
+     */
+    void setPath(String path);
+
+    /**
+     * 这个参数是变速又变声的,这个参数大于0,否则会报错
+     */
+    void setRateChange(float rate);
+
+    /**
+     * 这个是音调,1.0表示正常
+     */
+    void setPitchSemi(float pitchSemi);
+
+    /**
+     * 这个是速度,1.0表示正常设置新的速度控制值,
+     */
+    void setTempoChange(float tempo);
+
+    /**
+     * 这个是速度,1.0表示正常设置新的速度控制值,
+     */
+    void setTempo(float tempo);
+
+    float getTemp();
+
+    /**
+     * 设置左右声道
+     *
+     * @param i :1:左声道,2:右声道
+     */
+    void setChannels(int i);
+
+    /**
+     * 获取当前播放进度的时长,单位:微秒,us
+     */
+    long getPlayedDuration();
+
+    /**
+     * 获取总时长,单位:微秒,us
+     */
+    long getDuration();
+
+    void seekTo(long progress);
+
+    void setOnProgressChangedListener(OnProgressChangedListener progressListener);
+
+    void setOnPreparedListener(PreparedListener listener);
+
+    void setMediaCallBack(MediaCallBack listener);
+
+    MediaCallBack getMediaCallBack();
+
+    long getCurrentId();
+
+    Audio getAudio();
+
+    int getState();
+
+    void removeCallBack();
+
+    /**
+     * 取消定时功能
+     */
+    void cancelDelay();
+
+    /**
+     * 定时关闭功能
+     *
+     * @param timerState :延时分钟
+     */
+    void delayClose(int timerState);
+
+    void release();
+
+    void resume();
+
+    List<Audio> getPlayList();
+
+    void setPlayList(List<Audio> list);
+
+    int getCurrentPosition();
+
+    OnProgressChangedListener getProgressListener();
+
+    boolean isSame(Audio audio);
+}

+ 618 - 0
app/src/main/java/com/jld/vod/audio/MusicControllerImp.java

@@ -0,0 +1,618 @@
+package com.jld.vod.audio;
+
+import android.content.Context;
+import android.os.Handler;
+import android.os.Message;
+import android.util.Log;
+
+import com.jld.vod.config.AudioPlayerConstant;
+import com.jld.vod.model.bean.Audio;
+import com.jld.vod.utils.AppUtil;
+import com.jld.vod.utils.LogUtils;
+import com.jld.vod.utils.SP;
+import com.jld.vod.utils.SPManager;
+import com.jld.vod.utils.TimerFlag;
+import com.smp.soundtouchandroid.AudioSpeed;
+import com.smp.soundtouchandroid.MediaCallBack;
+import com.smp.soundtouchandroid.OnProgressChangedListener;
+import com.smp.soundtouchandroid.PreparedListener;
+import com.smp.soundtouchandroid.SoundStreamAudioPlayer;
+
+import java.io.IOException;
+import java.util.List;
+
+import static com.jld.vod.config.AudioPlayerConstant.ACITION_AUDIO_DELAY_CLOSE;
+import static com.jld.vod.config.AudioPlayerConstant.ACITION_AUDIO_PLAYER_PAUSE;
+import static com.jld.vod.config.AudioPlayerConstant.ACITION_AUDIO_PLAYER_PLAY;
+import static com.jld.vod.config.AudioPlayerConstant.ACITION_AUDIO_PLAYER_PLAY_COMPLETE;
+import static com.jld.vod.config.AudioPlayerConstant.ACITION_AUDIO_PLAYER_PLAY_NEXT_AUDIO;
+import static com.jld.vod.config.AudioPlayerConstant.ACITION_AUDIO_PLAYER_PLAY_PRE_AUDIO;
+import static com.jld.vod.config.AudioPlayerConstant.ACITION_AUDIO_PLAYER_PREPARE;
+import static com.jld.vod.config.AudioPlayerConstant.ACITION_AUDIO_PLAYER_PREPARED;
+import static com.jld.vod.config.AudioPlayerConstant.ACITION_AUDIO_PLAYER_STOP;
+
+
+public class MusicControllerImp implements MusicController {
+    private String TAG = "debug:MusicControllerImp--";
+    private SoundStreamAudioPlayer player;
+    private float tempo = 1.0f;//这个是速度,1.0表示正常设置新的速度控制值,
+    private float pitchSemi = 1.0f;//这个是音调,1.0表示正常,
+    private float rate = 1.0f;//这个参数是变速又变声的,这个参数大于0,否则会报错
+    Thread playThread;
+    Context context;
+    private final AudioFocusManager focusManager;
+    private final MediaSessionManager sessionManager;
+    private MusicNotification notification;
+
+    private MusicControllerImp(Context context) {
+        this.context = context;
+        this.sessionManager = new MediaSessionManager(context, this);
+        this.focusManager = new AudioFocusManager(context, this);
+        notification = MusicNotification.getMusicNotification(context, this);
+    }
+
+    private static MusicController musicController;
+
+    public static MusicController getInstance(Context context) {
+        if (musicController == null) {
+            synchronized (MusicController.class) {
+                if (musicController == null) {
+                    musicController = new MusicControllerImp(context);
+                }
+            }
+        }
+        return musicController;
+    }
+
+    @Override
+    public void play() {
+        try {
+            if (player != null && player.isPause()) {
+                player.start();
+                sessionManager.updatePlaybackState();
+            } else if (player != null && status == ACITION_AUDIO_PLAYER_PREPARE) {
+                Log.d("debug", "正在加载中...");
+                onState(status);
+            } else {
+                start();
+            }
+        } catch (Exception e) {
+            if (serviceMediaCallBack != null) {
+                serviceMediaCallBack.onError();
+            }
+            e.printStackTrace();
+        }
+    }
+
+    Audio audio;
+
+    public void setAudio(Audio audio) {
+        this.audio = audio;
+        setCurrentPosition(getCurrentPosition(audio));
+    }
+
+    private int getCurrentPosition(Audio audio) {
+        if (audio == null) return 0;
+        if (list == null || list.isEmpty()) return 0;
+        for (int i = 0; i < list.size(); i++) {
+            if (list.get(i) != null && audio.getId() == list.get(i).getId()) {
+                return i;
+            }
+        }
+        return 0;
+    }
+
+    @Override
+    public void play(Audio audio) {
+        try {
+            if (isSame(audio)) {
+                if (player.isPlaying()) {
+                    pause();
+                } else if (player.isPause()) {
+                    player.start();
+                    sessionManager.updatePlaybackState();
+                } else if (status == ACITION_AUDIO_PLAYER_PREPARE) {
+                    Log.d("debug", "正在加载中。。。");
+                    onState(status);
+                } else {
+                    setAudio(audio);
+                    start();
+                }
+            } else {
+                setAudio(audio);
+                start();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void next() {
+        initPosition(ACITION_AUDIO_PLAYER_PLAY_NEXT_AUDIO);
+    }
+
+    @Override
+    public void pre() {
+        initPosition(ACITION_AUDIO_PLAYER_PLAY_PRE_AUDIO);
+    }
+
+    private int currentPosition;
+
+    private void initPosition(int action) {
+        if (list == null || list.isEmpty()) return;
+        int temp = this.currentPosition;
+        List<Audio> audioList = list;
+        if (audioList != null && audioList.size() > 0) {
+            if (action == ACITION_AUDIO_PLAYER_PLAY_NEXT_AUDIO) {
+                currentPosition = currentPosition + 1;
+                if (currentPosition > audioList.size() - 1) {
+                    currentPosition = 0;
+                }
+            } else {
+                currentPosition = currentPosition - 1;
+                if (currentPosition < 0) {
+                    currentPosition = audioList.size() - 1;
+                }
+            }
+            Audio audio = audioList.get(currentPosition);
+            if (audio != null) {
+                //不能观看
+                if (audio.isLock()) {
+                    AppUtil.ShowToast(context, "请先购买再进行播放");
+                    setCurrentPosition(temp);
+                } else {
+                    status = 0;
+                    setAudio(audio);
+                    if (mediaCallBack != null) {
+                        mediaCallBack.onChange(action);
+                    }
+                    start();
+                }
+            }
+        }
+    }
+
+    private void setCurrentPosition(int position) {
+        this.currentPosition = position;
+    }
+
+    @Override
+    public int getCurrentPosition() {
+        return currentPosition;
+    }
+
+    @Override
+    public List<Audio> getPlayList() {
+        return list;
+    }
+
+    @Override
+    public void setPlayList(List<Audio> list) {
+        this.list = list;
+    }
+
+    List<Audio> list;
+
+    //继续播放
+    @Override
+    public void resume() {
+        if (status != AudioPlayerConstant.ACITION_AUDIO_PLAYER_PLAY) {
+            focusManager.requestAudioFocus();
+            sessionManager.updatePlaybackState();
+            player.start();
+        }
+    }
+
+    @Override
+    public boolean isSame(Audio audio) {
+        if (audio == null) return false;
+        if (this.audio == null) return false;
+        return player != null && this.audio != null && audio.getId() == this.audio.getId();
+    }
+
+    @Override
+    public void stop() {
+        try {
+            if (player != null) {
+                player.stop();
+            }
+            player = null;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void pause() {
+        if (player != null) {
+            if (!player.isPaused()) {
+                player.pause();
+                sessionManager.updatePlaybackState();
+            }
+        }
+    }
+
+    @Override
+    public void setPath(String path) {
+    }
+
+    private void start() {
+        try {
+            if (player != null) {
+                player.stop();
+                player.seekTo(0, true);
+                player.release();
+                player = null;
+            }
+            player = new SoundStreamAudioPlayer(0, audio.getFileUrl(), tempo, pitchSemi, serviceMediaCallBack, new PreparedListener() {
+                @Override
+                public void onPrepared(long duration) {
+                    handler.post(new Runnable() {
+                        @Override
+                        public void run() {
+                            player.setOnProgressChangedListener(new OnProgressChangedListener() {
+                                @Override
+                                public void onProgressChanged(int track, double currentPercentage, long position) {
+                                    if (player == null) return;
+                                    if (progressListener == null) return;
+                                    progressListener.onProgressChanged(track, currentPercentage, position);
+                                }
+
+                                @Override
+                                public void onTrackEnd(int track) {
+                                    Log.d("debug", "onTrackEnd=" + track);
+                                    if (progressListener != null) {
+                                        progressListener.onTrackEnd(track);
+                                    }
+                                }
+
+                                @Override
+                                public void onExceptionThrown(String string) {
+                                    if (serviceMediaCallBack != null) {
+                                        serviceMediaCallBack.onError();
+                                    }
+                                    if (progressListener != null) {
+                                        progressListener.onExceptionThrown(string);
+                                    }
+                                    Log.d("debug", "onExceptionThrown=" + string);
+                                }
+                            });
+                            if (player != null) {
+                                player.setRate(rate);
+                                player.setTempo(tempo);
+                            }
+                            if (playThread != null) {
+                                playThread.interrupt();
+                                playThread = null;
+                            }
+                            if (progressListener != null) {
+                                progressListener.onProgressChanged(0, 0f, 0);
+                            }
+                            playThread = new Thread(player);
+                            playThread.start();
+                            player.start();
+                            sessionManager.updateMetaData(audio);
+                            focusManager.requestAudioFocus();
+                            sessionManager.updatePlaybackState();
+                        }
+                    });
+                }
+            });
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private int status;
+
+    @Override
+    public long getCurrentId() {
+        return audio == null ? 0 : audio.getId();
+    }
+
+    @Override
+    public Audio getAudio() {
+        return audio;
+    }
+
+
+    @Override
+    public int getState() {
+        return status;
+    }
+
+    @Override
+    public boolean isPlaying() {
+        return player == null ? false : player.isPlaying();
+    }
+
+    @Override
+    public boolean isPause() {
+        return player == null ? false : player.isPause();
+    }
+
+    OnProgressChangedListener progressListener;
+
+    @Override
+    public void setOnProgressChangedListener(OnProgressChangedListener progressListener) {
+        this.progressListener = progressListener;
+    }
+
+    @Override
+    public OnProgressChangedListener getProgressListener() {
+        return progressListener;
+    }
+
+    PreparedListener preparedListener;
+
+    @Override
+    public void setOnPreparedListener(PreparedListener preparedListener) {
+        this.preparedListener = preparedListener;
+    }
+
+    MediaCallBack mediaCallBack;
+
+    @Override
+    public void setMediaCallBack(MediaCallBack listener) {
+        this.mediaCallBack = listener;
+    }
+
+    @Override
+    public MediaCallBack getMediaCallBack() {
+        return mediaCallBack;
+    }
+
+    @Override
+    public void removeCallBack() {
+        mediaCallBack = null;
+        progressListener = null;
+    }
+
+    MediaCallBack serviceMediaCallBack = new MediaCallBack() {
+        @Override
+        public void onChange(int state) {
+            if (mediaCallBack != null) {
+                mediaCallBack.onChange(state);
+            }
+        }
+
+        @Override
+        public void onPrepare() {
+            status = ACITION_AUDIO_PLAYER_PREPARE;
+            if (notification != null) {
+                notification.upDataNotifacation(true, getAudio().getName(), getAudio().getFaceUrl(), false);
+            }
+            onChange(status);
+            onState(status);
+        }
+
+        @Override
+        public void onPrepared(long duration) {
+            LogUtils.INSTANCE.logD(TAG, "onPrepared");
+            status = ACITION_AUDIO_PLAYER_PREPARED;
+            onChange(status);
+            onState(status, duration);
+        }
+
+        @Override
+        public void onPlay() {
+            if (notification != null) {
+                notification.upDataNotifacation(false, getAudio().getName(), getAudio().getFaceUrl(), true);
+            }
+
+            status = ACITION_AUDIO_PLAYER_PLAY;
+            onChange(status);
+            onState(status);
+        }
+
+        @Override
+        public void onStop() {
+            status = ACITION_AUDIO_PLAYER_STOP;
+            if (notification != null) {
+                notification.upDataNotifacation(false, getAudio().getName(), getAudio().getFaceUrl(), false);
+            }
+
+            onChange(status);
+            onState(status);
+        }
+
+        @Override
+        public void onPause() {
+            status = ACITION_AUDIO_PLAYER_PAUSE;
+            if (notification != null) {
+                notification.upDataNotifacation(false, getAudio().getName(), getAudio().getFaceUrl(), false);
+            }
+
+            onChange(status);
+            onState(status);
+        }
+
+        @Override
+        public void onComplete() {
+            status = ACITION_AUDIO_PLAYER_PLAY_COMPLETE;
+            if (notification != null) {
+                notification.upDataNotifacation(false, getAudio().getName(), getAudio().getFaceUrl(), false);
+            }
+            onChange(status);
+            onState(status);
+            //如果定时模式为只播放当前,则暂停
+            int timerState = SPManager.getTimerState(context);
+          LogUtils.INSTANCE.logD(TAG, " timerState=" + timerState);
+            if (timerState == TimerFlag.CURRENT) {
+            } else {//否则播放下一首
+                next();
+            }
+        }
+
+        @Override
+        public void onError() {
+            status = AudioPlayerConstant.ACITION_AUDIO_PLAYER_ERROR;
+            if (notification != null) {
+                notification.upDataNotifacation(false, getAudio().getName(), getAudio().getFaceUrl(), false);
+            }
+
+            onChange(status);
+            onState(status);
+        }
+    };
+    private Handler handler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            super.handleMessage(msg);
+            switch (msg.what) {
+                case AudioPlayerConstant.ACITION_AUDIO_DELAY_CLOSE:
+                    if (isPlaying()) {
+                        //定时状态设置为关闭
+                        SPManager.write(context, SP.TIMER_STATE, TimerFlag.CLOSE);
+                        pause();
+                    }
+                    break;
+            }
+        }
+    };
+
+    private void onState(final int status, final Long... duration) {
+        if (mediaCallBack == null) return;
+        handler.post(new Runnable() {
+            @Override
+            public void run() {
+                switch (status) {
+                    case AudioPlayerConstant.ACITION_AUDIO_PLAYER_PLAY_COMPLETE:
+                        mediaCallBack.onComplete();
+                        break;
+                    case AudioPlayerConstant.ACITION_AUDIO_PLAYER_PAUSE:
+                        mediaCallBack.onPause();
+                        break;
+                    case AudioPlayerConstant.ACITION_AUDIO_PLAYER_PLAY:
+                        mediaCallBack.onPlay();
+                        break;
+                    case AudioPlayerConstant.ACITION_AUDIO_PLAYER_STOP:
+                        mediaCallBack.onStop();
+                        break;
+                    case AudioPlayerConstant.ACITION_AUDIO_PLAYER_PREPARE:
+                        mediaCallBack.onPrepare();
+                        break;
+                    case AudioPlayerConstant.ACITION_AUDIO_PLAYER_PREPARED:
+                        if (duration != null && duration.length > 0) {
+                            mediaCallBack.onPrepared(duration[0]);
+                        }
+                        break;
+                    case AudioPlayerConstant.ACITION_AUDIO_PLAYER_ERROR:
+                        mediaCallBack.onError();
+                        break;
+
+                }
+            }
+        });
+
+    }
+
+    @Override
+    public long getPlayedDuration() {
+        if (player == null) return 0;
+        return player.getPlayedDuration();
+    }
+
+    @Override
+    public long getDuration() {
+        return player == null ? 0 : player.getDuration();
+    }
+
+    @Override
+    public void setRateChange(float rate) {
+        this.rate = rate;
+        if (player != null) {
+            player.setRateChange(rate);
+        }
+    }
+
+    @Override
+    public void setPitchSemi(float pitchSemi) {
+        this.pitchSemi = pitchSemi;
+        if (player != null) {
+            player.setPitchSemi(pitchSemi);
+        }
+    }
+
+    @Override
+    public void setTempoChange(float tempo) {
+        this.tempo = tempo;
+        if (player != null) {
+            player.setTempoChange(tempo);
+        }
+    }
+
+    @Override
+    public void setTempo(float tempo) {
+        this.tempo = tempo;
+        if (player != null) {
+            player.setTempo(tempo);
+        }
+    }
+
+    @Override
+    public float getTemp() {
+        return tempo == 0 ? AudioSpeed.SPEED_NORMAL : tempo;
+    }
+
+    @Override
+    public void seekTo(long progress) {
+        if (player != null) {
+            player.seekTo(progress);
+            sessionManager.updatePlaybackState();
+        }
+    }
+
+    @Override
+    public void setChannels(int i) {
+        if (player != null) {
+            player.setChannels(i);
+        }
+    }
+
+    /**
+     * 取消定时功能
+     */
+    @Override
+    public void cancelDelay() {
+        if (handler == null) return;
+        if (handler.hasMessages(AudioPlayerConstant.ACITION_AUDIO_DELAY_CLOSE)) {
+            handler.removeMessages(AudioPlayerConstant.ACITION_AUDIO_DELAY_CLOSE);
+        }
+    }
+
+    /**
+     * 定时关闭功能
+     *
+     * @param delayTime :延时分钟
+     */
+    public void delayClose(int delayTime) {
+        //取消之前的定时功能
+        cancelDelay();
+        //将分钟转换成秒
+        delayTime = delayTime * 60 * 1000;
+        if (handler != null) {
+            handler.sendEmptyMessageDelayed(ACITION_AUDIO_DELAY_CLOSE, delayTime);
+        }
+    }
+
+    @Override
+    public void release() {
+        removeCallBack();
+        if (player != null) {
+            if (playThread != null) {
+                playThread.interrupt();
+                playThread = null;
+            }
+            cancelDelay();
+            player.release();
+            sessionManager.release();
+            status = 0;
+            audio = null;
+            musicController = null;
+            LogUtils.INSTANCE.logD("debug", "  release");
+        }
+    }
+}

+ 259 - 0
app/src/main/java/com/jld/vod/audio/MusicNotification.java

@@ -0,0 +1,259 @@
+package com.jld.vod.audio;
+
+import android.annotation.SuppressLint;
+import android.app.Notification;
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Build;
+import android.widget.ImageView;
+import android.widget.RemoteViews;
+
+import com.jld.vod.R;
+import com.jld.vod.view.MainActivity;
+
+
+/**
+ * Created by ding on 2016/12/3.
+ * 状态栏的音频播放控制器
+ */
+public class MusicNotification {
+
+    /**
+     * 音频播放控制 的  Notification
+     * 动态的显示后台的AudioplayService的前台展示
+     */
+    private static MusicNotification notifyInstance = null;
+
+    // 通知id
+    private final int FLAG = PendingIntent.FLAG_UPDATE_CURRENT;
+    private final int NOTIFICATION_ID = 0x1213;
+    // 通知
+    private Notification musicNotifi = null;
+    // 管理通知
+    private NotificationManager manager = null;
+    // 界面实现
+    private Notification.Builder builder = null;
+    // 上下文
+    private Context context;
+    MusicController musicController;
+    // 布局
+    private RemoteViews remoteViews;
+    private Intent playsIntent = null;
+    /**
+     * 上一首 按钮点击 ID
+     */
+    private final static int BUTTON_PREV_ID = 1;
+    /**
+     * 播放/暂停 按钮点击 ID
+     */
+    private final static int BUTTON_PALY_ID = 2;
+    /**
+     * 下一首 按钮点击 ID
+     */
+    private final static int BUTTON_NEXT_ID = 3;
+    /**
+     * 关闭 按钮点击 ID
+     */
+    private final static int BUTTON_COSE_ID = 4;
+
+    /**
+     * 跳转播放界面 按钮点击 ID
+     */
+    private final static int BUTTON_JUMP_ID = 5;
+
+    private final static String ACTION_BUTTON = "xinkunic.aifatushu.customviews.MusicNotification.ButtonClick";
+    private final static String INTENT_BUTTONID_TAG = "ButtonId";
+    private ImageView imageView;
+
+    private MusicNotification() {
+
+    }
+
+    private MusicNotification(Context context, MusicController musicController) {
+        this.context = context;
+        this.musicController = musicController;
+        // 初始化操作
+        remoteViews = new RemoteViews(context.getPackageName(), R.layout.music_view_custom_button);
+
+        builder = new Notification.Builder(context);
+        // 初始化控制的Intent
+        playsIntent = new Intent();
+        playsIntent.setAction(ACTION_BUTTON);
+        imageView = new ImageView(context);
+        onCreateMusicNotifi(context);
+    }
+
+    /**
+     * 恶汉式实现 通知
+     *
+     * @return
+     */
+    public static MusicNotification getMusicNotification(Context context, MusicController musicController) {
+        if (notifyInstance == null) {
+            synchronized (MusicNotification.class) {
+                if (notifyInstance == null) {
+                    notifyInstance = new MusicNotification(context, musicController);
+                }
+            }
+        }
+        return notifyInstance;
+    }
+
+    /**
+     * 创建通知
+     * 初始化通知
+     */
+    @SuppressLint("NewApi")
+    public void onCreateMusicNotifi(Context context) {
+        // 设置点击事件
+        manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
+//        manager = NotificationManagerCompat.from(context);
+        registerClick();
+        Intent intent1 = new Intent(context, MainActivity.class);
+        intent1.putExtra("isHead", true);
+        PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent1, PendingIntent.FLAG_UPDATE_CURRENT);
+//
+        builder.setContent(remoteViews).setWhen(System.currentTimeMillis())
+                .setContentIntent(pendingIntent)
+                .setOngoing(true)
+                .setSmallIcon(R.mipmap.ic_launcher);
+        //Android 8.0以后
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+            NotificationChannel channel = new NotificationChannel(context.getPackageName(), "有章音频", NotificationManager.IMPORTANCE_HIGH);
+            channel.enableLights(false);
+            channel.enableVibration(false);
+            channel.setVibrationPattern(new long[]{0});
+            channel.setSound(null, null);
+            manager.createNotificationChannel(channel);
+            builder.setChannelId(context.getPackageName());
+        } else {
+            builder.setVibrate(new long[]{0});
+            builder.setSound(null);
+        }
+        musicNotifi = builder.build();
+        initButtonReceiver(context);
+
+    }
+
+    private void registerClick() {
+        // 1.注册播放或暂停点击事件
+        playsIntent.putExtra(INTENT_BUTTONID_TAG, BUTTON_PALY_ID);
+        PendingIntent pplay = PendingIntent.getBroadcast(context, 1, playsIntent, FLAG);
+        remoteViews.setOnClickPendingIntent(R.id.btn_custom_play, pplay);
+
+        // 2.注册上一首点击事件
+        playsIntent.putExtra(INTENT_BUTTONID_TAG, BUTTON_PREV_ID);
+        PendingIntent playPre = PendingIntent.getBroadcast(context, 3, playsIntent, FLAG);
+        remoteViews.setOnClickPendingIntent(R.id.btn_custom_prev, playPre);
+
+        // 3.注册下一首点击事件
+        playsIntent.putExtra(INTENT_BUTTONID_TAG, BUTTON_NEXT_ID);
+        PendingIntent pnext = PendingIntent.getBroadcast(context, 2, playsIntent, FLAG);
+        remoteViews.setOnClickPendingIntent(R.id.btn_custom_next, pnext);
+
+        // 4.注册关闭点击事件
+        playsIntent.putExtra(INTENT_BUTTONID_TAG, BUTTON_COSE_ID);
+        PendingIntent pclose = PendingIntent.getBroadcast(context, 4, playsIntent, FLAG);
+        remoteViews.setOnClickPendingIntent(R.id.btn_custom_close, pclose);
+
+    }
+
+    private void initButtonReceiver(Context context) {
+        ButtonBroadcastReceiver bReceiver = new ButtonBroadcastReceiver();
+        IntentFilter intentFilter = new IntentFilter();
+        intentFilter.addAction(ACTION_BUTTON);
+        context.registerReceiver(bReceiver, intentFilter);
+    }
+
+
+    /**
+     * 取消通知栏
+     */
+    public void onCancelMusicNotifi() {
+        if (manager == null) return;
+        manager.cancel(NOTIFICATION_ID);
+        isShowing = false;
+    }
+
+    private String TAG = "---MusicNotification--";
+
+    private boolean isPlaying = false;
+
+    /**
+     * 更新通知
+     */
+    public void upDataNotifacation(boolean needRefrush, final String name, String faceUrl, boolean isPlaying) {
+        this.isPlaying = isPlaying;
+        if (remoteViews == null) {
+            return;
+        }
+        if (needRefrush) {
+            remoteViews.setTextViewText(R.id.tv_custom_song_singer, name);
+        }
+        if (isPlaying) {
+            remoteViews.setImageViewResource(R.id.btn_custom_play, android.R.drawable.ic_media_pause);
+        } else {
+            remoteViews.setImageViewResource(R.id.btn_custom_play, android.R.drawable.ic_media_play);
+        }
+        show();
+    }
+
+    boolean isShowing = false;
+
+    private void show() {
+//        if (isShowing) {
+//            return;
+//        }
+        manager.notify(NOTIFICATION_ID, musicNotifi);
+        isShowing = true;
+    }
+
+
+    public class ButtonBroadcastReceiver extends BroadcastReceiver {
+
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            // TODO Auto-generated method stub
+            String action = intent.getAction();
+            if (action.equals(ACTION_BUTTON)) {
+                int buttonId = intent.getIntExtra(INTENT_BUTTONID_TAG, 0);
+                switch (buttonId) {
+                    case BUTTON_PREV_ID://上一首
+                        if (musicController != null) {
+                            musicController.pre();
+                        }
+                        break;
+                    case BUTTON_PALY_ID://播放或暂停
+                        if (musicController != null) {
+                            if (musicController.isPlaying()) {
+                                musicController.pause();
+                            } else {
+                                musicController.play();
+                            }
+                        }
+                        break;
+
+                    case BUTTON_NEXT_ID://下一首
+                        if (musicController != null) {
+                            musicController.next();
+                        }
+                        break;
+
+                    case BUTTON_COSE_ID://关闭
+                        onCancelMusicNotifi();
+                        if (musicController != null) {
+                            musicController.release();
+                        }
+                        break;
+                    default:
+                        break;
+                }
+            }
+        }
+    }
+}

+ 165 - 0
app/src/main/java/com/jld/vod/base/BaseActivity.kt

@@ -0,0 +1,165 @@
+package com.jld.vod.base
+
+import android.annotation.SuppressLint
+import android.app.ProgressDialog
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import android.util.Log
+import android.widget.Toast
+import com.jld.vod.R
+import com.jld.vod.utils.CommonUtil
+import com.jld.vod.view.widget.CustomProgressDialog
+import com.kaopiz.kprogresshud.KProgressHUD
+import com.xuexiang.xpage.base.XPageActivity
+import com.xuexiang.xpage.base.XPageFragment
+import com.xuexiang.xpage.core.CoreSwitchBean
+
+/**
+ * Create by Panda on 2019/3/14
+ */
+abstract class BaseActivity : XPageActivity() {
+
+    protected lateinit var mContext: Context
+    private var dialog: ProgressDialog? = null
+    private var mToast: Toast? = null
+    private var dialogs: KProgressHUD? = null
+    //页面是否处于前台
+    var isFront = false
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        setContentView(layoutId)
+        mContext = this
+
+        initView()
+        initData()
+        initEvent()
+    }
+
+
+    open protected fun initView() {
+
+    }
+
+    open protected fun initData() {
+
+    }
+
+    open protected fun initEvent() {
+
+    }
+
+    fun showLoading() {
+        if (dialog == null) {
+            dialog = CustomProgressDialog(this, R.style.CustomDialog)
+        }
+        if (dialog != null && !dialog!!.isShowing) {
+            dialog?.show()
+        }
+    }
+
+    fun finishLoading() {
+        Log.i("finishLoading", "关闭刷新!")
+        dialog?.dismiss()
+    }
+
+    override fun onResume() {
+        super.onResume()
+        isFront = true
+    }
+
+    override fun onPause() {
+        super.onPause()
+        isFront = false
+    }
+
+    protected abstract override fun getLayoutId(): Int
+
+    @SuppressLint("ShowToast")
+    fun toast(str: String) {
+        if (mToast == null) {
+            mToast = Toast.makeText(this, str, Toast.LENGTH_SHORT)
+        } else {
+            mToast?.setText(str)
+        }
+        mToast?.show()
+    }
+
+    inline fun <reified T> go() {
+        startActivity(Intent(this, T::class.java))
+    }
+
+    inline fun <reified T> go(bundle: Bundle) {
+        startActivity(Intent(this, T::class.java).putExtras(bundle))
+    }
+
+    inline fun <reified T> goForResult(req: Int) {
+        startActivityForResult(Intent(this, T::class.java), req)
+    }
+
+    inline fun <reified T> goForResult(req: Int, bundle: Bundle) {
+        startActivityForResult(Intent(this, T::class.java).putExtras(bundle), req)
+    }
+
+    /**
+     * 初始化状态栏的样式
+     */
+    protected open fun initStatusBarStyle() {}
+    protected open fun showDialog() {
+        if (!isFront) return
+        try {
+            if (dialogs == null) {
+                dialogs = KProgressHUD.create(this).setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
+            } else {
+                dialogs!!.setLabel(null)
+            }
+            dialogs!!.show()
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    }
+
+    protected open fun dismissDialog() {
+        if (dialogs != null && dialogs!!.isShowing) {
+            dialogs!!.dismiss()
+        }
+    }
+    /**
+     * 打开fragment
+     *
+     * @param clazz          页面类
+     * @param addToBackStack 是否添加到栈中
+     * @return 打开的fragment对象
+     */
+    open fun <T : XPageFragment?> openPage(
+        clazz: Class<T>?,
+        addToBackStack: Boolean
+    ): T {
+        val page = CoreSwitchBean(clazz)
+            .setAddToBackStack(addToBackStack)
+        return openPage(page) as T
+    }
+
+    /**
+     * 打开fragment
+     *
+     * @return 打开的fragment对象
+     */
+    open fun <T : XPageFragment?> openNewPage(clazz: Class<T>?): T {
+        val page = CoreSwitchBean(clazz)
+            .setNewActivity(true)
+        return openPage(page) as T
+    }
+
+
+    /**
+     * 切换fragment
+     *
+     * @param clazz 页面类
+     * @return 打开的fragment对象
+     */
+    open fun <T : XPageFragment?> switchPage(clazz: Class<T>?): T {
+        return changePage(clazz)
+    }
+
+}

+ 309 - 0
app/src/main/java/com/jld/vod/base/BaseFragment.java

@@ -0,0 +1,309 @@
+package com.jld.vod.base;
+
+import android.app.ProgressDialog;
+import android.content.res.Configuration;
+import android.os.Parcelable;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+
+import com.jld.vod.R;
+import com.jld.vod.view.widget.CustomProgressDialog;
+import com.xuexiang.xpage.PageConfig;
+import com.xuexiang.xpage.base.XPageActivity;
+import com.xuexiang.xpage.base.XPageFragment;
+import com.xuexiang.xpage.core.CoreSwitchBean;
+import com.xuexiang.xpage.core.PageOption;
+import com.xuexiang.xpage.enums.CoreAnim;
+import com.xuexiang.xui.utils.WidgetUtils;
+import com.xuexiang.xui.widget.actionbar.TitleBar;
+import com.xuexiang.xui.widget.actionbar.TitleUtils;
+import com.xuexiang.xui.widget.progress.loading.IMessageLoader;
+
+import java.io.Serializable;
+
+import static com.xuexiang.xutil.display.SnackbarUtils.dismiss;
+
+/**
+ * @author xuexiang
+ * @since 2018/5/25 下午3:44
+ */
+public abstract class BaseFragment extends XPageFragment {
+
+    private IMessageLoader mIMessageLoader;
+    private ProgressDialog dialog;
+    @Override
+    protected void initPage() {
+        initTitle();
+        initViews();
+        initListeners();
+    }
+
+    protected TitleBar initTitle() {
+        return TitleUtils.addTitleBarDynamic((ViewGroup) getRootView(), getPageTitle(), new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                popToBack();
+            }
+        });
+    }
+
+    public IMessageLoader getMessageLoader() {
+        if (mIMessageLoader == null) {
+            mIMessageLoader = WidgetUtils.getMiniLoadingDialog(getContext());
+        }
+        return mIMessageLoader;
+    }
+
+    public IMessageLoader getMessageLoader(String message) {
+        if (mIMessageLoader == null) {
+            mIMessageLoader = WidgetUtils.getMiniLoadingDialog(getContext(), message);
+        } else {
+            mIMessageLoader.updateMessage(message);
+        }
+        return mIMessageLoader;
+    }
+
+    @Override
+    protected void initListeners() {
+
+    }
+    public void showLoading() {
+        if (dialog == null) {
+            dialog = new CustomProgressDialog(getContext(), R.style.CustomDialog);
+        }
+        if (dialog != null && !dialog.isShowing()) {
+            dialog.show();
+        }
+    }
+
+    public void finishLoading() {
+        if (dialog != null) {
+            dialog.dismiss();
+        }
+    }
+
+    @Override
+    public void onDestroyView() {
+//        KeyboardUtils.fixSoftInputLeaks(getContext());
+        super.onDestroyView();
+        unbindDrawables(getView());
+    }
+
+    private void unbindDrawables(View view)
+    {
+        if (view.getBackground() != null)
+        {
+            view.getBackground().setCallback(null);
+        }
+        if (view instanceof ViewGroup && !(view instanceof AdapterView))
+        {
+            for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++)
+            {
+                unbindDrawables(((ViewGroup) view).getChildAt(i));
+            }
+            ((ViewGroup) view).removeAllViews();
+        }
+    }
+
+    @Override
+    public void onConfigurationChanged(Configuration newConfig) {
+        //屏幕旋转时刷新一下title
+        super.onConfigurationChanged(newConfig);
+        ViewGroup root = (ViewGroup) getRootView();
+        if (root.getChildAt(0) instanceof TitleBar) {
+            root.removeViewAt(0);
+            initTitle();
+        }
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+
+    }
+
+    @Override
+    public void onPause() {
+        super.onPause();
+
+    }
+
+    /**
+     * 打开一个新的页面
+     *
+     * @param clazz
+     * @param <T>
+     * @return
+     */
+    public <T extends XPageFragment> Fragment openNewPage(Class<T> clazz) {
+        return new PageOption(clazz)
+                .setNewActivity(true)
+                .open(this);
+    }
+
+    /**
+     * 打开一个新的页面
+     *
+     * @param clazzName
+     * @param <T>
+     * @return
+     */
+    public <T extends XPageFragment> Fragment openNewPage(String clazzName) {
+        return new PageOption(clazzName)
+                .setAnim(CoreAnim.slide)
+                .setNewActivity(true)
+                .open(this);
+    }
+
+    /**
+     * 打开一个新的页面
+     *
+     * @param clazz
+     * @param <T>
+     * @return
+     */
+    public <T extends XPageFragment> Fragment openNewPage(Class<T> clazz, @NonNull Class<? extends XPageActivity> containActivityClazz) {
+        return new PageOption(clazz)
+                .setNewActivity(true)
+                .setContainActivityClazz(containActivityClazz)
+                .open(this);
+    }
+
+
+    /**
+     * 打开一个新的页面
+     *
+     * @param clazz
+     * @param <T>
+     * @return
+     */
+    public <T extends XPageFragment> Fragment openNewPage(Class<T> clazz, String key, Object value) {
+        PageOption option = new PageOption(clazz).setNewActivity(true);
+        return openPage(option, key, value);
+    }
+
+    public Fragment openPage(PageOption option, String key, Object value) {
+        if (value instanceof Integer) {
+            option.putInt(key, (Integer) value);
+        } else if (value instanceof String) {
+            option.putString(key, (String) value);
+        } else if (value instanceof Float) {
+            option.putFloat(key, (Float) value);
+        } else if (value instanceof Parcelable) {
+            option.putParcelable(key, (Parcelable) value);
+        } else if (value instanceof Serializable) {
+            option.putSerializable(key, (Serializable) value);
+        } else {
+           // option.putString(key, XRouter.getInstance().navigation(SerializationService.class).object2Json(value));
+        }
+        return option.open(this);
+    }
+
+    /**
+     * 打开一个新的页面
+     *
+     * @param clazz
+     * @param <T>
+     * @return
+     */
+    public <T extends XPageFragment> Fragment openPage(Class<T> clazz, boolean addToBackStack, String key, String value) {
+        return new PageOption(clazz)
+                .setAddToBackStack(addToBackStack)
+                .putString(key, value)
+                .open(this);
+    }
+
+    /**
+     * 打开一个新的页面
+     *
+     * @param clazz
+     * @param <T>
+     * @return
+     */
+    public <T extends XPageFragment> Fragment openPage(Class<T> clazz, String key, Object value) {
+        return openPage(clazz, true, key, value);
+    }
+
+    /**
+     * 打开一个新的页面
+     *
+     * @param clazz
+     * @param <T>
+     * @return
+     */
+    public <T extends XPageFragment> Fragment openPage(Class<T> clazz, boolean addToBackStack, String key, Object value) {
+        PageOption option = new PageOption(clazz).setAddToBackStack(addToBackStack);
+        return openPage(option, key, value);
+    }
+
+    /**
+     * 打开一个新的页面
+     *
+     * @param clazz
+     * @param <T>
+     * @return
+     */
+    public <T extends XPageFragment> Fragment openPage(Class<T> clazz, String key, String value) {
+        return new PageOption(clazz)
+                .putString(key, value)
+                .open(this);
+    }
+
+    /**
+     * 打开页面,需要结果返回
+     *
+     * @param clazz
+     * @param <T>
+     * @return
+     */
+    public <T extends XPageFragment> Fragment openPageForResult(Class<T> clazz, String key, Object value, int requestCode) {
+        PageOption option = new PageOption(clazz).setRequestCode(requestCode);
+        return openPage(option, key, value);
+    }
+
+    /**
+     * 打开页面,需要结果返回
+     *
+     * @param clazz
+     * @param <T>
+     * @return
+     */
+    public <T extends XPageFragment> Fragment openPageForResult(Class<T> clazz, String key, String value, int requestCode) {
+        return new PageOption(clazz)
+                .setRequestCode(requestCode)
+                .putString(key, value)
+                .open(this);
+    }
+
+    /**
+     * 打开页面,需要结果返回
+     *
+     * @param clazz
+     * @param <T>
+     * @return
+     */
+    public <T extends XPageFragment> Fragment openNewPageForResult(Class<T> clazz, String key, String value, int requestCode) {
+        return new PageOption(clazz)
+                .setNewActivity(true)
+                .setRequestCode(requestCode)
+                .putString(key, value)
+                .open(this);
+    }
+
+    /**
+     * 打开页面,需要结果返回
+     *
+     * @param clazz
+     * @param <T>
+     * @return
+     */
+    public <T extends XPageFragment> Fragment openPageForResult(Class<T> clazz, int requestCode) {
+        return new PageOption(clazz)
+                .setRequestCode(requestCode)
+                .open(this);
+    }
+}

+ 81 - 0
app/src/main/java/com/jld/vod/base/MyApplication.kt

@@ -0,0 +1,81 @@
+package com.jld.vod.base
+
+import android.app.Application
+import android.preference.PreferenceManager
+import android.util.Log
+import com.facebook.drawee.backends.pipeline.Fresco
+import com.jld.vod.ui.XBasicLibInit
+import com.jld.vod.utils.http.RetrofitUtils
+import com.xuexiang.xui.XUI
+import com.zzhoujay.richtext.RichText
+import org.mapsforge.map.android.graphics.AndroidGraphicFactory
+import org.mapsforge.map.layer.renderer.MapWorkerPool
+import org.mapsforge.map.model.DisplayModel
+import org.mapsforge.map.reader.MapFile
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/26 14:47
+ */
+class MyApplication : Application(){
+    val TAG = "Mapsforge Samples"
+
+    val SETTING_DEBUG_TIMING = "debug_timing"
+    val SETTING_LANGUAGE_SHOWLOCAL = "language_showlocal"
+    val SETTING_PREFERRED_LANGUAGE = "language_selection"
+    val SETTING_RENDERING_THREADS = "rendering_threads"
+    val SETTING_SCALE = "scale"
+    val SETTING_TEXTWIDTH = "textwidth"
+    val SETTING_TILECACHE_PERSISTENCE = "tilecache_persistence"
+    val SETTING_WAYFILTERING = "wayfiltering"
+    val SETTING_WAYFILTERING_DISTANCE = "wayfiltering_distance"
+
+    /**
+     * 内存检测
+     */
+    companion object{
+        fun isDebug(): Boolean {
+            return true
+        }
+        lateinit var app: Application
+    }
+    override fun onCreate() {
+        super.onCreate()
+        app = this
+        RetrofitUtils.init()
+        Fresco.initialize(app)
+        /**
+         * 地图
+         */
+        AndroidGraphicFactory.createInstance(this)
+        Log.e(TAG, "Device scale factor " + java.lang.Float.toString(DisplayModel.getDeviceScaleFactor()))
+        val preferences = PreferenceManager.getDefaultSharedPreferences(this)
+        val fs = java.lang.Float.valueOf(preferences.getString(SETTING_SCALE, java.lang.Float.toString(DisplayModel.getDefaultUserScaleFactor()))!!)
+        Log.e(TAG, "User ScaleFactor " + java.lang.Float.toString(fs))
+        if (fs != DisplayModel.getDefaultUserScaleFactor()) { DisplayModel.setDefaultUserScaleFactor(fs) }
+
+        MapFile.wayFilterEnabled = preferences.getBoolean(SETTING_WAYFILTERING, true)
+        if (MapFile.wayFilterEnabled) {
+            MapFile.wayFilterDistance = preferences.getString(SETTING_WAYFILTERING_DISTANCE, "20")!!.toInt()
+        }
+        MapWorkerPool.DEBUG_TIMING = preferences.getBoolean(SETTING_DEBUG_TIMING, false)
+        //XUI
+        initUI()
+        //初始化基础库
+        XBasicLibInit.init(this)
+        //html
+        RichText.initCacheDir(this)
+        RichText.debugMode = true
+    }
+
+    /**
+     * 初始化XUI 框架
+     */
+
+    private fun initUI() {
+        XUI.init(this)
+        XUI.debug(isDebug())
+    }
+}

+ 12 - 0
app/src/main/java/com/jld/vod/config/AudioFlag.kt

@@ -0,0 +1,12 @@
+package com.jld.vod.config
+
+object AudioFlag {
+    //不是播放的一个
+    const val NOT_PLAY_ITEM = -1
+
+    //后台服务没有运行
+    const val SERVICE_NOT_RUNING = -2
+
+    //后台没有播放听法类型的音乐
+    const val SERVICE_NOT_TIFA = -3
+}

+ 114 - 0
app/src/main/java/com/jld/vod/config/AudioPlayerConstant.kt

@@ -0,0 +1,114 @@
+package com.jld.vod.config
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/6/23 17:21
+ */
+object AudioPlayerConstant {
+    //发送到Activity的Action
+    const val ACITION_AUDIO_PLAYER_SERVICE_TO_ACT = "action_audio_player_service_to_act"
+
+    //发送到Service的Action
+    const val ACITION_AUDIO_PLAYER_ACT_TO_SERVICE = "action_audio_player_act_to_service"
+
+    //播放1
+    const val ACITION_AUDIO_PLAYER_PLAY = 1
+
+    //暂停2
+    const val ACITION_AUDIO_PLAYER_PAUSE = ACITION_AUDIO_PLAYER_PLAY + 1
+
+    //停止3
+    const val ACITION_AUDIO_PLAYER_STOP = ACITION_AUDIO_PLAYER_PAUSE + 1
+
+    //再次播放4
+    const val ACITION_AUDIO_PLAYER_REPLAY = ACITION_AUDIO_PLAYER_STOP + 1
+
+    //判断播放状态5
+    const val ACITION_AUDIO_PLAYER_JUDGE = ACITION_AUDIO_PLAYER_REPLAY + 1
+
+    //准备状态6
+    const val ACITION_AUDIO_PLAYER_PREPARE = ACITION_AUDIO_PLAYER_JUDGE + 1
+
+    //准备完成7
+    const val ACITION_AUDIO_PLAYER_PREPARED = ACITION_AUDIO_PLAYER_PREPARE + 1
+
+    //MediaPlayer当前播放进度8
+    const val ACITION_AUDIO_PLAYER_UPDATE_MEDIA_CURRENT_PROGRESS = ACITION_AUDIO_PLAYER_PREPARED + 1
+
+    //MediaPlayer缓冲进度9
+    const val ACITION_AUDIO_PLAYER_UPDATE_MEDIA_BUFFERING_PROGRESS =
+        ACITION_AUDIO_PLAYER_UPDATE_MEDIA_CURRENT_PROGRESS + 1
+
+    //保存进度
+    const val ACITION_AUDIO_PLAYER_SAVE_CURENT_DATA =
+        ACITION_AUDIO_PLAYER_UPDATE_MEDIA_BUFFERING_PROGRESS + 1
+
+    //播放下一首
+    const val ACITION_AUDIO_PLAYER_PLAY_NEXT_AUDIO = ACITION_AUDIO_PLAYER_SAVE_CURENT_DATA + 1
+
+    //播放上一首
+    const val ACITION_AUDIO_PLAYER_PLAY_PRE_AUDIO = ACITION_AUDIO_PLAYER_PLAY_NEXT_AUDIO + 1
+
+    //播放选择的某一首
+    const val ACITION_AUDIO_PLAYER_PLAY_SELECT_AUDIO = ACITION_AUDIO_PLAYER_PLAY_PRE_AUDIO + 1
+
+    //滑动seekBar
+    const val ACITION_AUDIO_PLAYER_SEEK = ACITION_AUDIO_PLAYER_PLAY_SELECT_AUDIO + 1
+
+    //获取时长
+    const val ACITION_AUDIO_PLAYER_GET_MEDIADURATION = ACITION_AUDIO_PLAYER_SEEK + 1
+
+    //获取总时长
+    const val ACITION_AUDIO_PLAYER_GET_MEDIADURATION_ALL =
+        ACITION_AUDIO_PLAYER_GET_MEDIADURATION + 1
+
+    //播放完成
+    const val ACITION_AUDIO_PLAYER_PLAY_COMPLETE = ACITION_AUDIO_PLAYER_GET_MEDIADURATION_ALL + 1
+
+    //获取初始数据
+    const val ACITION_AUDIO_PLAYER_GET_INIT_DATA = ACITION_AUDIO_PLAYER_PLAY_COMPLETE + 1
+
+    //销毁播放服务
+    const val ACITION_AUDIO_PLAYER_DESTROY = ACITION_AUDIO_PLAYER_GET_INIT_DATA + 1
+
+    //初始化成功
+    const val ACITION_AUDIO_PLAYER_INIT_SUCCESS = ACITION_AUDIO_PLAYER_DESTROY + 1
+
+    //重新获取播放列表
+    const val ACITION_AUDIO_PLAYER_REGET_PLAYER_LIST = ACITION_AUDIO_PLAYER_INIT_SUCCESS + 1
+
+    //获取所有数据
+    const val ACITION_AUDIO_PLAYER_GET_ALL_DATA = ACITION_AUDIO_PLAYER_REGET_PLAYER_LIST + 1
+    const val ACITION_AUDIO_PLAYER_ERROE = ACITION_AUDIO_PLAYER_GET_ALL_DATA + 1
+
+    //定时关闭
+    const val ACITION_AUDIO_DELAY_CLOSE = ACITION_AUDIO_PLAYER_ERROE + 1
+    const val ACITION_AUDIO_PLAYER_ERROR = ACITION_AUDIO_DELAY_CLOSE + 1
+
+    //是否需要继续播放
+    var needContinuePlay = false
+
+    //当前位置
+    var currentPosition = 0
+
+    //当前audio的类型,为音频还是听法
+    var type = 0
+
+    //播放状态
+    var playerState = 0
+
+    //各种进度
+    var current_progress = 0  //各种进度
+    var bufferingProgress = 0  //各种进度
+    var totalSeconds = 0  //各种进度
+    var media_duration = 0
+
+    //当前时间和总时间
+    var currentTimeStr: String? = null  //当前时间和总时间
+    var totalTimeStr: String? = null
+
+    //书名
+    var BookName = ""
+}

+ 18 - 0
app/src/main/java/com/jld/vod/config/Config.kt

@@ -0,0 +1,18 @@
+package com.jld.vod.config
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/21 14:18
+ */
+object Config {
+//    const val ApiBaseUrl : String = "http://192.168.16.110:8088"
+//    const val ApiBaseUrlDebug : String = "http://192.168.16.110:8088"
+    const val ApiBaseUrl : String = "http://192.168.0.16:8088"
+    const val ApiBaseUrlDebug : String = "http://192.168.0.16:8088"
+//    true--有线VOD false ---无线VOD
+    const val Breed:Boolean = false
+//   进入设置的密码
+    const val pwd:String = "123456"
+}

+ 30 - 0
app/src/main/java/com/jld/vod/dao/AboutDao.kt

@@ -0,0 +1,30 @@
+package com.jld.vod.dao
+
+import androidx.paging.DataSource
+import androidx.room.*
+import com.jld.vod.model.bean.FindAboutAllBean
+
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/28 15:31
+ */
+@Dao
+interface AboutDao {
+    @Insert
+    fun insertAll(vararg users: FindAboutAllBean)
+
+    @Query("SELECT * FROM FindAboutAllBean")
+    fun getAll(): List<FindAboutAllBean>
+
+    /**
+     * 获取所有设备给paging使用
+     */
+    @Query("SELECT * FROM FindAboutAllBean")
+    fun getAlls(): DataSource.Factory<Int, FindAboutAllBean>
+
+    @Query(" DELETE FROM FindAboutAllBean")
+    fun delete()
+}

+ 30 - 0
app/src/main/java/com/jld/vod/dao/BrowserDao.kt

@@ -0,0 +1,30 @@
+package com.jld.vod.dao
+
+import androidx.paging.DataSource
+import androidx.room.*
+import com.jld.vod.model.bean.BrowserBean
+
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/28 15:31
+ */
+@Dao
+interface BrowserDao {
+    @Insert
+    fun insertAll(vararg users: BrowserBean)
+
+    @Query("SELECT * FROM BrowserBean")
+    fun getAll(): List<BrowserBean>
+
+    /**
+     * 获取所有设备给paging使用
+     */
+    @Query("SELECT * FROM BrowserBean")
+    fun getAlls(): DataSource.Factory<Int, BrowserBean>
+
+    @Query(" DELETE FROM BrowserBean")
+    fun delete()
+}

+ 31 - 0
app/src/main/java/com/jld/vod/dao/CarInfoDao.kt

@@ -0,0 +1,31 @@
+package com.jld.vod.dao
+
+import androidx.paging.DataSource
+import androidx.room.*
+import com.jld.vod.model.bean.BrowserBean
+import com.jld.vod.model.bean.CarInfoBean
+
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/28 15:31
+ */
+@Dao
+interface CarInfoDao {
+    @Insert
+    fun insertAll(vararg users: CarInfoBean)
+
+    @Query("SELECT * FROM CarInfoBean")
+    fun getAll(): List<CarInfoBean>
+
+    /**
+     * 获取所有设备给paging使用
+     */
+    @Query("SELECT * FROM CarInfoBean")
+    fun getAlls(): DataSource.Factory<Int, CarInfoBean>
+
+    @Query(" DELETE FROM CarInfoBean")
+    fun delete()
+}

+ 30 - 0
app/src/main/java/com/jld/vod/dao/CarSiteAllDao.kt

@@ -0,0 +1,30 @@
+package com.jld.vod.dao
+
+import androidx.paging.DataSource
+import androidx.room.*
+import com.jld.vod.model.bean.CarSiteAllBean
+
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/28 15:31
+ */
+@Dao
+interface CarSiteAllDao {
+    @Insert
+    fun insertAll(vararg users: CarSiteAllBean)
+
+    @Query("SELECT * FROM CarSiteAllBean")
+    fun getAll(): List<CarSiteAllBean>
+
+    /**
+     * 获取所有设备给paging使用
+     */
+    @Query("SELECT * FROM CarSiteAllBean")
+    fun getAlls(): DataSource.Factory<Int, CarSiteAllBean>
+
+    @Query(" DELETE FROM CarSiteAllBean")
+    fun delete()
+}

+ 30 - 0
app/src/main/java/com/jld/vod/dao/CategoryFatherAllDao.kt

@@ -0,0 +1,30 @@
+package com.jld.vod.dao
+
+import androidx.paging.DataSource
+import androidx.room.*
+import com.jld.vod.model.bean.CategoryFatherAllBean
+
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/28 15:31
+ */
+@Dao
+interface CategoryFatherAllDao {
+    @Insert
+    fun insertAll(vararg users: CategoryFatherAllBean)
+
+    @Query("SELECT * FROM CategoryFatherAllBean")
+    fun getAll(): List<CategoryFatherAllBean>
+
+    /**
+     * 获取所有设备给paging使用
+     */
+    @Query("SELECT * FROM CategoryFatherAllBean")
+    fun getAlls(): DataSource.Factory<Int, CategoryFatherAllBean>
+
+    @Query(" DELETE FROM CategoryFatherAllBean")
+    fun delete()
+}

+ 30 - 0
app/src/main/java/com/jld/vod/dao/CategorySonAllDao.kt

@@ -0,0 +1,30 @@
+package com.jld.vod.dao
+
+import androidx.paging.DataSource
+import androidx.room.*
+import com.jld.vod.model.bean.CategorySonAllBean
+
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/28 15:31
+ */
+@Dao
+interface CategorySonAllDao {
+    @Insert
+    fun insertAll(vararg users: CategorySonAllBean)
+
+    @Query("SELECT * FROM CategorySonAllBean")
+    fun getAll(): List<CategorySonAllBean>
+
+    /**
+     * 获取所有设备给paging使用
+     */
+    @Query("SELECT * FROM CategorySonAllBean")
+    fun getAlls(): DataSource.Factory<Int, CategorySonAllBean>
+
+    @Query(" DELETE FROM CategorySonAllBean")
+    fun delete()
+}

+ 30 - 0
app/src/main/java/com/jld/vod/dao/GameDao.kt

@@ -0,0 +1,30 @@
+package com.jld.vod.dao
+
+import androidx.paging.DataSource
+import androidx.room.*
+import com.jld.vod.model.bean.GameBean
+
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/28 15:31
+ */
+@Dao
+interface GameDao {
+    @Insert
+    fun insertAll(vararg users: GameBean)
+
+    @Query("SELECT * FROM GameBean")
+    fun getAll(): List<GameBean>
+
+    /**
+     * 获取所有设备给paging使用
+     */
+    @Query("SELECT * FROM GameBean")
+    fun getAlls(): DataSource.Factory<Int, GameBean>
+
+    @Query(" DELETE FROM GameBean")
+    fun delete()
+}

+ 30 - 0
app/src/main/java/com/jld/vod/dao/LanguageDao.kt

@@ -0,0 +1,30 @@
+package com.jld.vod.dao
+
+import androidx.paging.DataSource
+import androidx.room.*
+import com.jld.vod.model.bean.LanguageBean
+
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/28 15:31
+ */
+@Dao
+interface LanguageDao {
+    @Insert
+    fun insertAll(vararg languageBean: LanguageBean)
+
+    @Query("SELECT * FROM LanguageBean")
+    fun getAll(): List<LanguageBean>
+
+    /**
+     * 获取所有设备给paging使用
+     */
+    @Query("SELECT * FROM LanguageBean")
+    fun getAlls(): DataSource.Factory<Int, LanguageBean>
+
+    @Query(" DELETE FROM LanguageBean")
+    fun delete()
+}

+ 33 - 0
app/src/main/java/com/jld/vod/dao/ModularAllDao.kt

@@ -0,0 +1,33 @@
+package com.jld.vod.dao
+
+import androidx.paging.DataSource
+import androidx.room.*
+import com.jld.vod.model.bean.ModelAllBean
+
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/28 15:31
+ */
+@Dao
+interface ModularAllDao {
+    @Insert
+    fun insertAll(vararg users: ModelAllBean)
+
+    @Query("SELECT * FROM ModelAllBean")
+    fun getAll(): List<ModelAllBean>
+
+    @Query("SELECT * FROM ModelAllBean WHERE rtName IN (:rtName)")
+    fun loadAllByrtNames(rtName: String): List<ModelAllBean>
+
+    /**
+     * 获取所有设备给paging使用
+     */
+    @Query("SELECT * FROM ModelAllBean")
+    fun getAlls(): DataSource.Factory<Int, ModelAllBean>
+
+    @Query(" DELETE FROM ModelAllBean")
+    fun delete()
+}

+ 33 - 0
app/src/main/java/com/jld/vod/dao/MusicByMidDao.kt

@@ -0,0 +1,33 @@
+package com.jld.vod.dao
+
+import androidx.paging.DataSource
+import androidx.room.*
+import com.jld.vod.model.bean.MusicByMidBean
+
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/28 15:31
+ */
+@Dao
+interface MusicByMidDao {
+    @Insert
+    fun insertAll(vararg users: MusicByMidBean)
+
+    @Query("SELECT * FROM MusicByMidBean")
+    fun getAll(): List<MusicByMidBean>
+
+    /**
+     * 获取所有设备给paging使用
+     */
+    @Query("SELECT * FROM MusicByMidBean")
+    fun getAlls(): DataSource.Factory<Int, MusicByMidBean>
+
+    @Query("SELECT * FROM MusicByMidBean WHERE id IN (:movieId)")
+    fun loadAllByIds(movieId: Long): List<MusicByMidBean>
+
+    @Query(" DELETE FROM MusicByMidBean")
+    fun delete()
+}

+ 24 - 0
app/src/main/java/com/jld/vod/dao/SettingDao.kt

@@ -0,0 +1,24 @@
+package com.jld.vod.dao
+
+import androidx.paging.DataSource
+import androidx.room.Dao
+import androidx.room.Insert
+import androidx.room.Query
+
+import com.jld.vod.model.bean.SettingBean
+
+@Dao
+interface SettingDao {
+
+    @Insert
+    fun insertAll(vararg users: SettingBean)
+
+    @Query("SELECT * FROM SettingBean")
+    fun getAll(): List<SettingBean>
+
+    @Query("SELECT * FROM SettingBean")
+    fun getAlls(): DataSource.Factory<Int, SettingBean>
+
+    @Query(" DELETE FROM SettingBean")
+    fun delete()
+}

+ 17 - 0
app/src/main/java/com/jld/vod/db/AboutDatabase.kt

@@ -0,0 +1,17 @@
+package com.jld.vod.db
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+import com.jld.vod.dao.AboutDao
+import com.jld.vod.model.bean.FindAboutAllBean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/19 11:14
+ */
+@Database(entities = arrayOf(FindAboutAllBean::class), version = 1)
+abstract class AboutDatabase : RoomDatabase() {
+    abstract fun aboutDao(): AboutDao
+}

+ 17 - 0
app/src/main/java/com/jld/vod/db/BrowserDatabase.kt

@@ -0,0 +1,17 @@
+package com.jld.vod.db
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+import com.jld.vod.dao.BrowserDao
+import com.jld.vod.model.bean.BrowserBean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/19 11:14
+ */
+@Database(entities = arrayOf(BrowserBean::class), version = 1)
+abstract class BrowserDatabase : RoomDatabase() {
+    abstract fun browserDao(): BrowserDao
+}

+ 19 - 0
app/src/main/java/com/jld/vod/db/CarInfoDatabase.kt

@@ -0,0 +1,19 @@
+package com.jld.vod.db
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+import com.jld.vod.dao.BrowserDao
+import com.jld.vod.dao.CarInfoDao
+import com.jld.vod.model.bean.BrowserBean
+import com.jld.vod.model.bean.CarInfoBean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/19 11:14
+ */
+@Database(entities = arrayOf(CarInfoBean::class), version = 1)
+abstract class CarInfoDatabase : RoomDatabase() {
+    abstract fun carInfoDao(): CarInfoDao
+}

+ 17 - 0
app/src/main/java/com/jld/vod/db/CarSiteAllDatabase.kt

@@ -0,0 +1,17 @@
+package com.jld.vod.db
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+import com.jld.vod.dao.CarSiteAllDao
+import com.jld.vod.model.bean.CarSiteAllBean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/19 11:14
+ */
+@Database(entities = arrayOf(CarSiteAllBean::class), version = 1)
+abstract class CarSiteAllDatabase : RoomDatabase() {
+    abstract fun carSiteAllDao(): CarSiteAllDao
+}

+ 17 - 0
app/src/main/java/com/jld/vod/db/CategoryFatherAllDatabase.kt

@@ -0,0 +1,17 @@
+package com.jld.vod.db
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+import com.jld.vod.dao.CategoryFatherAllDao
+import com.jld.vod.model.bean.CategoryFatherAllBean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/19 11:14
+ */
+@Database(entities = arrayOf(CategoryFatherAllBean::class), version = 1)
+abstract class CategoryFatherAllDatabase : RoomDatabase() {
+    abstract fun categoryFatherAllDao(): CategoryFatherAllDao
+}

+ 17 - 0
app/src/main/java/com/jld/vod/db/CategorySonAllDatabase.kt

@@ -0,0 +1,17 @@
+package com.jld.vod.db
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+import com.jld.vod.dao.CategorySonAllDao
+import com.jld.vod.model.bean.CategorySonAllBean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/19 11:14
+ */
+@Database(entities = arrayOf(CategorySonAllBean::class), version = 1)
+abstract class CategorySonAllDatabase : RoomDatabase() {
+    abstract fun categorySonAllDao(): CategorySonAllDao
+}

+ 17 - 0
app/src/main/java/com/jld/vod/db/GameDatabase.kt

@@ -0,0 +1,17 @@
+package com.jld.vod.db
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+import com.jld.vod.dao.GameDao
+import com.jld.vod.model.bean.GameBean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/19 11:14
+ */
+@Database(entities = arrayOf(GameBean::class), version = 1)
+abstract class GameDatabase : RoomDatabase() {
+    abstract fun gameDao(): GameDao
+}

+ 17 - 0
app/src/main/java/com/jld/vod/db/LanguageDatabase.kt

@@ -0,0 +1,17 @@
+package com.jld.vod.db
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+import com.jld.vod.dao.LanguageDao
+import com.jld.vod.model.bean.LanguageBean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/19 11:14
+ */
+@Database(entities = arrayOf(LanguageBean::class), version = 1)
+abstract class LanguageDatabase : RoomDatabase() {
+    abstract fun languageDao(): LanguageDao
+}

+ 17 - 0
app/src/main/java/com/jld/vod/db/ModularAllDatabase.kt

@@ -0,0 +1,17 @@
+package com.jld.vod.db
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+import com.jld.vod.dao.ModularAllDao
+import com.jld.vod.model.bean.ModelAllBean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/19 11:14
+ */
+@Database(entities = arrayOf(ModelAllBean::class), version = 1)
+abstract class ModularAllDatabase : RoomDatabase() {
+    abstract fun modularAllDao(): ModularAllDao
+}

+ 17 - 0
app/src/main/java/com/jld/vod/db/MusicByMidDatabase.kt

@@ -0,0 +1,17 @@
+package com.jld.vod.db
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+import com.jld.vod.dao.MusicByMidDao
+import com.jld.vod.model.bean.MusicByMidBean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/19 11:14
+ */
+@Database(entities = arrayOf(MusicByMidBean::class), version = 1)
+abstract class MusicByMidDatabase : RoomDatabase() {
+    abstract fun musicByMidDao(): MusicByMidDao
+}

+ 13 - 0
app/src/main/java/com/jld/vod/db/SettingDataBase.kt

@@ -0,0 +1,13 @@
+package com.jld.vod.db
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+import com.jld.vod.dao.SettingDao
+import com.jld.vod.model.bean.SettingBean
+
+
+@Database(entities = [SettingBean::class], version = 1)
+abstract class SettingDataBase: RoomDatabase() {
+    abstract fun settingDao(): SettingDao
+
+}

+ 18 - 0
app/src/main/java/com/jld/vod/interfaces/IDownloadCallBack.java

@@ -0,0 +1,18 @@
+package com.jld.vod.interfaces;
+
+import java.io.File;
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/11/14 10:50
+ */
+public interface IDownloadCallBack {
+
+    void success(File apkfile);
+
+    void progress(int progress);
+
+    void failed(Throwable throwable);
+}

+ 311 - 0
app/src/main/java/com/jld/vod/interfaces/remote/Apis.kt

@@ -0,0 +1,311 @@
+package com.jld.vod.interfaces.remote
+
+import com.jld.vod.model.bean.*
+import io.reactivex.Observable
+import okhttp3.MultipartBody
+import retrofit2.http.*
+
+/**
+ * Create by zhaofuxin on 2020/7/15
+ */
+interface Apis {
+
+    /**
+     * 获取硬盘资源信息
+     */
+    @GET("/sys/findDisk")
+    fun findDisk(): Observable<BaseBean<List<DiskBean>>>
+
+    /**
+     * 获取MAC地址
+     */
+    @GET("/sys/findIPAndMAC")
+    fun findIPAndMAC(): Observable<BaseBean<String>>
+
+    /**
+     * 获取Cpu信息
+     */
+    @GET("/sys/findCpu")
+    fun findCpu(): Observable<BaseBean<String>>
+
+    /**
+     * 根据模块编号获取所有一级类别
+     */
+    @GET("/category/findCategoryFatherAllByMid")
+    suspend fun findCategoryFatherAllByMid(@Query("mid")mid:Long,@Query("lid") lid:Long): BaseBean<List<CategoryFatherAllBean>>
+
+    /**
+     * 根据类别编号获取所有二级类别
+     */
+    @GET("/category/findCategorySonAllByCid")
+    suspend fun findCategorySonAllByCid(@Query("cid")cid:Long,@Query("lid") lid:Long): BaseBean<List<CategorySonAllBean>>
+
+    /**
+     * 获取所有语言信息
+     */
+    @GET("/language/findLanguageAll")
+    fun findLanguageAll(): Observable<BaseBean<List<LanguageBean>>>
+
+    /**
+     * 获取全部模块信息
+     */
+    @GET("/modular/findModularAll")
+    fun findModularAll(@Query("userId") userId:Long): Observable<BaseBean<List<ModelAllBean>>>
+
+    /**
+     * 根据模块编号获取模块页面列表
+     */
+    @GET("/modular/findModularPageAllByMid/{mid}")
+    fun findModularPageAllByMid(): Observable<BaseBean<String>>
+
+    /**
+     * 根据模块页面编号获取对应的页面静态资源
+     */
+    @GET("/modular/findModularPageAllByMpId/{mpId}")
+    fun findModularPageAllByMpId(): Observable<BaseBean<String>>
+
+    /**
+     * 根据模块编号查询电影信息
+     */
+    @GET("/movie/findMovieByMid")
+    suspend fun findMovieByMid(@Query("mid") mid:Long,@Query("lid") lid:Long): BaseBean<List<MovieByMidBean>>
+
+    /**
+     * 根据类别编号获取电影信息
+     */
+    @GET("/movie/findMovieByCid")
+    suspend fun findMovieByCid(@Query("cid") cid:Long,@Query("mid") mid:Long,@Query("lid") lid:Long): BaseBean<List<MovieByMidBean>>
+
+    /**
+     * 根据电影编号查询电影信息
+     */
+    @GET("/movie/findMovieById/{resId}/{lid}")
+    fun findMovieById(): Observable<BaseBean<String>>
+
+    /**
+     * 文件电影上传(POST请求)
+     */
+    @Multipart
+    @POST("/movie/upload")
+    fun movieUpload(@Part file: MultipartBody.Part,@Query("mid") mid:Long,@Query("resId") resId:Long): Observable<BaseBean<String>>
+
+    /**
+     * 根据模块编号查询音乐信息
+     */
+    @GET("/music/findMusicByMid")
+    suspend fun findMusicByMid(@Query("mid") mid:Long,@Query("lid") lid:Long): BaseBean<List<MusicByMidBean>>
+
+    /**
+     * 根据类别编号获取音乐信息
+     */
+    @GET("/music/findMusicByCid")
+    suspend fun findMusicByCid(@Query("cid") cid:Long,@Query("mid") mid:Long,@Query("lid") lid:Long):  BaseBean<List<MusicByMidBean>>
+
+    /**
+     * 根据类别编号获取音乐信息
+     */
+    @GET("/music/findMusicById/{resId}/{lid}")
+    fun findMusicById(): Observable<BaseBean<String>>
+
+    /**
+     * 文件音乐上传(POST请求)
+     */
+    @POST("/music/upload")
+    fun musicUpload(): Observable<BaseBean<String>>
+
+    /**
+     * 根据模块编号查询网络链接信息
+     */
+    @GET("/netWork/findNetWorkAll")
+    suspend fun findNetWorkAll(@Query("mid") mid:Long,@Query("lid") lid:Long): BaseBean<List<BrowserBean>>
+
+    /**
+     * 获取所有点餐信息
+     */
+    @GET("/orderFood/findOrderFoodAll/{mid}/{lid}")
+    fun findOrderFoodAll(): Observable<BaseBean<String>>
+
+    /**
+     * 获取所有游戏信息
+     */
+    @GET("/game/findGameAll")
+    suspend fun findGameAll(@Query("mid") mid:Long,@Query("lid") lid:Long,@Query("terminal") terminal :String): BaseBean<List<GameBean>>
+
+    /**
+     * 获取车辆信息
+     */
+    @GET("/car/carInfo")
+    fun carInfo(): Observable<BaseBean<List<CarInfoBean>>>
+
+    /**
+     * 获取车辆运行信息
+     */
+    @GET("/car/carRunInfo")
+    fun carRunInfo(): Observable<BaseBean<CarRunInfoBean>>
+
+    /**
+     * 更新车牌号(需云服务器启动才可更新)
+     */
+    @GET("/car/updateCarNum")
+    fun updateCarNum(): Observable<BaseBean<String>>
+
+    /**
+     * 更同步WiFi信息(需云服务器启动才可更新)
+     */
+    @GET("/car/updateWFI")
+    fun updateWFI(): Observable<BaseBean<String>>
+
+    /**
+     * 获取用户信息
+     */
+    @GET("/user")
+    fun getUser(): Observable<UserBean>
+
+    /**
+     * 更新上传状态
+     */
+    @GET("/synchronization/updateUploadState/{mid}/{resId}")
+    fun updateUploadState(): Observable<BaseBean<String>>
+
+//    /**
+//     * 获取未上传列表
+//     */
+//    @GET("/synchronization/findResByNotUploaded")
+//    fun syncFindResByNotUploaded(@Query("mid") mid:Long): Observable<BaseBean<List<MovieResByNotUploaded>>>
+
+    /**
+     * 获取图片
+     */
+    @GET("/synchronization/previewImg/{imgUrl}")
+    fun syncPreviewImg(): Observable<BaseBean<String>>
+
+    /**
+     * 更新游戏安装状态
+     */
+    @GET("/synchronization/updateGameInstallState/{resId}")
+    fun syncUpdateGameInstallState(): Observable<BaseBean<String>>
+
+    /**
+     * 检测APP是否有更新(与云服务器交互)
+     */
+    @GET("/synchronization/detectAppUpdates")
+    fun detectAppUpdates(@Query("userId") userId:Long, @Query("versionNum") versionNum : Long): Observable<AppUpdateInfo>
+
+    /**
+     * 下载云apk到本地服务器(与云服务器交互)
+     */
+    @GET("/synchronization/previewAPK")
+    fun previewAPK(@Query("apkFile") apkFile :String): Observable<BaseBean<String>>
+
+    /**
+     * 获取本地apk文件流
+     */
+    @GET("/synchronization/previewAPKByteByLocal")
+    @Streaming
+    fun previewAPKByteByLocal(@Query("pakFile") pakFile:Long): Observable<BaseBean<String>>
+
+
+    /**
+     * 检测车辆是否绑定云平台
+     */
+    @GET("/synchronization/eqCar")
+    fun eqCar(): Observable<BaseBean<String>>
+
+    /**
+     * 获取用户未绑定车辆
+     */
+    @GET("/synchronization/findCarByUnbound")
+    fun findCarByUnbound(@Query("userId") userId:Long): Observable<BaseBean<List<FindCarByUnboundBean>>>
+
+    /**
+     * 车辆绑定云平台
+     */
+    @GET("/synchronization/binding")
+    fun binding(@Query("ciId") ciId :String): Observable<BaseBean<String>>
+
+    /**
+     * 获取关于信息资源
+     */
+    @GET("/about/findAboutAll")
+    suspend fun findAboutAll(@Query("mid") mid:Long,@Query("lid") lid:Long): BaseBean<List<FindAboutAllBean>>
+
+    /**
+     * 文件音乐上传(POST请求)
+     */
+    @Multipart
+    @POST("/music/upload")
+    fun musicUpload(@Part file: MultipartBody.Part,@Query("mid") mid:Long,@Query("resId") resId:Long): Observable<BaseBean<String>>
+
+    /**
+     * 获取音乐未上传列表
+     */
+    @GET("/synchronization/findResByNotUploaded/music")
+    fun findResByNotUploadedmusic(): Observable<BaseBean<List<MusicResByNotUploaded>>>
+
+    /**
+     * 获取电影未上传列表
+     */
+    @GET("/synchronization/findResByNotUploaded/movie")
+    fun findResByNotUploadedmovie(): Observable<BaseBean<List<MovieResByNotUploaded>>>
+
+    /**
+     * 获取该车辆所有站点信息
+     */
+    @GET("/carSite/findCarSiteAll")
+    fun findCarSiteAll(@Query("ciId") ciId:Long,@Query("lid") lid:Long): Observable<BaseBean<List<CarSiteAllBean>>>
+
+    /**
+     * 获取游戏未上传列表
+     */
+    @GET("/synchronization/findResByNotUploaded/game")
+    fun findResByNotUploadedgame(): Observable<BaseBean<List<GameResByNotUploaded>>>
+
+    /**
+     * 文件游戏上传(POST请求)
+     */
+    @Multipart
+    @POST("/game/upload")
+    fun gameUpload(@Part file: MultipartBody.Part,@Query("mid") mid:Long,@Query("resId") resId:Long): Observable<BaseBean<String>>
+
+    /**
+     * 更新游戏安装状态
+     */
+    @GET("/game/updateGameInstallState")
+    fun updateGameInstallState(@Query("resId") resId:String,@Query("install") install:String,@Query("terminal") terminal :String): Observable<BaseBean<String>>
+
+    /**
+     * 获取未安装游戏列表
+     */
+    @GET("/game/findGameByNoInstall")
+    fun findGameByNoInstall(@Query("terminal") terminal :String): Observable<BaseBean<List<FindGameByNoInstallBean>>>
+
+    /**
+     * 获取所有静态资源
+     */
+    @GET("/modular/findAllModularImg")
+    fun findAllModularImg(@Query("userId") userId :String): Observable<BaseBean<findAllModularImgBean>>
+
+    /**
+     * 获取图标静态资源(new)
+     */
+    @GET("/modular/findAllModularRotateImg")
+    fun findAllModularRotateImg(@Query("userId") userId :String,@Query("index") index :Int): Observable<BaseBean<List<AllModularRotateImgBean>>>
+
+    /**
+     * 获取系统主页静态资源
+     */
+    @GET("/modular/findHomePageImg")
+    fun findHomePageImg(): Observable<BaseBean<HomePageImgBean>>
+
+    /**
+     * 返回需要卸载的游戏
+     */
+    @GET("/game/getNuInstallGame")
+    fun getNuInstallGame(@Query("terminal") terminal :String): Observable<BaseBean<List<NuInstallGameBean>>>
+
+    /**
+     * 删除安装目录
+     */
+    @GET("/modular/delInstallPath")
+    fun delInstallPath(@Query("tiId") tiId :String): Observable<BaseBean<List<NuInstallGameBean>>>
+}

+ 75 - 0
app/src/main/java/com/jld/vod/model/ProgressModel.java

@@ -0,0 +1,75 @@
+package com.jld.vod.model;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * Created by zhaofuxin on 2019/9/12.
+ */
+
+public class ProgressModel implements Parcelable {
+
+    private long currentBytes;
+    private long contentLength;
+    private boolean done = false;
+
+    public ProgressModel(long currentBytes, long contentLength, boolean done) {
+        this.currentBytes = currentBytes;
+        this.contentLength = contentLength;
+        this.done = done;
+    }
+
+    public long getCurrentBytes() {
+        return currentBytes;
+    }
+
+    public void setCurrentBytes(long currentBytes) {
+        this.currentBytes = currentBytes;
+    }
+
+    public long getContentLength() {
+        return contentLength;
+    }
+
+    public void setContentLength(long contentLength) {
+        this.contentLength = contentLength;
+    }
+
+    public boolean isDone() {
+        return done;
+    }
+
+    public void setDone(boolean done) {
+        this.done = done;
+    }
+
+    private static final Creator<ProgressModel> CREATOR = new Creator<ProgressModel>() {
+        @Override
+        public ProgressModel createFromParcel(Parcel parcel) {
+            return new ProgressModel(parcel);
+        }
+
+        @Override
+        public ProgressModel[] newArray(int i) {
+            return new ProgressModel[i];
+        }
+    };
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel parcel, int i) {
+        parcel.writeLong(currentBytes);
+        parcel.writeLong(contentLength);
+        parcel.writeByte((byte) (done==true?1:0));
+    }
+
+    protected ProgressModel(Parcel parcel) {
+        currentBytes = parcel.readLong();
+        contentLength = parcel.readLong();
+        done = parcel.readByte()!=0;
+    }
+}

+ 8 - 0
app/src/main/java/com/jld/vod/model/bean/AllModularRotateImgBean.kt

@@ -0,0 +1,8 @@
+package com.jld.vod.model.bean
+
+data class AllModularRotateImgBean(
+
+    val garden: String,
+    val icon: String,
+    val mid: String
+)

+ 14 - 0
app/src/main/java/com/jld/vod/model/bean/AppUpdateInfo.kt

@@ -0,0 +1,14 @@
+package com.jld.vod.model.bean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/8/1 14:30
+ */
+data class AppUpdateInfo(
+    val code: Int,
+    val `data`: String,
+    val flag: Boolean,
+    val message: String
+)

+ 219 - 0
app/src/main/java/com/jld/vod/model/bean/Audio.java

@@ -0,0 +1,219 @@
+package com.jld.vod.model.bean;
+
+
+import java.io.Serializable;
+
+
+/**
+ * Created by ding on 2016/10/5.
+ * 音频实体类
+ */
+public class Audio implements Serializable {
+    //id
+    private long id;
+    //类型
+    private int type;
+    //大小
+    private int length;
+    //时长
+    private int time;
+    //状态
+    private int status;
+    //名称
+    private String name;
+    private String bookName;
+    //封面
+    private String faceUrl;
+    //文稿url
+    private String textUrl;
+    //标签一
+    private String tag1;
+    //标签二
+    private String tag2;
+    //标签三
+    private String tag3;
+    //作者
+    private String author;
+    //读者
+    private String reader;
+    //来源
+    private String source;
+    //简介
+    private String abstractInfo;
+    //文稿内容
+    private String wengao;
+    //文件地址
+    private String fileUrl;
+    //是否可播放
+    private boolean lock;
+
+    public String getBookName() {
+        return bookName;
+    }
+
+    public void setBookName(String bookName) {
+        this.bookName = bookName;
+    }
+
+    public String getWengao() {
+        return wengao;
+    }
+
+    public void setWengao(String wengao) {
+        this.wengao = wengao;
+    }
+
+    public String getAbstractInfo() {
+        return abstractInfo;
+    }
+
+    public void setAbstractInfo(String abstractInfo) {
+        this.abstractInfo = abstractInfo;
+    }
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getAuthor() {
+        return author;
+    }
+
+    public void setAuthor(String author) {
+        this.author = author;
+    }
+
+    public String getReader() {
+        return reader;
+    }
+
+    public void setReader(String reader) {
+        this.reader = reader;
+    }
+
+    public String getSource() {
+        return (source);
+    }
+
+    public void setSource(String source) {
+        this.source = source;
+    }
+
+
+    public int getTime() {
+        return time;
+    }
+
+    public void setTime(int time) {
+        this.time = time;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public int getType() {
+        return type;
+    }
+
+    public void setType(int type) {
+        this.type = type;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public void setStatus(int status) {
+        this.status = status;
+    }
+
+    public int getLength() {
+        return length;
+    }
+
+    public void setLength(int length) {
+        this.length = length;
+    }
+
+    public String getName() {
+        return (name);
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getFaceUrl() {
+        return faceUrl;
+    }
+
+    public void setFaceUrl(String faceUrl) {
+        this.faceUrl = faceUrl;
+    }
+
+    public String getTextUrl() {
+        return textUrl;
+    }
+
+    public void setTextUrl(String textUrl) {
+        this.textUrl = textUrl;
+    }
+
+    public String getTag1() {
+        return tag1;
+    }
+
+    public void setTag1(String tag1) {
+        this.tag1 = tag1;
+    }
+
+    public String getTag2() {
+        return tag2;
+    }
+
+    public void setTag2(String tag2) {
+        this.tag2 = tag2;
+    }
+
+    public String getTag3() {
+        return tag3;
+    }
+
+    public void setTag3(String tag3) {
+        this.tag3 = tag3;
+    }
+
+    @Override
+    public String toString() {
+        return "Audio{" +
+                "type=" + type +
+                ", id=" + id +
+                ", name='" + name + '\'' +
+                '}';
+    }
+
+    public void setLock(boolean lock) {
+        this.lock = lock;
+    }
+
+    public boolean isLock() {
+        return lock;
+    }
+
+    public String getArtist() {
+        return "";
+    }
+
+    public String getAlbum() {
+        return "";
+    }
+}

+ 24 - 0
app/src/main/java/com/jld/vod/model/bean/BaseBean.kt

@@ -0,0 +1,24 @@
+package com.jld.vod.model.bean
+
+/**
+ * Create by zhaofuxin on 2020/7/12
+ */
+
+data class BaseBean<T>(val code: Int, val data: T?, val message: String) {
+
+    companion object {
+        const val SUCCESS = 20000
+        const val ERROR = 1
+        const val EXCEPTION = 2
+        const val LOADING = 3
+
+        fun <T> success(data: T?) = BaseBean(SUCCESS, data, "success")
+
+        fun <T> error(msg: String, data: T?) = BaseBean(ERROR, data, msg)
+
+        fun <T> exception(msg: String, data: T?) = BaseBean(ERROR, data, msg)
+
+        fun <T> loading(data: T?) = BaseBean(LOADING, data, "loading")
+    }
+
+}

+ 28 - 0
app/src/main/java/com/jld/vod/model/bean/BrowserBean.kt

@@ -0,0 +1,28 @@
+package com.jld.vod.model.bean
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/6 9:22
+ */
+
+@Entity
+data class BrowserBean(
+    @PrimaryKey(autoGenerate = true) val id: Long,
+    @ColumnInfo(name = "createTime") val createTime: String,
+    @ColumnInfo(name = "createUser") val createUser: Long,
+    @ColumnInfo(name = "delState") val delState: String,
+    @ColumnInfo(name = "imgUrl") val imgUrl: String,
+    @ColumnInfo(name = "mid") val mid: Long,
+    @ColumnInfo(name = "nName") val nName: String,
+    @ColumnInfo(name = "nUrl") val nUrl: String,
+    @ColumnInfo(name = "nid") val nid: Long,
+    @ColumnInfo(name = "updateTime") val updateTime: String?,
+    @ColumnInfo(name = "updateUser") val updateUser: Long,
+    @ColumnInfo(name = "userId") val userId: Long
+)

+ 30 - 0
app/src/main/java/com/jld/vod/model/bean/CarInfoBean.kt

@@ -0,0 +1,30 @@
+package com.jld.vod.model.bean
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/22 11:18
+ */
+@Entity
+data class CarInfoBean(
+    @PrimaryKey(autoGenerate = true) val id: Long,
+    @ColumnInfo(name = "carNum") val carNum: String?,
+    @ColumnInfo(name = "ciId") val ciId: Long,
+    @ColumnInfo(name = "createTime") val createTime: String?,
+    @ColumnInfo(name = "createUser") val createUser: Long,
+    @ColumnInfo(name = "mac") val mac: String?,
+    @ColumnInfo(name = "region") val region: String?,
+    @ColumnInfo(name = "regionName") val regionName: String?,
+    @ColumnInfo(name = "runInfo") val runInfo: String?,
+    @ColumnInfo(name = "seatNum") val seatNum: String?,
+    @ColumnInfo(name = "updateTime") val updateTime: String?,
+    @ColumnInfo(name = "updateUser") val updateUser: Long,
+    @ColumnInfo(name = "userId") val userId: Long,
+    @ColumnInfo(name = "wifiName") val wifiName: String?,
+    @ColumnInfo(name = "wifiPwd") val wifiPwd: String?
+)

+ 32 - 0
app/src/main/java/com/jld/vod/model/bean/CarRunInfoBean.kt

@@ -0,0 +1,32 @@
+package com.jld.vod.model.bean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/22 15:00
+ */
+
+data class CarRunInfoBean(
+    val cpu: Cpu,
+    val date: Long,
+    val disk: List<Disk>,
+    val mac: String,
+    val userId: Long
+)
+
+data class Cpu(
+    val cpuCategory: String,
+    val cpuKernelNumber: String,
+    val cpuTotal: String
+)
+
+data class Disk(
+    val avail: String,
+    val free: String,
+    val symbol: String,
+    val total: String,
+    val type: Any,
+    val usePercent: String,
+    val used: String
+)

+ 27 - 0
app/src/main/java/com/jld/vod/model/bean/CarSiteAllBean.kt

@@ -0,0 +1,27 @@
+package com.jld.vod.model.bean
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/8/27 15:24
+ */
+@Entity
+data class CarSiteAllBean(
+    @PrimaryKey(autoGenerate = true) val id: Int,
+    @ColumnInfo(name = "ciId") val ciId: Long,
+    @ColumnInfo(name = "create_time") val create_time: Long,
+    @ColumnInfo(name = "create_user") val create_user: String,
+    @ColumnInfo(name = "delState") val delState: String,
+    @ColumnInfo(name = "latitude") val latitude: String,
+    @ColumnInfo(name = "longitude") val longitude: String,
+    @ColumnInfo(name = "name") val name: String,
+    @ColumnInfo(name = "sImg") val sImg: String,
+    @ColumnInfo(name = "sInfo") val sInfo: String,
+    @ColumnInfo(name = "siteId") val siteId: Long,
+    @ColumnInfo(name = "sort") val sort: Int
+)

+ 26 - 0
app/src/main/java/com/jld/vod/model/bean/CategoryFatherAllBean.kt

@@ -0,0 +1,26 @@
+package com.jld.vod.model.bean
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/23 10:50
+ */
+@Entity
+data class CategoryFatherAllBean(
+    @PrimaryKey(autoGenerate = true) val id: Int,
+    @ColumnInfo(name = "cName") val cName: String?,
+    @ColumnInfo(name = "cid") val cid: Long?,
+    @ColumnInfo(name = "createTime") val createTime: String?,
+    @ColumnInfo(name = "createUser") val createUser: Long?,
+    @ColumnInfo(name = "delState") val delState: String?,
+    @ColumnInfo(name = "mid") val mid: Long?,
+    @ColumnInfo(name = "pid") val pid: Int?,
+    @ColumnInfo(name = "updateTime") val updateTime: String?,
+    @ColumnInfo(name = "updateUser") val updateUser: String?,
+    @ColumnInfo(name = "userId") val userId: Long?
+)

+ 26 - 0
app/src/main/java/com/jld/vod/model/bean/CategorySonAllBean.kt

@@ -0,0 +1,26 @@
+package com.jld.vod.model.bean
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/24 10:03
+ */
+@Entity
+data class CategorySonAllBean(
+    @PrimaryKey(autoGenerate = true) val id: Int,
+    @ColumnInfo(name = "cName") val cName: String,
+    @ColumnInfo(name = "cid") val cid: Long,
+    @ColumnInfo(name = "createTime") val createTime: String,
+    @ColumnInfo(name = "createUser") val createUser: Long,
+    @ColumnInfo(name = "delState") val delState: String,
+    @ColumnInfo(name = "mid") val mid: Long,
+    @ColumnInfo(name = "pid") val pid: Long,
+    @ColumnInfo(name = "updateTime") val updateTime: String?,
+    @ColumnInfo(name = "updateUser") val updateUser: String?,
+    @ColumnInfo(name = "userId") val userId: Long
+)

+ 17 - 0
app/src/main/java/com/jld/vod/model/bean/DiskBean.kt

@@ -0,0 +1,17 @@
+package com.jld.vod.model.bean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/21 14:30
+ */
+data class DiskBean(
+    val avail: String,
+    val free: String,
+    val symbol: String,
+    val total: String,
+    val type: String,
+    val usePercent: String,
+    val used: String
+)

+ 40 - 0
app/src/main/java/com/jld/vod/model/bean/DownloadApkBean.java

@@ -0,0 +1,40 @@
+package com.jld.vod.model.bean;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.Serializable;
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2019/10/29 16:15
+ */
+public class DownloadApkBean implements Serializable {
+
+    /**
+     * title : 4.5.0更新
+     * content : 1.优化体验
+     * url : http://192.168.0.108/jld_movie/data/cache/20190318180101_15652408.apk
+     * md5 :
+     * versionCode : 450
+     */
+
+    public String title;
+    public String content;
+    public String url;
+
+
+    public DownloadApkBean parse(String urls) {
+            String title = "Update";
+            String url = urls;
+
+            DownloadApkBean bean = new DownloadApkBean();
+
+            bean.title =title;
+            bean.content ="Update";
+            bean.url = url;
+            return bean;
+    }
+}

+ 26 - 0
app/src/main/java/com/jld/vod/model/bean/FindAboutAllBean.kt

@@ -0,0 +1,26 @@
+package com.jld.vod.model.bean
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/8/18 9:29
+ */
+@Entity
+data class FindAboutAllBean(
+    @PrimaryKey(autoGenerate = true) val aid: Long,
+    @ColumnInfo(name = "create_time")  val create_time: Long,
+    @ColumnInfo(name = "create_user")  val create_user: Long,
+    @ColumnInfo(name = "delState")  val delState: String,
+    @ColumnInfo(name = "info")  val info: String,
+    @ColumnInfo(name = "mid")  val mid: Long,
+    @ColumnInfo(name = "name")  val name: String,
+    @ColumnInfo(name = "pictures")  val pictures: String,
+    @ColumnInfo(name = "update_time")  val update_time: Long,
+    @ColumnInfo(name = "update_user")  val update_user: Long,
+    @ColumnInfo(name = "userId")  val userId: Long
+)

+ 24 - 0
app/src/main/java/com/jld/vod/model/bean/FindCarByUnboundBean.kt

@@ -0,0 +1,24 @@
+package com.jld.vod.model.bean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/8/17 13:40
+ */
+data class FindCarByUnboundBean(
+    val carNum: String,
+    val ciId: String,
+    val createTime: String,
+    val createUser: Long,
+    val mAC: String,
+    val region: String,
+    val regionName: String,
+    val runInfo: String,
+    val seatNum: String,
+    val updateTime: String,
+    val updateUser: Any,
+    val userId: String,
+    val wifiName: String,
+    val wifiPwd: String
+)

+ 24 - 0
app/src/main/java/com/jld/vod/model/bean/FindGameByNoInstallBean.kt

@@ -0,0 +1,24 @@
+package com.jld.vod.model.bean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/9/1 17:24
+ */
+data class FindGameByNoInstallBean(
+    val apkUrl: String,
+    val createTime: Long,
+    val createUser: Long,
+    val delState: String,
+    val gid: Long,
+    val imgUrl: String,
+    val install: String,
+    val mid: Long,
+    val name: String,
+    val updateTime: Long,
+    val updateUser: Long,
+    val upload: String,
+    val userId: Long,
+    val versionNum: String
+)

+ 30 - 0
app/src/main/java/com/jld/vod/model/bean/GameBean.kt

@@ -0,0 +1,30 @@
+package com.jld.vod.model.bean
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/29 9:04
+ */
+@Entity
+data class GameBean(
+    @PrimaryKey(autoGenerate = true) val id: Int,
+    @ColumnInfo(name = "apkUrl") val apkUrl: String?,
+    @ColumnInfo(name = "createTime") val createTime: String?,
+    @ColumnInfo(name = "createUser") val createUser: Long?,
+    @ColumnInfo(name = "delState") val delState: String?,
+    @ColumnInfo(name = "gid") val gid: Long?,
+    @ColumnInfo(name = "imgUrl") val imgUrl: String?,
+    @ColumnInfo(name = "install") val install: String?,
+    @ColumnInfo(name = "mid") val mid: Long?,
+    @ColumnInfo(name = "name") val name: String?,
+    @ColumnInfo(name = "updateTime") val updateTime: String?,
+    @ColumnInfo(name = "updateUser") val updateUser: Long?,
+    @ColumnInfo(name = "upload") val upload: String?,
+    @ColumnInfo(name = "userId") val userId: Long?,
+    @ColumnInfo(name = "versionNum") val versionNum: String?
+)

+ 24 - 0
app/src/main/java/com/jld/vod/model/bean/GameResByNotUploaded.kt

@@ -0,0 +1,24 @@
+package com.jld.vod.model.bean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/9/1 9:57
+ */
+data class GameResByNotUploaded(
+    val apkUrl: String,
+    val createTime: Long,
+    val createUser: Long,
+    val delState: String,
+    val gid: Long,
+    val imgUrl: String,
+    val install: String,
+    val mid: Long,
+    val name: String,
+    val updateTime: Any,
+    val updateUser: Any,
+    val upload: String,
+    val userId: Long,
+    val versionNum: String
+)

+ 7 - 0
app/src/main/java/com/jld/vod/model/bean/HomePageImgBean.kt

@@ -0,0 +1,7 @@
+package com.jld.vod.model.bean
+
+data class HomePageImgBean(
+    val main_bg_img: String,
+    val main_close_btn: String,
+    val main_logo: String
+)

+ 23 - 0
app/src/main/java/com/jld/vod/model/bean/LanguageBean.kt

@@ -0,0 +1,23 @@
+package com.jld.vod.model.bean
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/22 15:08
+ */
+@Entity
+data class LanguageBean(
+    @PrimaryKey val lid: Long,
+    @ColumnInfo(name = "countryLanguage") val countryLanguage: String?,
+    @ColumnInfo(name = "createTime") val createTime: String?,
+    @ColumnInfo(name = "createUser") val createUser: Long?,
+    @ColumnInfo(name = "delState") val delState: String?,
+    @ColumnInfo(name = "name") val name: String?,
+    @ColumnInfo(name = "updateTime") val updateTime: String?,
+    @ColumnInfo(name = "updateUser") val updateUser: Int?
+)

+ 19 - 0
app/src/main/java/com/jld/vod/model/bean/LatLongBean.kt

@@ -0,0 +1,19 @@
+package com.jld.vod.model.bean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/9/18 11:03
+ */
+data class LatLongBean(
+    val code: Int,
+    val `data`: Data,
+    val flag: Boolean,
+    val message: String
+)
+
+data class Data(
+    val Latitude: Double,
+    val Longitude: Double
+)

+ 27 - 0
app/src/main/java/com/jld/vod/model/bean/ModelAllBean.kt

@@ -0,0 +1,27 @@
+package com.jld.vod.model.bean
+
+import androidx.room.*
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/22 17:28
+ */
+@Entity
+data class ModelAllBean(
+    @PrimaryKey(autoGenerate = true) val id: Int,
+    @ColumnInfo(name = "categoryStatus") val categoryStatus: String?,
+    @ColumnInfo(name = "createTime") val createTime: String?,
+    @ColumnInfo(name = "createUser") val createUser: Long?,
+    @ColumnInfo(name = "delState") val delState: String?,
+    @ColumnInfo(name = "imgUrl") val imgUrl: String?,
+    @ColumnInfo(name = "level") val level: String?,
+    @ColumnInfo(name = "mid") val mid: Long,
+    @ColumnInfo(name = "name") val name: String?,
+    @ColumnInfo(name = "rtId") val rtId: Long?,
+    @ColumnInfo(name = "rtName") val rtName: String?,
+    @ColumnInfo(name = "tid") val tid: Long?,
+    @ColumnInfo(name = "updateTime") val updateTime: String?,
+    @ColumnInfo(name = "updateUser") val updateUser: Long?,
+    @ColumnInfo(name = "userId") val userId: Long)

+ 38 - 0
app/src/main/java/com/jld/vod/model/bean/MovieByMidBean.kt

@@ -0,0 +1,38 @@
+package com.jld.vod.model.bean
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+import java.io.Serializable
+import java.io.SerializablePermission
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/24 14:15
+ */
+
+class MovieByMidBean:Serializable{
+    var id:Long=0
+    var cid: Long = 0
+    lateinit var createTime: String
+    var createUser: Long = 0
+    lateinit var delState: String
+    var mid: Long = 0
+    lateinit var movieBirthday: String
+    lateinit var movieDirector: String
+    lateinit var movieDuration: String
+    lateinit var movieFileUrl: String
+    var movieId: Long = 0
+    lateinit var movieImgUrl: String
+    lateinit var movieInfo: String
+    lateinit var movieLanguage: String
+    lateinit var movieLead: String
+    lateinit var movieName: String
+    lateinit var movieScore: String
+    var updateTime: String? = null
+    var updateUser: Long? = null
+    var uploadState: String? = null
+    var userId: Long = 0
+}

+ 30 - 0
app/src/main/java/com/jld/vod/model/bean/MovieResByNotUploaded.kt

@@ -0,0 +1,30 @@
+package com.jld.vod.model.bean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/31 16:48
+ */
+data class MovieResByNotUploaded(
+    val cid: Long,
+    val createTime: String,
+    val createUser: Long,
+    val delState: String,
+    val mid: Long,
+    val movieBirthday: String,
+    val movieDirector: String,
+    val movieDuration: String,
+    val movieFileUrl: String,
+    val movieId: Long,
+    val movieImgUrl: String,
+    val movieInfo: String,
+    val movieLanguage: String,
+    val movieLead: String,
+    val movieName: String,
+    val movieScore: String,
+    val updateTime: String,
+    val updateUser: Long,
+    val uploadState: String,
+    val userId: Long
+)

+ 32 - 0
app/src/main/java/com/jld/vod/model/bean/MusicByMidBean.kt

@@ -0,0 +1,32 @@
+package com.jld.vod.model.bean
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/28 11:39
+ */
+@Entity
+data class MusicByMidBean(
+    @PrimaryKey(autoGenerate = true ) var id:Long?,
+    @ColumnInfo(name = "cid") val cid: Long?,
+    @ColumnInfo(name = "createTime") val createTime: String?,
+    @ColumnInfo(name = "createUser") val createUser: Long?,
+    @ColumnInfo(name = "delState") val delState: String?,
+    @ColumnInfo(name = "mid") val mid: Long?,
+    @ColumnInfo(name = "musicDuration") val musicDuration: String?,
+    @ColumnInfo(name = "musicId") val musicId: Long?,
+    @ColumnInfo(name = "musicImgUrl") val musicImgUrl: String?,
+    @ColumnInfo(name = "musicName") val musicName: String?,
+    @ColumnInfo(name = "musicSinger") val musicSinger: String?,
+    @ColumnInfo(name = "musicUrl") val musicUrl: String?,
+    @ColumnInfo(name = "cName") val cName: String?,
+    @ColumnInfo(name = "updateTime") val updateTime: String?,
+    @ColumnInfo(name = "updateUser") val updateUser: Long?,
+    @ColumnInfo(name = "uploadState") val uploadState: String?,
+    @ColumnInfo(name = "userId") val userId: Long?
+)

+ 8 - 0
app/src/main/java/com/jld/vod/model/bean/MusicByMidBeans.kt

@@ -0,0 +1,8 @@
+package com.jld.vod.model.bean
+
+data class MusicByMidBeans(
+    val code: Int,
+    val `data`: List<MusicByMidBean>,
+    val flag: Boolean,
+    val message: String
+)

+ 25 - 0
app/src/main/java/com/jld/vod/model/bean/MusicResByNotUploaded.kt

@@ -0,0 +1,25 @@
+package com.jld.vod.model.bean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/31 16:48
+ */
+data class MusicResByNotUploaded(
+    val cid: Long,
+    val createTime: Long,
+    val createUser: Long,
+    val delState: String,
+    val mid: Long,
+    val musicDuration: String,
+    val musicId: Long,
+    val musicImgUrl: String,
+    val musicName: String,
+    val musicSinger: String,
+    val musicUrl: String,
+    val updateTime: Long,
+    val updateUser: Long,
+    val uploadState: String,
+    val userId: Long
+)

+ 10 - 0
app/src/main/java/com/jld/vod/model/bean/NotificationInfoBean.kt

@@ -0,0 +1,10 @@
+package com.jld.vod.model.bean
+
+import android.graphics.Bitmap
+
+class NotificationInfoBean (
+    var pat: String,
+    var info: String,
+    var bitmap: Bitmap
+
+)

+ 7 - 0
app/src/main/java/com/jld/vod/model/bean/NuInstallGameBean.kt

@@ -0,0 +1,7 @@
+package com.jld.vod.model.bean
+
+
+data class NuInstallGameBean(
+    val packName: String,
+    val tid: Long
+)

+ 11 - 0
app/src/main/java/com/jld/vod/model/bean/ResultBean.kt

@@ -0,0 +1,11 @@
+package com.jld.vod.model.bean
+
+/**
+ * 处理座位设置返回值
+ */
+data class ResultBean(
+    val code: Int,
+    val `data`: String,
+    val flag: Boolean,
+    val message: String
+)

+ 12 - 0
app/src/main/java/com/jld/vod/model/bean/SettingBean.kt

@@ -0,0 +1,12 @@
+package com.jld.vod.model.bean
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+@Entity
+data class SettingBean(
+    @PrimaryKey(autoGenerate = true ) val id: Long?,
+    @ColumnInfo(name = "sid") var sid:Int?,
+    @ColumnInfo(name = "name") var name:String?,
+    @ColumnInfo(name = "img") var img:Int?)

+ 3 - 0
app/src/main/java/com/jld/vod/model/bean/TerminalInstall.kt

@@ -0,0 +1,3 @@
+package com.jld.vod.model.bean
+
+class TerminalInstall (var tiid:Long?,var gid:Long? ,var packname:String)

+ 6 - 0
app/src/main/java/com/jld/vod/model/bean/TerminalInstallBean.kt

@@ -0,0 +1,6 @@
+package com.jld.vod.model.bean
+
+class TerminalInstallBean( val code: Int,
+                           val message: String,
+                           val flag: Boolean,
+                           val data: List<TerminalInstall>?)

+ 14 - 0
app/src/main/java/com/jld/vod/model/bean/UserBean.kt

@@ -0,0 +1,14 @@
+package com.jld.vod.model.bean
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:
+ * @date :2020/7/21 17:29
+ */
+class UserBean : ArrayList<UserBeanItem>()
+
+data class UserBeanItem(
+    val name: String,
+    val userId: Long
+)

+ 19 - 0
app/src/main/java/com/jld/vod/model/bean/findAllModularImgBean.kt

@@ -0,0 +1,19 @@
+package com.jld.vod.model.bean
+
+data class findAllModularImgBean(
+    val about_garden_img: String,
+    val about_icon: String,
+    val game_garden_img: String,
+    val game_icon: String,
+    val main_bg_img: String,
+    val main_close_btn: String,
+    val main_logo: String,
+    val map_garden_img: String,
+    val map_icon: String,
+    val movie_garden_img: String,
+    val movie_icon: String,
+    val music_garden_img: String,
+    val music_icon: String,
+    val network_garden_img: String,
+    val network_icon: String
+)

+ 9 - 0
app/src/main/java/com/jld/vod/model/event/MapsEvent.java

@@ -0,0 +1,9 @@
+package com.jld.vod.model.event;
+
+public class MapsEvent {
+    public String data;
+    public MapsEvent(String data)
+    {
+        this.data = data;
+    }
+}

+ 9 - 0
app/src/main/java/com/jld/vod/model/event/SiteEvent.java

@@ -0,0 +1,9 @@
+package com.jld.vod.model.event;
+
+public class SiteEvent {
+    public int data;
+    public SiteEvent(int data)
+    {
+        this.data = data;
+    }
+}

+ 25 - 0
app/src/main/java/com/jld/vod/model/event/UsbStatusChangeEvent.java

@@ -0,0 +1,25 @@
+package com.jld.vod.model.event;
+
+import android.hardware.usb.UsbDevice;
+
+public class UsbStatusChangeEvent {
+    public boolean isConnected = false;
+    public boolean isGetPermission = false;
+    public UsbDevice usbDevice;
+
+    public String filePath = "";
+
+
+    public UsbStatusChangeEvent(boolean isConnected) {
+        this.isConnected = isConnected;
+    }
+
+    public UsbStatusChangeEvent(String filePath) {
+        this.filePath = filePath;
+    }
+
+    public UsbStatusChangeEvent(boolean isGetPermission, String filePath) {
+        this.isGetPermission = isGetPermission;
+        this.filePath = filePath;
+    }
+}

+ 28 - 0
app/src/main/java/com/jld/vod/receiver/BootBroadcastReceiver.kt

@@ -0,0 +1,28 @@
+package com.jld.face.receiver
+
+import android.content.BroadcastReceiver
+import android.content.Context
+import android.content.Intent
+import com.jld.vod.view.SplashActivity
+
+/**
+ * @author ZhaoFuXin
+ * @Email:18276061387@163.com
+ * @description:开机自启广播
+ * @date :2020/4/22 17:25
+ */
+class BootBroadcastReceiver : BroadcastReceiver() {
+    private val TAG:String ="BootBroadcastReceiver"
+    private val ACTION:String = "android.intent.action.BOOT_COMPLETED"
+
+    override fun onReceive(context: Context?, intent: Intent?) {
+        var action = intent!!.action
+        if (action.equals(ACTION)){
+                var launchIntent =  Intent(context, SplashActivity::class.java)//重新启动应用
+                //此处如果不想写死启动的Activity,也可以通过如下方法获取默认的启动Activity
+               // val launchIntent = context!!.getPackageManager().getLaunchIntentForPackage(packageName);
+//                launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+//                context!!.startActivity(launchIntent)
+        }
+    }
+}

+ 56 - 0
app/src/main/java/com/jld/vod/receiver/UsbBroadcastReceiver.java

@@ -0,0 +1,56 @@
+package com.jld.vod.receiver;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.text.TextUtils;
+import android.util.Log;
+
+import com.jld.vod.model.event.UsbStatusChangeEvent;
+import com.jld.vod.utils.FileFuUtils;
+import com.jld.vod.utils.LogUtils;
+import com.jld.vod.view.PostFileActivity;
+
+import org.greenrobot.eventbus.EventBus;
+
+import java.io.File;
+import java.io.FileFilter;
+
+
+/**
+ *Created by zhaofuxin 2019.9.24
+ * Descriotion usb插拔广播接收
+ */
+public class UsbBroadcastReceiver extends BroadcastReceiver {
+
+    private static final String TAG = UsbBroadcastReceiver.class.getSimpleName();
+
+    @Override
+    public void onReceive(Context context, Intent intent) {
+        String action = intent.getAction();
+        if (action.equals(Intent.ACTION_MEDIA_MOUNTED)) {//ACTION_MEDIA_REMOVED
+            String mountPath = intent.getData().getPath();
+            Log.d(TAG, "mountPath = " + mountPath);
+            if (!TextUtils.isEmpty(mountPath)&&!mountPath.equals("/storage/emulated/0")) {
+                //读取到U盘路径再做其他业务逻辑
+                 LogUtils.INSTANCE.logD(TAG,mountPath);
+
+                Intent mIntent = new Intent();
+                mIntent.setClass(context, PostFileActivity.class);
+                mIntent.putExtra("path",mountPath);
+                mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK );
+                context.startActivity(mIntent);
+
+                EventBus.getDefault().post(new UsbStatusChangeEvent(true,mountPath));
+            }
+        } else if (action.equals(Intent.ACTION_MEDIA_UNMOUNTED) || action.equals(Intent.ACTION_MEDIA_EJECT)) {
+            LogUtils.INSTANCE.logD("拔出U盘");
+           // Toast.makeText(context, "No services information detected !", Toast.LENGTH_SHORT).show();
+            EventBus.getDefault().post(new UsbStatusChangeEvent(true));
+
+        } else if (action.equals("android.intent.action.BOOT_COMPLETED")) {
+            //如果是开机完成,则需要调用另外的方法获取U盘的路径
+        }
+    }
+
+}

+ 30 - 0
app/src/main/java/com/jld/vod/repository/AboutPagingSource.kt

@@ -0,0 +1,30 @@
+package com.jld.vod.repository
+
+import androidx.paging.PagingSource
+import com.jld.vod.interfaces.remote.Apis
+import com.jld.vod.model.bean.BrowserBean
+import com.jld.vod.model.bean.FindAboutAllBean
+import com.jld.vod.model.bean.GameBean
+import com.jld.vod.utils.LogUtils
+
+class AboutPagingSource (private val articleApi: Apis, val mid:Long, val lid:Long) : PagingSource<Int, FindAboutAllBean>() {
+
+    override suspend fun load(params: LoadParams<Int>): LoadResult<Int, FindAboutAllBean> {
+        val page = params.key ?: 0
+        return try {
+            val response = articleApi.findAboutAll(mid,lid)
+            if (response.code == 20000) {
+                LoadResult.Page(
+                    data = response.data!!,
+                    prevKey = null,
+                    nextKey = null
+                )
+            } else {
+                LoadResult.Error(Throwable(response.message))
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+            LoadResult.Error(e)
+        }
+    }
+}

+ 20 - 0
app/src/main/java/com/jld/vod/repository/AboutRepository.kt

@@ -0,0 +1,20 @@
+package com.jld.vod.repository
+
+import androidx.paging.Pager
+import androidx.paging.PagingConfig
+import androidx.paging.PagingData
+import com.jld.vod.interfaces.remote.Apis
+import com.jld.vod.model.bean.BrowserBean
+import com.jld.vod.model.bean.FindAboutAllBean
+import com.jld.vod.model.bean.GameBean
+import kotlinx.coroutines.flow.Flow
+
+class AboutRepository {
+
+    fun getAboutAllList(gameApi: Apis, mid:Long,  lid:Long): Flow<PagingData<FindAboutAllBean>> {
+        return Pager(
+            config = PagingConfig(pageSize = 10, initialLoadSize = 20),
+            pagingSourceFactory = { AboutPagingSource(gameApi,mid,lid) }
+        ).flow
+    }
+}

+ 28 - 0
app/src/main/java/com/jld/vod/repository/BrowserPagingSource.kt

@@ -0,0 +1,28 @@
+package com.jld.vod.repository
+
+import androidx.paging.PagingSource
+import com.jld.vod.interfaces.remote.Apis
+import com.jld.vod.model.bean.BrowserBean
+import com.jld.vod.model.bean.GameBean
+
+class BrowserPagingSource (private val articleApi: Apis, val mid:Long, val lid:Long) : PagingSource<Int, BrowserBean>() {
+
+    override suspend fun load(params: LoadParams<Int>): LoadResult<Int, BrowserBean> {
+        val page = params.key ?: 0
+        return try {
+            val response = articleApi.findNetWorkAll(mid,lid)
+            if (response.code == 20000) {
+                LoadResult.Page(
+                    data = response.data!!,
+                    prevKey = null,
+                    nextKey = null
+                )
+            } else {
+                LoadResult.Error(Throwable(response.message))
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+            LoadResult.Error(e)
+        }
+    }
+}

+ 19 - 0
app/src/main/java/com/jld/vod/repository/BrowserRepository.kt

@@ -0,0 +1,19 @@
+package com.jld.vod.repository
+
+import androidx.paging.Pager
+import androidx.paging.PagingConfig
+import androidx.paging.PagingData
+import com.jld.vod.interfaces.remote.Apis
+import com.jld.vod.model.bean.BrowserBean
+import com.jld.vod.model.bean.GameBean
+import kotlinx.coroutines.flow.Flow
+
+class BrowserRepository {
+
+    fun getBrowserAllList(gameApi: Apis, mid:Long,  lid:Long): Flow<PagingData<BrowserBean>> {
+        return Pager(
+            config = PagingConfig(pageSize = 10, initialLoadSize = 20),
+            pagingSourceFactory = { BrowserPagingSource(gameApi,mid,lid) }
+        ).flow
+    }
+}

+ 30 - 0
app/src/main/java/com/jld/vod/repository/CategoryFatherAllPagingSource.kt

@@ -0,0 +1,30 @@
+package com.jld.vod.repository
+
+import androidx.paging.PagingSource
+import com.jld.vod.interfaces.remote.Apis
+import com.jld.vod.model.bean.BrowserBean
+import com.jld.vod.model.bean.CategoryFatherAllBean
+import com.jld.vod.model.bean.GameBean
+import com.jld.vod.utils.LogUtils
+
+class CategoryFatherAllPagingSource (private val articleApi: Apis, val mid:Long, val lid:Long) : PagingSource<Int, CategoryFatherAllBean>() {
+
+    override suspend fun load(params: LoadParams<Int>): LoadResult<Int, CategoryFatherAllBean> {
+        val page = params.key ?: 0
+        return try {
+            val response = articleApi.findCategoryFatherAllByMid(mid,lid)
+            if (response.code == 20000) {
+                LoadResult.Page(
+                    data = response.data!!,
+                    prevKey = null,
+                    nextKey = null
+                )
+            } else {
+                LoadResult.Error(Throwable(response.message))
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+            LoadResult.Error(e)
+        }
+    }
+}

+ 31 - 0
app/src/main/java/com/jld/vod/repository/CategorySonAllPagingSource.kt

@@ -0,0 +1,31 @@
+package com.jld.vod.repository
+
+import androidx.paging.PagingSource
+import com.jld.vod.interfaces.remote.Apis
+import com.jld.vod.model.bean.BrowserBean
+import com.jld.vod.model.bean.CategoryFatherAllBean
+import com.jld.vod.model.bean.CategorySonAllBean
+import com.jld.vod.model.bean.GameBean
+import com.jld.vod.utils.LogUtils
+
+class CategorySonAllPagingSource (private val articleApi: Apis, val cid:Long, val lid:Long) : PagingSource<Int, CategorySonAllBean>() {
+
+    override suspend fun load(params: LoadParams<Int>): LoadResult<Int, CategorySonAllBean> {
+        val page = params.key ?: 0
+        return try {
+            val response = articleApi.findCategorySonAllByCid(cid,lid)
+            if (response.code == 20000) {
+                LoadResult.Page(
+                    data = response.data!!,
+                    prevKey = null,
+                    nextKey = null
+                )
+            } else {
+                LoadResult.Error(Throwable(response.message))
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+            LoadResult.Error(e)
+        }
+    }
+}

+ 29 - 0
app/src/main/java/com/jld/vod/repository/GamePagingSource.kt

@@ -0,0 +1,29 @@
+package com.jld.vod.repository
+
+import androidx.paging.PagingSource
+import com.jld.vod.interfaces.remote.Apis
+import com.jld.vod.model.bean.GameBean
+import com.jld.vod.utils.LogUtils
+
+class GamePagingSource (private val articleApi: Apis,val mid:Long, val lid:Long,val terminal :String ) : PagingSource<Int, GameBean>() {
+
+    override suspend fun load(params: LoadParams<Int>): LoadResult<Int, GameBean> {
+        val page = params.key ?: 0
+        return try {
+            val response = articleApi.findGameAll(mid,lid,terminal)
+            if (response.code == 20000) {
+               // LogUtils.logD("game"+response)
+                LoadResult.Page(
+                    data = response.data!!,
+                    prevKey = null,
+                    nextKey = null
+                )
+            } else {
+                LoadResult.Error(Throwable(response.message))
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+            LoadResult.Error(e)
+        }
+    }
+}

+ 18 - 0
app/src/main/java/com/jld/vod/repository/GameRepository.kt

@@ -0,0 +1,18 @@
+package com.jld.vod.repository
+
+import androidx.paging.Pager
+import androidx.paging.PagingConfig
+import androidx.paging.PagingData
+import com.jld.vod.interfaces.remote.Apis
+import com.jld.vod.model.bean.GameBean
+import kotlinx.coroutines.flow.Flow
+
+class GameRepository {
+
+    fun getGameAllList(gameApi: Apis, mid:Long,  lid:Long, terminal :String): Flow<PagingData<GameBean>> {
+        return Pager(
+            config = PagingConfig(pageSize = 10, initialLoadSize = 20),
+            pagingSourceFactory = { GamePagingSource(gameApi,mid,lid,terminal) }
+        ).flow
+    }
+}

+ 0 - 0
app/src/main/java/com/jld/vod/repository/MovieAllPagingSource.kt


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff