diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
new file mode 100644
index 0000000..6fc764e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.base;
+
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+public abstract class DoubleClickExitActivity extends BaseActivity {
+
+ private long clickTime = 0;
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (System.currentTimeMillis() - clickTime > 2000) {
+ Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
+ clickTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
new file mode 100644
index 0000000..6fc764e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.base;
+
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+public abstract class DoubleClickExitActivity extends BaseActivity {
+
+ private long clickTime = 0;
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (System.currentTimeMillis() - clickTime > 2000) {
+ Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
+ clickTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
new file mode 100644
index 0000000..b3b1e44
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
@@ -0,0 +1,74 @@
+package com.casic.dcms.bean;
+
+public class LoginResultBean {
+
+ /**
+ * code : 200
+ * data : {"kaptcha":"","token":"e2dc5885-c830-4773-ba63-9f6f4efdc0fd"}
+ * message : 登录成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * kaptcha :
+ * token : e2dc5885-c830-4773-ba63-9f6f4efdc0fd
+ */
+
+ private String kaptcha;
+ private String token;
+
+ public String getKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(String kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
new file mode 100644
index 0000000..6fc764e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.base;
+
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+public abstract class DoubleClickExitActivity extends BaseActivity {
+
+ private long clickTime = 0;
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (System.currentTimeMillis() - clickTime > 2000) {
+ Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
+ clickTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
new file mode 100644
index 0000000..b3b1e44
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
@@ -0,0 +1,74 @@
+package com.casic.dcms.bean;
+
+public class LoginResultBean {
+
+ /**
+ * code : 200
+ * data : {"kaptcha":"","token":"e2dc5885-c830-4773-ba63-9f6f4efdc0fd"}
+ * message : 登录成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * kaptcha :
+ * token : e2dc5885-c830-4773-ba63-9f6f4efdc0fd
+ */
+
+ private String kaptcha;
+ private String token;
+
+ public String getKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(String kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
new file mode 100644
index 0000000..1298cd3
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
@@ -0,0 +1,97 @@
+package com.casic.dcms.bean;
+
+/**
+ * PublicKey 登录校验Key
+ */
+public class PublicKeyBean {
+
+ /**
+ * code : 200
+ * data : {"appKaptcha":false,"kaptcha":false,"publicKey":"","sid":"a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d"}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * appKaptcha : false
+ * kaptcha : false
+ * publicKey :
+ * sid : a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d
+ */
+
+ private boolean appKaptcha;
+ private boolean kaptcha;
+ private String publicKey;
+ private String sid;
+
+ public boolean isAppKaptcha() {
+ return appKaptcha;
+ }
+
+ public void setAppKaptcha(boolean appKaptcha) {
+ this.appKaptcha = appKaptcha;
+ }
+
+ public boolean isKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(boolean kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getPublicKey() {
+ return publicKey;
+ }
+
+ public void setPublicKey(String publicKey) {
+ this.publicKey = publicKey;
+ }
+
+ public String getSid() {
+ return sid;
+ }
+
+ public void setSid(String sid) {
+ this.sid = sid;
+ }
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
new file mode 100644
index 0000000..6fc764e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.base;
+
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+public abstract class DoubleClickExitActivity extends BaseActivity {
+
+ private long clickTime = 0;
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (System.currentTimeMillis() - clickTime > 2000) {
+ Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
+ clickTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
new file mode 100644
index 0000000..b3b1e44
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
@@ -0,0 +1,74 @@
+package com.casic.dcms.bean;
+
+public class LoginResultBean {
+
+ /**
+ * code : 200
+ * data : {"kaptcha":"","token":"e2dc5885-c830-4773-ba63-9f6f4efdc0fd"}
+ * message : 登录成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * kaptcha :
+ * token : e2dc5885-c830-4773-ba63-9f6f4efdc0fd
+ */
+
+ private String kaptcha;
+ private String token;
+
+ public String getKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(String kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
new file mode 100644
index 0000000..1298cd3
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
@@ -0,0 +1,97 @@
+package com.casic.dcms.bean;
+
+/**
+ * PublicKey 登录校验Key
+ */
+public class PublicKeyBean {
+
+ /**
+ * code : 200
+ * data : {"appKaptcha":false,"kaptcha":false,"publicKey":"","sid":"a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d"}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * appKaptcha : false
+ * kaptcha : false
+ * publicKey :
+ * sid : a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d
+ */
+
+ private boolean appKaptcha;
+ private boolean kaptcha;
+ private String publicKey;
+ private String sid;
+
+ public boolean isAppKaptcha() {
+ return appKaptcha;
+ }
+
+ public void setAppKaptcha(boolean appKaptcha) {
+ this.appKaptcha = appKaptcha;
+ }
+
+ public boolean isKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(boolean kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getPublicKey() {
+ return publicKey;
+ }
+
+ public void setPublicKey(String publicKey) {
+ this.publicKey = publicKey;
+ }
+
+ public String getSid() {
+ return sid;
+ }
+
+ public void setSid(String sid) {
+ this.sid = sid;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/UserBean.java b/app/src/main/java/com/casic/dcms/bean/UserBean.java
new file mode 100644
index 0000000..31ec3a0
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/UserBean.java
@@ -0,0 +1,422 @@
+package com.casic.dcms.bean;
+
+import java.util.List;
+
+public class UserBean {
+
+ /**
+ * code : 200
+ * data : {"account":"cgjd01","attr1":"","avatar":"","bizData":"","dataScope":["1177026995528237058"],"deptId":"1177026995528237058","deptName":"指挥中心","devices":[{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}],"id":"1177050541084160002","ipAddr":"111.198.10.15","name":"王金龙","phone":"18600202669","roleList":["1177029183042322434"],"roleNames":["监督员"],"roleTips":["supervisor"],"scopeType":"4","sysData":"","targetId":"","targetName":"","tenantId":""}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * account : cgjd01
+ * attr1 :
+ * avatar :
+ * bizData :
+ * dataScope : ["1177026995528237058"]
+ * deptId : 1177026995528237058
+ * deptName : 指挥中心
+ * devices : [{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}]
+ * id : 1177050541084160002
+ * ipAddr : 111.198.10.15
+ * name : 王金龙
+ * phone : 18600202669
+ * roleList : ["1177029183042322434"]
+ * roleNames : ["监督员"]
+ * roleTips : ["supervisor"]
+ * scopeType : 4
+ * sysData :
+ * targetId :
+ * targetName :
+ * tenantId :
+ */
+
+ private String account;
+ private String attr1;
+ private String avatar;
+ private String bizData;
+ private String deptId;
+ private String deptName;
+ private String id;
+ private String ipAddr;
+ private String name;
+ private String phone;
+ private String scopeType;
+ private String sysData;
+ private String targetId;
+ private String targetName;
+ private String tenantId;
+ private List dataScope;
+ private List devices;
+ private List roleList;
+ private List roleNames;
+ private List roleTips;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getAttr1() {
+ return attr1;
+ }
+
+ public void setAttr1(String attr1) {
+ this.attr1 = attr1;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public void setAvatar(String avatar) {
+ this.avatar = avatar;
+ }
+
+ public String getBizData() {
+ return bizData;
+ }
+
+ public void setBizData(String bizData) {
+ this.bizData = bizData;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getIpAddr() {
+ return ipAddr;
+ }
+
+ public void setIpAddr(String ipAddr) {
+ this.ipAddr = ipAddr;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getScopeType() {
+ return scopeType;
+ }
+
+ public void setScopeType(String scopeType) {
+ this.scopeType = scopeType;
+ }
+
+ public String getSysData() {
+ return sysData;
+ }
+
+ public void setSysData(String sysData) {
+ this.sysData = sysData;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public void setTargetName(String targetName) {
+ this.targetName = targetName;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public List getDataScope() {
+ return dataScope;
+ }
+
+ public void setDataScope(List dataScope) {
+ this.dataScope = dataScope;
+ }
+
+ public List getDevices() {
+ return devices;
+ }
+
+ public void setDevices(List devices) {
+ this.devices = devices;
+ }
+
+ public List getRoleList() {
+ return roleList;
+ }
+
+ public void setRoleList(List roleList) {
+ this.roleList = roleList;
+ }
+
+ public List getRoleNames() {
+ return roleNames;
+ }
+
+ public void setRoleNames(List roleNames) {
+ this.roleNames = roleNames;
+ }
+
+ public List getRoleTips() {
+ return roleTips;
+ }
+
+ public void setRoleTips(List roleTips) {
+ this.roleTips = roleTips;
+ }
+
+ public static class DevicesBean {
+ /**
+ * account :
+ * deptId :
+ * deptName :
+ * deviceName : 12345
+ * id : 1349258555972796417
+ * imei : 1234
+ * lastTime : 2021-01-13
+ * lastTimeFmt :
+ * name :
+ * networkNumber : 1234
+ * onLine : false
+ * phone :
+ * positionLat :
+ * positionLng :
+ * targetId :
+ * userId : 1177050541084160002
+ */
+
+ private String account;
+ private String deptId;
+ private String deptName;
+ private String deviceName;
+ private String id;
+ private String imei;
+ private String lastTime;
+ private String lastTimeFmt;
+ private String name;
+ private String networkNumber;
+ private boolean onLine;
+ private String phone;
+ private String positionLat;
+ private String positionLng;
+ private String targetId;
+ private String userId;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ public void setDeviceName(String deviceName) {
+ this.deviceName = deviceName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getImei() {
+ return imei;
+ }
+
+ public void setImei(String imei) {
+ this.imei = imei;
+ }
+
+ public String getLastTime() {
+ return lastTime;
+ }
+
+ public void setLastTime(String lastTime) {
+ this.lastTime = lastTime;
+ }
+
+ public String getLastTimeFmt() {
+ return lastTimeFmt;
+ }
+
+ public void setLastTimeFmt(String lastTimeFmt) {
+ this.lastTimeFmt = lastTimeFmt;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getNetworkNumber() {
+ return networkNumber;
+ }
+
+ public void setNetworkNumber(String networkNumber) {
+ this.networkNumber = networkNumber;
+ }
+
+ public boolean isOnLine() {
+ return onLine;
+ }
+
+ public void setOnLine(boolean onLine) {
+ this.onLine = onLine;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getPositionLat() {
+ return positionLat;
+ }
+
+ public void setPositionLat(String positionLat) {
+ this.positionLat = positionLat;
+ }
+
+ public String getPositionLng() {
+ return positionLng;
+ }
+
+ public void setPositionLng(String positionLng) {
+ this.positionLng = positionLng;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ }
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
new file mode 100644
index 0000000..6fc764e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.base;
+
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+public abstract class DoubleClickExitActivity extends BaseActivity {
+
+ private long clickTime = 0;
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (System.currentTimeMillis() - clickTime > 2000) {
+ Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
+ clickTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
new file mode 100644
index 0000000..b3b1e44
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
@@ -0,0 +1,74 @@
+package com.casic.dcms.bean;
+
+public class LoginResultBean {
+
+ /**
+ * code : 200
+ * data : {"kaptcha":"","token":"e2dc5885-c830-4773-ba63-9f6f4efdc0fd"}
+ * message : 登录成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * kaptcha :
+ * token : e2dc5885-c830-4773-ba63-9f6f4efdc0fd
+ */
+
+ private String kaptcha;
+ private String token;
+
+ public String getKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(String kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
new file mode 100644
index 0000000..1298cd3
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
@@ -0,0 +1,97 @@
+package com.casic.dcms.bean;
+
+/**
+ * PublicKey 登录校验Key
+ */
+public class PublicKeyBean {
+
+ /**
+ * code : 200
+ * data : {"appKaptcha":false,"kaptcha":false,"publicKey":"","sid":"a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d"}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * appKaptcha : false
+ * kaptcha : false
+ * publicKey :
+ * sid : a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d
+ */
+
+ private boolean appKaptcha;
+ private boolean kaptcha;
+ private String publicKey;
+ private String sid;
+
+ public boolean isAppKaptcha() {
+ return appKaptcha;
+ }
+
+ public void setAppKaptcha(boolean appKaptcha) {
+ this.appKaptcha = appKaptcha;
+ }
+
+ public boolean isKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(boolean kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getPublicKey() {
+ return publicKey;
+ }
+
+ public void setPublicKey(String publicKey) {
+ this.publicKey = publicKey;
+ }
+
+ public String getSid() {
+ return sid;
+ }
+
+ public void setSid(String sid) {
+ this.sid = sid;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/UserBean.java b/app/src/main/java/com/casic/dcms/bean/UserBean.java
new file mode 100644
index 0000000..31ec3a0
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/UserBean.java
@@ -0,0 +1,422 @@
+package com.casic.dcms.bean;
+
+import java.util.List;
+
+public class UserBean {
+
+ /**
+ * code : 200
+ * data : {"account":"cgjd01","attr1":"","avatar":"","bizData":"","dataScope":["1177026995528237058"],"deptId":"1177026995528237058","deptName":"指挥中心","devices":[{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}],"id":"1177050541084160002","ipAddr":"111.198.10.15","name":"王金龙","phone":"18600202669","roleList":["1177029183042322434"],"roleNames":["监督员"],"roleTips":["supervisor"],"scopeType":"4","sysData":"","targetId":"","targetName":"","tenantId":""}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * account : cgjd01
+ * attr1 :
+ * avatar :
+ * bizData :
+ * dataScope : ["1177026995528237058"]
+ * deptId : 1177026995528237058
+ * deptName : 指挥中心
+ * devices : [{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}]
+ * id : 1177050541084160002
+ * ipAddr : 111.198.10.15
+ * name : 王金龙
+ * phone : 18600202669
+ * roleList : ["1177029183042322434"]
+ * roleNames : ["监督员"]
+ * roleTips : ["supervisor"]
+ * scopeType : 4
+ * sysData :
+ * targetId :
+ * targetName :
+ * tenantId :
+ */
+
+ private String account;
+ private String attr1;
+ private String avatar;
+ private String bizData;
+ private String deptId;
+ private String deptName;
+ private String id;
+ private String ipAddr;
+ private String name;
+ private String phone;
+ private String scopeType;
+ private String sysData;
+ private String targetId;
+ private String targetName;
+ private String tenantId;
+ private List dataScope;
+ private List devices;
+ private List roleList;
+ private List roleNames;
+ private List roleTips;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getAttr1() {
+ return attr1;
+ }
+
+ public void setAttr1(String attr1) {
+ this.attr1 = attr1;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public void setAvatar(String avatar) {
+ this.avatar = avatar;
+ }
+
+ public String getBizData() {
+ return bizData;
+ }
+
+ public void setBizData(String bizData) {
+ this.bizData = bizData;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getIpAddr() {
+ return ipAddr;
+ }
+
+ public void setIpAddr(String ipAddr) {
+ this.ipAddr = ipAddr;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getScopeType() {
+ return scopeType;
+ }
+
+ public void setScopeType(String scopeType) {
+ this.scopeType = scopeType;
+ }
+
+ public String getSysData() {
+ return sysData;
+ }
+
+ public void setSysData(String sysData) {
+ this.sysData = sysData;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public void setTargetName(String targetName) {
+ this.targetName = targetName;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public List getDataScope() {
+ return dataScope;
+ }
+
+ public void setDataScope(List dataScope) {
+ this.dataScope = dataScope;
+ }
+
+ public List getDevices() {
+ return devices;
+ }
+
+ public void setDevices(List devices) {
+ this.devices = devices;
+ }
+
+ public List getRoleList() {
+ return roleList;
+ }
+
+ public void setRoleList(List roleList) {
+ this.roleList = roleList;
+ }
+
+ public List getRoleNames() {
+ return roleNames;
+ }
+
+ public void setRoleNames(List roleNames) {
+ this.roleNames = roleNames;
+ }
+
+ public List getRoleTips() {
+ return roleTips;
+ }
+
+ public void setRoleTips(List roleTips) {
+ this.roleTips = roleTips;
+ }
+
+ public static class DevicesBean {
+ /**
+ * account :
+ * deptId :
+ * deptName :
+ * deviceName : 12345
+ * id : 1349258555972796417
+ * imei : 1234
+ * lastTime : 2021-01-13
+ * lastTimeFmt :
+ * name :
+ * networkNumber : 1234
+ * onLine : false
+ * phone :
+ * positionLat :
+ * positionLng :
+ * targetId :
+ * userId : 1177050541084160002
+ */
+
+ private String account;
+ private String deptId;
+ private String deptName;
+ private String deviceName;
+ private String id;
+ private String imei;
+ private String lastTime;
+ private String lastTimeFmt;
+ private String name;
+ private String networkNumber;
+ private boolean onLine;
+ private String phone;
+ private String positionLat;
+ private String positionLng;
+ private String targetId;
+ private String userId;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ public void setDeviceName(String deviceName) {
+ this.deviceName = deviceName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getImei() {
+ return imei;
+ }
+
+ public void setImei(String imei) {
+ this.imei = imei;
+ }
+
+ public String getLastTime() {
+ return lastTime;
+ }
+
+ public void setLastTime(String lastTime) {
+ this.lastTime = lastTime;
+ }
+
+ public String getLastTimeFmt() {
+ return lastTimeFmt;
+ }
+
+ public void setLastTimeFmt(String lastTimeFmt) {
+ this.lastTimeFmt = lastTimeFmt;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getNetworkNumber() {
+ return networkNumber;
+ }
+
+ public void setNetworkNumber(String networkNumber) {
+ this.networkNumber = networkNumber;
+ }
+
+ public boolean isOnLine() {
+ return onLine;
+ }
+
+ public void setOnLine(boolean onLine) {
+ this.onLine = onLine;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getPositionLat() {
+ return positionLat;
+ }
+
+ public void setPositionLat(String positionLat) {
+ this.positionLat = positionLat;
+ }
+
+ public String getPositionLng() {
+ return positionLng;
+ }
+
+ public void setPositionLng(String positionLng) {
+ this.positionLng = positionLng;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
new file mode 100644
index 0000000..b3e7d1e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.mvp;
+
+import rx.Subscription;
+import rx.subscriptions.CompositeSubscription;
+
+public class BasePresenter {
+ private CompositeSubscription mCompositeSubscription;
+
+ //RxJava注册
+ protected void addSubscription(Subscription subscriber) {
+ if (mCompositeSubscription == null) {
+ mCompositeSubscription = new CompositeSubscription();
+ }
+ mCompositeSubscription.add(subscriber);
+ }
+
+ //RxJava取消注册,以避免内存泄露
+ protected void unSubscription() {
+ if (mCompositeSubscription != null && mCompositeSubscription.hasSubscriptions()) {
+ mCompositeSubscription.unsubscribe();
+ }
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
new file mode 100644
index 0000000..6fc764e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.base;
+
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+public abstract class DoubleClickExitActivity extends BaseActivity {
+
+ private long clickTime = 0;
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (System.currentTimeMillis() - clickTime > 2000) {
+ Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
+ clickTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
new file mode 100644
index 0000000..b3b1e44
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
@@ -0,0 +1,74 @@
+package com.casic.dcms.bean;
+
+public class LoginResultBean {
+
+ /**
+ * code : 200
+ * data : {"kaptcha":"","token":"e2dc5885-c830-4773-ba63-9f6f4efdc0fd"}
+ * message : 登录成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * kaptcha :
+ * token : e2dc5885-c830-4773-ba63-9f6f4efdc0fd
+ */
+
+ private String kaptcha;
+ private String token;
+
+ public String getKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(String kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
new file mode 100644
index 0000000..1298cd3
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
@@ -0,0 +1,97 @@
+package com.casic.dcms.bean;
+
+/**
+ * PublicKey 登录校验Key
+ */
+public class PublicKeyBean {
+
+ /**
+ * code : 200
+ * data : {"appKaptcha":false,"kaptcha":false,"publicKey":"","sid":"a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d"}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * appKaptcha : false
+ * kaptcha : false
+ * publicKey :
+ * sid : a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d
+ */
+
+ private boolean appKaptcha;
+ private boolean kaptcha;
+ private String publicKey;
+ private String sid;
+
+ public boolean isAppKaptcha() {
+ return appKaptcha;
+ }
+
+ public void setAppKaptcha(boolean appKaptcha) {
+ this.appKaptcha = appKaptcha;
+ }
+
+ public boolean isKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(boolean kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getPublicKey() {
+ return publicKey;
+ }
+
+ public void setPublicKey(String publicKey) {
+ this.publicKey = publicKey;
+ }
+
+ public String getSid() {
+ return sid;
+ }
+
+ public void setSid(String sid) {
+ this.sid = sid;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/UserBean.java b/app/src/main/java/com/casic/dcms/bean/UserBean.java
new file mode 100644
index 0000000..31ec3a0
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/UserBean.java
@@ -0,0 +1,422 @@
+package com.casic.dcms.bean;
+
+import java.util.List;
+
+public class UserBean {
+
+ /**
+ * code : 200
+ * data : {"account":"cgjd01","attr1":"","avatar":"","bizData":"","dataScope":["1177026995528237058"],"deptId":"1177026995528237058","deptName":"指挥中心","devices":[{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}],"id":"1177050541084160002","ipAddr":"111.198.10.15","name":"王金龙","phone":"18600202669","roleList":["1177029183042322434"],"roleNames":["监督员"],"roleTips":["supervisor"],"scopeType":"4","sysData":"","targetId":"","targetName":"","tenantId":""}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * account : cgjd01
+ * attr1 :
+ * avatar :
+ * bizData :
+ * dataScope : ["1177026995528237058"]
+ * deptId : 1177026995528237058
+ * deptName : 指挥中心
+ * devices : [{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}]
+ * id : 1177050541084160002
+ * ipAddr : 111.198.10.15
+ * name : 王金龙
+ * phone : 18600202669
+ * roleList : ["1177029183042322434"]
+ * roleNames : ["监督员"]
+ * roleTips : ["supervisor"]
+ * scopeType : 4
+ * sysData :
+ * targetId :
+ * targetName :
+ * tenantId :
+ */
+
+ private String account;
+ private String attr1;
+ private String avatar;
+ private String bizData;
+ private String deptId;
+ private String deptName;
+ private String id;
+ private String ipAddr;
+ private String name;
+ private String phone;
+ private String scopeType;
+ private String sysData;
+ private String targetId;
+ private String targetName;
+ private String tenantId;
+ private List dataScope;
+ private List devices;
+ private List roleList;
+ private List roleNames;
+ private List roleTips;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getAttr1() {
+ return attr1;
+ }
+
+ public void setAttr1(String attr1) {
+ this.attr1 = attr1;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public void setAvatar(String avatar) {
+ this.avatar = avatar;
+ }
+
+ public String getBizData() {
+ return bizData;
+ }
+
+ public void setBizData(String bizData) {
+ this.bizData = bizData;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getIpAddr() {
+ return ipAddr;
+ }
+
+ public void setIpAddr(String ipAddr) {
+ this.ipAddr = ipAddr;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getScopeType() {
+ return scopeType;
+ }
+
+ public void setScopeType(String scopeType) {
+ this.scopeType = scopeType;
+ }
+
+ public String getSysData() {
+ return sysData;
+ }
+
+ public void setSysData(String sysData) {
+ this.sysData = sysData;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public void setTargetName(String targetName) {
+ this.targetName = targetName;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public List getDataScope() {
+ return dataScope;
+ }
+
+ public void setDataScope(List dataScope) {
+ this.dataScope = dataScope;
+ }
+
+ public List getDevices() {
+ return devices;
+ }
+
+ public void setDevices(List devices) {
+ this.devices = devices;
+ }
+
+ public List getRoleList() {
+ return roleList;
+ }
+
+ public void setRoleList(List roleList) {
+ this.roleList = roleList;
+ }
+
+ public List getRoleNames() {
+ return roleNames;
+ }
+
+ public void setRoleNames(List roleNames) {
+ this.roleNames = roleNames;
+ }
+
+ public List getRoleTips() {
+ return roleTips;
+ }
+
+ public void setRoleTips(List roleTips) {
+ this.roleTips = roleTips;
+ }
+
+ public static class DevicesBean {
+ /**
+ * account :
+ * deptId :
+ * deptName :
+ * deviceName : 12345
+ * id : 1349258555972796417
+ * imei : 1234
+ * lastTime : 2021-01-13
+ * lastTimeFmt :
+ * name :
+ * networkNumber : 1234
+ * onLine : false
+ * phone :
+ * positionLat :
+ * positionLng :
+ * targetId :
+ * userId : 1177050541084160002
+ */
+
+ private String account;
+ private String deptId;
+ private String deptName;
+ private String deviceName;
+ private String id;
+ private String imei;
+ private String lastTime;
+ private String lastTimeFmt;
+ private String name;
+ private String networkNumber;
+ private boolean onLine;
+ private String phone;
+ private String positionLat;
+ private String positionLng;
+ private String targetId;
+ private String userId;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ public void setDeviceName(String deviceName) {
+ this.deviceName = deviceName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getImei() {
+ return imei;
+ }
+
+ public void setImei(String imei) {
+ this.imei = imei;
+ }
+
+ public String getLastTime() {
+ return lastTime;
+ }
+
+ public void setLastTime(String lastTime) {
+ this.lastTime = lastTime;
+ }
+
+ public String getLastTimeFmt() {
+ return lastTimeFmt;
+ }
+
+ public void setLastTimeFmt(String lastTimeFmt) {
+ this.lastTimeFmt = lastTimeFmt;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getNetworkNumber() {
+ return networkNumber;
+ }
+
+ public void setNetworkNumber(String networkNumber) {
+ this.networkNumber = networkNumber;
+ }
+
+ public boolean isOnLine() {
+ return onLine;
+ }
+
+ public void setOnLine(boolean onLine) {
+ this.onLine = onLine;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getPositionLat() {
+ return positionLat;
+ }
+
+ public void setPositionLat(String positionLat) {
+ this.positionLat = positionLat;
+ }
+
+ public String getPositionLng() {
+ return positionLng;
+ }
+
+ public void setPositionLng(String positionLng) {
+ this.positionLng = positionLng;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
new file mode 100644
index 0000000..b3e7d1e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.mvp;
+
+import rx.Subscription;
+import rx.subscriptions.CompositeSubscription;
+
+public class BasePresenter {
+ private CompositeSubscription mCompositeSubscription;
+
+ //RxJava注册
+ protected void addSubscription(Subscription subscriber) {
+ if (mCompositeSubscription == null) {
+ mCompositeSubscription = new CompositeSubscription();
+ }
+ mCompositeSubscription.add(subscriber);
+ }
+
+ //RxJava取消注册,以避免内存泄露
+ protected void unSubscription() {
+ if (mCompositeSubscription != null && mCompositeSubscription.hasSubscriptions()) {
+ mCompositeSubscription.unsubscribe();
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
new file mode 100644
index 0000000..b3361da
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
@@ -0,0 +1,51 @@
+package com.casic.dcms.mvp.model;
+
+import com.casic.dcms.bean.PublicKeyBean;
+import com.casic.dcms.utils.HttpConfig;
+import com.casic.dcms.utils.retrofit.RetrofitServiceManager;
+
+import rx.Observable;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+public class AuthenticateModelImpl implements IAuthenticateModel {
+
+ private OnAuthenticateListener onAuthenticateListener;
+
+ public AuthenticateModelImpl(OnAuthenticateListener listener) {
+ this.onAuthenticateListener = listener;
+ }
+
+ public interface OnAuthenticateListener {
+ void onSuccess(PublicKeyBean key);
+
+ void onFailure(Throwable throwable);
+ }
+
+ @Override
+ public Subscription sendRetrofitRequest() {
+ Observable observable = RetrofitServiceManager.authenticate(HttpConfig.BASE_IP);
+ return observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer() {
+ @Override
+ public void onCompleted() {
+
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (onAuthenticateListener != null) {
+ onAuthenticateListener.onFailure(e);
+ }
+ }
+
+ @Override
+ public void onNext(PublicKeyBean key) {
+ if (key != null) {
+ onAuthenticateListener.onSuccess(key);
+ }
+ }
+ });
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
new file mode 100644
index 0000000..6fc764e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.base;
+
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+public abstract class DoubleClickExitActivity extends BaseActivity {
+
+ private long clickTime = 0;
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (System.currentTimeMillis() - clickTime > 2000) {
+ Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
+ clickTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
new file mode 100644
index 0000000..b3b1e44
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
@@ -0,0 +1,74 @@
+package com.casic.dcms.bean;
+
+public class LoginResultBean {
+
+ /**
+ * code : 200
+ * data : {"kaptcha":"","token":"e2dc5885-c830-4773-ba63-9f6f4efdc0fd"}
+ * message : 登录成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * kaptcha :
+ * token : e2dc5885-c830-4773-ba63-9f6f4efdc0fd
+ */
+
+ private String kaptcha;
+ private String token;
+
+ public String getKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(String kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
new file mode 100644
index 0000000..1298cd3
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
@@ -0,0 +1,97 @@
+package com.casic.dcms.bean;
+
+/**
+ * PublicKey 登录校验Key
+ */
+public class PublicKeyBean {
+
+ /**
+ * code : 200
+ * data : {"appKaptcha":false,"kaptcha":false,"publicKey":"","sid":"a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d"}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * appKaptcha : false
+ * kaptcha : false
+ * publicKey :
+ * sid : a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d
+ */
+
+ private boolean appKaptcha;
+ private boolean kaptcha;
+ private String publicKey;
+ private String sid;
+
+ public boolean isAppKaptcha() {
+ return appKaptcha;
+ }
+
+ public void setAppKaptcha(boolean appKaptcha) {
+ this.appKaptcha = appKaptcha;
+ }
+
+ public boolean isKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(boolean kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getPublicKey() {
+ return publicKey;
+ }
+
+ public void setPublicKey(String publicKey) {
+ this.publicKey = publicKey;
+ }
+
+ public String getSid() {
+ return sid;
+ }
+
+ public void setSid(String sid) {
+ this.sid = sid;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/UserBean.java b/app/src/main/java/com/casic/dcms/bean/UserBean.java
new file mode 100644
index 0000000..31ec3a0
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/UserBean.java
@@ -0,0 +1,422 @@
+package com.casic.dcms.bean;
+
+import java.util.List;
+
+public class UserBean {
+
+ /**
+ * code : 200
+ * data : {"account":"cgjd01","attr1":"","avatar":"","bizData":"","dataScope":["1177026995528237058"],"deptId":"1177026995528237058","deptName":"指挥中心","devices":[{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}],"id":"1177050541084160002","ipAddr":"111.198.10.15","name":"王金龙","phone":"18600202669","roleList":["1177029183042322434"],"roleNames":["监督员"],"roleTips":["supervisor"],"scopeType":"4","sysData":"","targetId":"","targetName":"","tenantId":""}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * account : cgjd01
+ * attr1 :
+ * avatar :
+ * bizData :
+ * dataScope : ["1177026995528237058"]
+ * deptId : 1177026995528237058
+ * deptName : 指挥中心
+ * devices : [{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}]
+ * id : 1177050541084160002
+ * ipAddr : 111.198.10.15
+ * name : 王金龙
+ * phone : 18600202669
+ * roleList : ["1177029183042322434"]
+ * roleNames : ["监督员"]
+ * roleTips : ["supervisor"]
+ * scopeType : 4
+ * sysData :
+ * targetId :
+ * targetName :
+ * tenantId :
+ */
+
+ private String account;
+ private String attr1;
+ private String avatar;
+ private String bizData;
+ private String deptId;
+ private String deptName;
+ private String id;
+ private String ipAddr;
+ private String name;
+ private String phone;
+ private String scopeType;
+ private String sysData;
+ private String targetId;
+ private String targetName;
+ private String tenantId;
+ private List dataScope;
+ private List devices;
+ private List roleList;
+ private List roleNames;
+ private List roleTips;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getAttr1() {
+ return attr1;
+ }
+
+ public void setAttr1(String attr1) {
+ this.attr1 = attr1;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public void setAvatar(String avatar) {
+ this.avatar = avatar;
+ }
+
+ public String getBizData() {
+ return bizData;
+ }
+
+ public void setBizData(String bizData) {
+ this.bizData = bizData;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getIpAddr() {
+ return ipAddr;
+ }
+
+ public void setIpAddr(String ipAddr) {
+ this.ipAddr = ipAddr;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getScopeType() {
+ return scopeType;
+ }
+
+ public void setScopeType(String scopeType) {
+ this.scopeType = scopeType;
+ }
+
+ public String getSysData() {
+ return sysData;
+ }
+
+ public void setSysData(String sysData) {
+ this.sysData = sysData;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public void setTargetName(String targetName) {
+ this.targetName = targetName;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public List getDataScope() {
+ return dataScope;
+ }
+
+ public void setDataScope(List dataScope) {
+ this.dataScope = dataScope;
+ }
+
+ public List getDevices() {
+ return devices;
+ }
+
+ public void setDevices(List devices) {
+ this.devices = devices;
+ }
+
+ public List getRoleList() {
+ return roleList;
+ }
+
+ public void setRoleList(List roleList) {
+ this.roleList = roleList;
+ }
+
+ public List getRoleNames() {
+ return roleNames;
+ }
+
+ public void setRoleNames(List roleNames) {
+ this.roleNames = roleNames;
+ }
+
+ public List getRoleTips() {
+ return roleTips;
+ }
+
+ public void setRoleTips(List roleTips) {
+ this.roleTips = roleTips;
+ }
+
+ public static class DevicesBean {
+ /**
+ * account :
+ * deptId :
+ * deptName :
+ * deviceName : 12345
+ * id : 1349258555972796417
+ * imei : 1234
+ * lastTime : 2021-01-13
+ * lastTimeFmt :
+ * name :
+ * networkNumber : 1234
+ * onLine : false
+ * phone :
+ * positionLat :
+ * positionLng :
+ * targetId :
+ * userId : 1177050541084160002
+ */
+
+ private String account;
+ private String deptId;
+ private String deptName;
+ private String deviceName;
+ private String id;
+ private String imei;
+ private String lastTime;
+ private String lastTimeFmt;
+ private String name;
+ private String networkNumber;
+ private boolean onLine;
+ private String phone;
+ private String positionLat;
+ private String positionLng;
+ private String targetId;
+ private String userId;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ public void setDeviceName(String deviceName) {
+ this.deviceName = deviceName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getImei() {
+ return imei;
+ }
+
+ public void setImei(String imei) {
+ this.imei = imei;
+ }
+
+ public String getLastTime() {
+ return lastTime;
+ }
+
+ public void setLastTime(String lastTime) {
+ this.lastTime = lastTime;
+ }
+
+ public String getLastTimeFmt() {
+ return lastTimeFmt;
+ }
+
+ public void setLastTimeFmt(String lastTimeFmt) {
+ this.lastTimeFmt = lastTimeFmt;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getNetworkNumber() {
+ return networkNumber;
+ }
+
+ public void setNetworkNumber(String networkNumber) {
+ this.networkNumber = networkNumber;
+ }
+
+ public boolean isOnLine() {
+ return onLine;
+ }
+
+ public void setOnLine(boolean onLine) {
+ this.onLine = onLine;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getPositionLat() {
+ return positionLat;
+ }
+
+ public void setPositionLat(String positionLat) {
+ this.positionLat = positionLat;
+ }
+
+ public String getPositionLng() {
+ return positionLng;
+ }
+
+ public void setPositionLng(String positionLng) {
+ this.positionLng = positionLng;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
new file mode 100644
index 0000000..b3e7d1e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.mvp;
+
+import rx.Subscription;
+import rx.subscriptions.CompositeSubscription;
+
+public class BasePresenter {
+ private CompositeSubscription mCompositeSubscription;
+
+ //RxJava注册
+ protected void addSubscription(Subscription subscriber) {
+ if (mCompositeSubscription == null) {
+ mCompositeSubscription = new CompositeSubscription();
+ }
+ mCompositeSubscription.add(subscriber);
+ }
+
+ //RxJava取消注册,以避免内存泄露
+ protected void unSubscription() {
+ if (mCompositeSubscription != null && mCompositeSubscription.hasSubscriptions()) {
+ mCompositeSubscription.unsubscribe();
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
new file mode 100644
index 0000000..b3361da
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
@@ -0,0 +1,51 @@
+package com.casic.dcms.mvp.model;
+
+import com.casic.dcms.bean.PublicKeyBean;
+import com.casic.dcms.utils.HttpConfig;
+import com.casic.dcms.utils.retrofit.RetrofitServiceManager;
+
+import rx.Observable;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+public class AuthenticateModelImpl implements IAuthenticateModel {
+
+ private OnAuthenticateListener onAuthenticateListener;
+
+ public AuthenticateModelImpl(OnAuthenticateListener listener) {
+ this.onAuthenticateListener = listener;
+ }
+
+ public interface OnAuthenticateListener {
+ void onSuccess(PublicKeyBean key);
+
+ void onFailure(Throwable throwable);
+ }
+
+ @Override
+ public Subscription sendRetrofitRequest() {
+ Observable observable = RetrofitServiceManager.authenticate(HttpConfig.BASE_IP);
+ return observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer() {
+ @Override
+ public void onCompleted() {
+
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (onAuthenticateListener != null) {
+ onAuthenticateListener.onFailure(e);
+ }
+ }
+
+ @Override
+ public void onNext(PublicKeyBean key) {
+ if (key != null) {
+ onAuthenticateListener.onSuccess(key);
+ }
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java b/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java
new file mode 100644
index 0000000..5e0fd55
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface IAuthenticateModel {
+ Subscription sendRetrofitRequest();
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
new file mode 100644
index 0000000..6fc764e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.base;
+
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+public abstract class DoubleClickExitActivity extends BaseActivity {
+
+ private long clickTime = 0;
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (System.currentTimeMillis() - clickTime > 2000) {
+ Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
+ clickTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
new file mode 100644
index 0000000..b3b1e44
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
@@ -0,0 +1,74 @@
+package com.casic.dcms.bean;
+
+public class LoginResultBean {
+
+ /**
+ * code : 200
+ * data : {"kaptcha":"","token":"e2dc5885-c830-4773-ba63-9f6f4efdc0fd"}
+ * message : 登录成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * kaptcha :
+ * token : e2dc5885-c830-4773-ba63-9f6f4efdc0fd
+ */
+
+ private String kaptcha;
+ private String token;
+
+ public String getKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(String kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
new file mode 100644
index 0000000..1298cd3
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
@@ -0,0 +1,97 @@
+package com.casic.dcms.bean;
+
+/**
+ * PublicKey 登录校验Key
+ */
+public class PublicKeyBean {
+
+ /**
+ * code : 200
+ * data : {"appKaptcha":false,"kaptcha":false,"publicKey":"","sid":"a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d"}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * appKaptcha : false
+ * kaptcha : false
+ * publicKey :
+ * sid : a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d
+ */
+
+ private boolean appKaptcha;
+ private boolean kaptcha;
+ private String publicKey;
+ private String sid;
+
+ public boolean isAppKaptcha() {
+ return appKaptcha;
+ }
+
+ public void setAppKaptcha(boolean appKaptcha) {
+ this.appKaptcha = appKaptcha;
+ }
+
+ public boolean isKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(boolean kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getPublicKey() {
+ return publicKey;
+ }
+
+ public void setPublicKey(String publicKey) {
+ this.publicKey = publicKey;
+ }
+
+ public String getSid() {
+ return sid;
+ }
+
+ public void setSid(String sid) {
+ this.sid = sid;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/UserBean.java b/app/src/main/java/com/casic/dcms/bean/UserBean.java
new file mode 100644
index 0000000..31ec3a0
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/UserBean.java
@@ -0,0 +1,422 @@
+package com.casic.dcms.bean;
+
+import java.util.List;
+
+public class UserBean {
+
+ /**
+ * code : 200
+ * data : {"account":"cgjd01","attr1":"","avatar":"","bizData":"","dataScope":["1177026995528237058"],"deptId":"1177026995528237058","deptName":"指挥中心","devices":[{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}],"id":"1177050541084160002","ipAddr":"111.198.10.15","name":"王金龙","phone":"18600202669","roleList":["1177029183042322434"],"roleNames":["监督员"],"roleTips":["supervisor"],"scopeType":"4","sysData":"","targetId":"","targetName":"","tenantId":""}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * account : cgjd01
+ * attr1 :
+ * avatar :
+ * bizData :
+ * dataScope : ["1177026995528237058"]
+ * deptId : 1177026995528237058
+ * deptName : 指挥中心
+ * devices : [{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}]
+ * id : 1177050541084160002
+ * ipAddr : 111.198.10.15
+ * name : 王金龙
+ * phone : 18600202669
+ * roleList : ["1177029183042322434"]
+ * roleNames : ["监督员"]
+ * roleTips : ["supervisor"]
+ * scopeType : 4
+ * sysData :
+ * targetId :
+ * targetName :
+ * tenantId :
+ */
+
+ private String account;
+ private String attr1;
+ private String avatar;
+ private String bizData;
+ private String deptId;
+ private String deptName;
+ private String id;
+ private String ipAddr;
+ private String name;
+ private String phone;
+ private String scopeType;
+ private String sysData;
+ private String targetId;
+ private String targetName;
+ private String tenantId;
+ private List dataScope;
+ private List devices;
+ private List roleList;
+ private List roleNames;
+ private List roleTips;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getAttr1() {
+ return attr1;
+ }
+
+ public void setAttr1(String attr1) {
+ this.attr1 = attr1;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public void setAvatar(String avatar) {
+ this.avatar = avatar;
+ }
+
+ public String getBizData() {
+ return bizData;
+ }
+
+ public void setBizData(String bizData) {
+ this.bizData = bizData;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getIpAddr() {
+ return ipAddr;
+ }
+
+ public void setIpAddr(String ipAddr) {
+ this.ipAddr = ipAddr;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getScopeType() {
+ return scopeType;
+ }
+
+ public void setScopeType(String scopeType) {
+ this.scopeType = scopeType;
+ }
+
+ public String getSysData() {
+ return sysData;
+ }
+
+ public void setSysData(String sysData) {
+ this.sysData = sysData;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public void setTargetName(String targetName) {
+ this.targetName = targetName;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public List getDataScope() {
+ return dataScope;
+ }
+
+ public void setDataScope(List dataScope) {
+ this.dataScope = dataScope;
+ }
+
+ public List getDevices() {
+ return devices;
+ }
+
+ public void setDevices(List devices) {
+ this.devices = devices;
+ }
+
+ public List getRoleList() {
+ return roleList;
+ }
+
+ public void setRoleList(List roleList) {
+ this.roleList = roleList;
+ }
+
+ public List getRoleNames() {
+ return roleNames;
+ }
+
+ public void setRoleNames(List roleNames) {
+ this.roleNames = roleNames;
+ }
+
+ public List getRoleTips() {
+ return roleTips;
+ }
+
+ public void setRoleTips(List roleTips) {
+ this.roleTips = roleTips;
+ }
+
+ public static class DevicesBean {
+ /**
+ * account :
+ * deptId :
+ * deptName :
+ * deviceName : 12345
+ * id : 1349258555972796417
+ * imei : 1234
+ * lastTime : 2021-01-13
+ * lastTimeFmt :
+ * name :
+ * networkNumber : 1234
+ * onLine : false
+ * phone :
+ * positionLat :
+ * positionLng :
+ * targetId :
+ * userId : 1177050541084160002
+ */
+
+ private String account;
+ private String deptId;
+ private String deptName;
+ private String deviceName;
+ private String id;
+ private String imei;
+ private String lastTime;
+ private String lastTimeFmt;
+ private String name;
+ private String networkNumber;
+ private boolean onLine;
+ private String phone;
+ private String positionLat;
+ private String positionLng;
+ private String targetId;
+ private String userId;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ public void setDeviceName(String deviceName) {
+ this.deviceName = deviceName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getImei() {
+ return imei;
+ }
+
+ public void setImei(String imei) {
+ this.imei = imei;
+ }
+
+ public String getLastTime() {
+ return lastTime;
+ }
+
+ public void setLastTime(String lastTime) {
+ this.lastTime = lastTime;
+ }
+
+ public String getLastTimeFmt() {
+ return lastTimeFmt;
+ }
+
+ public void setLastTimeFmt(String lastTimeFmt) {
+ this.lastTimeFmt = lastTimeFmt;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getNetworkNumber() {
+ return networkNumber;
+ }
+
+ public void setNetworkNumber(String networkNumber) {
+ this.networkNumber = networkNumber;
+ }
+
+ public boolean isOnLine() {
+ return onLine;
+ }
+
+ public void setOnLine(boolean onLine) {
+ this.onLine = onLine;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getPositionLat() {
+ return positionLat;
+ }
+
+ public void setPositionLat(String positionLat) {
+ this.positionLat = positionLat;
+ }
+
+ public String getPositionLng() {
+ return positionLng;
+ }
+
+ public void setPositionLng(String positionLng) {
+ this.positionLng = positionLng;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
new file mode 100644
index 0000000..b3e7d1e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.mvp;
+
+import rx.Subscription;
+import rx.subscriptions.CompositeSubscription;
+
+public class BasePresenter {
+ private CompositeSubscription mCompositeSubscription;
+
+ //RxJava注册
+ protected void addSubscription(Subscription subscriber) {
+ if (mCompositeSubscription == null) {
+ mCompositeSubscription = new CompositeSubscription();
+ }
+ mCompositeSubscription.add(subscriber);
+ }
+
+ //RxJava取消注册,以避免内存泄露
+ protected void unSubscription() {
+ if (mCompositeSubscription != null && mCompositeSubscription.hasSubscriptions()) {
+ mCompositeSubscription.unsubscribe();
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
new file mode 100644
index 0000000..b3361da
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
@@ -0,0 +1,51 @@
+package com.casic.dcms.mvp.model;
+
+import com.casic.dcms.bean.PublicKeyBean;
+import com.casic.dcms.utils.HttpConfig;
+import com.casic.dcms.utils.retrofit.RetrofitServiceManager;
+
+import rx.Observable;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+public class AuthenticateModelImpl implements IAuthenticateModel {
+
+ private OnAuthenticateListener onAuthenticateListener;
+
+ public AuthenticateModelImpl(OnAuthenticateListener listener) {
+ this.onAuthenticateListener = listener;
+ }
+
+ public interface OnAuthenticateListener {
+ void onSuccess(PublicKeyBean key);
+
+ void onFailure(Throwable throwable);
+ }
+
+ @Override
+ public Subscription sendRetrofitRequest() {
+ Observable observable = RetrofitServiceManager.authenticate(HttpConfig.BASE_IP);
+ return observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer() {
+ @Override
+ public void onCompleted() {
+
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (onAuthenticateListener != null) {
+ onAuthenticateListener.onFailure(e);
+ }
+ }
+
+ @Override
+ public void onNext(PublicKeyBean key) {
+ if (key != null) {
+ onAuthenticateListener.onSuccess(key);
+ }
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java b/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java
new file mode 100644
index 0000000..5e0fd55
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface IAuthenticateModel {
+ Subscription sendRetrofitRequest();
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java b/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java
new file mode 100644
index 0000000..1a3681a
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface ILoginActionModel {
+ Subscription sendRetrofitRequest(String username, String password);
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
new file mode 100644
index 0000000..6fc764e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.base;
+
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+public abstract class DoubleClickExitActivity extends BaseActivity {
+
+ private long clickTime = 0;
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (System.currentTimeMillis() - clickTime > 2000) {
+ Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
+ clickTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
new file mode 100644
index 0000000..b3b1e44
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
@@ -0,0 +1,74 @@
+package com.casic.dcms.bean;
+
+public class LoginResultBean {
+
+ /**
+ * code : 200
+ * data : {"kaptcha":"","token":"e2dc5885-c830-4773-ba63-9f6f4efdc0fd"}
+ * message : 登录成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * kaptcha :
+ * token : e2dc5885-c830-4773-ba63-9f6f4efdc0fd
+ */
+
+ private String kaptcha;
+ private String token;
+
+ public String getKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(String kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
new file mode 100644
index 0000000..1298cd3
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
@@ -0,0 +1,97 @@
+package com.casic.dcms.bean;
+
+/**
+ * PublicKey 登录校验Key
+ */
+public class PublicKeyBean {
+
+ /**
+ * code : 200
+ * data : {"appKaptcha":false,"kaptcha":false,"publicKey":"","sid":"a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d"}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * appKaptcha : false
+ * kaptcha : false
+ * publicKey :
+ * sid : a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d
+ */
+
+ private boolean appKaptcha;
+ private boolean kaptcha;
+ private String publicKey;
+ private String sid;
+
+ public boolean isAppKaptcha() {
+ return appKaptcha;
+ }
+
+ public void setAppKaptcha(boolean appKaptcha) {
+ this.appKaptcha = appKaptcha;
+ }
+
+ public boolean isKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(boolean kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getPublicKey() {
+ return publicKey;
+ }
+
+ public void setPublicKey(String publicKey) {
+ this.publicKey = publicKey;
+ }
+
+ public String getSid() {
+ return sid;
+ }
+
+ public void setSid(String sid) {
+ this.sid = sid;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/UserBean.java b/app/src/main/java/com/casic/dcms/bean/UserBean.java
new file mode 100644
index 0000000..31ec3a0
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/UserBean.java
@@ -0,0 +1,422 @@
+package com.casic.dcms.bean;
+
+import java.util.List;
+
+public class UserBean {
+
+ /**
+ * code : 200
+ * data : {"account":"cgjd01","attr1":"","avatar":"","bizData":"","dataScope":["1177026995528237058"],"deptId":"1177026995528237058","deptName":"指挥中心","devices":[{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}],"id":"1177050541084160002","ipAddr":"111.198.10.15","name":"王金龙","phone":"18600202669","roleList":["1177029183042322434"],"roleNames":["监督员"],"roleTips":["supervisor"],"scopeType":"4","sysData":"","targetId":"","targetName":"","tenantId":""}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * account : cgjd01
+ * attr1 :
+ * avatar :
+ * bizData :
+ * dataScope : ["1177026995528237058"]
+ * deptId : 1177026995528237058
+ * deptName : 指挥中心
+ * devices : [{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}]
+ * id : 1177050541084160002
+ * ipAddr : 111.198.10.15
+ * name : 王金龙
+ * phone : 18600202669
+ * roleList : ["1177029183042322434"]
+ * roleNames : ["监督员"]
+ * roleTips : ["supervisor"]
+ * scopeType : 4
+ * sysData :
+ * targetId :
+ * targetName :
+ * tenantId :
+ */
+
+ private String account;
+ private String attr1;
+ private String avatar;
+ private String bizData;
+ private String deptId;
+ private String deptName;
+ private String id;
+ private String ipAddr;
+ private String name;
+ private String phone;
+ private String scopeType;
+ private String sysData;
+ private String targetId;
+ private String targetName;
+ private String tenantId;
+ private List dataScope;
+ private List devices;
+ private List roleList;
+ private List roleNames;
+ private List roleTips;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getAttr1() {
+ return attr1;
+ }
+
+ public void setAttr1(String attr1) {
+ this.attr1 = attr1;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public void setAvatar(String avatar) {
+ this.avatar = avatar;
+ }
+
+ public String getBizData() {
+ return bizData;
+ }
+
+ public void setBizData(String bizData) {
+ this.bizData = bizData;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getIpAddr() {
+ return ipAddr;
+ }
+
+ public void setIpAddr(String ipAddr) {
+ this.ipAddr = ipAddr;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getScopeType() {
+ return scopeType;
+ }
+
+ public void setScopeType(String scopeType) {
+ this.scopeType = scopeType;
+ }
+
+ public String getSysData() {
+ return sysData;
+ }
+
+ public void setSysData(String sysData) {
+ this.sysData = sysData;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public void setTargetName(String targetName) {
+ this.targetName = targetName;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public List getDataScope() {
+ return dataScope;
+ }
+
+ public void setDataScope(List dataScope) {
+ this.dataScope = dataScope;
+ }
+
+ public List getDevices() {
+ return devices;
+ }
+
+ public void setDevices(List devices) {
+ this.devices = devices;
+ }
+
+ public List getRoleList() {
+ return roleList;
+ }
+
+ public void setRoleList(List roleList) {
+ this.roleList = roleList;
+ }
+
+ public List getRoleNames() {
+ return roleNames;
+ }
+
+ public void setRoleNames(List roleNames) {
+ this.roleNames = roleNames;
+ }
+
+ public List getRoleTips() {
+ return roleTips;
+ }
+
+ public void setRoleTips(List roleTips) {
+ this.roleTips = roleTips;
+ }
+
+ public static class DevicesBean {
+ /**
+ * account :
+ * deptId :
+ * deptName :
+ * deviceName : 12345
+ * id : 1349258555972796417
+ * imei : 1234
+ * lastTime : 2021-01-13
+ * lastTimeFmt :
+ * name :
+ * networkNumber : 1234
+ * onLine : false
+ * phone :
+ * positionLat :
+ * positionLng :
+ * targetId :
+ * userId : 1177050541084160002
+ */
+
+ private String account;
+ private String deptId;
+ private String deptName;
+ private String deviceName;
+ private String id;
+ private String imei;
+ private String lastTime;
+ private String lastTimeFmt;
+ private String name;
+ private String networkNumber;
+ private boolean onLine;
+ private String phone;
+ private String positionLat;
+ private String positionLng;
+ private String targetId;
+ private String userId;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ public void setDeviceName(String deviceName) {
+ this.deviceName = deviceName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getImei() {
+ return imei;
+ }
+
+ public void setImei(String imei) {
+ this.imei = imei;
+ }
+
+ public String getLastTime() {
+ return lastTime;
+ }
+
+ public void setLastTime(String lastTime) {
+ this.lastTime = lastTime;
+ }
+
+ public String getLastTimeFmt() {
+ return lastTimeFmt;
+ }
+
+ public void setLastTimeFmt(String lastTimeFmt) {
+ this.lastTimeFmt = lastTimeFmt;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getNetworkNumber() {
+ return networkNumber;
+ }
+
+ public void setNetworkNumber(String networkNumber) {
+ this.networkNumber = networkNumber;
+ }
+
+ public boolean isOnLine() {
+ return onLine;
+ }
+
+ public void setOnLine(boolean onLine) {
+ this.onLine = onLine;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getPositionLat() {
+ return positionLat;
+ }
+
+ public void setPositionLat(String positionLat) {
+ this.positionLat = positionLat;
+ }
+
+ public String getPositionLng() {
+ return positionLng;
+ }
+
+ public void setPositionLng(String positionLng) {
+ this.positionLng = positionLng;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
new file mode 100644
index 0000000..b3e7d1e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.mvp;
+
+import rx.Subscription;
+import rx.subscriptions.CompositeSubscription;
+
+public class BasePresenter {
+ private CompositeSubscription mCompositeSubscription;
+
+ //RxJava注册
+ protected void addSubscription(Subscription subscriber) {
+ if (mCompositeSubscription == null) {
+ mCompositeSubscription = new CompositeSubscription();
+ }
+ mCompositeSubscription.add(subscriber);
+ }
+
+ //RxJava取消注册,以避免内存泄露
+ protected void unSubscription() {
+ if (mCompositeSubscription != null && mCompositeSubscription.hasSubscriptions()) {
+ mCompositeSubscription.unsubscribe();
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
new file mode 100644
index 0000000..b3361da
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
@@ -0,0 +1,51 @@
+package com.casic.dcms.mvp.model;
+
+import com.casic.dcms.bean.PublicKeyBean;
+import com.casic.dcms.utils.HttpConfig;
+import com.casic.dcms.utils.retrofit.RetrofitServiceManager;
+
+import rx.Observable;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+public class AuthenticateModelImpl implements IAuthenticateModel {
+
+ private OnAuthenticateListener onAuthenticateListener;
+
+ public AuthenticateModelImpl(OnAuthenticateListener listener) {
+ this.onAuthenticateListener = listener;
+ }
+
+ public interface OnAuthenticateListener {
+ void onSuccess(PublicKeyBean key);
+
+ void onFailure(Throwable throwable);
+ }
+
+ @Override
+ public Subscription sendRetrofitRequest() {
+ Observable observable = RetrofitServiceManager.authenticate(HttpConfig.BASE_IP);
+ return observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer() {
+ @Override
+ public void onCompleted() {
+
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (onAuthenticateListener != null) {
+ onAuthenticateListener.onFailure(e);
+ }
+ }
+
+ @Override
+ public void onNext(PublicKeyBean key) {
+ if (key != null) {
+ onAuthenticateListener.onSuccess(key);
+ }
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java b/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java
new file mode 100644
index 0000000..5e0fd55
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface IAuthenticateModel {
+ Subscription sendRetrofitRequest();
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java b/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java
new file mode 100644
index 0000000..1a3681a
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface ILoginActionModel {
+ Subscription sendRetrofitRequest(String username, String password);
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/IUserDataModel.java b/app/src/main/java/com/casic/dcms/mvp/model/IUserDataModel.java
new file mode 100644
index 0000000..74b79b7
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/IUserDataModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface IUserDataModel {
+ Subscription sendRetrofitRequest(String token);
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
new file mode 100644
index 0000000..6fc764e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.base;
+
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+public abstract class DoubleClickExitActivity extends BaseActivity {
+
+ private long clickTime = 0;
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (System.currentTimeMillis() - clickTime > 2000) {
+ Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
+ clickTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
new file mode 100644
index 0000000..b3b1e44
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
@@ -0,0 +1,74 @@
+package com.casic.dcms.bean;
+
+public class LoginResultBean {
+
+ /**
+ * code : 200
+ * data : {"kaptcha":"","token":"e2dc5885-c830-4773-ba63-9f6f4efdc0fd"}
+ * message : 登录成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * kaptcha :
+ * token : e2dc5885-c830-4773-ba63-9f6f4efdc0fd
+ */
+
+ private String kaptcha;
+ private String token;
+
+ public String getKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(String kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
new file mode 100644
index 0000000..1298cd3
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
@@ -0,0 +1,97 @@
+package com.casic.dcms.bean;
+
+/**
+ * PublicKey 登录校验Key
+ */
+public class PublicKeyBean {
+
+ /**
+ * code : 200
+ * data : {"appKaptcha":false,"kaptcha":false,"publicKey":"","sid":"a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d"}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * appKaptcha : false
+ * kaptcha : false
+ * publicKey :
+ * sid : a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d
+ */
+
+ private boolean appKaptcha;
+ private boolean kaptcha;
+ private String publicKey;
+ private String sid;
+
+ public boolean isAppKaptcha() {
+ return appKaptcha;
+ }
+
+ public void setAppKaptcha(boolean appKaptcha) {
+ this.appKaptcha = appKaptcha;
+ }
+
+ public boolean isKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(boolean kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getPublicKey() {
+ return publicKey;
+ }
+
+ public void setPublicKey(String publicKey) {
+ this.publicKey = publicKey;
+ }
+
+ public String getSid() {
+ return sid;
+ }
+
+ public void setSid(String sid) {
+ this.sid = sid;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/UserBean.java b/app/src/main/java/com/casic/dcms/bean/UserBean.java
new file mode 100644
index 0000000..31ec3a0
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/UserBean.java
@@ -0,0 +1,422 @@
+package com.casic.dcms.bean;
+
+import java.util.List;
+
+public class UserBean {
+
+ /**
+ * code : 200
+ * data : {"account":"cgjd01","attr1":"","avatar":"","bizData":"","dataScope":["1177026995528237058"],"deptId":"1177026995528237058","deptName":"指挥中心","devices":[{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}],"id":"1177050541084160002","ipAddr":"111.198.10.15","name":"王金龙","phone":"18600202669","roleList":["1177029183042322434"],"roleNames":["监督员"],"roleTips":["supervisor"],"scopeType":"4","sysData":"","targetId":"","targetName":"","tenantId":""}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * account : cgjd01
+ * attr1 :
+ * avatar :
+ * bizData :
+ * dataScope : ["1177026995528237058"]
+ * deptId : 1177026995528237058
+ * deptName : 指挥中心
+ * devices : [{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}]
+ * id : 1177050541084160002
+ * ipAddr : 111.198.10.15
+ * name : 王金龙
+ * phone : 18600202669
+ * roleList : ["1177029183042322434"]
+ * roleNames : ["监督员"]
+ * roleTips : ["supervisor"]
+ * scopeType : 4
+ * sysData :
+ * targetId :
+ * targetName :
+ * tenantId :
+ */
+
+ private String account;
+ private String attr1;
+ private String avatar;
+ private String bizData;
+ private String deptId;
+ private String deptName;
+ private String id;
+ private String ipAddr;
+ private String name;
+ private String phone;
+ private String scopeType;
+ private String sysData;
+ private String targetId;
+ private String targetName;
+ private String tenantId;
+ private List dataScope;
+ private List devices;
+ private List roleList;
+ private List roleNames;
+ private List roleTips;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getAttr1() {
+ return attr1;
+ }
+
+ public void setAttr1(String attr1) {
+ this.attr1 = attr1;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public void setAvatar(String avatar) {
+ this.avatar = avatar;
+ }
+
+ public String getBizData() {
+ return bizData;
+ }
+
+ public void setBizData(String bizData) {
+ this.bizData = bizData;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getIpAddr() {
+ return ipAddr;
+ }
+
+ public void setIpAddr(String ipAddr) {
+ this.ipAddr = ipAddr;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getScopeType() {
+ return scopeType;
+ }
+
+ public void setScopeType(String scopeType) {
+ this.scopeType = scopeType;
+ }
+
+ public String getSysData() {
+ return sysData;
+ }
+
+ public void setSysData(String sysData) {
+ this.sysData = sysData;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public void setTargetName(String targetName) {
+ this.targetName = targetName;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public List getDataScope() {
+ return dataScope;
+ }
+
+ public void setDataScope(List dataScope) {
+ this.dataScope = dataScope;
+ }
+
+ public List getDevices() {
+ return devices;
+ }
+
+ public void setDevices(List devices) {
+ this.devices = devices;
+ }
+
+ public List getRoleList() {
+ return roleList;
+ }
+
+ public void setRoleList(List roleList) {
+ this.roleList = roleList;
+ }
+
+ public List getRoleNames() {
+ return roleNames;
+ }
+
+ public void setRoleNames(List roleNames) {
+ this.roleNames = roleNames;
+ }
+
+ public List getRoleTips() {
+ return roleTips;
+ }
+
+ public void setRoleTips(List roleTips) {
+ this.roleTips = roleTips;
+ }
+
+ public static class DevicesBean {
+ /**
+ * account :
+ * deptId :
+ * deptName :
+ * deviceName : 12345
+ * id : 1349258555972796417
+ * imei : 1234
+ * lastTime : 2021-01-13
+ * lastTimeFmt :
+ * name :
+ * networkNumber : 1234
+ * onLine : false
+ * phone :
+ * positionLat :
+ * positionLng :
+ * targetId :
+ * userId : 1177050541084160002
+ */
+
+ private String account;
+ private String deptId;
+ private String deptName;
+ private String deviceName;
+ private String id;
+ private String imei;
+ private String lastTime;
+ private String lastTimeFmt;
+ private String name;
+ private String networkNumber;
+ private boolean onLine;
+ private String phone;
+ private String positionLat;
+ private String positionLng;
+ private String targetId;
+ private String userId;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ public void setDeviceName(String deviceName) {
+ this.deviceName = deviceName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getImei() {
+ return imei;
+ }
+
+ public void setImei(String imei) {
+ this.imei = imei;
+ }
+
+ public String getLastTime() {
+ return lastTime;
+ }
+
+ public void setLastTime(String lastTime) {
+ this.lastTime = lastTime;
+ }
+
+ public String getLastTimeFmt() {
+ return lastTimeFmt;
+ }
+
+ public void setLastTimeFmt(String lastTimeFmt) {
+ this.lastTimeFmt = lastTimeFmt;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getNetworkNumber() {
+ return networkNumber;
+ }
+
+ public void setNetworkNumber(String networkNumber) {
+ this.networkNumber = networkNumber;
+ }
+
+ public boolean isOnLine() {
+ return onLine;
+ }
+
+ public void setOnLine(boolean onLine) {
+ this.onLine = onLine;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getPositionLat() {
+ return positionLat;
+ }
+
+ public void setPositionLat(String positionLat) {
+ this.positionLat = positionLat;
+ }
+
+ public String getPositionLng() {
+ return positionLng;
+ }
+
+ public void setPositionLng(String positionLng) {
+ this.positionLng = positionLng;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
new file mode 100644
index 0000000..b3e7d1e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.mvp;
+
+import rx.Subscription;
+import rx.subscriptions.CompositeSubscription;
+
+public class BasePresenter {
+ private CompositeSubscription mCompositeSubscription;
+
+ //RxJava注册
+ protected void addSubscription(Subscription subscriber) {
+ if (mCompositeSubscription == null) {
+ mCompositeSubscription = new CompositeSubscription();
+ }
+ mCompositeSubscription.add(subscriber);
+ }
+
+ //RxJava取消注册,以避免内存泄露
+ protected void unSubscription() {
+ if (mCompositeSubscription != null && mCompositeSubscription.hasSubscriptions()) {
+ mCompositeSubscription.unsubscribe();
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
new file mode 100644
index 0000000..b3361da
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
@@ -0,0 +1,51 @@
+package com.casic.dcms.mvp.model;
+
+import com.casic.dcms.bean.PublicKeyBean;
+import com.casic.dcms.utils.HttpConfig;
+import com.casic.dcms.utils.retrofit.RetrofitServiceManager;
+
+import rx.Observable;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+public class AuthenticateModelImpl implements IAuthenticateModel {
+
+ private OnAuthenticateListener onAuthenticateListener;
+
+ public AuthenticateModelImpl(OnAuthenticateListener listener) {
+ this.onAuthenticateListener = listener;
+ }
+
+ public interface OnAuthenticateListener {
+ void onSuccess(PublicKeyBean key);
+
+ void onFailure(Throwable throwable);
+ }
+
+ @Override
+ public Subscription sendRetrofitRequest() {
+ Observable observable = RetrofitServiceManager.authenticate(HttpConfig.BASE_IP);
+ return observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer() {
+ @Override
+ public void onCompleted() {
+
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (onAuthenticateListener != null) {
+ onAuthenticateListener.onFailure(e);
+ }
+ }
+
+ @Override
+ public void onNext(PublicKeyBean key) {
+ if (key != null) {
+ onAuthenticateListener.onSuccess(key);
+ }
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java b/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java
new file mode 100644
index 0000000..5e0fd55
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface IAuthenticateModel {
+ Subscription sendRetrofitRequest();
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java b/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java
new file mode 100644
index 0000000..1a3681a
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface ILoginActionModel {
+ Subscription sendRetrofitRequest(String username, String password);
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/IUserDataModel.java b/app/src/main/java/com/casic/dcms/mvp/model/IUserDataModel.java
new file mode 100644
index 0000000..74b79b7
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/IUserDataModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface IUserDataModel {
+ Subscription sendRetrofitRequest(String token);
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/LoginActionModelImpl.java b/app/src/main/java/com/casic/dcms/mvp/model/LoginActionModelImpl.java
new file mode 100644
index 0000000..f48dbb9
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/LoginActionModelImpl.java
@@ -0,0 +1,55 @@
+package com.casic.dcms.mvp.model;
+
+import com.casic.dcms.bean.LoginResultBean;
+import com.casic.dcms.utils.HttpConfig;
+import com.casic.dcms.utils.retrofit.RetrofitServiceManager;
+
+import rx.Observable;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+public class LoginActionModelImpl implements ILoginActionModel {
+
+ private OnLoginListener loginListener;
+
+ public LoginActionModelImpl(OnLoginListener listener) {
+ this.loginListener = listener;
+ }
+
+ /**
+ * 数据回调接口
+ */
+ public interface OnLoginListener {
+ void onSuccess(LoginResultBean resultBean);
+
+ void onFailure(Throwable throwable);
+ }
+
+
+ @Override
+ public Subscription sendRetrofitRequest(String username, String key) {
+ Observable observable = RetrofitServiceManager.getTokenData(HttpConfig.BASE_IP, username, key);
+ return observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer() {
+ @Override
+ public void onCompleted() {
+
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (loginListener != null) {
+ loginListener.onFailure(e);
+ }
+ }
+
+ @Override
+ public void onNext(LoginResultBean resultBean) {
+ if (resultBean != null) {
+ loginListener.onSuccess(resultBean);
+ }
+ }
+ });
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
new file mode 100644
index 0000000..6fc764e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.base;
+
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+public abstract class DoubleClickExitActivity extends BaseActivity {
+
+ private long clickTime = 0;
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (System.currentTimeMillis() - clickTime > 2000) {
+ Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
+ clickTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
new file mode 100644
index 0000000..b3b1e44
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
@@ -0,0 +1,74 @@
+package com.casic.dcms.bean;
+
+public class LoginResultBean {
+
+ /**
+ * code : 200
+ * data : {"kaptcha":"","token":"e2dc5885-c830-4773-ba63-9f6f4efdc0fd"}
+ * message : 登录成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * kaptcha :
+ * token : e2dc5885-c830-4773-ba63-9f6f4efdc0fd
+ */
+
+ private String kaptcha;
+ private String token;
+
+ public String getKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(String kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
new file mode 100644
index 0000000..1298cd3
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
@@ -0,0 +1,97 @@
+package com.casic.dcms.bean;
+
+/**
+ * PublicKey 登录校验Key
+ */
+public class PublicKeyBean {
+
+ /**
+ * code : 200
+ * data : {"appKaptcha":false,"kaptcha":false,"publicKey":"","sid":"a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d"}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * appKaptcha : false
+ * kaptcha : false
+ * publicKey :
+ * sid : a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d
+ */
+
+ private boolean appKaptcha;
+ private boolean kaptcha;
+ private String publicKey;
+ private String sid;
+
+ public boolean isAppKaptcha() {
+ return appKaptcha;
+ }
+
+ public void setAppKaptcha(boolean appKaptcha) {
+ this.appKaptcha = appKaptcha;
+ }
+
+ public boolean isKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(boolean kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getPublicKey() {
+ return publicKey;
+ }
+
+ public void setPublicKey(String publicKey) {
+ this.publicKey = publicKey;
+ }
+
+ public String getSid() {
+ return sid;
+ }
+
+ public void setSid(String sid) {
+ this.sid = sid;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/UserBean.java b/app/src/main/java/com/casic/dcms/bean/UserBean.java
new file mode 100644
index 0000000..31ec3a0
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/UserBean.java
@@ -0,0 +1,422 @@
+package com.casic.dcms.bean;
+
+import java.util.List;
+
+public class UserBean {
+
+ /**
+ * code : 200
+ * data : {"account":"cgjd01","attr1":"","avatar":"","bizData":"","dataScope":["1177026995528237058"],"deptId":"1177026995528237058","deptName":"指挥中心","devices":[{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}],"id":"1177050541084160002","ipAddr":"111.198.10.15","name":"王金龙","phone":"18600202669","roleList":["1177029183042322434"],"roleNames":["监督员"],"roleTips":["supervisor"],"scopeType":"4","sysData":"","targetId":"","targetName":"","tenantId":""}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * account : cgjd01
+ * attr1 :
+ * avatar :
+ * bizData :
+ * dataScope : ["1177026995528237058"]
+ * deptId : 1177026995528237058
+ * deptName : 指挥中心
+ * devices : [{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}]
+ * id : 1177050541084160002
+ * ipAddr : 111.198.10.15
+ * name : 王金龙
+ * phone : 18600202669
+ * roleList : ["1177029183042322434"]
+ * roleNames : ["监督员"]
+ * roleTips : ["supervisor"]
+ * scopeType : 4
+ * sysData :
+ * targetId :
+ * targetName :
+ * tenantId :
+ */
+
+ private String account;
+ private String attr1;
+ private String avatar;
+ private String bizData;
+ private String deptId;
+ private String deptName;
+ private String id;
+ private String ipAddr;
+ private String name;
+ private String phone;
+ private String scopeType;
+ private String sysData;
+ private String targetId;
+ private String targetName;
+ private String tenantId;
+ private List dataScope;
+ private List devices;
+ private List roleList;
+ private List roleNames;
+ private List roleTips;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getAttr1() {
+ return attr1;
+ }
+
+ public void setAttr1(String attr1) {
+ this.attr1 = attr1;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public void setAvatar(String avatar) {
+ this.avatar = avatar;
+ }
+
+ public String getBizData() {
+ return bizData;
+ }
+
+ public void setBizData(String bizData) {
+ this.bizData = bizData;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getIpAddr() {
+ return ipAddr;
+ }
+
+ public void setIpAddr(String ipAddr) {
+ this.ipAddr = ipAddr;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getScopeType() {
+ return scopeType;
+ }
+
+ public void setScopeType(String scopeType) {
+ this.scopeType = scopeType;
+ }
+
+ public String getSysData() {
+ return sysData;
+ }
+
+ public void setSysData(String sysData) {
+ this.sysData = sysData;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public void setTargetName(String targetName) {
+ this.targetName = targetName;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public List getDataScope() {
+ return dataScope;
+ }
+
+ public void setDataScope(List dataScope) {
+ this.dataScope = dataScope;
+ }
+
+ public List getDevices() {
+ return devices;
+ }
+
+ public void setDevices(List devices) {
+ this.devices = devices;
+ }
+
+ public List getRoleList() {
+ return roleList;
+ }
+
+ public void setRoleList(List roleList) {
+ this.roleList = roleList;
+ }
+
+ public List getRoleNames() {
+ return roleNames;
+ }
+
+ public void setRoleNames(List roleNames) {
+ this.roleNames = roleNames;
+ }
+
+ public List getRoleTips() {
+ return roleTips;
+ }
+
+ public void setRoleTips(List roleTips) {
+ this.roleTips = roleTips;
+ }
+
+ public static class DevicesBean {
+ /**
+ * account :
+ * deptId :
+ * deptName :
+ * deviceName : 12345
+ * id : 1349258555972796417
+ * imei : 1234
+ * lastTime : 2021-01-13
+ * lastTimeFmt :
+ * name :
+ * networkNumber : 1234
+ * onLine : false
+ * phone :
+ * positionLat :
+ * positionLng :
+ * targetId :
+ * userId : 1177050541084160002
+ */
+
+ private String account;
+ private String deptId;
+ private String deptName;
+ private String deviceName;
+ private String id;
+ private String imei;
+ private String lastTime;
+ private String lastTimeFmt;
+ private String name;
+ private String networkNumber;
+ private boolean onLine;
+ private String phone;
+ private String positionLat;
+ private String positionLng;
+ private String targetId;
+ private String userId;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ public void setDeviceName(String deviceName) {
+ this.deviceName = deviceName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getImei() {
+ return imei;
+ }
+
+ public void setImei(String imei) {
+ this.imei = imei;
+ }
+
+ public String getLastTime() {
+ return lastTime;
+ }
+
+ public void setLastTime(String lastTime) {
+ this.lastTime = lastTime;
+ }
+
+ public String getLastTimeFmt() {
+ return lastTimeFmt;
+ }
+
+ public void setLastTimeFmt(String lastTimeFmt) {
+ this.lastTimeFmt = lastTimeFmt;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getNetworkNumber() {
+ return networkNumber;
+ }
+
+ public void setNetworkNumber(String networkNumber) {
+ this.networkNumber = networkNumber;
+ }
+
+ public boolean isOnLine() {
+ return onLine;
+ }
+
+ public void setOnLine(boolean onLine) {
+ this.onLine = onLine;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getPositionLat() {
+ return positionLat;
+ }
+
+ public void setPositionLat(String positionLat) {
+ this.positionLat = positionLat;
+ }
+
+ public String getPositionLng() {
+ return positionLng;
+ }
+
+ public void setPositionLng(String positionLng) {
+ this.positionLng = positionLng;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
new file mode 100644
index 0000000..b3e7d1e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.mvp;
+
+import rx.Subscription;
+import rx.subscriptions.CompositeSubscription;
+
+public class BasePresenter {
+ private CompositeSubscription mCompositeSubscription;
+
+ //RxJava注册
+ protected void addSubscription(Subscription subscriber) {
+ if (mCompositeSubscription == null) {
+ mCompositeSubscription = new CompositeSubscription();
+ }
+ mCompositeSubscription.add(subscriber);
+ }
+
+ //RxJava取消注册,以避免内存泄露
+ protected void unSubscription() {
+ if (mCompositeSubscription != null && mCompositeSubscription.hasSubscriptions()) {
+ mCompositeSubscription.unsubscribe();
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
new file mode 100644
index 0000000..b3361da
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
@@ -0,0 +1,51 @@
+package com.casic.dcms.mvp.model;
+
+import com.casic.dcms.bean.PublicKeyBean;
+import com.casic.dcms.utils.HttpConfig;
+import com.casic.dcms.utils.retrofit.RetrofitServiceManager;
+
+import rx.Observable;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+public class AuthenticateModelImpl implements IAuthenticateModel {
+
+ private OnAuthenticateListener onAuthenticateListener;
+
+ public AuthenticateModelImpl(OnAuthenticateListener listener) {
+ this.onAuthenticateListener = listener;
+ }
+
+ public interface OnAuthenticateListener {
+ void onSuccess(PublicKeyBean key);
+
+ void onFailure(Throwable throwable);
+ }
+
+ @Override
+ public Subscription sendRetrofitRequest() {
+ Observable observable = RetrofitServiceManager.authenticate(HttpConfig.BASE_IP);
+ return observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer() {
+ @Override
+ public void onCompleted() {
+
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (onAuthenticateListener != null) {
+ onAuthenticateListener.onFailure(e);
+ }
+ }
+
+ @Override
+ public void onNext(PublicKeyBean key) {
+ if (key != null) {
+ onAuthenticateListener.onSuccess(key);
+ }
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java b/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java
new file mode 100644
index 0000000..5e0fd55
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface IAuthenticateModel {
+ Subscription sendRetrofitRequest();
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java b/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java
new file mode 100644
index 0000000..1a3681a
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface ILoginActionModel {
+ Subscription sendRetrofitRequest(String username, String password);
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/IUserDataModel.java b/app/src/main/java/com/casic/dcms/mvp/model/IUserDataModel.java
new file mode 100644
index 0000000..74b79b7
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/IUserDataModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface IUserDataModel {
+ Subscription sendRetrofitRequest(String token);
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/LoginActionModelImpl.java b/app/src/main/java/com/casic/dcms/mvp/model/LoginActionModelImpl.java
new file mode 100644
index 0000000..f48dbb9
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/LoginActionModelImpl.java
@@ -0,0 +1,55 @@
+package com.casic.dcms.mvp.model;
+
+import com.casic.dcms.bean.LoginResultBean;
+import com.casic.dcms.utils.HttpConfig;
+import com.casic.dcms.utils.retrofit.RetrofitServiceManager;
+
+import rx.Observable;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+public class LoginActionModelImpl implements ILoginActionModel {
+
+ private OnLoginListener loginListener;
+
+ public LoginActionModelImpl(OnLoginListener listener) {
+ this.loginListener = listener;
+ }
+
+ /**
+ * 数据回调接口
+ */
+ public interface OnLoginListener {
+ void onSuccess(LoginResultBean resultBean);
+
+ void onFailure(Throwable throwable);
+ }
+
+
+ @Override
+ public Subscription sendRetrofitRequest(String username, String key) {
+ Observable observable = RetrofitServiceManager.getTokenData(HttpConfig.BASE_IP, username, key);
+ return observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer() {
+ @Override
+ public void onCompleted() {
+
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (loginListener != null) {
+ loginListener.onFailure(e);
+ }
+ }
+
+ @Override
+ public void onNext(LoginResultBean resultBean) {
+ if (resultBean != null) {
+ loginListener.onSuccess(resultBean);
+ }
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/UserDataModelImpl.java b/app/src/main/java/com/casic/dcms/mvp/model/UserDataModelImpl.java
new file mode 100644
index 0000000..d71558d
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/UserDataModelImpl.java
@@ -0,0 +1,55 @@
+package com.casic.dcms.mvp.model;
+
+import com.casic.dcms.bean.UserBean;
+import com.casic.dcms.utils.HttpConfig;
+import com.casic.dcms.utils.retrofit.RetrofitServiceManager;
+
+import rx.Observable;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+public class UserDataModelImpl implements IUserDataModel {
+
+ private static final String TAG = "UserDataModelImpl";
+ private OnObtainUserListener listener;
+
+ public UserDataModelImpl(OnObtainUserListener obtainUserListener) {
+ this.listener = obtainUserListener;
+ }
+
+ /**
+ * 数据回调接口
+ */
+ public interface OnObtainUserListener {
+ void onSuccess(UserBean userBean);
+
+ void onFailure(Throwable throwable);
+ }
+
+ @Override
+ public Subscription sendRetrofitRequest(String token) {
+ Observable observable = RetrofitServiceManager.getUserData(HttpConfig.BASE_IP, token);
+ return observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer() {
+ @Override
+ public void onCompleted() {
+
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (listener != null) {
+ listener.onFailure(e);
+ }
+ }
+
+ @Override
+ public void onNext(UserBean userBean) {
+ if (userBean != null) {
+ listener.onSuccess(userBean);
+ }
+ }
+ });
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
new file mode 100644
index 0000000..6fc764e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.base;
+
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+public abstract class DoubleClickExitActivity extends BaseActivity {
+
+ private long clickTime = 0;
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (System.currentTimeMillis() - clickTime > 2000) {
+ Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
+ clickTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
new file mode 100644
index 0000000..b3b1e44
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
@@ -0,0 +1,74 @@
+package com.casic.dcms.bean;
+
+public class LoginResultBean {
+
+ /**
+ * code : 200
+ * data : {"kaptcha":"","token":"e2dc5885-c830-4773-ba63-9f6f4efdc0fd"}
+ * message : 登录成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * kaptcha :
+ * token : e2dc5885-c830-4773-ba63-9f6f4efdc0fd
+ */
+
+ private String kaptcha;
+ private String token;
+
+ public String getKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(String kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
new file mode 100644
index 0000000..1298cd3
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
@@ -0,0 +1,97 @@
+package com.casic.dcms.bean;
+
+/**
+ * PublicKey 登录校验Key
+ */
+public class PublicKeyBean {
+
+ /**
+ * code : 200
+ * data : {"appKaptcha":false,"kaptcha":false,"publicKey":"","sid":"a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d"}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * appKaptcha : false
+ * kaptcha : false
+ * publicKey :
+ * sid : a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d
+ */
+
+ private boolean appKaptcha;
+ private boolean kaptcha;
+ private String publicKey;
+ private String sid;
+
+ public boolean isAppKaptcha() {
+ return appKaptcha;
+ }
+
+ public void setAppKaptcha(boolean appKaptcha) {
+ this.appKaptcha = appKaptcha;
+ }
+
+ public boolean isKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(boolean kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getPublicKey() {
+ return publicKey;
+ }
+
+ public void setPublicKey(String publicKey) {
+ this.publicKey = publicKey;
+ }
+
+ public String getSid() {
+ return sid;
+ }
+
+ public void setSid(String sid) {
+ this.sid = sid;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/UserBean.java b/app/src/main/java/com/casic/dcms/bean/UserBean.java
new file mode 100644
index 0000000..31ec3a0
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/UserBean.java
@@ -0,0 +1,422 @@
+package com.casic.dcms.bean;
+
+import java.util.List;
+
+public class UserBean {
+
+ /**
+ * code : 200
+ * data : {"account":"cgjd01","attr1":"","avatar":"","bizData":"","dataScope":["1177026995528237058"],"deptId":"1177026995528237058","deptName":"指挥中心","devices":[{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}],"id":"1177050541084160002","ipAddr":"111.198.10.15","name":"王金龙","phone":"18600202669","roleList":["1177029183042322434"],"roleNames":["监督员"],"roleTips":["supervisor"],"scopeType":"4","sysData":"","targetId":"","targetName":"","tenantId":""}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * account : cgjd01
+ * attr1 :
+ * avatar :
+ * bizData :
+ * dataScope : ["1177026995528237058"]
+ * deptId : 1177026995528237058
+ * deptName : 指挥中心
+ * devices : [{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}]
+ * id : 1177050541084160002
+ * ipAddr : 111.198.10.15
+ * name : 王金龙
+ * phone : 18600202669
+ * roleList : ["1177029183042322434"]
+ * roleNames : ["监督员"]
+ * roleTips : ["supervisor"]
+ * scopeType : 4
+ * sysData :
+ * targetId :
+ * targetName :
+ * tenantId :
+ */
+
+ private String account;
+ private String attr1;
+ private String avatar;
+ private String bizData;
+ private String deptId;
+ private String deptName;
+ private String id;
+ private String ipAddr;
+ private String name;
+ private String phone;
+ private String scopeType;
+ private String sysData;
+ private String targetId;
+ private String targetName;
+ private String tenantId;
+ private List dataScope;
+ private List devices;
+ private List roleList;
+ private List roleNames;
+ private List roleTips;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getAttr1() {
+ return attr1;
+ }
+
+ public void setAttr1(String attr1) {
+ this.attr1 = attr1;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public void setAvatar(String avatar) {
+ this.avatar = avatar;
+ }
+
+ public String getBizData() {
+ return bizData;
+ }
+
+ public void setBizData(String bizData) {
+ this.bizData = bizData;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getIpAddr() {
+ return ipAddr;
+ }
+
+ public void setIpAddr(String ipAddr) {
+ this.ipAddr = ipAddr;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getScopeType() {
+ return scopeType;
+ }
+
+ public void setScopeType(String scopeType) {
+ this.scopeType = scopeType;
+ }
+
+ public String getSysData() {
+ return sysData;
+ }
+
+ public void setSysData(String sysData) {
+ this.sysData = sysData;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public void setTargetName(String targetName) {
+ this.targetName = targetName;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public List getDataScope() {
+ return dataScope;
+ }
+
+ public void setDataScope(List dataScope) {
+ this.dataScope = dataScope;
+ }
+
+ public List getDevices() {
+ return devices;
+ }
+
+ public void setDevices(List devices) {
+ this.devices = devices;
+ }
+
+ public List getRoleList() {
+ return roleList;
+ }
+
+ public void setRoleList(List roleList) {
+ this.roleList = roleList;
+ }
+
+ public List getRoleNames() {
+ return roleNames;
+ }
+
+ public void setRoleNames(List roleNames) {
+ this.roleNames = roleNames;
+ }
+
+ public List getRoleTips() {
+ return roleTips;
+ }
+
+ public void setRoleTips(List roleTips) {
+ this.roleTips = roleTips;
+ }
+
+ public static class DevicesBean {
+ /**
+ * account :
+ * deptId :
+ * deptName :
+ * deviceName : 12345
+ * id : 1349258555972796417
+ * imei : 1234
+ * lastTime : 2021-01-13
+ * lastTimeFmt :
+ * name :
+ * networkNumber : 1234
+ * onLine : false
+ * phone :
+ * positionLat :
+ * positionLng :
+ * targetId :
+ * userId : 1177050541084160002
+ */
+
+ private String account;
+ private String deptId;
+ private String deptName;
+ private String deviceName;
+ private String id;
+ private String imei;
+ private String lastTime;
+ private String lastTimeFmt;
+ private String name;
+ private String networkNumber;
+ private boolean onLine;
+ private String phone;
+ private String positionLat;
+ private String positionLng;
+ private String targetId;
+ private String userId;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ public void setDeviceName(String deviceName) {
+ this.deviceName = deviceName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getImei() {
+ return imei;
+ }
+
+ public void setImei(String imei) {
+ this.imei = imei;
+ }
+
+ public String getLastTime() {
+ return lastTime;
+ }
+
+ public void setLastTime(String lastTime) {
+ this.lastTime = lastTime;
+ }
+
+ public String getLastTimeFmt() {
+ return lastTimeFmt;
+ }
+
+ public void setLastTimeFmt(String lastTimeFmt) {
+ this.lastTimeFmt = lastTimeFmt;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getNetworkNumber() {
+ return networkNumber;
+ }
+
+ public void setNetworkNumber(String networkNumber) {
+ this.networkNumber = networkNumber;
+ }
+
+ public boolean isOnLine() {
+ return onLine;
+ }
+
+ public void setOnLine(boolean onLine) {
+ this.onLine = onLine;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getPositionLat() {
+ return positionLat;
+ }
+
+ public void setPositionLat(String positionLat) {
+ this.positionLat = positionLat;
+ }
+
+ public String getPositionLng() {
+ return positionLng;
+ }
+
+ public void setPositionLng(String positionLng) {
+ this.positionLng = positionLng;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
new file mode 100644
index 0000000..b3e7d1e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/BasePresenter.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.mvp;
+
+import rx.Subscription;
+import rx.subscriptions.CompositeSubscription;
+
+public class BasePresenter {
+ private CompositeSubscription mCompositeSubscription;
+
+ //RxJava注册
+ protected void addSubscription(Subscription subscriber) {
+ if (mCompositeSubscription == null) {
+ mCompositeSubscription = new CompositeSubscription();
+ }
+ mCompositeSubscription.add(subscriber);
+ }
+
+ //RxJava取消注册,以避免内存泄露
+ protected void unSubscription() {
+ if (mCompositeSubscription != null && mCompositeSubscription.hasSubscriptions()) {
+ mCompositeSubscription.unsubscribe();
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
new file mode 100644
index 0000000..b3361da
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/AuthenticateModelImpl.java
@@ -0,0 +1,51 @@
+package com.casic.dcms.mvp.model;
+
+import com.casic.dcms.bean.PublicKeyBean;
+import com.casic.dcms.utils.HttpConfig;
+import com.casic.dcms.utils.retrofit.RetrofitServiceManager;
+
+import rx.Observable;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+public class AuthenticateModelImpl implements IAuthenticateModel {
+
+ private OnAuthenticateListener onAuthenticateListener;
+
+ public AuthenticateModelImpl(OnAuthenticateListener listener) {
+ this.onAuthenticateListener = listener;
+ }
+
+ public interface OnAuthenticateListener {
+ void onSuccess(PublicKeyBean key);
+
+ void onFailure(Throwable throwable);
+ }
+
+ @Override
+ public Subscription sendRetrofitRequest() {
+ Observable observable = RetrofitServiceManager.authenticate(HttpConfig.BASE_IP);
+ return observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer() {
+ @Override
+ public void onCompleted() {
+
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (onAuthenticateListener != null) {
+ onAuthenticateListener.onFailure(e);
+ }
+ }
+
+ @Override
+ public void onNext(PublicKeyBean key) {
+ if (key != null) {
+ onAuthenticateListener.onSuccess(key);
+ }
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java b/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java
new file mode 100644
index 0000000..5e0fd55
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/IAuthenticateModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface IAuthenticateModel {
+ Subscription sendRetrofitRequest();
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java b/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java
new file mode 100644
index 0000000..1a3681a
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/ILoginActionModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface ILoginActionModel {
+ Subscription sendRetrofitRequest(String username, String password);
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/IUserDataModel.java b/app/src/main/java/com/casic/dcms/mvp/model/IUserDataModel.java
new file mode 100644
index 0000000..74b79b7
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/IUserDataModel.java
@@ -0,0 +1,7 @@
+package com.casic.dcms.mvp.model;
+
+import rx.Subscription;
+
+public interface IUserDataModel {
+ Subscription sendRetrofitRequest(String token);
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/LoginActionModelImpl.java b/app/src/main/java/com/casic/dcms/mvp/model/LoginActionModelImpl.java
new file mode 100644
index 0000000..f48dbb9
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/LoginActionModelImpl.java
@@ -0,0 +1,55 @@
+package com.casic.dcms.mvp.model;
+
+import com.casic.dcms.bean.LoginResultBean;
+import com.casic.dcms.utils.HttpConfig;
+import com.casic.dcms.utils.retrofit.RetrofitServiceManager;
+
+import rx.Observable;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+public class LoginActionModelImpl implements ILoginActionModel {
+
+ private OnLoginListener loginListener;
+
+ public LoginActionModelImpl(OnLoginListener listener) {
+ this.loginListener = listener;
+ }
+
+ /**
+ * 数据回调接口
+ */
+ public interface OnLoginListener {
+ void onSuccess(LoginResultBean resultBean);
+
+ void onFailure(Throwable throwable);
+ }
+
+
+ @Override
+ public Subscription sendRetrofitRequest(String username, String key) {
+ Observable observable = RetrofitServiceManager.getTokenData(HttpConfig.BASE_IP, username, key);
+ return observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer() {
+ @Override
+ public void onCompleted() {
+
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (loginListener != null) {
+ loginListener.onFailure(e);
+ }
+ }
+
+ @Override
+ public void onNext(LoginResultBean resultBean) {
+ if (resultBean != null) {
+ loginListener.onSuccess(resultBean);
+ }
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/model/UserDataModelImpl.java b/app/src/main/java/com/casic/dcms/mvp/model/UserDataModelImpl.java
new file mode 100644
index 0000000..d71558d
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/model/UserDataModelImpl.java
@@ -0,0 +1,55 @@
+package com.casic.dcms.mvp.model;
+
+import com.casic.dcms.bean.UserBean;
+import com.casic.dcms.utils.HttpConfig;
+import com.casic.dcms.utils.retrofit.RetrofitServiceManager;
+
+import rx.Observable;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+public class UserDataModelImpl implements IUserDataModel {
+
+ private static final String TAG = "UserDataModelImpl";
+ private OnObtainUserListener listener;
+
+ public UserDataModelImpl(OnObtainUserListener obtainUserListener) {
+ this.listener = obtainUserListener;
+ }
+
+ /**
+ * 数据回调接口
+ */
+ public interface OnObtainUserListener {
+ void onSuccess(UserBean userBean);
+
+ void onFailure(Throwable throwable);
+ }
+
+ @Override
+ public Subscription sendRetrofitRequest(String token) {
+ Observable observable = RetrofitServiceManager.getUserData(HttpConfig.BASE_IP, token);
+ return observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer() {
+ @Override
+ public void onCompleted() {
+
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (listener != null) {
+ listener.onFailure(e);
+ }
+ }
+
+ @Override
+ public void onNext(UserBean userBean) {
+ if (userBean != null) {
+ listener.onSuccess(userBean);
+ }
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/mvp/presenter/AuthenticatePresenterImpl.java b/app/src/main/java/com/casic/dcms/mvp/presenter/AuthenticatePresenterImpl.java
new file mode 100644
index 0000000..50a32db
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/mvp/presenter/AuthenticatePresenterImpl.java
@@ -0,0 +1,38 @@
+package com.casic.dcms.mvp.presenter;
+
+import com.casic.dcms.bean.PublicKeyBean;
+import com.casic.dcms.mvp.BasePresenter;
+import com.casic.dcms.mvp.model.AuthenticateModelImpl;
+import com.casic.dcms.mvp.view.IAuthenticateView;
+
+public class AuthenticatePresenterImpl extends BasePresenter implements IAuthenticatePresenter, AuthenticateModelImpl.OnAuthenticateListener {
+
+ private IAuthenticateView view;
+ private AuthenticateModelImpl model;
+
+ public AuthenticatePresenterImpl(IAuthenticateView authenticateView) {
+ this.view = authenticateView;
+ model = new AuthenticateModelImpl(this);
+ }
+
+ @Override
+ public void onReadyRetrofitRequest() {
+ view.showProgress();
+ addSubscription(model.sendRetrofitRequest());
+ }
+
+ @Override
+ public void disposeRetrofitRequest() {
+ unSubscription();
+ }
+
+ @Override
+ public void onSuccess(PublicKeyBean key) {
+ view.authenticateResult(key);
+ }
+
+ @Override
+ public void onFailure(Throwable throwable) {
+
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7bfef59
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..ca3f486
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.casic.dcms"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ //Google官方授权框架
+ implementation 'pub.devrel:easypermissions:1.3.0'
+ //腾讯Android UI框架
+ implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
+ implementation 'com.qmuiteam:arch:0.3.1'
+ //MVP控件注解
+ implementation 'com.jakewharton:butterknife:10.2.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+ //图片加载框架
+ implementation 'com.github.bumptech.glide:glide:4.5.0'
+ //MVP网络请求框架retrofit2+rxjava
+ implementation 'io.reactivex:rxjava:1.3.8'
+ implementation 'io.reactivex:rxandroid:1.2.1'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.8.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
+ //官方Json解析库
+ implementation 'com.google.code.gson:gson:2.8.6'
+ //图片选择框架
+ implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
+ //视频播放器
+ implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
+ //全球可用地图MapBox
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
+ implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/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
diff --git a/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d8faada
--- /dev/null
+++ b/app/src/androidTest/java/com/casic/dcms/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.casic.dcms;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.casic.dcms", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7651c6f
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
new file mode 100644
index 0000000..f036dfb
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/HomeRecycleAdapter.java
@@ -0,0 +1,75 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.Constant;
+
+public class HomeRecycleAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+
+ public HomeRecycleAdapter(Context context) {
+ this.context = context;
+ }
+
+ @NonNull
+ @Override
+ public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(context).inflate(R.layout.item_home_recycleview, parent, false);
+ return new ItemViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
+ holder.bindView(context, position);
+ if (clickListener != null) {
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return Constant.ITEMS.size();
+ }
+
+ private OnGridItemClickListener clickListener;
+
+ public interface OnGridItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnGridItemClickListener(OnGridItemClickListener onGridItemClickListener) {
+ this.clickListener = onGridItemClickListener;
+ }
+
+ static class ItemViewHolder extends RecyclerView.ViewHolder {
+
+ private ImageView imageView;
+ private TextView textView;
+
+ ItemViewHolder(@NonNull View itemView) {
+ super(itemView);
+ imageView = itemView.findViewById(R.id.imageView);
+ textView = itemView.findViewById(R.id.textView);
+ }
+
+ void bindView(Context context, int position) {
+ imageView.setBackgroundResource(Constant.ICONS.get(position));
+ textView.setText(Constant.ITEMS.get(position));
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
new file mode 100644
index 0000000..5ac7a3b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/ImageGridViewAdapter.java
@@ -0,0 +1,87 @@
+package com.casic.dcms.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.casic.dcms.R;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.List;
+
+/**
+ * @Author: Pengxh
+ * @Time: 2021/4/7 17:17
+ * @Emain: 290677893@qq.com
+ **/
+public class ImageGridViewAdapter extends BaseAdapter {
+
+ private static final String TAG = "ImageGridViewAdapter";
+ private Context context;
+ private List mediaList;
+ private LayoutInflater inflater;
+
+ public ImageGridViewAdapter(Context mContext, List selectList) {
+ this.context = mContext;
+ this.mediaList = selectList;
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return mediaList == null ? 0 : mediaList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mediaList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ItemViewHolder itemViewHolder;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.item_select_gridview, null);
+ itemViewHolder = new ItemViewHolder();
+ itemViewHolder.imageView = convertView.findViewById(R.id.imageView);
+ itemViewHolder.deleteView = convertView.findViewById(R.id.deleteView);
+ convertView.setTag(itemViewHolder);
+ } else {
+ itemViewHolder = (ItemViewHolder) convertView.getTag();
+ }
+ Glide.with(context).load(mediaList.get(position).getRealPath()).into(itemViewHolder.imageView);
+ if (clickListener != null) {
+ itemViewHolder.deleteView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clickListener.onClick(position);
+ }
+ });
+ }
+ return convertView;
+ }
+
+ private static class ItemViewHolder {
+ private ImageView imageView;
+ private ImageView deleteView;
+ }
+
+ private OnDeleteItemClickListener clickListener;
+
+ public interface OnDeleteItemClickListener {
+ void onClick(int position);
+ }
+
+ public void setOnDeleteClickListener(OnDeleteItemClickListener deleteItemClickListener) {
+ this.clickListener = deleteItemClickListener;
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
new file mode 100644
index 0000000..34195af
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/adapter/MainPageAdapter.java
@@ -0,0 +1,29 @@
+package com.casic.dcms.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import java.util.List;
+
+public class MainPageAdapter extends FragmentPagerAdapter {
+
+ private List fragmentList;
+
+ public MainPageAdapter(@NonNull FragmentManager fm, List pages) {
+ super(fm);
+ this.fragmentList = pages;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return fragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return fragmentList.size();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseActivity.java b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
new file mode 100644
index 0000000..9213f3c
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseActivity.java
@@ -0,0 +1,46 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.casic.dcms.R;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
+
+import butterknife.ButterKnife;
+
+public abstract class BaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(initLayoutView());
+ ButterKnife.bind(this);
+ QMUIStatusBarHelper.translucent(this);//沉浸式状态栏
+ setupTopBarLayout();
+ initData();
+ initEvent();
+ }
+
+ /**
+ * 初始化xml布局
+ */
+ public abstract int initLayoutView();
+
+ /**
+ * 特定页面定制沉浸式状态栏
+ */
+ protected abstract void setupTopBarLayout();
+
+ /**
+ * 初始化默认数据
+ */
+ public abstract void initData();
+
+ /**
+ * 初始化业务逻辑
+ */
+ public abstract void initEvent();
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseApplication.java b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
new file mode 100644
index 0000000..6150788
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseApplication.java
@@ -0,0 +1,19 @@
+package com.casic.dcms.base;
+
+import android.app.Application;
+
+import com.casic.dcms.R;
+import com.casic.dcms.utils.SaveKeyValues;
+import com.mapbox.mapboxsdk.Mapbox;
+import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
+
+public class BaseApplication extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ QMUISwipeBackActivityManager.init(this);
+ SaveKeyValues.initSharedPreferences(this);
+ //MapBox地图注册
+ Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/BaseFragment.java b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
new file mode 100644
index 0000000..ed6949b
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/BaseFragment.java
@@ -0,0 +1,45 @@
+package com.casic.dcms.base;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+public abstract class BaseFragment extends Fragment {
+
+ private Unbinder bind;
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(initLayoutView(), container, false);
+ bind = ButterKnife.bind(this, view);
+ return view;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ initData();
+ initEvent();
+ }
+
+ protected abstract int initLayoutView();
+
+ protected abstract void initData();
+
+ protected abstract void initEvent();
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ bind.unbind();
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
new file mode 100644
index 0000000..6fc764e
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/base/DoubleClickExitActivity.java
@@ -0,0 +1,23 @@
+package com.casic.dcms.base;
+
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+public abstract class DoubleClickExitActivity extends BaseActivity {
+
+ private long clickTime = 0;
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (System.currentTimeMillis() - clickTime > 2000) {
+ Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
+ clickTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
new file mode 100644
index 0000000..b3b1e44
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/LoginResultBean.java
@@ -0,0 +1,74 @@
+package com.casic.dcms.bean;
+
+public class LoginResultBean {
+
+ /**
+ * code : 200
+ * data : {"kaptcha":"","token":"e2dc5885-c830-4773-ba63-9f6f4efdc0fd"}
+ * message : 登录成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * kaptcha :
+ * token : e2dc5885-c830-4773-ba63-9f6f4efdc0fd
+ */
+
+ private String kaptcha;
+ private String token;
+
+ public String getKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(String kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
new file mode 100644
index 0000000..1298cd3
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/PublicKeyBean.java
@@ -0,0 +1,97 @@
+package com.casic.dcms.bean;
+
+/**
+ * PublicKey 登录校验Key
+ */
+public class PublicKeyBean {
+
+ /**
+ * code : 200
+ * data : {"appKaptcha":false,"kaptcha":false,"publicKey":"","sid":"a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d"}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * appKaptcha : false
+ * kaptcha : false
+ * publicKey :
+ * sid : a084d9c0-6ac5-46f4-b9d7-b6edabb31b6d
+ */
+
+ private boolean appKaptcha;
+ private boolean kaptcha;
+ private String publicKey;
+ private String sid;
+
+ public boolean isAppKaptcha() {
+ return appKaptcha;
+ }
+
+ public void setAppKaptcha(boolean appKaptcha) {
+ this.appKaptcha = appKaptcha;
+ }
+
+ public boolean isKaptcha() {
+ return kaptcha;
+ }
+
+ public void setKaptcha(boolean kaptcha) {
+ this.kaptcha = kaptcha;
+ }
+
+ public String getPublicKey() {
+ return publicKey;
+ }
+
+ public void setPublicKey(String publicKey) {
+ this.publicKey = publicKey;
+ }
+
+ public String getSid() {
+ return sid;
+ }
+
+ public void setSid(String sid) {
+ this.sid = sid;
+ }
+ }
+}
diff --git a/app/src/main/java/com/casic/dcms/bean/UserBean.java b/app/src/main/java/com/casic/dcms/bean/UserBean.java
new file mode 100644
index 0000000..31ec3a0
--- /dev/null
+++ b/app/src/main/java/com/casic/dcms/bean/UserBean.java
@@ -0,0 +1,422 @@
+package com.casic.dcms.bean;
+
+import java.util.List;
+
+public class UserBean {
+
+ /**
+ * code : 200
+ * data : {"account":"cgjd01","attr1":"","avatar":"","bizData":"","dataScope":["1177026995528237058"],"deptId":"1177026995528237058","deptName":"指挥中心","devices":[{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}],"id":"1177050541084160002","ipAddr":"111.198.10.15","name":"王金龙","phone":"18600202669","roleList":["1177029183042322434"],"roleNames":["监督员"],"roleTips":["supervisor"],"scopeType":"4","sysData":"","targetId":"","targetName":"","tenantId":""}
+ * message : 请求成功
+ * success : true
+ */
+
+ private int code;
+ private DataBean data;
+ private String message;
+ private boolean success;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public DataBean getData() {
+ return data;
+ }
+
+ public void setData(DataBean data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public static class DataBean {
+ /**
+ * account : cgjd01
+ * attr1 :
+ * avatar :
+ * bizData :
+ * dataScope : ["1177026995528237058"]
+ * deptId : 1177026995528237058
+ * deptName : 指挥中心
+ * devices : [{"account":"","deptId":"","deptName":"","deviceName":"12345","id":"1349258555972796417","imei":"1234","lastTime":"2021-01-13","lastTimeFmt":"","name":"","networkNumber":"1234","onLine":false,"phone":"","positionLat":"","positionLng":"","targetId":"","userId":"1177050541084160002"}]
+ * id : 1177050541084160002
+ * ipAddr : 111.198.10.15
+ * name : 王金龙
+ * phone : 18600202669
+ * roleList : ["1177029183042322434"]
+ * roleNames : ["监督员"]
+ * roleTips : ["supervisor"]
+ * scopeType : 4
+ * sysData :
+ * targetId :
+ * targetName :
+ * tenantId :
+ */
+
+ private String account;
+ private String attr1;
+ private String avatar;
+ private String bizData;
+ private String deptId;
+ private String deptName;
+ private String id;
+ private String ipAddr;
+ private String name;
+ private String phone;
+ private String scopeType;
+ private String sysData;
+ private String targetId;
+ private String targetName;
+ private String tenantId;
+ private List dataScope;
+ private List devices;
+ private List roleList;
+ private List roleNames;
+ private List roleTips;
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getAttr1() {
+ return attr1;
+ }
+
+ public void setAttr1(String attr1) {
+ this.attr1 = attr1;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public void setAvatar(String avatar) {
+ this.avatar = avatar;
+ }
+
+ public String getBizData() {
+ return bizData;
+ }
+
+ public void setBizData(String bizData) {
+ this.bizData = bizData;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getDeptName() {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName) {
+ this.deptName = deptName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getIpAddr() {
+ return ipAddr;
+ }
+
+ public void setIpAddr(String ipAddr) {
+ this.ipAddr = ipAddr;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getScopeType() {
+ return scopeType;
+ }
+
+ public void setScopeType(String scopeType) {
+ this.scopeType = scopeType;
+ }
+
+ public String getSysData() {
+ return sysData;
+ }
+
+ public void setSysData(String sysData) {
+ this.sysData = sysData;
+ }
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public void setTargetName(String targetName) {
+ this.targetName = targetName;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public List getDataScope() {
+ return dataScope;
+ }
+
+ public void setDataScope(List