Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
637296d769 | ||
|
|
4f7f5d6a73 | ||
|
|
97e588b283 | ||
|
|
2dc947bacb |
+22
-38
@@ -3,7 +3,6 @@ plugins {
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.huawei.agconnect'
|
||||
id 'kotlin-android-extensions'
|
||||
}
|
||||
|
||||
android {
|
||||
@@ -16,29 +15,27 @@ android {
|
||||
keyPassword '123456'
|
||||
storeFile file('key.jks')
|
||||
storePassword '123456'
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
// debug {
|
||||
// keyAlias 'key0'
|
||||
// keyPassword '123456'
|
||||
// storeFile file('key.jks')
|
||||
// storePassword '123456'
|
||||
// }
|
||||
// release {
|
||||
// keyAlias 'key0'
|
||||
// keyPassword '123456'
|
||||
// storeFile file('key.jks')
|
||||
// storePassword '123456'
|
||||
// }
|
||||
debug {
|
||||
keyAlias 'key0'
|
||||
keyPassword '123456'
|
||||
storeFile file('key.jks')
|
||||
storePassword '123456'
|
||||
}
|
||||
release {
|
||||
keyAlias 'key0'
|
||||
keyPassword '123456'
|
||||
storeFile file('key.jks')
|
||||
storePassword '123456'
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||
minSdkVersion 23
|
||||
minSdkVersion 22
|
||||
targetSdkVersion 30
|
||||
versionCode 57
|
||||
versionName "3.2.7"
|
||||
versionCode 51
|
||||
versionName "3.2.0"
|
||||
flavorDimensions "CHANNEL_VALUE"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
javaCompileOptions {
|
||||
@@ -88,10 +85,9 @@ android {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.config
|
||||
}
|
||||
debug {
|
||||
signingConfig signingConfigs.config
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
@@ -115,20 +111,14 @@ android {
|
||||
|
||||
productFlavors {
|
||||
qa {
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "好运司机测试"]
|
||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
||||
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
|
||||
buildConfigField "boolean", "isTest", "true"
|
||||
//APP名称,可以在androidMainfest中引用
|
||||
resValue "string", "appName", "司机测试"
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机"]
|
||||
buildConfigField("String", "OPEN_API_URL", "\"http://192.168.111.244:4009\"")
|
||||
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
|
||||
}
|
||||
product {
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机"]
|
||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
|
||||
buildConfigField("String", "OPEN_API_URL", "\"https://oapi.alct56.com\"")
|
||||
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
|
||||
buildConfigField "boolean", "isTest", "false"
|
||||
//APP名称,可以在androidMainfest中引用
|
||||
resValue "string", "appName", "大河好运司机"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -140,14 +130,9 @@ android {
|
||||
android.applicationVariants.all { variant ->
|
||||
variant.outputs.all {
|
||||
def date = new Date().format("MMdd_HH-mm" , TimeZone.getTimeZone("GMT+08"))
|
||||
def isText = variant.productFlavors[0].properties.get("buildConfigFields").getAt("isTest").properties.get("value")
|
||||
def appName = null
|
||||
if (isText=="true") {
|
||||
appName = '大河好运司机测试_'
|
||||
}else{
|
||||
appName = '大河好运司机_'
|
||||
if(variant.buildType.name.equals('release')){
|
||||
outputFileName = "dhhy-driver-"+date+"-${versionName}.apk"
|
||||
}
|
||||
outputFileName =appName+"${variant.buildType.name}_${defaultConfig.versionName}_${date}.apk"
|
||||
}
|
||||
}
|
||||
lintOptions {
|
||||
@@ -233,6 +218,5 @@ dependencies {
|
||||
implementation 'com.github.getActivity:XToast:8.2'
|
||||
|
||||
implementation project(path: ':mylibrary')
|
||||
implementation project(path: ':ocr_ui')
|
||||
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.arpa.hndahesudintocctmsdriver">
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||
<!-- 白名单 -->
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
<uses-permission android:name="com.huawei.permission.external_app_settings.USE_COMPONENT"/>
|
||||
<!-- 基础权限 -->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
@@ -54,31 +54,54 @@
|
||||
android:allowBackup="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:icon="@drawable/diver_logo"
|
||||
android:label="@string/appName"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="android:label,android:allowBackup">
|
||||
tools:replace="android:icon">
|
||||
|
||||
<uses-library
|
||||
android:name="com/alct/mdp"
|
||||
android:required="false" />
|
||||
|
||||
<service
|
||||
android:name=".ui.text.TestNotificationListenerService"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"><!--必要的绑定权限-->
|
||||
<intent-filter>
|
||||
<action android:name="android.service.notification.NotificationListenerService" /><!--必要的action-->
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service
|
||||
android:name=".ui.text.TestService"
|
||||
android:directBootAware="true"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:foregroundServiceType="phoneCall|mediaPlayback|dataSync|mediaProjection|connectedDevice|location" />
|
||||
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" ></activity>
|
||||
android:screenOrientation="portrait"></activity>
|
||||
|
||||
<activity
|
||||
android:name=".ui.text.TextActivity"
|
||||
android:exported="true">
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.wallet.WithdrawalActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.OrderAllActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@@ -93,10 +116,17 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.PhotoCarActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.VehicleAuthActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity"
|
||||
android:screenOrientation="portrait">
|
||||
@@ -109,30 +139,16 @@
|
||||
<data android:mimeType="*/*" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity2"
|
||||
android:screenOrientation="portrait">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<data android:mimeType="*/*" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.GetShangChuanActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AuthQualificationActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.OrderListActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.HuoYunDelActivity"
|
||||
android:screenOrientation="portrait">
|
||||
@@ -145,13 +161,13 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AddCarSuccActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.WelcomeActivity"
|
||||
android:screenOrientation="portrait">
|
||||
@@ -174,10 +190,10 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.drivercircle.VideoReleaseActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.WebPDFActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity"
|
||||
android:screenOrientation="portrait">
|
||||
@@ -185,13 +201,13 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.drivercircle.HomePageActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.alert.VehicleChoiceActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.OrderComplaintActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity"
|
||||
android:screenOrientation="portrait"
|
||||
@@ -205,7 +221,7 @@
|
||||
<activity
|
||||
android:name=".ui.news.NewActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
|
||||
<service
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.service.TrackService"
|
||||
@@ -248,7 +264,7 @@
|
||||
<meta-data
|
||||
android:name="com.amap.api.v2.apikey"
|
||||
android:value="78019612271411eca3af34db91930620" />
|
||||
<!-- android:value="702eaa84675618b8eb69298d9fd42ca3" />-->
|
||||
<!-- android:value="702eaa84675618b8eb69298d9fd42ca3" />-->
|
||||
|
||||
<service android:name="com.amap.api.location.APSService"></service>
|
||||
|
||||
@@ -341,27 +357,6 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".H5Activity"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:host="demo"
|
||||
android:path="/signBack"
|
||||
android:scheme="esign" />
|
||||
<data
|
||||
android:host="demo"
|
||||
android:path="/realBack"
|
||||
android:scheme="esign" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.push.XService"
|
||||
android:enabled="true"
|
||||
|
||||
@@ -2,47 +2,54 @@ package com.arpa.hndahesudintocctmsdriver;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.Application;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.Api;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.BillLocationUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.text.TestNotificationListenerService;
|
||||
import com.dahe.mylibrary.CommonBaseLibrary;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.gyf.cactus.Cactus;
|
||||
import com.gyf.cactus.callback.CactusBackgroundCallback;
|
||||
import com.gyf.cactus.callback.CactusCallback;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
|
||||
import cn.jiguang.verifysdk.api.JVerificationInterface;
|
||||
|
||||
public class App extends Application {
|
||||
|
||||
// String key = "f9d35b1133cff1f6e3960c89b249e03f";
|
||||
String key = "19ac0aa74338e487e45057faf7212401";
|
||||
String license = "HF41uGxM/1i3CtW98DimoA97BlNTAnQ+DiEAihYmZ2jR1jqC4be253joEJbOJgFDIzp5aIoeuXSWWHFaDVfaHL2Pksbq5f8M8EqsVhP9q/i1xGYSYf6MJVlHdMAVLWgR0Kra+n8dVzkSDuZeyJuDsskAmZaGFQN1CqnWYCI1tmV1Tk4A57e9LQMed0U11QWjdshdU2DGqBXKmGE419PdW3NmIxOR2u9iB1OKBmvzCUT8RAYyBzSn/yhU++YJ25g5a8Pb5kOvi+eOh+PEFEcQL6oOp/CF4Iw5nadlsLhc+XEnVJpwL2myZBoSlVcKxrJKbRn1/DIgXBueKKnqhyHKdJlpqI9eghAlRF0p2Q4f23m89mWRZf4nhKzTeXGIjCTFO4TNVucrlGU7tyJcrRCDVdfV24fziH+hB3QGckpuYzzjefr7hZalLRJ/w8dPw/8dCY1wnWq3AJ3zw2g1PzMxl51q7AgdKvwc1ERcGBns0zb8PK6vGKCnJq3uHiJEnslbTI0MEosje+h+OPO7hf2QofErewjI19wHEOv4dTvuFLh3VmGFMObAmov5kI47705fjSxCvAPGATBrfUSwim+5EQ1hanc5IcXe0/nOTiRUNEpZ+x65zVydqAs7490yqQiIUQvPazEwcal7vH2OD54lCcgpxKxqdmGc5/bp5UnqB45+n+iuInV/Q9DMOQVk15uaVZmhS8VaCqH21CmfH/ZGLb9wiEpaRLrPZLKX3bK7MT9Z0/OlDnb2QUKU8LMMIhLuQQntzsf0Wn4kA/0e9QAJJQ==";
|
||||
|
||||
// String license = "eQQm7gCZPF58Cy4i9OGkqSdFdDnFF0VSUVpw92WcrNLx7zVbpGJwjQhnKL8b0piApIbOTog5log/S1ZIxoUQogueaG84BQlJfRwKjtvpVWImlmhthQyQd2ogRqGkm3rkVGeG9wK49fzP3g5AtghNF05je2rQWd/Tyy/wutXq0e0rvR/bEckFaZ4BesQaYd0MejFC3lA8BjxNWiuvCKs15e1aRUOU5vwN5wsaTsTHokBIYhioSxOoGgHn6NrX6K9Dsl9uTWZ2dOVK/jEzYsNt6E/1Ww2ck1XmIWdRCQNmCpgikuPT0ACAL/w7UaRoWzM/Pm+akWqyp+bEavHT1Vhug3HAHOSGfOghGw2NerNlyEg8h6cVneMx+TsidnQ0ZG29aqdcLBRsvi26BYJJCA8+0WXjT+73RhS8g97Rfb6h0/W//5Az8UNZ6dp6XvUi2EJXQRhY5hkHiuwWT2W1ik+6wiiURkkrBACKbO1kmZWbVpRIe3Y3pcr3Q/V+oAcyPHRXCxu+JIe/j40/epuRrCyf8yvKsZ2Dnkl4QQmlwNqlW1F/arS+19G6zOG+6VKwtbI01A1R9SU1TYOA5UL/Qpo6Gyi3Ec3/irgQlzkq1rZrOIS4oo6tghul/zcG8rjno3luqHYwIZf8vAVfpwBesIVcANCOIuTRPU3A8vdmUoK/twGIchPapmjlAzLhjZ4KoAbNeMsWu3sN6kF44xofLMghos2X8OtvUA9CMD37v2FpYoM75qavyoivsBAbb6mG0p5TmkZ37BxfaGGP6SYrCa9ygQ==";
|
||||
String key = "f9d35b1133cff1f6e3960c89b249e03f";
|
||||
String license = "eQQm7gCZPF58Cy4i9OGkqSdFdDnFF0VSUVpw92WcrNLx7zVbpGJwjQhnKL8b0piApIbOTog5log/S1ZIxoUQogueaG84BQlJfRwKjtvpVWImlmhthQyQd2ogRqGkm3rkVGeG9wK49fzP3g5AtghNF05je2rQWd/Tyy/wutXq0e0rvR/bEckFaZ4BesQaYd0MejFC3lA8BjxNWiuvCKs15e1aRUOU5vwN5wsaTsTHokBIYhioSxOoGgHn6NrX6K9Dsl9uTWZ2dOVK/jEzYsNt6E/1Ww2ck1XmIWdRCQNmCpgikuPT0ACAL/w7UaRoWzM/Pm+akWqyp+bEavHT1Vhug3HAHOSGfOghGw2NerNlyEg8h6cVneMx+TsidnQ0ZG29aqdcLBRsvi26BYJJCA8+0WXjT+73RhS8g97Rfb6h0/W//5Az8UNZ6dp6XvUi2EJXQRhY5hkHiuwWT2W1ik+6wiiURkkrBACKbO1kmZWbVpRIe3Y3pcr3Q/V+oAcyPHRXCxu+JIe/j40/epuRrCyf8yvKsZ2Dnkl4QQmlwNqlW1F/arS+19G6zOG+6VKwtbI01A1R9SU1TYOA5UL/Qpo6Gyi3Ec3/irgQlzkq1rZrOIS4oo6tghul/zcG8rjno3luqHYwIZf8vAVfpwBesIVcANCOIuTRPU3A8vdmUoK/twGIchPapmjlAzLhjZ4KoAbNeMsWu3sN6kF44xofLMghos2X8OtvUA9CMD37v2FpYoM75qavyoivsBAbb6mG0p5TmkZ37BxfaGGP6SYrCa9ygQ==";
|
||||
|
||||
public final static int APP_STATUS_KILLED = 0; // 表示应用是被杀死后在启动的
|
||||
public final static int APP_STATUS_NORMAL = 1; // 表示应用时正常的启动流程
|
||||
public static int APP_STATUS = APP_STATUS_KILLED; // 记录App的启动状态
|
||||
private Context con;
|
||||
public static App mApplication = null;
|
||||
/**
|
||||
* 启动服务
|
||||
*/
|
||||
private void startService() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
/****************第三点*******************/
|
||||
//安卓8.0以上开启为前台服务
|
||||
startForegroundService(new Intent(this, App.class));
|
||||
} else {
|
||||
startService(new Intent(this, App.class));
|
||||
}
|
||||
startService(new Intent(this, TestNotificationListenerService.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
startService();
|
||||
mApplication = this;
|
||||
con = getBaseContext();
|
||||
CommonBaseLibrary.getInstance().init(this, Api.BASE_URL);
|
||||
@@ -57,7 +64,7 @@ public class App extends Application {
|
||||
//安联初始化
|
||||
if (context.getPackageName().equals(getCurrentProcessName(context))) {
|
||||
//Log.e("--使用的测试环境--",BuildConfig.OPEN_API_URL);
|
||||
MDPLocationCollectionManager.initialize(this, BuildConfig.OPEN_AL_URL);
|
||||
MDPLocationCollectionManager.initialize(this, "https://oapi.alct56.com");
|
||||
}
|
||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||
// 路由初始化
|
||||
@@ -76,29 +83,17 @@ public class App extends Application {
|
||||
}
|
||||
}
|
||||
|
||||
// PendingIntent pendingIntent =
|
||||
// PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
// Cactus.getInstance()
|
||||
// .isDebug(true)
|
||||
// //可选,设置通知栏点击事件
|
||||
// .setPendingIntent(pendingIntent)
|
||||
//// .setBackgroundMusicEnabled(true)//可选,退到后台是否可以播放音乐
|
||||
//// .setMusicId(R.raw.main) //可选,设置音乐
|
||||
//// .setPendingIntent(pendingIntent)//可选,设置通知栏点击事件
|
||||
//// .addCallback(new CactusCallback())//可选,运行时回调
|
||||
// .setCrashRestartUIEnabled(true) //可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
||||
// .setCrashRestartUIEnabled(true)//可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
||||
// .setTitle("大河好运")
|
||||
// .setSmallIcon(R.drawable.diver_logo)
|
||||
// .addBackgroundCallback(new CactusBackgroundCallback() {
|
||||
// @Override
|
||||
// public void onBackground(boolean b) {
|
||||
// if (b){
|
||||
// getBillLocation();
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// .register(this);
|
||||
Cactus.getInstance()
|
||||
.isDebug(true)
|
||||
// .setBackgroundMusicEnabled(true)//可选,退到后台是否可以播放音乐
|
||||
.setMusicId(R.raw.main) //可选,设置音乐
|
||||
// .setPendingIntent(pendingIntent)//可选,设置通知栏点击事件
|
||||
// .addCallback(new CactusCallback())//可选,运行时回调
|
||||
.setCrashRestartUIEnabled(true) //可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
||||
.setCrashRestartUIEnabled(true)//可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
||||
.setTitle("大河好运")
|
||||
.setSmallIcon(R.drawable.diver_logo)
|
||||
.register(this);
|
||||
}
|
||||
|
||||
public static App getApp() {
|
||||
@@ -119,10 +114,6 @@ public class App extends Application {
|
||||
UMConfigure.init(getApplicationContext(), UMConfigure.DEVICE_TYPE_PHONE, "");
|
||||
}
|
||||
|
||||
private void getBillLocation() {
|
||||
BillLocationUtils.getInstance().getBillLocation(con);
|
||||
}
|
||||
|
||||
private static String getCurrentProcessName(Context context) {
|
||||
String currentProcessName = "";
|
||||
int pid = android.os.Process.myPid();
|
||||
|
||||
@@ -1,502 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.net.http.SslError;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.webkit.ConsoleMessage;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.CookieSyncManager;
|
||||
import android.webkit.JsPromptResult;
|
||||
import android.webkit.JsResult;
|
||||
import android.webkit.PermissionRequest;
|
||||
import android.webkit.SslErrorHandler;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebResourceError;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.esign.esignsdk.h5.base.WBH5FaceVerifySDK;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
|
||||
import pub.devrel.easypermissions.EasyPermissions;
|
||||
|
||||
import static android.webkit.WebSettings.LOAD_NO_CACHE;
|
||||
|
||||
/**
|
||||
* @author xingtian on 2019/3/25
|
||||
*/
|
||||
public class H5Activity extends AppCompatActivity {
|
||||
|
||||
public static final int REQUEST_PERMISSION_STORAGE = 0x00;
|
||||
public static final int REQUEST_PERMISSION_CAMERA = 0x01;
|
||||
|
||||
public final static String SCHEMA_REAL = "esign://demo/realBack";
|
||||
|
||||
public final static String SCHEMA_SIGN = "esign://demo/signBack";
|
||||
|
||||
private WebView mWebView;
|
||||
|
||||
String curUrl = null;
|
||||
boolean viewFile = false;
|
||||
|
||||
long time = System.currentTimeMillis();
|
||||
|
||||
ValueCallback<Uri> uploadMessage;
|
||||
private ValueCallback<Uri[]> uploadMessageAboveL;
|
||||
private final static int FILE_CHOOSER_RESULT_CODE = 10000;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
super.setContentView(R.layout.activity_h5);
|
||||
|
||||
|
||||
mWebView = findViewById(R.id.webview);
|
||||
ImageView back = findViewById(R.id.back);
|
||||
TextView close = findViewById(R.id.close);
|
||||
WebSettings webSetting = mWebView.getSettings();
|
||||
|
||||
back.setOnClickListener(v -> {
|
||||
if (mWebView.canGoBack()) {
|
||||
mWebView.goBack();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
close.setOnClickListener(v -> {
|
||||
if (mWebView.canGoBack()) {
|
||||
mWebView.goBack();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
webSetting.setJavaScriptEnabled(true);
|
||||
webSetting.setDomStorageEnabled(true);
|
||||
webSetting.setAppCacheMaxSize(1024 * 1024 * 8);
|
||||
webSetting.setUseWideViewPort(true);
|
||||
webSetting.setLoadWithOverviewMode(true);
|
||||
webSetting.setAllowFileAccess(true);
|
||||
webSetting.setAppCacheEnabled(true);
|
||||
String appCachePath = getApplication().getCacheDir().getAbsolutePath();
|
||||
webSetting.setAppCachePath(appCachePath);
|
||||
webSetting.setDatabaseEnabled(true);
|
||||
webSetting.setCacheMode(LOAD_NO_CACHE);
|
||||
webSetting.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
WebView.setWebContentsDebuggingEnabled(true);
|
||||
}
|
||||
|
||||
CookieSyncManager.createInstance(this);
|
||||
CookieManager cookieManager = CookieManager.getInstance();
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
cookieManager.setAcceptThirdPartyCookies(mWebView, true);
|
||||
}
|
||||
cookieManager.setAcceptCookie(true);
|
||||
|
||||
|
||||
mWebView.setWebViewClient(new MyWebViewClient());
|
||||
mWebView.setWebChromeClient(new H5FaceWebChromeClient(this));
|
||||
|
||||
WBH5FaceVerifySDK.getInstance().setWebViewSettings(mWebView, getApplicationContext());
|
||||
|
||||
processExtraData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
mWebView.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mWebView.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
mWebView.stopLoading();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
try {
|
||||
if (mWebView != null) {
|
||||
mWebView.removeAllViews();
|
||||
mWebView.destroy();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
setIntent(intent);
|
||||
processExtraData();
|
||||
}
|
||||
|
||||
private void processExtraData() {
|
||||
|
||||
Intent intent = getIntent();
|
||||
Uri uri = intent.getData();
|
||||
Log.e("test", "===" + uri);
|
||||
if (uri != null) {
|
||||
// 芝麻认证刷脸结束返回获取后续操作页面地址
|
||||
// String callbackUrl = uri.getQueryParameter("callback");
|
||||
|
||||
String callbackUrl = uri.getQueryParameter("realnameUrl");
|
||||
if (!TextUtils.isEmpty(callbackUrl)) {
|
||||
try {
|
||||
mWebView.loadUrl(URLDecoder.decode(callbackUrl, "utf-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
String url = intent.getStringExtra("url");
|
||||
viewFile = intent.getBooleanExtra("view_file", false);
|
||||
if (url.startsWith("alipay")) {
|
||||
|
||||
try {
|
||||
Intent intent2 = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
startActivity(intent2);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
if (curUrl == null) {
|
||||
curUrl = url;
|
||||
}
|
||||
mWebView.loadUrl(url);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class MyWebViewClient extends WebViewClient {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
if (url == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Uri uri = Uri.parse(url);
|
||||
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
||||
|
||||
|
||||
// if (url.contains("callback")) {
|
||||
// // 实名认证结束 返回按钮/倒计时返回/暂不认证
|
||||
// boolean status = uri.getBooleanQueryParameter("passed", false);
|
||||
// if (status) {
|
||||
//
|
||||
// new Handler().postDelayed(() -> {
|
||||
// FaceEvent he = new FaceEvent("刷脸成功");
|
||||
// EventBus.getDefault().post(he);
|
||||
// finish();
|
||||
// }, 4000);
|
||||
// }else{
|
||||
// if (mWebView.canGoBack()) {
|
||||
// mWebView.goBack();
|
||||
// }
|
||||
// Toast.makeText(H5Activity.this, "认证失败,请重新刷脸认证", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
||||
view.loadUrl(url);
|
||||
return true;
|
||||
} else if (uri.getScheme().equals("js") || uri.getScheme().equals("jsbridge")) {
|
||||
|
||||
// js://signCallback?signResult=true 签署结果
|
||||
if (uri.getAuthority().equals("signCallback")) {
|
||||
if (viewFile) {
|
||||
view.loadUrl(curUrl);
|
||||
return true;
|
||||
} else {
|
||||
if (url.contains("signResult")) {
|
||||
boolean signResult = uri.getBooleanQueryParameter("signResult", false);
|
||||
Toast.makeText(H5Activity.this, "签署结果: " + " signResult = " + signResult, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
String tsignCode = uri.getQueryParameter("tsignCode");
|
||||
if ("0".equals(tsignCode)) {
|
||||
tsignCode = "签署成功";
|
||||
} else {
|
||||
tsignCode = "签署失败";
|
||||
}
|
||||
Toast.makeText(H5Activity.this, "签署结果: " + tsignCode, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
//js://tsignRealBack?esignAppScheme=esign://app/callback&serviceId=854677892133554052&verifycode=4a52e2af0d0abfb7b285c4f05b5af133&status=true&passed=true
|
||||
//实名结果
|
||||
if (uri.getAuthority().equals("tsignRealBack")) {
|
||||
//实名结果字段
|
||||
if (uri.getQueryParameter("verifycode") != null) {
|
||||
String realVerifyCode = uri.getQueryParameter("verifycode");
|
||||
}
|
||||
// 实名认证结束 返回按钮/倒计时返回/暂不认证
|
||||
boolean status = uri.getBooleanQueryParameter("status", false);
|
||||
if (status) {
|
||||
//认证成功返回
|
||||
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if (url.startsWith(SCHEMA_REAL)) {
|
||||
//esign://app/realBack&serviceId=854677892133554052&verifycode=4a52e2af0d0abfb7b285c4f05b5af133&status=true&passed=true
|
||||
|
||||
//实名结果
|
||||
if (uri.getQueryParameter("verifycode") != null) {
|
||||
String realVerifyCode = uri.getQueryParameter("verifycode");
|
||||
}
|
||||
// 实名认证结束 返回按钮/倒计时返回/暂不认证
|
||||
boolean status = uri.getBooleanQueryParameter("status", false);
|
||||
if (status) {
|
||||
//认证成功返回
|
||||
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (url.startsWith(SCHEMA_SIGN)) {
|
||||
// js://signCallback?signResult=true 签署结果
|
||||
if (url.contains("signResult")) {
|
||||
boolean signResult = uri.getBooleanQueryParameter("signResult", false);
|
||||
Toast.makeText(H5Activity.this, "签署结果: " + " signResult = " + signResult, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
String tsignCode = uri.getQueryParameter("tsignCode");
|
||||
if ("0".equals(tsignCode)) {
|
||||
//延时1.5秒跳转运单详情页面
|
||||
new Handler().postDelayed(() -> {
|
||||
FaceEvent he = new FaceEvent("刷脸成功");
|
||||
EventBus.getDefault().post(he);
|
||||
finish();
|
||||
}, 800);
|
||||
tsignCode = "签署成功";
|
||||
} else {
|
||||
tsignCode = "签署失败";
|
||||
}
|
||||
Toast.makeText(H5Activity.this, "签署结果: " + tsignCode, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
// finish();
|
||||
return true;
|
||||
} else if (uri.getScheme().equals("alipays")) {
|
||||
// 跳转到支付宝刷脸
|
||||
// alipays://platformapi/startapp?appId=20000067&pd=NO&url=https%3A%2F%2Fzmcustprod.zmxy.com.cn%2Fcertify%2Fbegin.htm%3Ftoken%3DZM201811133000000050500431389414
|
||||
try {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
|
||||
super.onReceivedError(view, request, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||
// super.onReceivedSslError(view, handler, error);
|
||||
handler.proceed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||
super.onPageStarted(view, url, favicon);
|
||||
time = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadResource(WebView view, String url) {
|
||||
super.onLoadResource(view, url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class H5FaceWebChromeClient extends WebChromeClient {
|
||||
private Activity activity;
|
||||
|
||||
public H5FaceWebChromeClient(Activity mActivity) {
|
||||
this.activity = mActivity;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onReceivedTitle(WebView view, String title) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
|
||||
return super.onJsPrompt(view, url, message, defaultValue, result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onJsConfirm(WebView view, String url, String message, JsResult result) {
|
||||
return super.onJsConfirm(view, url, message, result);
|
||||
}
|
||||
|
||||
@TargetApi(8)
|
||||
@Override
|
||||
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
|
||||
return super.onConsoleMessage(consoleMessage);
|
||||
}
|
||||
|
||||
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType) {
|
||||
if (WBH5FaceVerifySDK.getInstance().recordVideoForApiBelow21(uploadMsg, acceptType, activity)) {
|
||||
return;
|
||||
}
|
||||
uploadMessage = uploadMsg;
|
||||
}
|
||||
|
||||
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) {
|
||||
if (WBH5FaceVerifySDK.getInstance().recordVideoForApiBelow21(uploadMsg, acceptType, activity)) {
|
||||
return;
|
||||
}
|
||||
uploadMessage = uploadMessage;
|
||||
}
|
||||
|
||||
@TargetApi(21)
|
||||
@Override
|
||||
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
|
||||
if (WBH5FaceVerifySDK.getInstance().recordVideoForApi21(webView, filePathCallback, activity, fileChooserParams)) {
|
||||
return true;
|
||||
}
|
||||
uploadMessageAboveL = filePathCallback;
|
||||
recordVideo(H5Activity.this);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPermissionRequest(PermissionRequest request) {
|
||||
request.grant(request.getResources());
|
||||
request.getOrigin();
|
||||
}
|
||||
}
|
||||
|
||||
public void recordVideo(Activity activity) {
|
||||
if (EasyPermissions.hasPermissions(activity, Manifest.permission.CAMERA)) {
|
||||
try {
|
||||
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
intent.putExtra("android.intent.extras.CAMERA_FACING", 1); // 调用前置摄像头
|
||||
activity.startActivityForResult(intent, FILE_CHOOSER_RESULT_CODE);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
EasyPermissions.requestPermissions(activity, "请同意使用相机功能", REQUEST_PERMISSION_CAMERA, Manifest.permission.CAMERA);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
if (mWebView.canGoBack()) {
|
||||
mWebView.goBack();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if (WBH5FaceVerifySDK.getInstance().receiveH5FaceVerifyResult(requestCode, resultCode, data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (requestCode == FILE_CHOOSER_RESULT_CODE) {
|
||||
if (null == uploadMessage && null == uploadMessageAboveL) {
|
||||
return;
|
||||
}
|
||||
Uri result = data == null || resultCode != RESULT_OK ? null : data.getData();
|
||||
if (uploadMessageAboveL != null) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
uploadMessageAboveL.onReceiveValue(new Uri[]{result});
|
||||
uploadMessageAboveL = null;
|
||||
} else {
|
||||
uploadMessageAboveL.onReceiveValue(new Uri[]{});
|
||||
uploadMessageAboveL = null;
|
||||
}
|
||||
} else if (uploadMessage != null) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
uploadMessage.onReceiveValue(result);
|
||||
uploadMessage = null;
|
||||
} else {
|
||||
uploadMessage.onReceiveValue(Uri.EMPTY);
|
||||
uploadMessage = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
WBH5FaceVerifySDK.getInstance().recordVideo(this);
|
||||
}
|
||||
}
|
||||
@@ -77,15 +77,6 @@ public class CarDelBean {
|
||||
private String registerNo;
|
||||
private String carEnergyTypValue;
|
||||
private String carPlateColorValue;
|
||||
private String needUpQCPhoto;
|
||||
|
||||
public String getNeedUpQCPhoto() {
|
||||
return needUpQCPhoto;
|
||||
}
|
||||
|
||||
public void setNeedUpQCPhoto(String needUpQCPhoto) {
|
||||
this.needUpQCPhoto = needUpQCPhoto;
|
||||
}
|
||||
|
||||
public String getCarPlateColorValue() {
|
||||
return carPlateColorValue;
|
||||
|
||||
@@ -1,150 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName CarInfoBean
|
||||
* @Author 用户
|
||||
* @Date 2023/8/17 15:35
|
||||
* @Description TODO
|
||||
*/
|
||||
public class CarInfoBean {
|
||||
|
||||
|
||||
private int code;
|
||||
private DataDTO data;
|
||||
private String msg;
|
||||
private int res;
|
||||
private Boolean success;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public DataDTO getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataDTO data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getRes() {
|
||||
return res;
|
||||
}
|
||||
|
||||
public void setRes(int res) {
|
||||
this.res = res;
|
||||
}
|
||||
|
||||
public Boolean getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(Boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public static class DataDTO {
|
||||
private Object code;
|
||||
private DataDTO.DataDTO2 data;
|
||||
private Object message;
|
||||
private String forceMatching;
|
||||
|
||||
|
||||
public String getForceMatching() {
|
||||
return forceMatching;
|
||||
}
|
||||
|
||||
public void setForceMatching(String forceMatching) {
|
||||
this.forceMatching = forceMatching;
|
||||
}
|
||||
|
||||
public Object getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Object code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public DataDTO2 getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataDTO2 data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public Object getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(Object message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public static class DataDTO2 {
|
||||
private List<DataDTO.DataDTO2.PrismKeyValueInfoDTO> prism_keyValueInfo;
|
||||
|
||||
public List<DataDTO.DataDTO2.PrismKeyValueInfoDTO> getPrism_keyValueInfo() {
|
||||
return prism_keyValueInfo;
|
||||
}
|
||||
|
||||
public void setPrism_keyValueInfo(List<DataDTO.DataDTO2.PrismKeyValueInfoDTO> prism_keyValueInfo) {
|
||||
this.prism_keyValueInfo = prism_keyValueInfo;
|
||||
}
|
||||
|
||||
public static class PrismKeyValueInfoDTO {
|
||||
private int keyProb;
|
||||
private int valueProb;
|
||||
private String value;
|
||||
private String key;
|
||||
|
||||
public int getKeyProb() {
|
||||
return keyProb;
|
||||
}
|
||||
|
||||
public void setKeyProb(int keyProb) {
|
||||
this.keyProb = keyProb;
|
||||
}
|
||||
|
||||
public int getValueProb() {
|
||||
return valueProb;
|
||||
}
|
||||
|
||||
public void setValueProb(int valueProb) {
|
||||
this.valueProb = valueProb;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,33 +56,6 @@ public class CarZhengBean {
|
||||
|
||||
public static class DataDTO {
|
||||
private int carId;
|
||||
private String needUpQCPhoto;
|
||||
private String isTrailer;
|
||||
private String needUpRLPhoto;
|
||||
|
||||
public String getNeedUpRLPhoto() {
|
||||
return needUpRLPhoto;
|
||||
}
|
||||
|
||||
public void setNeedUpRLPhoto(String needUpRLPhoto) {
|
||||
this.needUpRLPhoto = needUpRLPhoto;
|
||||
}
|
||||
|
||||
public String getIsTrailer() {
|
||||
return isTrailer;
|
||||
}
|
||||
|
||||
public void setIsTrailer(String isTrailer) {
|
||||
this.isTrailer = isTrailer;
|
||||
}
|
||||
|
||||
public String getNeedUpQCPhoto() {
|
||||
return needUpQCPhoto;
|
||||
}
|
||||
|
||||
public void setNeedUpQCPhoto(String needUpQCPhoto) {
|
||||
this.needUpQCPhoto = needUpQCPhoto;
|
||||
}
|
||||
|
||||
public int getCarId() {
|
||||
return carId;
|
||||
|
||||
@@ -257,7 +257,6 @@ public class StartOrderBean {
|
||||
private String realityTimeDate;
|
||||
private int status;
|
||||
private String longitude;
|
||||
private String imageTakenDate;
|
||||
private String latitude;
|
||||
private List<GoodsDTO> goods;
|
||||
private int report;
|
||||
@@ -281,14 +280,6 @@ public class StartOrderBean {
|
||||
private String distance;
|
||||
private int isEvaluation;
|
||||
|
||||
public String getImageTakenDate() {
|
||||
return imageTakenDate;
|
||||
}
|
||||
|
||||
public void setImageTakenDate(String imageTakenDate) {
|
||||
this.imageTakenDate = imageTakenDate;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.constant;
|
||||
|
||||
/**
|
||||
* @ClassName HYConstant
|
||||
* @Author 用户
|
||||
* @Date 2023/8/29 09:32
|
||||
* @Description TODO
|
||||
*/
|
||||
public class HYConstant {
|
||||
|
||||
//-------------安联---------------start
|
||||
//企业代码
|
||||
private static final String ENTERPRISE_CODE="E0019169";
|
||||
//企业app的身份码
|
||||
private static final String APP_IDENTITY="b4a472a025e443b383970cdd5465552e";
|
||||
//企业app验证码
|
||||
private static final String APP_KEY="b948efbb4c2a4ba0805c534f2fba0c89";
|
||||
|
||||
//企业代码-测试
|
||||
private static final String ENTERPRISE_CODE_TEXT="E0019093";
|
||||
//企业app的身份码-测试
|
||||
private static final String APP_IDENTITY_TEXT="a15b4ba5bd2542cc9a6bea9bdadf9ef9";
|
||||
//企业app验证码-测试
|
||||
private static final String APP_KEY_TEXT="07a6256cad5642138ed6e962a5a157be";
|
||||
//-------------安联---------------end
|
||||
|
||||
|
||||
//-------------交通厅---------------start
|
||||
public final static String JTT_DATA_NAME="jtt_data";
|
||||
public final static String JTT_DATA_JTTORDER_KEY="JTT_order_key";
|
||||
public final static String JTT_DATA_ORDER_KEY="order_key";
|
||||
//-------------交通厅---------------end
|
||||
|
||||
//--------------E签宝--------------start
|
||||
String key = "19ac0aa74338e487e45057faf7212401";
|
||||
String license = "HF41uGxM/1i3CtW98DimoA97BlNTAnQ+DiEAihYmZ2jR1jqC4be253joEJbOJgFDIzp5aIoeuXSWWHFaDVfaHL2Pksbq5f8M8EqsVhP9q/i1xGYSYf6MJVlHdMAVLWgR0Kra+n8dVzkSDuZeyJuDsskAmZaGFQN1CqnWYCI1tmV1Tk4A57e9LQMed0U11QWjdshdU2DGqBXKmGE419PdW3NmIxOR2u9iB1OKBmvzCUT8RAYyBzSn/yhU++YJ25g5a8Pb5kOvi+eOh+PEFEcQL6oOp/CF4Iw5nadlsLhc+XEnVJpwL2myZBoSlVcKxrJKbRn1/DIgXBueKKnqhyHKdJlpqI9eghAlRF0p2Q4f23m89mWRZf4nhKzTeXGIjCTFO4TNVucrlGU7tyJcrRCDVdfV24fziH+hB3QGckpuYzzjefr7hZalLRJ/w8dPw/8dCY1wnWq3AJ3zw2g1PzMxl51q7AgdKvwc1ERcGBns0zb8PK6vGKCnJq3uHiJEnslbTI0MEosje+h+OPO7hf2QofErewjI19wHEOv4dTvuFLh3VmGFMObAmov5kI47705fjSxCvAPGATBrfUSwim+5EQ1hanc5IcXe0/nOTiRUNEpZ+x65zVydqAs7490yqQiIUQvPazEwcal7vH2OD54lCcgpxKxqdmGc5/bp5UnqB45+n+iuInV/Q9DMOQVk15uaVZmhS8VaCqH21CmfH/ZGLb9wiEpaRLrPZLKX3bK7MT9Z0/OlDnb2QUKU8LMMIhLuQQntzsf0Wn4kA/0e9QAJJQ==";
|
||||
//-------------E签宝---------------end
|
||||
|
||||
//--------------交通厅--------------start
|
||||
private final static String APPID="com.arpa.hndahesudintocctmsdriver";
|
||||
private final static String APP_SECURITY="01e20fc6585a42738ac88a12321dc41bff473b4b20184aacbbcee7d7864359a6";
|
||||
private final static String CODE="41110447";
|
||||
private final static String ENVIRONMENT="release";
|
||||
//-------------交通厅---------------end
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.view.View
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.lxj.xpopup.core.CenterPopupView
|
||||
import kotlinx.android.synthetic.main.load.view.*
|
||||
import kotlinx.android.synthetic.main.pop_message_center.view.*
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName MessagePop
|
||||
* @Author 用户
|
||||
* @Date 2023/8/14 18:01
|
||||
* @Description TODO
|
||||
*/
|
||||
class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListener {
|
||||
|
||||
lateinit var content :String
|
||||
var secMessage :String? = ""
|
||||
|
||||
constructor(context: Context,message : String) :this(context) {
|
||||
content = message
|
||||
}
|
||||
|
||||
constructor(context: Context,message : String,message2 : String) :this(context) {
|
||||
content = message
|
||||
secMessage = message2
|
||||
}
|
||||
|
||||
override fun getImplLayoutId() = R.layout.pop_message_center
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
tvCancel.setOnClickListener(this)
|
||||
tvOk.setOnClickListener(this)
|
||||
tvPhone.setOnClickListener(this)
|
||||
tvContent.text = "$content"
|
||||
tvMessage2.text =secMessage
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when(v?.id){
|
||||
R.id.tvCancel -> {
|
||||
dismiss()
|
||||
}
|
||||
R.id.tvOk,R.id.tvPhone -> {
|
||||
dismiss()
|
||||
val toString = tvPhone.text.toString()
|
||||
val intent = Intent(Intent.ACTION_DIAL)
|
||||
val data = Uri.parse("tel:$toString")
|
||||
intent.data = data
|
||||
context.startActivity(intent)
|
||||
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var listener: OnMyItemClickListener? = null
|
||||
fun setOnMyItemClickListener(listener: OnMyItemClickListener?): MessagePop {
|
||||
this.listener = listener
|
||||
return this
|
||||
}
|
||||
|
||||
interface OnMyItemClickListener {
|
||||
fun onItemClick(startTime: String, endTime: String)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity
|
||||
import com.lxj.xpopup.core.CenterPopupView
|
||||
import kotlinx.android.synthetic.main.pop_sim_center.view.*
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName MessagePop
|
||||
* @Author 用户
|
||||
* @Date 2023/8/14 18:01
|
||||
* @Description TODO
|
||||
*/
|
||||
class SimCenterPop(context: Context) : CenterPopupView(context), View.OnClickListener {
|
||||
|
||||
lateinit var content: String
|
||||
lateinit var secMessage: String
|
||||
|
||||
constructor(context: Context, message: String) : this(context) {
|
||||
content = message
|
||||
}
|
||||
|
||||
|
||||
override fun getImplLayoutId() = R.layout.pop_sim_center
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
tvCancel.setOnClickListener(this)
|
||||
tvOk.setOnClickListener(this)
|
||||
tvContent.text = "$content"
|
||||
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when (v?.id) {
|
||||
R.id.tvCancel -> {
|
||||
dismiss()
|
||||
}
|
||||
R.id.tvOk -> {
|
||||
dismiss()
|
||||
listener?.onItemClick()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var listener: OnMyItemClickListener? = null
|
||||
fun setOnMyItemClickListener(listener: OnMyItemClickListener): SimCenterPop {
|
||||
this.listener = listener
|
||||
return this
|
||||
}
|
||||
|
||||
interface OnMyItemClickListener {
|
||||
fun onItemClick()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.event;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
* @date 2021/10/20 14:43
|
||||
* @description:
|
||||
*/
|
||||
public class FaceEvent {
|
||||
|
||||
private String message;
|
||||
|
||||
public FaceEvent(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -8,11 +8,7 @@ import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.alct.mdp.callback.OnDownloadResultListener;
|
||||
import com.alct.mdp.callback.OnResultListener;
|
||||
import com.alct.mdp.model.Identity;
|
||||
import com.arpa.hndahesudintocctmsdriver.App;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.FqBean;
|
||||
@@ -32,23 +28,15 @@ public class ALProcess {
|
||||
//企业app验证码
|
||||
private static final String APP_KEY="b948efbb4c2a4ba0805c534f2fba0c89";
|
||||
|
||||
//企业代码-测试
|
||||
private static final String ENTERPRISE_CODE_TEXT="E0019093";
|
||||
//企业app的身份码-测试
|
||||
private static final String APP_IDENTITY_TEXT="a15b4ba5bd2542cc9a6bea9bdadf9ef9";
|
||||
//企业app验证码-测试
|
||||
private static final String APP_KEY_TEXT="07a6256cad5642138ed6e962a5a157be";
|
||||
|
||||
|
||||
public static void verification(Context con){
|
||||
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
||||
Identity idy=new Identity();
|
||||
//企业代码
|
||||
idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||
idy.setEnterpriseCode(ENTERPRISE_CODE);
|
||||
//企业app的身份码
|
||||
idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||
idy.setAppIdentity(APP_IDENTITY);
|
||||
//企业app验证码
|
||||
idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||
idy.setAppKey(APP_KEY);
|
||||
//司机身份证
|
||||
idy.setDriverIdentity(auth.getData().getIdcard());
|
||||
//idy.setDriverIdentity("410725198311042012");
|
||||
@@ -62,7 +50,6 @@ public class ALProcess {
|
||||
@Override
|
||||
public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||
Log.e("--error--",s+s1+"");
|
||||
new MessageUtils().showCenMessage(con,s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -91,7 +78,7 @@ public class ALProcess {
|
||||
|
||||
public static void applyFq(Context con,FqBean fb){
|
||||
for (FqBean.Invoice driverInvoice : fb.getDriverInvoices()) {
|
||||
MDPLocationCollectionManager.confirmInvoice(con, BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE, driverInvoice.getDriverInvoiceCode(), new OnResultListener() {
|
||||
MDPLocationCollectionManager.confirmInvoice(con, ENTERPRISE_CODE, driverInvoice.getDriverInvoiceCode(), new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
@@ -112,7 +99,7 @@ public class ALProcess {
|
||||
// @param enterpriseCode 企业号
|
||||
// @param nfcId NFC id
|
||||
// @param listener 回调函数
|
||||
MDPLocationCollectionManager.checkNfc(con, shipmentCode,ENTERPRISE_CODE, nfcId, new OnResultListener() {
|
||||
MDPLocationCollectionManager.checkNfc(con, shipmentCode,ENTERPRISE_CODE, nfcId, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
@@ -126,33 +113,4 @@ public class ALProcess {
|
||||
}
|
||||
|
||||
|
||||
public static void verification(Context con,Handler hd){
|
||||
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
||||
Identity idy=new Identity();
|
||||
//企业代码
|
||||
idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||
//企业app的身份码
|
||||
idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||
//企业app验证码
|
||||
idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||
//司机身份证
|
||||
idy.setDriverIdentity(auth.getData().getIdcard());
|
||||
//idy.setDriverIdentity("410725198311042012");
|
||||
MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
||||
Log.e("--success--","验证成功");
|
||||
getFq(con);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||
Log.e("--error--",s+s1+"");
|
||||
MsgUtil.addHdMsgWatBody(hd, 2222,s1);
|
||||
// new MessageUtils().showCenMessage(con,s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,9 +59,4 @@ public class OCRRequest {
|
||||
RequestUtil.start(12, "carName",re,con,hd);
|
||||
}
|
||||
|
||||
|
||||
public void OCRCarPlateLicense(Context con, Handler hd, File file){
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getPlateLicense2()),getToken(con),file);
|
||||
RequestUtil.start(12, "carNum",re,con,hd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
|
||||
public class RequestConstant {
|
||||
|
||||
public static String TOKEN="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MzA0MDE3OTIsInVzZXJJZCI6ODAsImlhdCI6MTYyNzcyMzM5Mn0.f9Q-UZVduW6nt1s0L-3vYsrOJJ8iuSCSlJ9uu8yIxBI";
|
||||
//域名地址http://request.one-clouds.com/api https://huoyun.mzxd56.com/api http://app.dahehuoyun.com/api
|
||||
public static String BASE_URL = BuildConfig.BASE_URL;
|
||||
public static String BASE_URL ="http://app.dahehuoyun.com/api";
|
||||
//版本更新/app/check/version
|
||||
public static String VERSION ="/app/check/version";
|
||||
//全部代码
|
||||
@@ -135,9 +133,6 @@ public class RequestConstant {
|
||||
//车牌号
|
||||
private static final String PLATE_LICENSE="/common/ocr/plateLicense";
|
||||
|
||||
//车牌号2
|
||||
private static final String PLATE_LICENSE2="/common/aliyun/ocr/RecognizeCarNumber";
|
||||
|
||||
//添加挂车
|
||||
private static final String SAVE_DRAW_CAR="/app/carDriver/saveDrawCar";
|
||||
//提现记录
|
||||
@@ -395,10 +390,6 @@ public class RequestConstant {
|
||||
return BASE_URL+PLATE_LICENSE;
|
||||
}
|
||||
|
||||
public static String getPlateLicense2() {
|
||||
return BASE_URL+PLATE_LICENSE2;
|
||||
}
|
||||
|
||||
public static String getGetImage() {
|
||||
return BASE_URL+GET_IMAGE;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ public interface Api {
|
||||
//获取版本
|
||||
String VERSION = BASE_URL + "app/version";
|
||||
|
||||
// @POST(BASE_URL+"/common/register")
|
||||
// Observable<CommonResponseBean> log(@Body LoginRegInputBean bean);
|
||||
@POST(BASE_URL+"/common/register")
|
||||
Observable<CommonResponseBean> log(@Body LoginRegInputBean bean);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui
|
||||
|
||||
import android.Manifest
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
@@ -21,11 +20,8 @@ import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BottomTabUtil
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.PanDuanUtil
|
||||
import com.google.gson.Gson
|
||||
import com.gyf.cactus.ext.cactusUpdateNotification
|
||||
import com.permissionx.guolindev.PermissionX
|
||||
|
||||
@Suppress("DIVISION_BY_ZERO")
|
||||
@SuppressLint("SetTextI18n")
|
||||
class MainActivity : BaseAppCompatActivity() {
|
||||
|
||||
private var ibs = arrayOf<ImageView>()
|
||||
@@ -41,8 +37,7 @@ class MainActivity : BaseAppCompatActivity() {
|
||||
1 -> {
|
||||
isExit = false;
|
||||
}
|
||||
RequsetCodeConstants.SUCCESS -> {
|
||||
}
|
||||
RequsetCodeConstants.SUCCESS -> {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,10 +45,6 @@ class MainActivity : BaseAppCompatActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
StateStyleUtil.stateTextColor(this)
|
||||
setContentView(R.layout.activity_main)
|
||||
cactusUpdateNotification {
|
||||
setTitle("好运司机")
|
||||
setContent("您的接单小助手")
|
||||
}
|
||||
con = this
|
||||
act = this
|
||||
//隐藏标题栏
|
||||
@@ -135,11 +126,7 @@ class MainActivity : BaseAppCompatActivity() {
|
||||
PermissionX.init(this)
|
||||
.permissions(Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION,
|
||||
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.RECORD_AUDIO,
|
||||
Manifest.permission.CAMERA)
|
||||
Manifest.permission.ACCESS_BACKGROUND_LOCATION)
|
||||
.request { allGranted, grantedList, deniedList ->
|
||||
if (allGranted) {
|
||||
|
||||
@@ -160,7 +147,6 @@ class MainActivity : BaseAppCompatActivity() {
|
||||
fun jumpLogin() {
|
||||
var inl = Intent(con, LoginActivity::class.java)
|
||||
startActivity(inl)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+16
-46
@@ -43,7 +43,6 @@ import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
@@ -60,7 +59,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
private RelativeLayout up_img, cow1;
|
||||
private LinearLayout data_view;
|
||||
private ImageView img;
|
||||
private TextView zjimg_name, upload_img, name2, title1, title2, tvSkip, tvTips;
|
||||
private TextView zjimg_name, upload_img, name2, title1, title2, tvSkip,tvTips;
|
||||
private View vs;
|
||||
private EditText value1;
|
||||
private Button submit;
|
||||
@@ -101,32 +100,16 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthQualification"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
// initAuth();
|
||||
//判断是否从车辆进来 carId为空从个人认证进来需跳转实名认证,不为空车辆信息进入,需跳转车辆照片
|
||||
if (TextUtils.isEmpty(carId)) {
|
||||
//从业资格证->实名认证
|
||||
if (key) {
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
key = true;
|
||||
}, 3000);
|
||||
}
|
||||
} else {
|
||||
finish();
|
||||
if (isOverCar){//从业资格证=》道路运输许可证
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", carId);
|
||||
startActivity(in);
|
||||
}else{//资料传完 补传情况
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
}
|
||||
//从业资格证->实名认证
|
||||
// finish();
|
||||
if (key) {
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
key = true;
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Toast.makeText(con, "资格证上传成功", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
@@ -152,7 +135,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
// finish();
|
||||
finish();
|
||||
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||
@@ -170,8 +153,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
|
||||
private String type = "0";
|
||||
private String carId = "";
|
||||
private boolean isOverCar = false;
|
||||
private UserBean userBean;
|
||||
|
||||
@Override
|
||||
@@ -180,7 +161,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_auth_qualification);
|
||||
con = this;
|
||||
act = this;
|
||||
act=this;
|
||||
img = findViewById(R.id.img);
|
||||
zjimg_name = findViewById(R.id.zjimg_name);
|
||||
upload_img = findViewById(R.id.upload_img);
|
||||
@@ -197,8 +178,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
vs = findViewById(R.id.vs);
|
||||
data_view = findViewById(R.id.data_view);
|
||||
type = getIntent().getExtras().getString("type");
|
||||
carId = getIntent().getExtras().getString("carId", "");
|
||||
isOverCar = getIntent().getExtras().getBoolean("isOverCar",false);
|
||||
ur = new UserRequset(con, hd);
|
||||
initView(null);
|
||||
if ("0".equals(type)) {
|
||||
@@ -210,11 +189,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
//new RZRequest().isDriverAuthQualification(con,hd);
|
||||
}
|
||||
if (TextUtils.isEmpty(carId)){//carId不为空 从添加车辆进入 该操作不能跳过
|
||||
tvSkip.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
tvSkip.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean key = true;
|
||||
@@ -231,10 +205,9 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
img.setOnClickListener(v -> {
|
||||
if (!"".equals(url)) {
|
||||
new XPopup.Builder(con).asImageViewer(img, url, new SmartGlideImageLoader(R.mipmap.ic_launcher_round)).show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img, url, true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img, url, true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
}
|
||||
});
|
||||
value2.setOnClickListener(v -> {
|
||||
@@ -253,7 +226,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
if (!"".equals(id) && !"".equals(date) && !"".equals(url)) {
|
||||
new AuthRequest().driverAuthQualification(con, hd, id, ub.getData().getId(), date);
|
||||
} else {
|
||||
Toast.makeText(con, "请补充证件信息", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(con, "提交信息不完整", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
if (!"".equals(url)) {
|
||||
@@ -284,9 +257,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
|
||||
tvSkip.setOnClickListener(v -> {
|
||||
|
||||
|
||||
|
||||
if (type.equals("0")) {
|
||||
// finish();
|
||||
if (key) {
|
||||
@@ -320,7 +290,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
zjimg_name.setText("党员证照片");
|
||||
data_view.setVisibility(View.GONE);
|
||||
title2.setVisibility(View.GONE);
|
||||
} else {
|
||||
}else{
|
||||
tvTips.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
+57
-214
@@ -4,7 +4,6 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -21,24 +20,17 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.cardview.widget.CardView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.DicBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.SinglePickBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PickerUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.map.MapUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.esign.esignsdk.data.AuthEvent;
|
||||
import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener;
|
||||
import com.google.gson.Gson;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
@@ -76,10 +68,8 @@ import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
import com.lxj.xpopup.photoview.PhotoView;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@@ -109,14 +99,14 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
private int[] typeImgOne = {R.mipmap.id, R.mipmap.license, R.mipmap.vehicle_license, R.mipmap.vehicle_license};
|
||||
private int[] typeImgTwo = {R.mipmap.id_back, R.mipmap.license_back, R.mipmap.vehicle_license_back, R.mipmap.vehicle_license_back};
|
||||
private int index = 0;
|
||||
private DicBean.DataDTO curColor, curEnergy;
|
||||
private DicBean.DataDTO curColor,curEnergy;
|
||||
private TextView zj_name, zjimg_name, zjimg2_name, zj_name2, zj_name3;
|
||||
private TextView name1, name2, name3, name4, value5, value6;
|
||||
private EditText value1, value2, value3, value4, value7;
|
||||
private EditText value1, value2, value3, value4,value7;
|
||||
private Button submit;
|
||||
private ImageView img1, img2, img3, type_img;
|
||||
private TextView u_img, u_img2, u_img3;
|
||||
private LinearLayout llColor, llType, llCarName;
|
||||
private LinearLayout llColor, llType,llCarName;
|
||||
private CardView there_div;
|
||||
private BaseRecyclerView brv;
|
||||
//
|
||||
@@ -131,7 +121,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
private String url2 = "";
|
||||
private String url3 = "";
|
||||
private boolean[] keys = {false, false, false};
|
||||
private boolean key = true;
|
||||
|
||||
public void FalseKeys() {
|
||||
for (int i = 0; i < keys.length; i++) {
|
||||
@@ -154,8 +143,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("driverAuthIdCard") != null || CacheGroup.cacheList.get("driverAuthLicense") != null
|
||||
|| CacheGroup.cacheList.get("saveVehicleLicense") != null || CacheGroup.cacheList.get("authUrl") != null
|
||||
|| CacheGroup.cacheList.get("saveDrawCar") != null) {
|
||||
|| CacheGroup.cacheList.get("saveVehicleLicense") != null || CacheGroup.cacheList.get("saveDrawCar") != null) {
|
||||
if (CacheGroup.cacheList.get("driverAuthIdCard") != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthIdCard"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
@@ -177,16 +165,12 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthLicense"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
Toast.makeText(con, "保存成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
|
||||
//上传驾驶证信息页面 进行实名认证操作
|
||||
if (key) {
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
key = true;
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
//上传驾驶证信息页面 跳转资格证信息页面
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
in.putExtra("type", "0");
|
||||
startActivity(in);
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
@@ -194,69 +178,19 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
CacheGroup.cacheList.remove("driverAuthLicense");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("authUrl") != null) {
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
||||
CacheGroup.cacheList.remove("authUrl");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("saveVehicleLicense") != null) {
|
||||
CarZhengBean czb = gson.fromJson(CacheGroup.cacheList.get("saveVehicleLicense"), CarZhengBean.class);
|
||||
if (czb.getCode() == 200) {
|
||||
String needUpQCPhoto = czb.getData().getNeedUpQCPhoto();//是否需要上传从业资格证
|
||||
String isTrailer = czb.getData().getIsTrailer();//是否需要上传挂车
|
||||
String needUpRLPhoto = czb.getData().getNeedUpRLPhoto();//是否需要上传道路运输证到
|
||||
Toast.makeText(con, "车辆行驶证保存成功", Toast.LENGTH_SHORT).show();
|
||||
|
||||
finish();
|
||||
VehicleEvent ve = new VehicleEvent(String.valueOf(czb.getData().getCarId()));
|
||||
EventBus.getDefault().post(ve);
|
||||
|
||||
// TODO: 2023/8/23
|
||||
if ("1".equals(isTrailer)) {//判断是否跳转挂车行驶证
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 3);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
startActivity(in);
|
||||
} else if ("1".equals(needUpQCPhoto)) {//判断是否跳转从业资格证
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
in.putExtra("type", "0");
|
||||
in.putExtra("isOverCar", true);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
startActivity(in);
|
||||
} else if ("1".equals(needUpRLPhoto)) {//判断是否跳转道路运输许可证
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
startActivity(in);
|
||||
} else {
|
||||
//跳转成功页面
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
con.startActivity(in);
|
||||
}
|
||||
finish();
|
||||
// if ("1".equals(needUpQCPhoto)) {
|
||||
// //现逻辑:上传行驶证信息后 判断是否跳转从业资格证
|
||||
// Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
// in.putExtra("type", "0");
|
||||
// in.putExtra("isOverCar", false);
|
||||
// in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
// startActivity(in);
|
||||
// } else {
|
||||
// //原逻辑:上传行驶证信息后 跳转车辆照片页面
|
||||
// Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
// in.putExtra("type", 0);
|
||||
// in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
// con.startActivity(in);
|
||||
// }
|
||||
|
||||
|
||||
//上传行驶证信息后 跳转车辆照片页面
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 0);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
con.startActivity(in);
|
||||
} else {
|
||||
Toast.makeText(con, czb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -264,34 +198,20 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
if (CacheGroup.cacheList.get("saveDrawCar") != null) {
|
||||
Log.e("-saveDrawCar-", CacheGroup.cacheList.get("saveDrawCar"));
|
||||
CarZhengBean bb = gson.fromJson(CacheGroup.cacheList.get("saveDrawCar"), CarZhengBean.class);
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("saveDrawCar"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
String needUpQCPhoto = bb.getData().getNeedUpQCPhoto();
|
||||
String needUpRLPhoto = bb.getData().getNeedUpRLPhoto();//是否需要上传道路运输证到
|
||||
Toast.makeText(con, "挂车信息保存成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
VehicleEvent ve = new VehicleEvent("挂");
|
||||
EventBus.getDefault().post(ve);
|
||||
|
||||
if ("1".equals(needUpQCPhoto)) {
|
||||
//现逻辑:上传挂车保信息后 判断是否跳转从业资格证
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
in.putExtra("type", "0");
|
||||
in.putExtra("carId", carId);
|
||||
in.putExtra("isOverCar", true);
|
||||
startActivity(in);
|
||||
} else if ("1".equals(needUpRLPhoto)) {//现判断是否跳转道路运输许可证
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", carId);
|
||||
startActivity(in);
|
||||
} else {
|
||||
//原逻辑:挂车信息保存成功跳转成功页面
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", carId);
|
||||
con.startActivity(in);
|
||||
}
|
||||
//挂车信息保存成功跳转成功页面
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", carId);
|
||||
con.startActivity(in);
|
||||
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, "挂车信息保存失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -299,7 +219,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
} else if (CacheGroup.cacheList.get(CAR_COLOR) != null) {
|
||||
DicBean bb = gson.fromJson(CacheGroup.cacheList.get(CAR_COLOR), DicBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
if (bb.getCode()==200){
|
||||
PickerUtils.getInstance().pickSingle(this, "车牌颜色", bb.getData(), new OnOptionPickedListener() {
|
||||
@Override
|
||||
public void onOptionPicked(int position, Object item) {
|
||||
@@ -313,7 +233,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
CacheGroup.cacheList.remove(CAR_COLOR);
|
||||
} else if (CacheGroup.cacheList.get(CAR_ENERGY_TYPE) != null) {
|
||||
DicBean bb = gson.fromJson(CacheGroup.cacheList.get(CAR_ENERGY_TYPE), DicBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
if (bb.getCode()==200){
|
||||
PickerUtils.getInstance().pickSingle(this, "燃油类型", bb.getData(), new OnOptionPickedListener() {
|
||||
@Override
|
||||
public void onOptionPicked(int position, Object item) {
|
||||
@@ -325,16 +245,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
}
|
||||
CacheGroup.cacheList.remove(CAR_ENERGY_TYPE);
|
||||
} else if (CacheGroup.cacheList.get("authUrl") != null) {
|
||||
//实名认证校验
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
||||
CacheGroup.cacheList.remove("authUrl");
|
||||
} else {
|
||||
initView(null);
|
||||
initData();
|
||||
@@ -355,7 +265,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_shangchuan_xsz);
|
||||
EventBus.getDefault().register(this);
|
||||
llColor = findViewById(R.id.llColor);
|
||||
llCarName = findViewById(R.id.llCarName);
|
||||
llType = findViewById(R.id.llType);
|
||||
@@ -423,8 +332,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
case 2:
|
||||
llCarName.setVisibility(View.GONE);
|
||||
// llColor.setVisibility(View.VISIBLE);
|
||||
// llType.setVisibility(View.VISIBLE);
|
||||
llColor.setVisibility(View.VISIBLE);
|
||||
llType.setVisibility(View.VISIBLE);
|
||||
type_img.setImageResource(R.mipmap.auth_icon_3);
|
||||
// there_div.setVisibility(View.VISIBLE);
|
||||
if (c_str != null && !c_str.equals("")) {
|
||||
@@ -463,12 +372,9 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
img1.setOnClickListener(v -> {
|
||||
if (!url1.equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img1, url1, new SmartGlideImageLoader(R.mipmap.ic_launcher_round))
|
||||
.asImageViewer(img1, url1, true, -1, -1, 50, false, new ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img1, url1, true, -1, -1, 50, false, new ImageLoader())
|
||||
// .show();
|
||||
} else {
|
||||
}else{
|
||||
if (!isAuth) {
|
||||
FalseKeys();
|
||||
keys[0] = true;
|
||||
@@ -480,12 +386,9 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
img2.setOnClickListener(v -> {
|
||||
if (!url2.equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img2, url2, new SmartGlideImageLoader(R.mipmap.ic_launcher_round))
|
||||
.asImageViewer(img2, url2, true, -1, -1, 50, false, new ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img2, url2, true, -1, -1, 50, false, new ImageLoader())
|
||||
// .show();
|
||||
} else {
|
||||
}else{
|
||||
if (!isAuth) {
|
||||
FalseKeys();
|
||||
keys[1] = true;
|
||||
@@ -527,11 +430,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
gia.showPopueWindow(this);
|
||||
} else if (!url3.equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img3, url3, new SmartGlideImageLoader(R.mipmap.ic_launcher_round))
|
||||
.asImageViewer(img3, url3, true, -1, -1, 50, false, new ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img3, url3, true, -1, -1, 50, false, new ImageLoader())
|
||||
// .show();
|
||||
}
|
||||
});
|
||||
value5.setOnClickListener(v -> {
|
||||
@@ -559,21 +459,11 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
startActivity(in1);
|
||||
break;
|
||||
case 1:
|
||||
//传驾驶证信息页面 跳转实名认证
|
||||
// finish();
|
||||
if (key) {
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
key = true;
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
finish();
|
||||
//上传驾驶证信息页面 跳转资格证信息页面
|
||||
// finish();
|
||||
// Intent in2 = new Intent(con, AuthQualificationActivity.class);
|
||||
// in2.putExtra("type", "0");
|
||||
// startActivity(in2);
|
||||
Intent in2 = new Intent(con, AuthQualificationActivity.class);
|
||||
in2.putExtra("type", "0");
|
||||
startActivity(in2);
|
||||
break;
|
||||
case 2:
|
||||
finish();
|
||||
@@ -588,12 +478,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
boolean isAuth = false;
|
||||
|
||||
public void initData() {
|
||||
@@ -751,9 +635,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
Glide.with(con).load(url2).into(img2);
|
||||
startTime = ocbb.getData().getStartTime();
|
||||
backId = ocbb.getData().getId();
|
||||
|
||||
//自动调取提交功能,实现页面自动跳转
|
||||
subimt();
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -785,8 +666,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
url2 = odlb.getData().getUrl();
|
||||
backId = odlb.getData().getId();
|
||||
Glide.with(con).load(url2).into(img2);
|
||||
//自动调取提交功能,实现页面自动跳转
|
||||
subimt();
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -820,8 +699,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
url2 = oblb.getData().getUrl();
|
||||
backId = oblb.getData().getId();
|
||||
Glide.with(con).load(url2).into(img2);
|
||||
//自动调取提交功能,实现页面自动跳转
|
||||
subimt();
|
||||
} else {
|
||||
Toast.makeText(con, oblb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -954,10 +831,10 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
case 2:
|
||||
if (olb != null && oblb != null) {
|
||||
// if (curColor == null || curEnergy == null) {
|
||||
// Toast.makeText(con, "请完善内容", Toast.LENGTH_SHORT).show();
|
||||
// return;
|
||||
// }
|
||||
if (curColor==null||curEnergy==null){
|
||||
Toast.makeText(con,"请完善内容",Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
if ("".equals(url3)) {
|
||||
map.put("imgId", fid);
|
||||
@@ -967,8 +844,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
map.put("type", str2);
|
||||
map.put("owner", str3);
|
||||
map.put("vehicleNumber", str4);
|
||||
// map.put("carPlateColor", curColor.getValue());
|
||||
// map.put("carEnergyTyp", curEnergy.getValue());
|
||||
map.put("carPlateColor", curColor.getValue());
|
||||
map.put("carEnergyTyp", curEnergy.getValue());
|
||||
new AuthRequest().saveVehicleLicense(con, hd, MapUtil.mapJson(map));
|
||||
} else {
|
||||
Toast.makeText(con, "请先上传资料", Toast.LENGTH_SHORT).show();
|
||||
@@ -1001,61 +878,27 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
public static void personEvent(String msg) {
|
||||
PersonEvent he = new PersonEvent(msg);
|
||||
public static void personEvent(String msg){
|
||||
PersonEvent he=new PersonEvent(msg);
|
||||
EventBus.getDefault().post(he);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void processResult(AuthEvent auth) {
|
||||
//添加实名/意愿/签署完成之后的逻辑
|
||||
Log.e("-回调信息-", auth.result);
|
||||
JSONObject jsonObject = JSON.parseObject(auth.result);
|
||||
if ("success".equalsIgnoreCase(jsonObject.getString("res"))) {
|
||||
EsignSdk.getInstance().finishH5Activity();
|
||||
new MessageUtils().showSimCenPop(con, "个人信息上传成功,请添加车辆信息!", () -> {
|
||||
finish();
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 2);
|
||||
startActivity(in);
|
||||
public static class ImageLoader implements XPopupImageLoader {
|
||||
@Override
|
||||
public void loadImage(int position, @NonNull Object url, @NonNull ImageView imageView) {
|
||||
//必须指定Target.SIZE_ORIGINAL,否则无法拿到原图,就无法享用天衣无缝的动画
|
||||
Glide.with(imageView).load(url).apply(new RequestOptions().placeholder(R.mipmap.ic_launcher_round).override(Target.SIZE_ORIGINAL)).into(imageView);
|
||||
}
|
||||
|
||||
});
|
||||
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "签署场景成功", Toast.LENGTH_SHORT).show();
|
||||
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "实名认证成功", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "意愿认证成功", Toast.LENGTH_SHORT).show();
|
||||
@Override
|
||||
public File getImageFile(@NonNull Context context, @NonNull Object uri) {
|
||||
try {
|
||||
return Glide.with(context).downloadOnly().load(uri).submit().get();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "签署场景失败", Toast.LENGTH_SHORT).show();
|
||||
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "实名认证失败", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "意愿认证失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
EsignSdk.getInstance().finishH5Activity();
|
||||
finish();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// public static class ImageLoader implements XPopupImageLoader {
|
||||
// @Override
|
||||
// public void loadImage(int position, @NonNull Object url, @NonNull ImageView imageView) {
|
||||
// //必须指定Target.SIZE_ORIGINAL,否则无法拿到原图,就无法享用天衣无缝的动画
|
||||
// Glide.with(imageView).load(url).apply(new RequestOptions().placeholder(R.mipmap.ic_launcher_round).override(Target.SIZE_ORIGINAL)).into(imageView);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public File getImageFile(@NonNull Context context, @NonNull Object uri) {
|
||||
// try {
|
||||
// return Glide.with(context).downloadOnly().load(uri).submit().get();
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
+1
-13
@@ -15,7 +15,6 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||
import com.bumptech.glide.Glide;
|
||||
@@ -41,7 +40,6 @@ import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -97,11 +95,6 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
|
||||
// Intent intent = new Intent(this, H5Activity.class);
|
||||
// intent.putExtra("url", (String) bb.getData());
|
||||
// intent.putExtra("view_file", false);
|
||||
// startActivity(intent);
|
||||
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||
@@ -168,8 +161,6 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
// startActivityForResult(in, 12);
|
||||
//EsignSdk.getInstance().startH5Activity(act,"https://smlh5.esign.cn/usercenterFront/oemAuth/v3/realName/index?contextKey=b7b103b15b866ec4c72beef1dfe20828&appId=7438873235");
|
||||
if (key) {
|
||||
// EsignSdk.getInstance().startH5Activity(act, "");
|
||||
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
@@ -184,11 +175,8 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
up_head.setOnClickListener(v -> {
|
||||
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(up_head, ub.getData().getHeadportraitUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(up_head, ub.getData().getHeadportraitUrl(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(up_head, ub.getData().getHeadportraitUrl(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
}
|
||||
});
|
||||
hyr = new HuoYuanRequset(con, hd);
|
||||
|
||||
@@ -36,7 +36,6 @@ import com.luck.picture.lib.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
@@ -53,12 +52,12 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
private String[] name1 = {"车辆照片", "NFC照片", "车辆登记证书照片", "道路运输许可证照片"};
|
||||
private String[] name2 = {"请上传车辆照片", "请上传NFC照片", "请上传车辆登记证书照片", "请上传道路运输许可证照片"};
|
||||
private Boolean[] isShowEdit = {false, false, true, true};
|
||||
private Boolean[] isShowSkip = {true, false, false, true};
|
||||
private Boolean[] isShowSkip = {true, false, false, false};
|
||||
private String[] tips = {
|
||||
"",
|
||||
"*注意: 没有粘贴NFC芯片的车辆无需上传,可直接跳过",
|
||||
"*注意: 没有可直接跳过,等候下次上传",
|
||||
"*注意: 4.5吨以下车辆不需要上传,可直接跳过"};
|
||||
"*注意: 4.5吨一下车辆不需要上传,可直接跳过"};
|
||||
|
||||
|
||||
private BaseRecyclerView brv;
|
||||
@@ -158,13 +157,8 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
IsAuthDriverAuthQualificationBean ib = gson.fromJson(CacheGroup.cacheList.get("saveCarRoadLicenseNo"), IsAuthDriverAuthQualificationBean.class);
|
||||
if (ib.getCode() == 200) {
|
||||
//判断是否需要跳转挂车行驶证页面
|
||||
if (!"".equals(carId) ){
|
||||
if (cdb.getData().getIsTrailer() == 1&&!TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())){//需要挂车,并且传过挂车直接结束
|
||||
finish();
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
}else if(cdb.getData().getIsTrailer() == 1&&TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())){//需要挂车,没传过挂车,到挂车页面
|
||||
if (!"".equals(carId) && cdb.getData().getIsTrailer() == 1) {
|
||||
if (!"".equals(carId)) {
|
||||
finish();
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 3);
|
||||
@@ -173,41 +167,15 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
in.putExtra("cheData", new Gson().toJson(cdb));
|
||||
}
|
||||
startActivity(in);
|
||||
}else if(cdb.getData().getIsTrailer() == 0){//不需要挂车
|
||||
if ("1".equals(cdb.getData().getNeedUpQCPhoto())){//需要从业资格证
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
in.putExtra("type", "0");
|
||||
in.putExtra("carId", carId);
|
||||
in.putExtra("isOverCar", false);
|
||||
startActivity(in);
|
||||
}else{
|
||||
finish();
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, "请先绑定行驶证", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
finish();
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
}
|
||||
|
||||
// if (!"".equals(carId) && cdb.getData().getIsTrailer() == 1) {
|
||||
// if (!"".equals(carId)) {
|
||||
// finish();
|
||||
// Intent in = new Intent(con, CertificatesActivity.class);
|
||||
// in.putExtra("index", 3);
|
||||
// in.putExtra("carId", carId);
|
||||
// if (cdb != null) {
|
||||
// in.putExtra("cheData", new Gson().toJson(cdb));
|
||||
// }
|
||||
// startActivity(in);
|
||||
// } else {
|
||||
// Toast.makeText(con, "请先绑定行驶证", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
// } else {
|
||||
// finish();
|
||||
// Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
// in.putExtra("type", 3);
|
||||
// con.startActivity(in);
|
||||
// }
|
||||
} else {
|
||||
Toast.makeText(con, ib.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -319,42 +287,30 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
case 0:
|
||||
if (cdb.getData().getRoadLicensePhoto() != null && !cdb.getData().getCarImage().equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img, cdb.getData().getCarImage(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(img, cdb.getData().getCarImage(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img, cdb.getData().getCarImage(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (cdb.getData().getRoadLicensePhoto() != null && !cdb.getData().getNfcImage().equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img, cdb.getData().getNfcImage(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(img, cdb.getData().getNfcImage(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img, cdb.getData().getNfcImage(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (cdb.getData().getRoadLicensePhoto() != null && !cdb.getData().getRegisterImage().equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img, cdb.getData().getRegisterImage(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(img, cdb.getData().getRegisterImage(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img, cdb.getData().getRegisterImage(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (cdb.getData().getRoadLicensePhoto() != null && !"".equals(cdb.getData().getRoadLicensePhoto())) {
|
||||
//roadLicensePhoto
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img, cdb.getData().getRoadLicensePhoto(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -376,8 +332,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
if (!TextUtils.isEmpty(url)||(cdb!=null&&!TextUtils.isEmpty(cdb.getData().getCarImage()))){
|
||||
finish();
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
// in.putExtra("type", 1);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("type", 1);
|
||||
in.putExtra("carId", carId);
|
||||
con.startActivity(in);
|
||||
} else{
|
||||
@@ -394,7 +349,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
case 2:
|
||||
String s = value1.getText().toString();
|
||||
if (TextUtils.isEmpty(s)) {
|
||||
Toast.makeText(this, "请补充证件信息", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, "请完善证号", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
new AuthRequest().saveCarRegisterNo(con,hd,carId,s);
|
||||
@@ -402,7 +357,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
case 3:
|
||||
String s1 = value1.getText().toString();
|
||||
if (TextUtils.isEmpty(s1)) {
|
||||
Toast.makeText(this, "请补充证件信息", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, "请完善证号", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
new AuthRequest().saveCarRoadLicenseNo(con,hd,carId,s1);
|
||||
@@ -470,8 +425,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
if (0 == type) {
|
||||
finish();
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
// in.putExtra("type", 1);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("type", 1);
|
||||
in.putExtra("carId", carId);
|
||||
con.startActivity(in);
|
||||
} else if (1 == type) {
|
||||
|
||||
+1
-5
@@ -33,7 +33,6 @@ import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@@ -222,11 +221,8 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
||||
carImage.setOnClickListener(v14 -> {
|
||||
if(cdb!=null && cdb.getData()!=null && cdb.getData().getCarImage()!=null && !cdb.getData().getCarImage().equals("")){
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(carImage,cdb.getData().getCarImage(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(carImage,cdb.getData().getCarImage(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(carImage,cdb.getData().getCarImage(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
}
|
||||
});
|
||||
r1.setOnClickListener(v12 -> {
|
||||
|
||||
+66
-151
@@ -2,7 +2,6 @@ package com.arpa.hndahesudintocctmsdriver.ui.business;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -10,15 +9,6 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.amap.api.services.core.AMapException;
|
||||
import com.amap.api.services.core.LatLonPoint;
|
||||
import com.amap.api.services.core.PoiItem;
|
||||
import com.amap.api.services.core.SuggestionCity;
|
||||
import com.amap.api.services.poisearch.PoiResult;
|
||||
import com.amap.api.services.poisearch.PoiSearch;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.dahe.mylibrary.utils.ImageLoader;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BusinessBean;
|
||||
@@ -49,70 +39,53 @@ import okhttp3.Response;
|
||||
* @date 2021/9/6 9:59
|
||||
* @description:
|
||||
*/
|
||||
public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSearchListener {
|
||||
public class BusinessActivity extends BaseActivity {
|
||||
|
||||
private BaseRecyclerView business_type;
|
||||
private BaseRecyclerView business_list;
|
||||
private LocationGDUtil ld;
|
||||
private TextView address;
|
||||
private BusinessListBean blb;
|
||||
private Gson gson = new Gson();
|
||||
private List<Object> bbs = new ArrayList<>();
|
||||
private Gson gson=new Gson();
|
||||
private List<Object> bbs=new ArrayList<>();
|
||||
private CustomDialog customDialog;
|
||||
private int sum = 0;
|
||||
private String type = "餐饮";
|
||||
private PoiSearch.Query query;
|
||||
private List<PoiItem> poiItems;// poi数据
|
||||
|
||||
private int sum=0;
|
||||
private String type="餐饮";
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
switch (m.what) {
|
||||
switch (m.what){
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("business_list") != null) {
|
||||
Log.e("--res--", CacheGroup.cacheList.get("business_list") + "");
|
||||
blb = gson.fromJson(CacheGroup.cacheList.get("business_list"), BusinessListBean.class);
|
||||
if (blb.getCode() == 200) {
|
||||
if(CacheGroup.cacheList.get("business_list")!=null){
|
||||
Log.e("--res--",CacheGroup.cacheList.get("business_list")+"");
|
||||
blb=gson.fromJson(CacheGroup.cacheList.get("business_list"),BusinessListBean.class);
|
||||
if(blb.getCode()==200){
|
||||
forGetBusDel();
|
||||
} else {
|
||||
Toast.makeText(con, blb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(con,blb.getMsg(),Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("business_list");
|
||||
}
|
||||
break;
|
||||
case LocationGDUtil.RES:
|
||||
address.setText(ld.getAddress());
|
||||
// new BusinessRequest().GetBusinessList(con,hd,ld.getLongitude()+"",ld.getLatitude()+"",type);
|
||||
|
||||
try {
|
||||
customDialog.dismiss();
|
||||
LatLonPoint lp = new LatLonPoint(ld.getLatitude(), ld.getLongitude());
|
||||
PoiSearch poiSearch = new PoiSearch(this, query);
|
||||
poiSearch.setOnPoiSearchListener(this);
|
||||
poiSearch.setBound(new PoiSearch.SearchBound(lp, 5000, true));//
|
||||
// 设置搜索区域为以lp点为圆心,其周围5000米范围
|
||||
poiSearch.searchPOIAsyn();// 异步搜索
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
new BusinessRequest().GetBusinessList(con,hd,ld.getLongitude()+"",ld.getLatitude()+"",type);
|
||||
break;
|
||||
case 2:
|
||||
BusinessBean.DataDTO bds = gson.fromJson((String) m.obj, BusinessBean.DataDTO.class);
|
||||
BusinessBean.DataDTO bds=gson.fromJson((String) m.obj,BusinessBean.DataDTO.class);
|
||||
bbs.add(bds);
|
||||
initBusListDel();
|
||||
break;
|
||||
case 3:
|
||||
Log.e("aaa", (String) m.obj);
|
||||
BusinessBean.DataDTO bd = gson.fromJson((String) m.obj, BusinessBean.DataDTO.class);
|
||||
Log.e("aaa",(String) m.obj);
|
||||
BusinessBean.DataDTO bd=gson.fromJson((String) m.obj,BusinessBean.DataDTO.class);
|
||||
|
||||
if (bd != null) {
|
||||
if(bd!=null){
|
||||
//if (BeanUtil.isBean(bd.getClass())) {
|
||||
try {
|
||||
business_list.addItemV(bd);
|
||||
} catch (Exception e) {
|
||||
Log.e("遇到了", bd.toString());
|
||||
}catch (Exception e){
|
||||
Log.e("遇到了",bd.toString());
|
||||
}
|
||||
//}
|
||||
}
|
||||
@@ -125,130 +98,71 @@ public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSea
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_business);
|
||||
con = this;
|
||||
business_type = findViewById(R.id.business_type);
|
||||
business_list = findViewById(R.id.business_list);
|
||||
address = findViewById(R.id.address);
|
||||
con=this;
|
||||
business_type=findViewById(R.id.business_type);
|
||||
business_list=findViewById(R.id.business_list);
|
||||
address=findViewById(R.id.address);
|
||||
try {
|
||||
type = getIntent().getExtras().getString("type");
|
||||
} catch (Exception e) {
|
||||
type = "餐饮";
|
||||
type=getIntent().getExtras().getString("type");
|
||||
}catch (Exception e){
|
||||
type="餐饮";
|
||||
}
|
||||
initView(null);
|
||||
customDialog = new CustomDialog(con, "正在定位...");
|
||||
customDialog=new CustomDialog(con, "正在定位...");
|
||||
customDialog.show();
|
||||
ld = new LocationGDUtil(con, hd);
|
||||
ld=new LocationGDUtil(con,hd);
|
||||
ld.onCreate();
|
||||
|
||||
changeType(type);
|
||||
|
||||
}
|
||||
|
||||
List<Object> list_type = new ArrayList<>();
|
||||
|
||||
List<Object> list_type=new ArrayList<>();
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
list_type.add(new Model("餐饮", R.mipmap.icon_canguan));
|
||||
list_type.add(new Model("住宿", R.mipmap.icon_jiudian));
|
||||
list_type.add(new Model("商店", R.mipmap.icon_shangdian));
|
||||
list_type.add(new Model("加油站", R.mipmap.icon_jiayouzhan));
|
||||
list_type.add(new Model("汽车维修", R.mipmap.icon_xiuche));
|
||||
business_type.createG(4, con, list_type, R.layout.item_business_type).setOnItemViewListener((position, o, v) -> {
|
||||
Model m = (Model) o;
|
||||
ImageView type_img = v.findViewById(R.id.type_icon);
|
||||
list_type.add(new Model("餐饮",R.mipmap.icon_canguan));
|
||||
list_type.add(new Model("住宿",R.mipmap.icon_jiudian));
|
||||
list_type.add(new Model("商店",R.mipmap.icon_shangdian));
|
||||
list_type.add(new Model("加油站",R.mipmap.icon_jiayouzhan));
|
||||
list_type.add(new Model("汽车维修",R.mipmap.icon_xiuche));
|
||||
business_type.createG(4,con,list_type,R.layout.item_business_type).setOnItemViewListener((position, o, v) -> {
|
||||
Model m= (Model) o;
|
||||
ImageView type_img=v.findViewById(R.id.type_icon);
|
||||
type_img.setImageResource(m.getType_img());
|
||||
v.setOnClickListener(v1 -> {
|
||||
sum = 0;
|
||||
bbs = new ArrayList<>();
|
||||
customDialog = new CustomDialog(con, "正在切换...");
|
||||
sum=0;
|
||||
bbs=new ArrayList<>();
|
||||
customDialog=new CustomDialog(con, "正在切换...");
|
||||
customDialog.show();
|
||||
changeType(m.getType_name());
|
||||
// new BusinessRequest().GetBusinessList(con,hd,ld.getLongitude()+"",ld.getLatitude()+"",m.getType_name());
|
||||
new BusinessRequest().GetBusinessList(con,hd,ld.getLongitude()+"",ld.getLatitude()+"",m.getType_name());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoiSearched(PoiResult poiResult, int i) {
|
||||
if (poiResult != null && poiResult.getQuery() != null) {// 搜索poi的结果
|
||||
poiItems = poiResult.getPois();// 当搜索不到poiitem数据时,会返回含有搜索关键字的城市信息
|
||||
if (poiItems != null && poiItems.size() > 0) {
|
||||
initBusListDel();
|
||||
} else {
|
||||
ToastUtils.showToast(con, "对不起,没有搜索到相关数据!");
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showToast(con, "对不起,没有搜索到相关数据!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoiItemSearched(PoiItem poiItem, int i) {
|
||||
System.out.println(poiItem);
|
||||
}
|
||||
|
||||
private void changeType(String type) {
|
||||
query = new PoiSearch.Query(type, "", "");
|
||||
query.setExtensions("all");
|
||||
query.setPageSize(20);// 设置每页最多返回多少条poiitem
|
||||
query.setPageNum(0);// 设置查第一页
|
||||
|
||||
if (ld.getLatitude() != 0) {
|
||||
try {
|
||||
|
||||
LatLonPoint lp = new LatLonPoint(ld.getLatitude(), ld.getLongitude());
|
||||
PoiSearch poiSearch = new PoiSearch(this, query);
|
||||
poiSearch.setOnPoiSearchListener(this);
|
||||
poiSearch.setBound(new PoiSearch.SearchBound(lp, 5000, true));//
|
||||
// 设置搜索区域为以lp点为圆心,其周围5000米范围
|
||||
poiSearch.searchPOIAsyn();// 异步搜索
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void forGetBusDel() {
|
||||
public void forGetBusDel(){
|
||||
customDialog.dismiss();
|
||||
//business_list.remo
|
||||
Log.e("-数组-", gson.toJson(blb));
|
||||
for (int i = 0; i < blb.getData().getResults().size(); i++) {
|
||||
Log.e("-数组-",gson.toJson(blb));
|
||||
for (int i=0;i<blb.getData().getResults().size();i++) {
|
||||
//new BusinessRequest().GetBusiness(con,hd,blb.getData().getResults().get(i).getOpenshopid());
|
||||
String url = "https://openapi.dianping.com/router/poiinfo/detailinfo";
|
||||
requestGet(url + Md5Util.resDelUrl(blb.getData().getResults().get(i).getOpenshopid()));
|
||||
String url="https://openapi.dianping.com/router/poiinfo/detailinfo";
|
||||
requestGet(url+Md5Util.resDelUrl(blb.getData().getResults().get(i).getOpenshopid()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void initBusListDel() {
|
||||
customDialog.dismiss();
|
||||
public void initBusListDel(){
|
||||
//开始渲染
|
||||
business_list.createV(con, poiItems, R.layout.item_business_list).setOnItemViewListener((position, o, v) -> {
|
||||
PoiItem bd = (PoiItem) o;
|
||||
ImageView img = v.findViewById(R.id.photo_url);
|
||||
TextView name = v.findViewById(R.id.name);
|
||||
TextView address = v.findViewById(R.id.address);
|
||||
TextView taste = v.findViewById(R.id.taste);
|
||||
|
||||
if (bd.getPhotos().size() > 0 && !TextUtils.isEmpty(bd.getPhotos().get(0).getUrl())) {
|
||||
ImageLoader.getInstance().loadRoundImage(con, bd.getPhotos().get(0).getUrl(), 10, img);
|
||||
}
|
||||
|
||||
name.setText(bd.getTitle());
|
||||
address.setText(bd.getSnippet());
|
||||
taste.setText(bd.getTel());
|
||||
|
||||
// v.setOnClickListener(v1 -> {
|
||||
business_list.createV(con,bbs,R.layout.item_business_list).setOnItemViewListener((position, o, v) -> {
|
||||
BusinessBean.DataDTO bd= (BusinessBean.DataDTO) o;
|
||||
v.setOnClickListener(v1 -> {
|
||||
// Intent in=new Intent(con, WebActivity.class);
|
||||
// in.putExtra("url",bd.getBusiness_url());
|
||||
// in.putExtra("title",bd.getName());
|
||||
// startActivity(in);
|
||||
// });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public void requestGet(String url) {
|
||||
public void requestGet(String url){
|
||||
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
Request request = new Request.Builder()
|
||||
@@ -264,22 +178,22 @@ public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSea
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
if (response.code() == 200) {
|
||||
String body = response.body().string();
|
||||
Log.e("-body-", body);
|
||||
BusinessBean bb = gson.fromJson(body, BusinessBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
if(response.code()==200){
|
||||
String body=response.body().string();
|
||||
Log.e("-body-",body);
|
||||
BusinessBean bb=gson.fromJson(body,BusinessBean.class);
|
||||
if(bb.getCode()==200){
|
||||
sum++;
|
||||
//bbs.add(bb.getData());
|
||||
if (sum == 1) {
|
||||
Log.e("--添加--", bbs.size() + "_" + blb.getData().getResults().size());
|
||||
MsgUtil.addHdMsgWatBody(hd, 2, gson.toJson(bb.getData()));
|
||||
} else {
|
||||
Log.e("--添加--", bbs.size() + "_" + blb.getData().getResults().size());
|
||||
MsgUtil.addHdMsgWatBody(hd, 3, gson.toJson(bb.getData()));
|
||||
if(sum==1){
|
||||
Log.e("--添加--",bbs.size()+"_"+blb.getData().getResults().size());
|
||||
MsgUtil.addHdMsgWatBody(hd,2,gson.toJson(bb.getData()));
|
||||
}else{
|
||||
Log.e("--添加--",bbs.size()+"_"+blb.getData().getResults().size());
|
||||
MsgUtil.addHdMsgWatBody(hd,3,gson.toJson(bb.getData()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -287,7 +201,8 @@ public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSea
|
||||
}
|
||||
|
||||
|
||||
class Model {
|
||||
|
||||
class Model{
|
||||
private String type_name;
|
||||
private int type_img;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ import java.util.Set;
|
||||
* @description:
|
||||
*/
|
||||
public class Md5Util {
|
||||
static String app_key="1000055";
|
||||
static String appSecret="4e0d1be81540c4d1f0868d329b3229467f071f6c";
|
||||
static String app_key="3d4c1b5592f9ae09";
|
||||
static String appSecret="642cc46b385264595df7cce271250a1cb782b39c";
|
||||
static String[] strs={"app_key","deviceId","longitude","latitude","keyword","timestamp","format","v","sign_method","session","sign"};
|
||||
static String[] strsDel={"app_key","deviceId","openshopid","timestamp","format","v","sign_method","session","sign"};
|
||||
public static String resUrl(String longitude,String latitude,String keyword){
|
||||
@@ -35,7 +35,7 @@ public class Md5Util {
|
||||
requestParam.put("format", "json");
|
||||
requestParam.put("v", "1");
|
||||
requestParam.put("sign_method", "MD5");
|
||||
requestParam.put("session", "c1fc1773a27d47e988725bc6df150626dbda0b4d");
|
||||
requestParam.put("session", "cb2007c78d055247f7f242760173268caef1183a");
|
||||
requestParam.put("sign", generateSign(requestParam,appSecret,"MD5"));
|
||||
str+="?";
|
||||
for(int i=0;i<requestParam.size();i++){
|
||||
|
||||
@@ -7,7 +7,6 @@ import android.graphics.Outline;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -43,14 +42,11 @@ import com.arpa.hndahesudintocctmsdriver.constant.JTTConstant;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.news.NewActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.baidu.ocr.ui.camera.CameraActivity;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.gson.Gson;
|
||||
import com.gyf.cactus.Cactus;
|
||||
import com.hjq.xtoast.XToast;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.interfaces.OnConfirmListener;
|
||||
@@ -95,7 +91,6 @@ import com.youth.banner.loader.ImageLoader;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -128,7 +123,6 @@ public class HomeFragment extends BaseFragment {
|
||||
private ImageConfig ic;
|
||||
private DriverExpireBean deb;
|
||||
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
@@ -146,15 +140,6 @@ public class HomeFragment extends BaseFragment {
|
||||
if (ub.getCode() == 200) {
|
||||
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata"));
|
||||
MsgUtil.addHdMsgWat(hd, 33);
|
||||
|
||||
//新用户注册,需弹窗提示注册
|
||||
if ("0".equals(ub.getData().getRealAuthentication())){
|
||||
new MessageUtils().showSimCenPop(con, "该司机还未认证,未认证无法接单。是否去注册!", () -> {
|
||||
Intent in=new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index",0);
|
||||
startActivity(in);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -338,20 +323,13 @@ public class HomeFragment extends BaseFragment {
|
||||
}
|
||||
});
|
||||
news_btn.setOnClickListener(v -> {
|
||||
// TODO: 2023/8/30 测试orc拍照
|
||||
Intent intent = new Intent(getActivity(), CameraActivity.class);
|
||||
intent.putExtra(CameraActivity.KEY_OUTPUT_FILE_PATH,
|
||||
new File(getActivity().getFilesDir(), "pic.jpg").getAbsolutePath());
|
||||
intent.putExtra(CameraActivity.KEY_CONTENT_TYPE, CameraActivity.CONTENT_TYPE_ID_CARD_FRONT);
|
||||
startActivityForResult(intent, 1111);
|
||||
|
||||
// if (UiAuxiliary.isLogin(con)) {
|
||||
// Intent in = new Intent(con, NewActivity.class);
|
||||
// startActivity(in);
|
||||
// } else {
|
||||
// Intent in = new Intent(con, LoginActivity.class);
|
||||
// startActivity(in);
|
||||
// }
|
||||
if (UiAuxiliary.isLogin(con)) {
|
||||
Intent in = new Intent(con, NewActivity.class);
|
||||
startActivity(in);
|
||||
} else {
|
||||
Intent in = new Intent(con, LoginActivity.class);
|
||||
startActivity(in);
|
||||
}
|
||||
});
|
||||
//Intent serviceIn=new Intent(con, LocationService.class);
|
||||
//getActivity().startService(serviceIn);
|
||||
@@ -405,7 +383,6 @@ public class HomeFragment extends BaseFragment {
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
Cactus.getInstance().updateNotification(getActivity());
|
||||
List<ManyBean> list = new ArrayList<>();
|
||||
list.add(new ManyBean(new Model(), R.layout.item_home));
|
||||
as = brv.creates(con, list);
|
||||
@@ -490,7 +467,7 @@ public class HomeFragment extends BaseFragment {
|
||||
case 0:
|
||||
//startActivity(new Intent(con, OrderListActivity.class));
|
||||
PermissionX.init(getActivity())
|
||||
.permissions(Manifest.permission.ACCESS_FINE_LOCATION)
|
||||
.permissions(Manifest.permission.ACCESS_BACKGROUND_LOCATION)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
Intent in = new Intent(con, BusinessActivity.class);
|
||||
@@ -552,9 +529,6 @@ public class HomeFragment extends BaseFragment {
|
||||
ur.upApp();
|
||||
hyr.getHuoYuan(1, 100);
|
||||
ur.getImage(1);
|
||||
|
||||
|
||||
|
||||
if (UiAuxiliary.isLogin(con)) {
|
||||
ur.User();
|
||||
ur.getDriverExpire();
|
||||
@@ -809,9 +783,7 @@ public class HomeFragment extends BaseFragment {
|
||||
private class MyLoader extends ImageLoader {
|
||||
@Override
|
||||
public void displayImage(Context context, Object path, ImageView imageView) {
|
||||
if (HomeFragment.this != null && getActivity() != null && !getActivity().isDestroyed()) {
|
||||
Glide.with(con).load(path).into(imageView);
|
||||
}
|
||||
Glide.with(con).load(path).into(imageView);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -910,7 +882,6 @@ public class HomeFragment extends BaseFragment {
|
||||
public void initAlct() {
|
||||
PermissionX.init(getActivity())
|
||||
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.RECORD_AUDIO)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
|
||||
+15
-89
@@ -1,7 +1,6 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.home;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
@@ -19,27 +18,20 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.PersonalAuthActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.img.ImageGetUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.esign.esignsdk.data.AuthEvent;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BasePopupView;
|
||||
import com.lxj.xpopup.interfaces.OnCancelListener;
|
||||
import com.lxj.xpopup.interfaces.OnConfirmListener;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
@@ -101,15 +93,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
if (bb.getCode() == 200) {
|
||||
//Toast.makeText(con,"接单成功",Toast.LENGTH_SHORT).show();
|
||||
customDialog.dismiss();
|
||||
// EsignSdk.getInstance().startH5Activity(act, (String) bb.getData());
|
||||
|
||||
|
||||
Intent intent = new Intent(this, H5Activity.class);
|
||||
intent.putExtra("url", (String) bb.getData());
|
||||
intent.putExtra("view_file", false);
|
||||
startActivity(intent);
|
||||
|
||||
|
||||
EsignSdk.getInstance().startH5Activity(act, (String) bb.getData());
|
||||
//finish();
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
@@ -136,21 +120,6 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
car.setText("选择车辆:" + clb.getData().get(index).getCarNumber());
|
||||
cid = clb.getData().get(index).getCarId();
|
||||
break;
|
||||
case 1111://安联用户验证通过,接单
|
||||
new XPopup.Builder(con)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.asConfirm("请确认接单", "是否确定承运此运单?",
|
||||
"取消", "确认",
|
||||
() -> {
|
||||
Log.e("--id--", "cid:" + cid + "---wid:" + id);
|
||||
hyr.confirm(cid, id);
|
||||
}, () -> customDialog.dismiss(), false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
||||
.show();
|
||||
break;
|
||||
case 2222://安联用户验证不通过
|
||||
customDialog.dismiss();
|
||||
new MessageUtils().showCenMessage(con, (String) m.obj);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +236,20 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
if (cid != null) {
|
||||
// if (fpKey){
|
||||
if (key) {
|
||||
reOrder();
|
||||
new XPopup.Builder(con)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.asConfirm("请确认接单", "是否确定承运此运单?",
|
||||
"取消", "确认",
|
||||
new OnConfirmListener() {
|
||||
@Override
|
||||
public void onConfirm() {
|
||||
Log.e("--id--", "cid:" + cid + "---wid:" + id);
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
hyr.confirm(cid, id);
|
||||
}
|
||||
}, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
||||
.show();
|
||||
} else {
|
||||
Toast.makeText(con, "请先同意并签署运输合同", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -334,51 +316,6 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void faceResult(FaceEvent home) {
|
||||
Log.e("-res-", home.getMessage());
|
||||
|
||||
UiAuxiliary.homeRequest("接单");
|
||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
in.putExtra("id", "0");
|
||||
startActivity(in);
|
||||
finish();
|
||||
|
||||
// new Handler().postDelayed(() -> {
|
||||
// UiAuxiliary.homeRequest("接单");
|
||||
// Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
// in.putExtra("id", "0");
|
||||
// startActivity(in);
|
||||
// finish();
|
||||
// }, 2500);
|
||||
|
||||
|
||||
|
||||
// new Handler().postDelayed(() -> {
|
||||
//
|
||||
//
|
||||
// UiAuxiliary.homeRequest("接单");
|
||||
//// //ur.getJtt(hyd.getData().getId());
|
||||
//
|
||||
// Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
// in.putExtra("id", "0");
|
||||
// startActivity(in);
|
||||
//
|
||||
// ActivityUtils.finishActivity(H5Activity.class);
|
||||
// finish();
|
||||
//
|
||||
//
|
||||
// }, 1500);
|
||||
|
||||
// UiAuxiliary.homeRequest("接单");
|
||||
|
||||
// Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
// in.putExtra("id", "0");
|
||||
// startActivity(in);
|
||||
// finish();
|
||||
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void processResult(AuthEvent auth) {
|
||||
//添加实名/意愿/签署完成之后的逻辑
|
||||
@@ -413,15 +350,4 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 接单
|
||||
* 先判断安联用户信息验证,随后接单
|
||||
*/
|
||||
private void reOrder() {
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con, hd);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class OrderAllActivity extends BaseActivity {
|
||||
}else{
|
||||
Toast.makeText(con,"抢单",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
// xp.dismiss();
|
||||
xp.dismiss();
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
|
||||
+195
-219
@@ -40,10 +40,7 @@ import com.amap.api.services.route.DriveStep;
|
||||
import com.amap.api.services.route.RideRouteResult;
|
||||
import com.amap.api.services.route.RouteSearch;
|
||||
import com.amap.api.services.route.WalkRouteResult;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.TimeUtil;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
@@ -76,11 +73,11 @@ import java.util.List;
|
||||
|
||||
public class StartYunDanActivity extends BaseActivity {
|
||||
|
||||
public static final String GET_EVALUTE = "getEvalute";
|
||||
public static final String KEEP_EVALUTE = "keepEvalte";
|
||||
public static final String GET_COMPLAINT = "getComplaint";
|
||||
public static final String GET_EVALUTE="getEvalute";
|
||||
public static final String KEEP_EVALUTE="keepEvalte";
|
||||
public static final String GET_COMPLAINT="getComplaint";
|
||||
|
||||
private String TAG = "StartYunDanActivity";
|
||||
private String TAG="StartYunDanActivity";
|
||||
private NestedScrollView bottomSheet;
|
||||
private MapView map;
|
||||
private BaseRecyclerView brv;
|
||||
@@ -88,58 +85,57 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
private LinearLayout protect;
|
||||
//private RelativeLayout title_rl;
|
||||
private TextView title;
|
||||
private ScoreView sv1, sv2;
|
||||
private Gson gson = new Gson();
|
||||
private ScoreView sv1,sv2;
|
||||
private Gson gson=new Gson();
|
||||
private StartOrderBean sob;
|
||||
private WNewsBean wnb;
|
||||
private HuoYuanRequset hyr;
|
||||
//是否处于展开状态
|
||||
private boolean key = false;
|
||||
private int id = 0;
|
||||
private boolean key=false;
|
||||
private int id=0;
|
||||
LocationGDUtil ld;
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
switch (m.what) {
|
||||
switch (m.what){
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
//获取页面数据
|
||||
if (CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER) != null && CacheGroup.cacheList.get(GET_EVALUTE) != null) {
|
||||
Log.e("-评论-", CacheGroup.cacheList.get(GET_EVALUTE));
|
||||
Log.e("-运单-", CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER));
|
||||
sob = gson.fromJson(CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER), StartOrderBean.class);
|
||||
wnb = gson.fromJson(CacheGroup.cacheList.get(GET_EVALUTE), WNewsBean.class);
|
||||
if (sob.getCode() == 200 && sob.getData() != null) {
|
||||
if (CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER)!=null && CacheGroup.cacheList.get(GET_EVALUTE)!=null) {
|
||||
Log.e("-评论-",CacheGroup.cacheList.get(GET_EVALUTE));
|
||||
Log.e("-运单-",CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER));
|
||||
sob=gson.fromJson(CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER), StartOrderBean.class);
|
||||
wnb=gson.fromJson(CacheGroup.cacheList.get(GET_EVALUTE), WNewsBean.class);
|
||||
if(sob.getCode()==200 && sob.getData()!=null){
|
||||
id = sob.getData().getWaybillId();
|
||||
initView(null);
|
||||
} else if (sob.getData() == null) {
|
||||
}else if(sob.getData()==null){
|
||||
// Toast.makeText(con,"运单执行结束",Toast.LENGTH_SHORT).show();
|
||||
SPUtil.insSP(con, "order", "ShippingNoteNumber", "");
|
||||
SPUtil.insSP(con,"order","ShippingNoteNumber","");
|
||||
UiAuxiliary.homeRequest("运单结束");
|
||||
// finish();
|
||||
} else {
|
||||
Toast.makeText(con, sob.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(con,sob.getMsg(),Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(HuoYuanFragmengt.START_ORDER);
|
||||
CacheGroup.cacheList.remove(GET_EVALUTE);
|
||||
}
|
||||
//保存评价
|
||||
if (CacheGroup.cacheList.get(KEEP_EVALUTE) != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(KEEP_EVALUTE), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
Toast.makeText(con, "评价保存成功", Toast.LENGTH_SHORT).show();
|
||||
if(CacheGroup.cacheList.get(KEEP_EVALUTE)!=null){
|
||||
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(KEEP_EVALUTE),BaseBean.class);
|
||||
if(bb.getCode()==200){
|
||||
Toast.makeText(con,"评价保存成功",Toast.LENGTH_SHORT).show();
|
||||
hyr.startOrder(id);
|
||||
hyr.getEvaluate(id);
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(KEEP_EVALUTE);
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,28 +147,28 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_yundan_start);
|
||||
con = this;
|
||||
id = getIntent().getExtras().getInt("id");
|
||||
brv = findViewById(R.id.brv);
|
||||
protect = findViewById(R.id.protect);
|
||||
title = findViewById(R.id.title);
|
||||
bottomSheet = findViewById(R.id.bottom_sheet);
|
||||
con=this;
|
||||
id=getIntent().getExtras().getInt("id");
|
||||
brv=findViewById(R.id.brv);
|
||||
protect=findViewById(R.id.protect);
|
||||
title=findViewById(R.id.title);
|
||||
bottomSheet =findViewById(R.id.bottom_sheet);
|
||||
BottomSheetBehavior mBottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
|
||||
mBottomSheetBehavior.setHideable(false);
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
//mBottomSheetBehavior.set
|
||||
map = findViewById(R.id.map);
|
||||
map=findViewById(R.id.map);
|
||||
map.onCreate(savedInstanceState);
|
||||
if (aMap == null) {
|
||||
aMap = map.getMap();
|
||||
initLoaction();
|
||||
}
|
||||
Log.e("--id--", "" + id);
|
||||
String userdata = SPUtil.getSP(con, "data", "userdata");
|
||||
if (!userdata.equals("")) {
|
||||
ub = gson.fromJson(userdata, UserBean.class);
|
||||
Log.e("--id--",""+id);
|
||||
String userdata= SPUtil.getSP(con,"data","userdata");
|
||||
if(!userdata.equals("")){
|
||||
ub=gson.fromJson(userdata,UserBean.class);
|
||||
}
|
||||
hyr = new HuoYuanRequset(con, hd);
|
||||
hyr=new HuoYuanRequset(con,hd);
|
||||
// hyr.startOrder(id);
|
||||
// hyr.getEvaluate(id);
|
||||
}
|
||||
@@ -188,60 +184,59 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
//控件隐藏的动画
|
||||
mHiddenAmin = new AlphaAnimation(1.0f, 0.0f);
|
||||
mHiddenAmin.setDuration(1000);
|
||||
List<ManyBean> list = new ArrayList<>();
|
||||
List<ManyBean> list=new ArrayList<>();
|
||||
//list.add(new ManyBean(new model(),R.layout.yundan_start_top));
|
||||
list.add(new ManyBean(sob.getData(), R.layout.item_yundan_yunxing));
|
||||
list.add(new ManyBean(sob.getData(), R.layout.yundan_start_bottom));
|
||||
brv.creates(con, list).setOnItemViewListener((position, o, v, layout) -> {
|
||||
switch (layout) {
|
||||
list.add(new ManyBean(sob.getData(),R.layout.item_yundan_yunxing));
|
||||
list.add(new ManyBean(sob.getData(),R.layout.yundan_start_bottom));
|
||||
brv.creates(con,list).setOnItemViewListener((position, o, v, layout) -> {
|
||||
switch (layout){
|
||||
case R.layout.yundan_start_top:
|
||||
ImageButton return_btn = v.findViewById(R.id.return_btn);
|
||||
ImageButton return_btn=v.findViewById(R.id.return_btn);
|
||||
return_btn.setOnClickListener(v1 -> finish());
|
||||
break;
|
||||
case R.layout.yundan_start_bottom:
|
||||
initStartBody(v);
|
||||
break;
|
||||
case R.layout.item_yundan_yunxing:
|
||||
ImageView head_img = v.findViewById(R.id.head_img);
|
||||
if (ub != null && ub.getData() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||
ImageView head_img=v.findViewById(R.id.head_img);
|
||||
if(ub!=null && ub.getData()!=null && !ub.getData().getHeadportraitUrl().equals("")){
|
||||
Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(head_img);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean iskey = false;
|
||||
private boolean iskey=false;
|
||||
|
||||
private void initStartBody(View v) {
|
||||
LinearLayout jiesuan = v.findViewById(R.id.jiesuan);
|
||||
private void initStartBody(View v){
|
||||
LinearLayout jiesuan=v.findViewById(R.id.jiesuan);
|
||||
// if(id==0){
|
||||
// jiesuan.setVisibility(View.GONE);
|
||||
// }else{
|
||||
// jiesuan.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
sv1 = v.findViewById(R.id.score1);
|
||||
sv2 = v.findViewById(R.id.score2);
|
||||
sv1=v.findViewById(R.id.score1);
|
||||
sv2=v.findViewById(R.id.score2);
|
||||
sv1.initView();
|
||||
sv2.initView();
|
||||
sv1.setScore(5);
|
||||
//设置是否可以修改评分,默认为true
|
||||
TextView pl_submit = v.findViewById(R.id.pl_submit);
|
||||
TextView m_pl_value = v.findViewById(R.id.m_pl_value);
|
||||
TextView pl_value = v.findViewById(R.id.pl_value);
|
||||
if (wnb.getData() != null) {
|
||||
TextView pl_submit=v.findViewById(R.id.pl_submit);
|
||||
TextView m_pl_value=v.findViewById(R.id.m_pl_value);
|
||||
TextView pl_value=v.findViewById(R.id.pl_value);
|
||||
if(wnb.getData()!=null){
|
||||
for (WNewsBean.DataDTO datum : wnb.getData()) {
|
||||
if (datum.getType() == 0) {
|
||||
if(datum.getType()==0){
|
||||
sv1.setScore(datum.getAttitudeScore());
|
||||
m_pl_value.setText(datum.getContent());
|
||||
pl_submit.setVisibility(View.GONE);
|
||||
sv1.setUpKey(false);
|
||||
m_pl_value.setEnabled(false);
|
||||
}
|
||||
if (datum.getType() == 1) {
|
||||
Log.e("分数", datum.getAttitudeScore() + "_");
|
||||
if(datum.getType()==1){
|
||||
Log.e("分数",datum.getAttitudeScore()+"_");
|
||||
sv2.setScore(datum.getAttitudeScore());
|
||||
pl_value.setText(datum.getContent());
|
||||
}
|
||||
@@ -249,45 +244,45 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
}
|
||||
sv2.setUpKey(false);
|
||||
pl_submit.setOnClickListener(v12 -> {
|
||||
String evaluate = m_pl_value.getText() + "";
|
||||
if (id != 0) {
|
||||
if (evaluate.length() >= 5) {
|
||||
Log.e("星星", "" + sv1.getScore());
|
||||
hyr.keepEvaluate(sv1.getScore(), m_pl_value.getText() + "", id);
|
||||
} else {
|
||||
Toast.makeText(con, "写够5个字才是好司机~", Toast.LENGTH_SHORT).show();
|
||||
String evaluate=m_pl_value.getText()+"";
|
||||
if(id!=0){
|
||||
if(evaluate.length()>=5){
|
||||
Log.e("星星",""+sv1.getScore());
|
||||
hyr.keepEvaluate(sv1.getScore(),m_pl_value.getText()+"",id);
|
||||
}else{
|
||||
Toast.makeText(con,"写够5个字才是好司机~",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, "运单尚未结束", Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(con,"运单尚未结束",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
Button complaint = v.findViewById(R.id.complaint);
|
||||
Button complaint=v.findViewById(R.id.complaint);
|
||||
complaint.setOnClickListener(v1 -> {
|
||||
Intent in = new Intent(con, OrderComplaintActivity.class);
|
||||
in.putExtra("id", id);
|
||||
Intent in=new Intent(con, OrderComplaintActivity.class);
|
||||
in.putExtra("id",id);
|
||||
startActivity(in);
|
||||
});
|
||||
BaseRecyclerView bv_zhuang = v.findViewById(R.id.bv_zhuang);
|
||||
BaseRecyclerView bv_xie = v.findViewById(R.id.bv_xie);
|
||||
BaseRecyclerView bv_zhuang=v.findViewById(R.id.bv_zhuang);
|
||||
BaseRecyclerView bv_xie=v.findViewById(R.id.bv_xie);
|
||||
//bv_zhuang.set
|
||||
List<Object> list_zhuang = new ArrayList<>();
|
||||
List<Object> list_xie = new ArrayList<>();
|
||||
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||
StartOrderBean.DataDTO.WayChildrenDTO sdw = sob.getData().getWayChildren().get(i);
|
||||
if (sdw.getType() == 1) {
|
||||
sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(), "未装货"));
|
||||
List<Object> list_zhuang=new ArrayList<>();
|
||||
List<Object> list_xie=new ArrayList<>();
|
||||
for(int i=0;i<sob.getData().getWayChildren().size();i++){
|
||||
StartOrderBean.DataDTO.WayChildrenDTO sdw=sob.getData().getWayChildren().get(i);
|
||||
if(sdw.getType()==1){
|
||||
sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(),"未装货"));
|
||||
list_zhuang.add(sdw);
|
||||
} else {
|
||||
sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(), "未卸货"));
|
||||
}else{
|
||||
sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(),"未卸货"));
|
||||
list_xie.add(sdw);
|
||||
}
|
||||
}
|
||||
TextView get_contract = v.findViewById(R.id.get_contract);
|
||||
TextView get_contract=v.findViewById(R.id.get_contract);
|
||||
get_contract.setOnClickListener(v13 -> {
|
||||
Intent in = new Intent(con, WebPDFActivity.class);
|
||||
in.putExtra("title", "电子合同");
|
||||
Log.e("--地址--", sob.getData().getContractUrl());
|
||||
in.putExtra("url", sob.getData().getContractUrl());
|
||||
Intent in=new Intent(con, WebPDFActivity.class);
|
||||
in.putExtra("title","电子合同");
|
||||
Log.e("--地址--",sob.getData().getContractUrl());
|
||||
in.putExtra("url",sob.getData().getContractUrl());
|
||||
startActivity(in);
|
||||
});
|
||||
// v.findViewById(R.id.upload_receipt).setOnClickListener(new View.OnClickListener() {
|
||||
@@ -299,149 +294,130 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
// startActivity(in);
|
||||
// }
|
||||
// });
|
||||
bv_zhuang.createV(con, list_zhuang, R.layout.item_huoyuan_start_zx).setOnItemViewListener((position, o, v14) -> {
|
||||
bv_zhuang.createV(con,list_zhuang,R.layout.item_huoyuan_start_zx).setOnItemViewListener((position, o, v14) -> {
|
||||
//
|
||||
boolean upkey = false;
|
||||
if (position == 0) {
|
||||
upkey = true;
|
||||
boolean upkey=false;
|
||||
if(position==0){
|
||||
upkey=true;
|
||||
}
|
||||
initZX(upkey, v14, position, o, 0);
|
||||
initZX(upkey, v14,position,o,0);
|
||||
});
|
||||
bv_xie.createV(con, list_xie, R.layout.item_huoyuan_start_zx).setOnItemViewListener((position, o, v15) -> {
|
||||
bv_xie.createV(con,list_xie,R.layout.item_huoyuan_start_zx).setOnItemViewListener((position, o, v15) -> {
|
||||
//
|
||||
boolean upkey = false;
|
||||
if (position == (list_xie.size() - 1)) {
|
||||
upkey = true;
|
||||
boolean upkey=false;
|
||||
if(position==(list_xie.size()-1)){
|
||||
upkey=true;
|
||||
}
|
||||
initZX(upkey, v15, position, o, 1);
|
||||
});
|
||||
search();
|
||||
}
|
||||
|
||||
public void initZX(boolean key, View v, int position, Object o, int type) {
|
||||
StartOrderBean.DataDTO.WayChildrenDTO sdw = (StartOrderBean.DataDTO.WayChildrenDTO) o;
|
||||
TextView index = v.findViewById(R.id.index);
|
||||
TextView s_zx = v.findViewById(R.id.s_zx);
|
||||
TextView j_zx = v.findViewById(R.id.j_zx);
|
||||
if (type == 1) {
|
||||
public void initZX(boolean key,View v,int position,Object o,int type){
|
||||
StartOrderBean.DataDTO.WayChildrenDTO sdw= (StartOrderBean.DataDTO.WayChildrenDTO) o;
|
||||
TextView index=v.findViewById(R.id.index);
|
||||
TextView s_zx=v.findViewById(R.id.s_zx);
|
||||
TextView j_zx=v.findViewById(R.id.j_zx);
|
||||
if(type==1){
|
||||
s_zx.setText("实际卸货时间:");
|
||||
j_zx.setText("计划卸货时间:");
|
||||
}
|
||||
if (position == 0) {
|
||||
if (type == 0) {
|
||||
if(position==0){
|
||||
if(type==0){
|
||||
index.setText("装货地");
|
||||
} else {
|
||||
}else{
|
||||
index.setText("卸货地");
|
||||
}
|
||||
} else {
|
||||
if (type == 0) {
|
||||
}else{
|
||||
if(type==0) {
|
||||
index.setText("第" + (position + 1) + "装货地");
|
||||
} else {
|
||||
}else{
|
||||
index.setText("第" + (position + 1) + "卸货地");
|
||||
}
|
||||
}
|
||||
TextView goodName = v.findViewById(R.id.goodName);
|
||||
TextView goodNum = v.findViewById(R.id.goodNum);
|
||||
TextView goodUnit = v.findViewById(R.id.goodUnit);
|
||||
TextView goodName=v.findViewById(R.id.goodName);
|
||||
TextView goodNum=v.findViewById(R.id.goodNum);
|
||||
TextView goodUnit=v.findViewById(R.id.goodUnit);
|
||||
goodName.setText(sdw.getGoods().get(0).getGoodName());
|
||||
goodNum.setText(sdw.getGoods().get(0).getGoodNum());
|
||||
goodUnit.setText(sdw.getGoods().get(0).getGoodUnit());
|
||||
TextView huoyuan_state = v.findViewById(R.id.huoyuan_state);
|
||||
huoyuan_state.setText(stateText(sdw.getStatus(), type));
|
||||
TextView huoyuan_state=v.findViewById(R.id.huoyuan_state);
|
||||
huoyuan_state.setText(stateText(sdw.getStatus(),type));
|
||||
huoyuan_state.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String wid = sdw.getId() + "";
|
||||
if (sdw.getStatus() == 0) {
|
||||
if (type == 0) {
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", type);
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", key);
|
||||
String wid= sdw.getId()+"";
|
||||
if(sdw.getStatus()==0){
|
||||
if(type==0){
|
||||
Intent in=new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type",type);
|
||||
in.putExtra("wid",wid);
|
||||
in.putExtra("sob",gson.toJson(sob));
|
||||
in.putExtra("keys",key);
|
||||
startActivity(in);
|
||||
} else {
|
||||
Toast.makeText(con, "您还没有装货", Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(con,"您还没有装货",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else if (sdw.getStatus() == 1) {//装货回单
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("h_type", type);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
}else if(sdw.getStatus()==1){//装货回单
|
||||
Intent in=new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type",2);
|
||||
in.putExtra("wid",wid);
|
||||
in.putExtra("h_type",type);
|
||||
in.putExtra("sob",gson.toJson(sob));
|
||||
startActivity(in);
|
||||
} else if (sdw.getStatus() == 2) {//上传收货单(卸货回单)
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("h_type", type);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", key);
|
||||
}else if(sdw.getStatus()==2){//上传收货单(卸货回单)
|
||||
Intent in=new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type",2);
|
||||
in.putExtra("wid",wid);
|
||||
in.putExtra("h_type",type);
|
||||
in.putExtra("sob",gson.toJson(sob));
|
||||
in.putExtra("keys",key);
|
||||
startActivity(in);
|
||||
} else if (sdw.getStatus() == 3) {
|
||||
Intent in = new Intent(con, GetShangChuanActivity.class);
|
||||
in.putExtra("sdwStr", gson.toJson(sdw));
|
||||
}else if(sdw.getStatus()==3){
|
||||
Intent in=new Intent(con, GetShangChuanActivity.class);
|
||||
in.putExtra("sdwStr",gson.toJson(sdw));
|
||||
startActivity(in);
|
||||
}else{//卸货照片
|
||||
Intent in=new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type",type);
|
||||
in.putExtra("wid",wid);
|
||||
in.putExtra("sob",gson.toJson(sob));
|
||||
in.putExtra("keys",key);
|
||||
startActivity(in);
|
||||
} else {//卸货照片
|
||||
StartOrderBean.DataDTO.WayChildrenDTO zInfo;
|
||||
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||
if (sob.getData().getWayChildren().get(i).getType() == 1) {
|
||||
zInfo = sob.getData().getWayChildren().get(i);
|
||||
int dis = TimeUtil.compareNowDate(TimeUtil.string2Millis(zInfo.getImageTakenDate(), TimeUtil.DEFAULT_FORMAT4));
|
||||
if (dis > 5) {
|
||||
if (zInfo.getReceiptUrl() != null && zInfo.getReceiptUrl().size() > 0) {
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", type);
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", key);
|
||||
startActivity(in);
|
||||
break;
|
||||
} else {
|
||||
ToastUtils.showToast(StartYunDanActivity.this, "请先上传出货单,再进行卸货操作!");
|
||||
}
|
||||
} else {//大于五分钟可以接单
|
||||
ToastUtils.showToast(StartYunDanActivity.this, "装卸货时间间隔过短,请稍后重试!");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public String stateText(int state, int type) {
|
||||
String str = "";
|
||||
public String stateText(int state,int type){
|
||||
String str="";
|
||||
//0待装货,1已装货 2已卸货 3已上传回单 4待卸货
|
||||
switch (state) {
|
||||
switch (state){
|
||||
case 0://str="待装货";
|
||||
if (type == 0) {
|
||||
str = "立即装货";
|
||||
if(type==0){
|
||||
str="立即装货";
|
||||
// str="确认装货";
|
||||
} else {
|
||||
str = "请先装货";
|
||||
}else{
|
||||
str="请先装货";
|
||||
}
|
||||
break;
|
||||
case 1://str="已装货";
|
||||
str = "上传出货单";
|
||||
str="上传出货单";
|
||||
// str="确认回单";
|
||||
break;
|
||||
case 2://str="已卸货";
|
||||
str = "上传收货单";
|
||||
str="上传收货单";
|
||||
// str="确认回单";
|
||||
break;
|
||||
case 3:
|
||||
//str="已上传回单";
|
||||
str = "查看凭证";
|
||||
str="查看凭证";
|
||||
break;
|
||||
case 4:
|
||||
//str="待卸货";
|
||||
str = "确认卸货";
|
||||
break;
|
||||
default:
|
||||
str="确认卸货";
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
@@ -449,7 +425,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (map != null) {
|
||||
if(map!=null){
|
||||
map.onResume();
|
||||
}
|
||||
hyr.startOrder(id);
|
||||
@@ -459,7 +435,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
if (map != null) {
|
||||
if(map!=null){
|
||||
map.onPause();
|
||||
}
|
||||
}
|
||||
@@ -467,7 +443,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (map != null) {
|
||||
if(map!=null){
|
||||
map.onDestroy();
|
||||
}
|
||||
}
|
||||
@@ -477,12 +453,11 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
super.onSaveInstanceState(outState);
|
||||
map.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
LocationSource.OnLocationChangedListener mListener;
|
||||
AMapLocationClient mlocationClient;
|
||||
AMapLocationClientOption mLocationOption;
|
||||
|
||||
public void initLoaction() {
|
||||
public void initLoaction(){
|
||||
// 设置定位监听
|
||||
aMap.setLocationSource(new LocationSource() {
|
||||
@Override
|
||||
@@ -501,13 +476,13 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
mlocationClient.setLocationListener(new AMapLocationListener() {
|
||||
@Override
|
||||
public void onLocationChanged(AMapLocation aMapLocation) {
|
||||
if (mListener != null && aMapLocation != null) {
|
||||
if (mListener != null&&aMapLocation != null) {
|
||||
if (aMapLocation != null
|
||||
&& aMapLocation.getErrorCode() == 0) {
|
||||
&&aMapLocation.getErrorCode() == 0) {
|
||||
mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
|
||||
} else {
|
||||
String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo();
|
||||
Log.e("AmapErr", errText);
|
||||
String errText = "定位失败," + aMapLocation.getErrorCode()+ ": " + aMapLocation.getErrorInfo();
|
||||
Log.e("AmapErr",errText);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -559,44 +534,45 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
|
||||
|
||||
private RouteSearch mRouteSearch;//路线查询器
|
||||
private List<LatLonPoint> lists = new ArrayList<>();
|
||||
private List<LatLonPoint> lists=new ArrayList<>();
|
||||
|
||||
|
||||
public void search() {
|
||||
public void search(){
|
||||
// try {
|
||||
// AMapLocationClient.updatePrivacyShow(con,true,true);
|
||||
// AMapLocationClient.updatePrivacyAgree(con,true);
|
||||
mRouteSearch = new RouteSearch(this);
|
||||
mRouteSearch = new RouteSearch(this);
|
||||
// } catch (AMapException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//设置数据回调监听器
|
||||
mRouteSearch.setRouteSearchListener(new OnRouteSearchListener());
|
||||
//设置开始位置坐标点(注意经纬度不能写反,会报错1800(只能规划到中国区域里的地图路线))
|
||||
LatLonPoint startPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||
LatLonPoint startPoint=new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));
|
||||
//设置目的地坐标点
|
||||
LatLonPoint endPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()));
|
||||
LatLonPoint endPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLongitude()));
|
||||
//查询信息对象
|
||||
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||
if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
|
||||
LatLonPoint sp = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(i).getLatitude()),
|
||||
for (int i=0;i<sob.getData().getWayChildren().size();i++){
|
||||
if(i!=0 && i!=(sob.getData().getWayChildren().size()-1)){
|
||||
LatLonPoint sp=new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(i).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get((i)).getLongitude()));
|
||||
lists.add(sp);
|
||||
}
|
||||
}
|
||||
RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(startPoint, endPoint);
|
||||
RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(startPoint,endPoint);
|
||||
//设置搜索参数 1.fromAndTo 路径的起点终点 2.路径规划的策略(这里是驾车模式,具体看高德API) 3.途
|
||||
//经点,可选 4.避让区域,可选, 5.避让道路 ,可选
|
||||
RouteSearch.DriveRouteQuery query = new
|
||||
RouteSearch.DriveRouteQuery(fromAndTo, RouteSearch.DRIVING_SINGLE_DEFAULT, lists, null, "");
|
||||
RouteSearch.DriveRouteQuery(fromAndTo,RouteSearch.DRIVING_SINGLE_DEFAULT,lists,null,"");
|
||||
//开始异步查询
|
||||
mRouteSearch.calculateDriveRouteAsyn(query);
|
||||
}
|
||||
|
||||
|
||||
class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener {
|
||||
|
||||
class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener{
|
||||
|
||||
@Override
|
||||
public void onBusRouteSearched(BusRouteResult busRouteResult, int i) {
|
||||
@@ -605,7 +581,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onDriveRouteSearched(DriveRouteResult driveRouteResult, int rCode) {
|
||||
if (rCode == 1000) {//获取规划路线成功,获取到的是了,路线坐标点的集合
|
||||
if (rCode == 1000){//获取规划路线成功,获取到的是了,路线坐标点的集合
|
||||
List<DrivePath> paths = driveRouteResult.getPaths();
|
||||
//创建存储坐标点的集合
|
||||
List<LatLng> latLngs = new ArrayList<>();
|
||||
@@ -614,7 +590,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
for (DriveStep mDriveStep : mDrivePath.getSteps()) {
|
||||
for (LatLonPoint mLatLonPoint : mDriveStep.getPolyline()) {
|
||||
latLngs.add(new
|
||||
LatLng(mLatLonPoint.getLatitude(), mLatLonPoint.getLongitude()));
|
||||
LatLng(mLatLonPoint.getLatitude(),mLatLonPoint.getLongitude()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -625,24 +601,24 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.qi))
|
||||
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get(0).getLongitude()))));
|
||||
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||
if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
|
||||
StartOrderBean.DataDTO.WayChildrenDTO sdw = sob.getData().getWayChildren().get(i);
|
||||
int icon = 0;
|
||||
if (sdw.getType() == 1) {
|
||||
icon = R.mipmap.z_loc;
|
||||
} else {
|
||||
icon = R.mipmap.x_loc;
|
||||
for(int i=0;i<sob.getData().getWayChildren().size();i++){
|
||||
if(i!=0 && i!=(sob.getData().getWayChildren().size()-1)){
|
||||
StartOrderBean.DataDTO.WayChildrenDTO sdw=sob.getData().getWayChildren().get(i);
|
||||
int icon=0;
|
||||
if(sdw.getType()==1){
|
||||
icon=R.mipmap.z_loc;
|
||||
}else{
|
||||
icon=R.mipmap.x_loc;
|
||||
}
|
||||
aMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(icon))
|
||||
.position(new LatLng(Double.parseDouble(sdw.getLatitude()), Double.parseDouble(sdw.getLongitude()))));
|
||||
.position(new LatLng(Double.parseDouble(sdw.getLatitude()),Double.parseDouble(sdw.getLongitude()))));
|
||||
}
|
||||
}
|
||||
aMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.zhong))
|
||||
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()))));
|
||||
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLongitude()))));
|
||||
//绘制规划路径路线
|
||||
aMap.addPolyline(new PolylineOptions()
|
||||
//路线坐标点的集合
|
||||
@@ -653,15 +629,15 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
//设置画线的颜色
|
||||
|
||||
//显示完整包含所有marker地图路线
|
||||
LatLngBounds.Builder builder = LatLngBounds.builder();
|
||||
LatLngBounds.Builder builder =LatLngBounds.builder();
|
||||
for (int i = 0; i < latLngs.size(); i++) {
|
||||
builder.include(latLngs.get(i));
|
||||
}
|
||||
//显示全部marker,第二个参数是四周留空宽度
|
||||
aMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 200));
|
||||
aMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(),200));
|
||||
LatLng latLng = new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));//构造一个位置
|
||||
aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 6));
|
||||
aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng,6));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -677,7 +653,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
|
||||
}
|
||||
|
||||
public void up_traffic() {
|
||||
public void up_traffic(){
|
||||
// ShippingNoteInfo[] snis=new ShippingNoteInfo[1];
|
||||
// ShippingNoteInfo sni=new ShippingNoteInfo();
|
||||
// sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
||||
|
||||
+2
-9
@@ -16,7 +16,6 @@ import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
@@ -75,22 +74,16 @@ public class GetShangChuanActivity extends BaseActivity {
|
||||
Glide.with(con).load(sdw.getSendPutImagesUrl().get(0)).into(img1);
|
||||
img1.setOnClickListener(v -> {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img1,sdw.getSendPutImagesUrl().get(0), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(img1,sdw.getSendPutImagesUrl().get(0), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img1,sdw.getSendPutImagesUrl().get(0), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
});
|
||||
}
|
||||
if(sdw.getReceiptUrl()!=null && sdw.getReceiptUrl().size()>=1){
|
||||
Glide.with(con).load(sdw.getReceiptUrl().get(0)).into(img2);
|
||||
img2.setOnClickListener(v -> {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img2,sdw.getReceiptUrl().get(0), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(img2,sdw.getReceiptUrl().get(0), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img2,sdw.getReceiptUrl().get(0), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
});
|
||||
}
|
||||
//new GlideUrl(sdw.getSendPutImagesUrl().toString(), new LazyHeaders.Builder().addHeader("Cookie", AppCurrentUser.getInstance().getUserCookie()).build());
|
||||
|
||||
+196
-328
@@ -19,22 +19,12 @@ import com.alct.mdp.callback.OnResultListener;
|
||||
import com.alct.mdp.model.Goods;
|
||||
import com.alct.mdp.model.Image;
|
||||
import com.alct.mdp.model.Location;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||
import com.baidu.mapapi.CoordType;
|
||||
import com.baidu.mapapi.SDKInitializer;
|
||||
import com.baidu.mapapi.model.LatLng;
|
||||
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
@@ -49,6 +39,7 @@ import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.file.FileUtil;
|
||||
@@ -57,7 +48,6 @@ import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@@ -66,115 +56,89 @@ import java.util.List;
|
||||
|
||||
public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
private TextView submit, name_top, name_body, address, tips, tips_x;
|
||||
private TextView submit,name_top,name_body,address,tips,tips_x;
|
||||
private RelativeLayout getImg;
|
||||
private ImageView res_img, img_icon, img_delete;
|
||||
private String[] names = {"装货", "卸货", "回单"};
|
||||
public static String[] TYPE_NAME = {"zhuanghuo", "xiehuo", "huidan"};
|
||||
private int index = 0;
|
||||
private ImageView res_img,img_icon,img_delete;
|
||||
private String[] names={"装货","卸货","回单"};
|
||||
public static String[] TYPE_NAME={"zhuanghuo","xiehuo","huidan"};
|
||||
private int index=0;
|
||||
//
|
||||
private Gson gson = new Gson();
|
||||
private Gson gson=new Gson();
|
||||
//
|
||||
private LUInputBean lub = new LUInputBean();
|
||||
private UploadReceiptInputBean urib = new UploadReceiptInputBean();
|
||||
private LUInputBean lub=new LUInputBean();
|
||||
private UploadReceiptInputBean urib=new UploadReceiptInputBean();
|
||||
private LocationGDUtil lgdu;
|
||||
public LocationUtil lu;
|
||||
private List<Integer> imgIds = new ArrayList<>();
|
||||
private LocationUtil lu;
|
||||
private List<Integer> imgIds=new ArrayList<>();
|
||||
private UploadBean ub;
|
||||
private HuoYuanRequset hyr;
|
||||
//
|
||||
private GetCarImageAlert gia = new GetCarImageAlert();
|
||||
private GetCarImageAlert gia=new GetCarImageAlert();
|
||||
private CustomDialog customDialog;
|
||||
private int id = 0;
|
||||
private boolean key = true;
|
||||
private boolean keys = false;
|
||||
private boolean locationKey = false;
|
||||
private int id=0;
|
||||
private boolean key=true;
|
||||
private boolean keys=false;
|
||||
private boolean locationKey=false;
|
||||
private TextView tv_loaction;
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
switch (m.what) {
|
||||
switch (m.what){
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("upload") != null) {
|
||||
Log.e("upload", CacheGroup.cacheList.get("upload"));
|
||||
ub = gson.fromJson(CacheGroup.cacheList.remove("upload"), UploadBean.class);
|
||||
if (ub.getCode() == 200) {
|
||||
if (CacheGroup.cacheList.get("upload")!=null) {
|
||||
Log.e("upload",CacheGroup.cacheList.get("upload"));
|
||||
ub=gson.fromJson(CacheGroup.cacheList.remove("upload"),UploadBean.class);
|
||||
if(ub.getCode()==200){
|
||||
imgIds.add(ub.getData().getId());
|
||||
Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||
res_img.setVisibility(View.VISIBLE);
|
||||
img_delete.setVisibility(View.VISIBLE);
|
||||
img_icon.setVisibility(View.GONE);
|
||||
key = false;
|
||||
} else {
|
||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
key=false;
|
||||
}else{
|
||||
Toast.makeText(con,ub.getMsg(),Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("upload");
|
||||
}
|
||||
for (int i = 0; i < TYPE_NAME.length; i++) {
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
if (!keys) {
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
for(int i=0;i<TYPE_NAME.length;i++){
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[i])!=null) {
|
||||
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]),BaseBean.class);
|
||||
if(bb.getCode()==200){
|
||||
if(!keys){
|
||||
Toast.makeText(con,"上传成功",Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
} else {
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(con,"上传成功",Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||
}
|
||||
}
|
||||
if (CacheGroup.cacheList.get("carName") != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("carName"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
if(CacheGroup.cacheList.get("carName")!=null){
|
||||
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get("carName"),BaseBean.class);
|
||||
if(bb.getCode()==200){
|
||||
|
||||
}
|
||||
CacheGroup.cacheList.remove("carName");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("carNum") != null) {
|
||||
Log.e("upload", CacheGroup.cacheList.get("carNum"));
|
||||
CarInfoBean ub = gson.fromJson(CacheGroup.cacheList.remove("carNum"), CarInfoBean.class);
|
||||
if (ub.getCode() == 200 && ub.getData().getData().getPrism_keyValueInfo().size() > 0) {
|
||||
String value = ub.getData().getData().getPrism_keyValueInfo().get(0).getValue();
|
||||
String forceMatching = ub.getData().getForceMatching();
|
||||
if ("1".equals(forceMatching)) {//是否强校验车牌号 1:强校验
|
||||
if (sob.getData().getCarNumber().equals(value)) {
|
||||
hyr.uploadFile(new File(path));
|
||||
} else {
|
||||
new MessageUtils().showCenMessage(ShangChuangImgActivity.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
||||
}
|
||||
} else {
|
||||
hyr.uploadFile(new File(path));
|
||||
}
|
||||
} else {//识别失败后返回code500
|
||||
if (index == 0) {//装卸货车辆需要识别车牌号){
|
||||
Toast.makeText(con, "装货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||
} else if (index == 1) {
|
||||
Toast.makeText(con, "卸货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
CacheGroup.cacheList.remove("carNum");
|
||||
}
|
||||
break;
|
||||
case 14://定位成功
|
||||
locationKey = true;
|
||||
locationKey=true;
|
||||
customDialog.dismiss();
|
||||
tv_loaction.setText("定位成功");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color,null));
|
||||
initLocation();
|
||||
break;
|
||||
case 16://定位失败
|
||||
locationKey = false;
|
||||
locationKey=false;
|
||||
customDialog.dismiss();
|
||||
tv_loaction.setText("定位失败,点击重试");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color, null));
|
||||
Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color,null));
|
||||
Toast.makeText(con,"定位失败,请确认开启定位后重试!",Toast.LENGTH_LONG).show();
|
||||
//定位结果接收
|
||||
//finish();
|
||||
break;
|
||||
@@ -182,74 +146,67 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
|
||||
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||
path = (String) m.obj;
|
||||
Log.e("res:", "选定图片结果");
|
||||
Log.e("res:", path);
|
||||
path= (String) m.obj;
|
||||
Log.e("res:","选定图片结果");
|
||||
Log.e("res:",path);
|
||||
//选定图片结果
|
||||
// if(index==1 || index==2){
|
||||
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||
// }
|
||||
if (index == 0 || index == 1) {//装卸货车辆需要识别车牌号
|
||||
new OCRRequest().OCRCarPlateLicense(con, hd, new File(path));
|
||||
} else {
|
||||
hyr.uploadFile(new File(path));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
hyr.uploadFile(new File(path));
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
||||
private String wid;
|
||||
private int h_type;
|
||||
String sobStr = "";
|
||||
String sobStr="";
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_shangchuan);
|
||||
con = this;
|
||||
submit = findViewById(R.id.submit);
|
||||
name_top = findViewById(R.id.name_top);
|
||||
name_body = findViewById(R.id.name_body);
|
||||
address = findViewById(R.id.address);
|
||||
getImg = findViewById(R.id.getImg);
|
||||
res_img = findViewById(R.id.res_img);
|
||||
img_icon = findViewById(R.id.img_icon);
|
||||
img_delete = findViewById(R.id.img_delete);
|
||||
tv_loaction = findViewById(R.id.tv_loaction);
|
||||
tips = findViewById(R.id.tips);
|
||||
tips_x = findViewById(R.id.tips_x);
|
||||
Bundle ins = getIntent().getExtras();
|
||||
index = ins.getInt("type");
|
||||
wid = ins.getString("wid");
|
||||
h_type = ins.getInt("h_type");
|
||||
keys = ins.getBoolean("keys");
|
||||
sobStr = getIntent().getExtras().getString("sob");
|
||||
con=this;
|
||||
submit=findViewById(R.id.submit);
|
||||
name_top=findViewById(R.id.name_top);
|
||||
name_body=findViewById(R.id.name_body);
|
||||
address=findViewById(R.id.address);
|
||||
getImg=findViewById(R.id.getImg);
|
||||
res_img=findViewById(R.id.res_img);
|
||||
img_icon=findViewById(R.id.img_icon);
|
||||
img_delete=findViewById(R.id.img_delete);
|
||||
tv_loaction=findViewById(R.id.tv_loaction);
|
||||
tips=findViewById(R.id.tips);
|
||||
tips_x=findViewById(R.id.tips_x);
|
||||
Bundle ins=getIntent().getExtras();
|
||||
index=ins.getInt("type");
|
||||
wid=ins.getString("wid");
|
||||
h_type=ins.getInt("h_type");
|
||||
keys=ins.getBoolean("keys");
|
||||
sobStr=getIntent().getExtras().getString("sob");
|
||||
//Log.e("---sdwStr--",sdwStr);
|
||||
sob = new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||
sob=new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||
initView(null);
|
||||
customDialog = new CustomDialog(con, "正在定位当前位置...");
|
||||
customDialog=new CustomDialog(con, "正在定位当前位置...");
|
||||
customDialog.show();
|
||||
lgdu = new LocationGDUtil(con, hd);
|
||||
lgdu=new LocationGDUtil(con,hd);
|
||||
//启动定位
|
||||
lgdu.onCreate();
|
||||
lu = new LocationUtil(con, hd);
|
||||
lu=new LocationUtil(con,hd);
|
||||
lu.onCreate();
|
||||
// if (keys) {
|
||||
// lu = new LocationUtil(con, hd);
|
||||
// lu.onCreate();
|
||||
// }
|
||||
if (keys){
|
||||
lu=new LocationUtil(con,hd);
|
||||
lu.onCreate();
|
||||
}
|
||||
tv_loaction.setOnClickListener(v -> {
|
||||
if (!locationKey) {
|
||||
if (!locationKey){
|
||||
customDialog.show();
|
||||
lgdu.onCreate();
|
||||
lu = new LocationUtil(con, hd);
|
||||
lu.onCreate();
|
||||
}
|
||||
});
|
||||
hyr = new HuoYuanRequset(con, hd);
|
||||
hyr=new HuoYuanRequset(con,hd);
|
||||
// if (!NfcUtils.hasNfc(con)) {
|
||||
// Toast.makeText(con,"请先开启nfc",Toast.LENGTH_LONG).show();
|
||||
// }else{
|
||||
@@ -265,42 +222,39 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
name_top.setText("上传" + names[index] + "照片");
|
||||
name_body.setText(names[index] + "照片");
|
||||
if (index == 1) {
|
||||
name_top.setText("上传"+names[index]+"照片");
|
||||
name_body.setText(names[index]+"照片");
|
||||
if(index==1){
|
||||
tips.setVisibility(View.VISIBLE);
|
||||
tips_x.setVisibility(View.VISIBLE);
|
||||
}
|
||||
submit.setOnClickListener(v -> {
|
||||
if (imgIds.size() != 0) {
|
||||
if(imgIds.size()!=0){
|
||||
typeRequest();
|
||||
} else {
|
||||
Toast.makeText(con, "请先上传一张图片", Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(con,"请先上传一张图片",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
getImg.setOnClickListener(v -> {
|
||||
if (key) {
|
||||
Log.e("--imgIds.size()--", imgIds.size() + "");
|
||||
gia.showPopueWindow(this, index == 2);
|
||||
} else {
|
||||
if(key){
|
||||
Log.e("--imgIds.size()--",imgIds.size()+"");
|
||||
gia.showPopueWindow(this,index==2);
|
||||
}else{
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(res_img, ub.getData().getUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(res_img, ub.getData().getUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(res_img, ub.getData().getUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
Toast.makeText(con, "查看了照片", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(con,"查看了照片", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
img_delete.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
imgIds = new ArrayList<>();
|
||||
ub = new UploadBean();
|
||||
imgIds=new ArrayList<>();
|
||||
ub=new UploadBean();
|
||||
res_img.setVisibility(View.GONE);
|
||||
img_delete.setVisibility(View.GONE);
|
||||
img_icon.setVisibility(View.VISIBLE);
|
||||
key = true;
|
||||
key=true;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -310,15 +264,15 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||
if (null == gia.getFile()) {
|
||||
new ToastUtil(con, Gravity.CENTER, "图片选择失败").show(Toast.LENGTH_SHORT);
|
||||
return;
|
||||
}
|
||||
path = gia.getFile().getPath();
|
||||
Log.e("图片地址:", path);
|
||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||
if (null==gia.getFile()){
|
||||
new ToastUtil(con, Gravity.CENTER,"图片选择失败").show(Toast.LENGTH_SHORT);
|
||||
return;
|
||||
}
|
||||
path=gia.getFile().getPath();
|
||||
Log.e("图片地址:",path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
||||
if (imgs != null && imgs.size() > 0) {
|
||||
@@ -328,53 +282,49 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
if (TextUtils.isEmpty(paths)) {
|
||||
paths = image.getPath();
|
||||
}
|
||||
path = paths;
|
||||
Log.e("图片地址:", path);
|
||||
path=paths;
|
||||
Log.e("图片地址:",path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void initLocation() {
|
||||
public void initLocation(){
|
||||
address.setText(lgdu.getAddress());
|
||||
}
|
||||
|
||||
public void typeRequest() {
|
||||
public void typeRequest(){
|
||||
// for(int i=0;i<imgIds.size();i++){
|
||||
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||
// }
|
||||
switch (index) {
|
||||
switch (index){
|
||||
case 0:
|
||||
//装货
|
||||
if (imgIds != null && imgIds.size() > 0) {
|
||||
if(imgIds!=null && imgIds.size()>0) {
|
||||
lub.setLatitude(lgdu.getLatitude() + "");
|
||||
lub.setLongitude(lgdu.getLongitude() + "");
|
||||
lub.setLocationAddress(lgdu.getAddress());
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--装货信息", gson.toJson(lub));
|
||||
if (locationKey) {//高德定位
|
||||
if (keys) {
|
||||
if (lu!=null&&lu.getErrorCode()!=161){
|
||||
ToastUtils.showToast(this,"百度地图定位失败,请确认开启定位后重试!");
|
||||
return;
|
||||
}
|
||||
if(locationKey){
|
||||
hyr.loading(lub);
|
||||
if(keys){
|
||||
nfc();
|
||||
loadInfo();
|
||||
// up_traffic_start();
|
||||
// up_image_z();
|
||||
up_traffic_start();
|
||||
up_image_z();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(con,"图片上传异常,请重新上传",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (imgIds != null && imgIds.size() > 0) {
|
||||
if(imgIds!=null && imgIds.size()>0) {
|
||||
//卸货
|
||||
lub.setLatitude(lgdu.getLatitude() + "");
|
||||
lub.setLongitude(lgdu.getLongitude() + "");
|
||||
@@ -382,73 +332,64 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--卸货信息", gson.toJson(lub));
|
||||
if (locationKey) {
|
||||
if (keys) {
|
||||
if (lu!=null&&lu.getErrorCode()!=161){
|
||||
ToastUtils.showToast(this,"百度地图定位失败,请确认开启定位后重试!");
|
||||
return;
|
||||
}
|
||||
if(locationKey){
|
||||
if(keys){
|
||||
nfc();
|
||||
uploadInfo();
|
||||
|
||||
up_traffic_end();
|
||||
up_image();
|
||||
}
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
hyr.dischargeCargo(lub);
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(con,"图片上传异常,请重新上传",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
||||
if(imgIds!=null && imgIds.size()>0){//卸货回单
|
||||
//上传回单
|
||||
urib.setLatitude(lgdu.getLatitude() + "");
|
||||
urib.setLongitude(lgdu.getLongitude() + "");
|
||||
urib.setLatitude(lgdu.getLatitude()+"");
|
||||
urib.setLongitude(lgdu.getLongitude()+"");
|
||||
urib.setLocationAddress(lgdu.getAddress());
|
||||
//装卸货类型
|
||||
urib.setType(h_type + 1);
|
||||
urib.setType(h_type+1);
|
||||
//回单id 数组
|
||||
urib.setReceiptId(imgIds);
|
||||
//子运运单ID
|
||||
urib.setWaybillId(wid);
|
||||
Log.e("--回单信息", gson.toJson(urib));
|
||||
if (locationKey) {
|
||||
Log.e("--回单信息",gson.toJson(urib));
|
||||
if(locationKey) {
|
||||
if (index == 2 && keys) {
|
||||
if (lu!=null&&lu.getErrorCode()!=161){
|
||||
ToastUtils.showToast(this,"百度地图定位失败,请确认开启定位后重试!");
|
||||
return;
|
||||
}
|
||||
up_trafficSign();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
}
|
||||
hyr.receipt(urib);
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(con,"图片上传异常,请重新上传",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
||||
private StartOrderBean sob;
|
||||
|
||||
//上传安联和交通厅-装货
|
||||
public void up_traffic_start() {
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
public void up_traffic_start(){
|
||||
//安联
|
||||
if(sob.getData().getReportAlct()==1) {
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(lu.getLongitude());
|
||||
l.setBaiduLatitude(lu.getLatitude());
|
||||
l.setLocation(lu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
MDPLocationCollectionManager.pickup(con,sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货上传成功");
|
||||
@@ -457,78 +398,77 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货):", s + s1);
|
||||
new MessageUtils().showCenMessage(con, s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
//交通厅
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.start(con, sob, "");
|
||||
if(sob.getData().getReport()==1){
|
||||
JTTProcess.start(con,sob,"");
|
||||
}
|
||||
}
|
||||
|
||||
public void nfc() {
|
||||
public void nfc(){
|
||||
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||
// }
|
||||
if ("".equals(sob.getData().getNfcId()) || sob.getData().getNfcId() == null) {
|
||||
if("".equals(sob.getData().getNfcId()) || sob.getData().getNfcId()==null){
|
||||
return;
|
||||
}
|
||||
MDPLocationCollectionManager.checkNfc(con, sob.getData().getShippingNoteNumber(),
|
||||
sob.getData().getNfcId(), new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Toast.makeText(con, "nfcId匹配成功", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Toast.makeText(con,"nfcId匹配成功",Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("不匹配", "" + s + s1);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("不匹配",""+s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//上传安联和交通厅-卸货
|
||||
public void up_traffic_end() {
|
||||
public void up_traffic_end(){
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
Location l = new Location();
|
||||
if(sob.getData().getReportAlct()==1){
|
||||
Location l=new Location();
|
||||
l.setBaiduLongitude(lu.getLongitude());
|
||||
l.setBaiduLatitude(lu.getLatitude());
|
||||
l.setLocation(lu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||
Log.e("-安联卸货信息-",gson.toJson(l));
|
||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "卸货上传成功");
|
||||
Log.e("上报安联","卸货上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货):", s + s1);
|
||||
Log.e("上报安联失败(卸货):",s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
//交通厅
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.stop(con, sob, "");
|
||||
if(sob.getData().getReport()==1){
|
||||
JTTProcess.stop(con,sob,"");
|
||||
}
|
||||
}
|
||||
|
||||
//上传安联-签收
|
||||
public void up_trafficSign() {
|
||||
public void up_trafficSign(){
|
||||
//安联
|
||||
Location l = new Location();
|
||||
Location l=new Location();
|
||||
l.setBaiduLongitude(lu.getLongitude());
|
||||
l.setBaiduLatitude(lu.getLatitude());
|
||||
l.setLocation(lu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
List<Goods> gs = new ArrayList<>();
|
||||
List<Goods> gs=new ArrayList<>();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wid.equals(wayChild.getId() + "")) {
|
||||
if(wid.equals(wayChild.getId()+"")){
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO.GoodsDTO good : wayChild.getGoods()) {
|
||||
Goods g = new Goods();
|
||||
Goods g=new Goods();
|
||||
g.setGoodsName(good.getGoodName());
|
||||
g.setUnit(good.getGoodUnit());
|
||||
g.setItemNo(good.getId());
|
||||
@@ -543,23 +483,23 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new com.alct.mdp.callback.OnResultListener() {
|
||||
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l,gs, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "签收成功");
|
||||
Log.e("上报安联","签收成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(签收):", s + s1);
|
||||
Log.e("上报安联失败(签收):",s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//上传安联-回单
|
||||
public void up_trafficReceipt() {
|
||||
public void up_trafficReceipt(){
|
||||
//安联
|
||||
Location l = new Location();
|
||||
Location l=new Location();
|
||||
l.setBaiduLongitude(lu.getLongitude());
|
||||
l.setBaiduLatitude(lu.getLatitude());
|
||||
l.setLocation(lu.getAddress());
|
||||
@@ -568,23 +508,23 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "回单上传成功");
|
||||
Log.e("上报安联","回单上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单):", s + s1);
|
||||
Log.e("上报安联失败(回单):",s+s1);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void up_image_z() {
|
||||
public void up_image_z(){
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
File file = new File(path);
|
||||
Image image = new Image();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
File file=new File(path);
|
||||
Image image=new Image();
|
||||
String base= BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/"+ FileUtil.lastName(file) +";base64,"+base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
@@ -595,12 +535,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货照片上传成功");
|
||||
Log.e("上报安联","装货照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货照片):", s + s1);
|
||||
Log.e("上报安联失败(装货照片):",s+s1);
|
||||
// SPUtil.insSP(con,"make","装货",sob.getData().getShippingNoteNumber());
|
||||
// SPUtil.insSP(con,"make","装货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
@@ -610,11 +550,11 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
public void up_image() {
|
||||
File file = new File(path);
|
||||
Image image = new Image();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
public void up_image(){
|
||||
File file=new File(path);
|
||||
Image image=new Image();
|
||||
String base= BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/"+ FileUtil.lastName(file) +";base64,"+base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
@@ -625,12 +565,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "卸货照片上传成功");
|
||||
Log.e("上报安联","卸货照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货照片):", s + s1);
|
||||
Log.e("上报安联失败(卸货照片):",s+s1);
|
||||
// SPUtil.insSP(con,"make","卸货",sob.getData().getShippingNoteNumber());
|
||||
// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
@@ -640,12 +580,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
public void receipt_image() {
|
||||
public void receipt_image(){
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
File file = new File(path);
|
||||
Image image = new Image();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
File file=new File(path);
|
||||
Image image=new Image();
|
||||
String base= BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/"+ FileUtil.lastName(file) +";base64,"+base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
@@ -656,12 +596,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "回单照片上传成功");
|
||||
Log.e("上报安联","回单照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单照片):", s + s1);
|
||||
Log.e("上报安联失败(回单照片):",s+s1);
|
||||
// SPUtil.insSP(con,"make","回单",sob.getData().getShippingNoteNumber());
|
||||
//// SPUtil.insSP(con,"make","回单-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
@@ -685,7 +625,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
//NfcUtils.mNfcAdapter.disableForegroundDispatch(this);
|
||||
}
|
||||
|
||||
String nfcStr = "";
|
||||
String nfcStr="";
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
@@ -697,80 +637,8 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.e("nfc", nfcStr);
|
||||
Log.e("nfc",nfcStr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传安联和交通厅,平台-装货
|
||||
*/
|
||||
private void loadInfo() {
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(lu.getLongitude());
|
||||
l.setBaiduLatitude(lu.getLatitude());
|
||||
l.setLocation(lu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货上传成功");
|
||||
//交通厅
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.start(con, sob, "");
|
||||
}
|
||||
//装货照片
|
||||
up_image_z();
|
||||
//装货状态
|
||||
hyr.loading(lub);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货):", s + s1);
|
||||
new MessageUtils().showCenMessage(con, s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传安联和交通厅,平台-卸货
|
||||
*/
|
||||
private void uploadInfo() {
|
||||
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(lu.getLongitude());
|
||||
l.setBaiduLatitude(lu.getLatitude());
|
||||
l.setLocation(lu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "卸货上传成功");
|
||||
//交通厅
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.stop(con, sob, "");
|
||||
}
|
||||
//卸货照片-安联
|
||||
up_image();
|
||||
//卸货状态-平台
|
||||
hyr.dischargeCargo(lub);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货):", s + s1);
|
||||
new MessageUtils().showCenMessage(con, s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-713
@@ -1,713 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.alct.mdp.callback.OnResultListener;
|
||||
import com.alct.mdp.model.Goods;
|
||||
import com.alct.mdp.model.Image;
|
||||
import com.alct.mdp.model.Location;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.file.FileUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ShangChuangImgActivity2 extends BaseAppCompatActivity {
|
||||
|
||||
private TextView submit,name_top,name_body,address,tips,tips_x;
|
||||
private RelativeLayout getImg;
|
||||
private ImageView res_img,img_icon,img_delete;
|
||||
private String[] names={"装货","卸货","回单"};
|
||||
public static String[] TYPE_NAME={"zhuanghuo","xiehuo","huidan"};
|
||||
private int index=0;
|
||||
//
|
||||
private Gson gson=new Gson();
|
||||
//
|
||||
private LUInputBean lub=new LUInputBean();
|
||||
private UploadReceiptInputBean urib=new UploadReceiptInputBean();
|
||||
private LocationGDUtil lgdu;
|
||||
private LocationUtil lu;
|
||||
private List<Integer> imgIds=new ArrayList<>();
|
||||
private UploadBean ub;
|
||||
private HuoYuanRequset hyr;
|
||||
//
|
||||
private GetCarImageAlert gia=new GetCarImageAlert();
|
||||
private CustomDialog customDialog;
|
||||
private int id=0;
|
||||
private boolean key=true;
|
||||
private boolean keys=false;
|
||||
private boolean locationKey=false;
|
||||
private TextView tv_loaction;
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
switch (m.what){
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("upload")!=null) {
|
||||
Log.e("upload",CacheGroup.cacheList.get("upload"));
|
||||
ub=gson.fromJson(CacheGroup.cacheList.remove("upload"),UploadBean.class);
|
||||
if(ub.getCode()==200){
|
||||
imgIds.add(ub.getData().getId());
|
||||
Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||
res_img.setVisibility(View.VISIBLE);
|
||||
img_delete.setVisibility(View.VISIBLE);
|
||||
img_icon.setVisibility(View.GONE);
|
||||
key=false;
|
||||
}else{
|
||||
Toast.makeText(con,ub.getMsg(),Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("upload");
|
||||
}
|
||||
for(int i=0;i<TYPE_NAME.length;i++){
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[i])!=null) {
|
||||
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]),BaseBean.class);
|
||||
if(bb.getCode()==200){
|
||||
if(!keys){
|
||||
Toast.makeText(con,"上传成功",Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}else{
|
||||
Toast.makeText(con,"上传成功",Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||
}
|
||||
}
|
||||
if(CacheGroup.cacheList.get("carName")!=null){
|
||||
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get("carName"),BaseBean.class);
|
||||
if(bb.getCode()==200){
|
||||
|
||||
}
|
||||
CacheGroup.cacheList.remove("carName");
|
||||
}
|
||||
break;
|
||||
case 14://定位成功
|
||||
locationKey=true;
|
||||
customDialog.dismiss();
|
||||
tv_loaction.setText("定位成功");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color,null));
|
||||
initLocation();
|
||||
break;
|
||||
case 16://定位失败
|
||||
locationKey=false;
|
||||
customDialog.dismiss();
|
||||
tv_loaction.setText("定位失败,点击重试");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color,null));
|
||||
Toast.makeText(con,"定位失败,请确认开启定位后重试!",Toast.LENGTH_LONG).show();
|
||||
//定位结果接收
|
||||
//finish();
|
||||
break;
|
||||
case 15:
|
||||
break;
|
||||
|
||||
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||
path= (String) m.obj;
|
||||
Log.e("res:","选定图片结果");
|
||||
Log.e("res:",path);
|
||||
//选定图片结果
|
||||
// if(index==1 || index==2){
|
||||
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||
// }
|
||||
hyr.uploadFile(new File(path));
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
||||
private String wid;
|
||||
private int h_type;
|
||||
String sobStr="";
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_shangchuan);
|
||||
con=this;
|
||||
submit=findViewById(R.id.submit);
|
||||
name_top=findViewById(R.id.name_top);
|
||||
name_body=findViewById(R.id.name_body);
|
||||
address=findViewById(R.id.address);
|
||||
getImg=findViewById(R.id.getImg);
|
||||
res_img=findViewById(R.id.res_img);
|
||||
img_icon=findViewById(R.id.img_icon);
|
||||
img_delete=findViewById(R.id.img_delete);
|
||||
tv_loaction=findViewById(R.id.tv_loaction);
|
||||
tips=findViewById(R.id.tips);
|
||||
tips_x=findViewById(R.id.tips_x);
|
||||
Bundle ins=getIntent().getExtras();
|
||||
index=ins.getInt("type");
|
||||
wid=ins.getString("wid");
|
||||
h_type=ins.getInt("h_type");
|
||||
keys=ins.getBoolean("keys");
|
||||
sobStr=getIntent().getExtras().getString("sob");
|
||||
//Log.e("---sdwStr--",sdwStr);
|
||||
sob=new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||
initView(null);
|
||||
customDialog=new CustomDialog(con, "正在定位当前位置...");
|
||||
customDialog.show();
|
||||
lgdu=new LocationGDUtil(con,hd);
|
||||
//启动定位
|
||||
lgdu.onCreate();
|
||||
lu=new LocationUtil(con,hd);
|
||||
lu.onCreate();
|
||||
if (keys){
|
||||
lu=new LocationUtil(con,hd);
|
||||
lu.onCreate();
|
||||
}
|
||||
tv_loaction.setOnClickListener(v -> {
|
||||
if (!locationKey){
|
||||
customDialog.show();
|
||||
lgdu.onCreate();
|
||||
}
|
||||
});
|
||||
hyr=new HuoYuanRequset(con,hd);
|
||||
// if (!NfcUtils.hasNfc(con)) {
|
||||
// Toast.makeText(con,"请先开启nfc",Toast.LENGTH_LONG).show();
|
||||
// }else{
|
||||
// initData();
|
||||
// }
|
||||
}
|
||||
|
||||
public void initData() {
|
||||
//nfc初始化设置
|
||||
NfcUtils nfcUtils = new NfcUtils(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
name_top.setText("上传"+names[index]+"照片");
|
||||
name_body.setText(names[index]+"照片");
|
||||
if(index==1){
|
||||
tips.setVisibility(View.VISIBLE);
|
||||
tips_x.setVisibility(View.VISIBLE);
|
||||
}
|
||||
submit.setOnClickListener(v -> {
|
||||
if(imgIds.size()!=0){
|
||||
typeRequest();
|
||||
}else{
|
||||
Toast.makeText(con,"请先上传一张图片",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
getImg.setOnClickListener(v -> {
|
||||
if(key){
|
||||
Log.e("--imgIds.size()--",imgIds.size()+"");
|
||||
gia.showPopueWindow(this,true);
|
||||
// gia.showPopueWindow(this,index==2);
|
||||
}else{
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(res_img, ub.getData().getUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(res_img, ub.getData().getUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
Toast.makeText(con,"查看了照片", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
img_delete.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
imgIds=new ArrayList<>();
|
||||
ub=new UploadBean();
|
||||
res_img.setVisibility(View.GONE);
|
||||
img_delete.setVisibility(View.GONE);
|
||||
img_icon.setVisibility(View.VISIBLE);
|
||||
key=true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String path;
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||
if (null==gia.getFile()){
|
||||
new ToastUtil(con, Gravity.CENTER,"图片选择失败").show(Toast.LENGTH_SHORT);
|
||||
return;
|
||||
}
|
||||
path=gia.getFile().getPath();
|
||||
Log.e("图片地址:",path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
||||
if (imgs != null && imgs.size() > 0) {
|
||||
LocalMedia image = imgs.get(0);
|
||||
|
||||
String paths = image.getAndroidQToPath();
|
||||
if (TextUtils.isEmpty(paths)) {
|
||||
paths = image.getPath();
|
||||
}
|
||||
path=paths;
|
||||
Log.e("图片地址:",path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void initLocation(){
|
||||
address.setText(lgdu.getAddress());
|
||||
}
|
||||
|
||||
public void typeRequest(){
|
||||
// for(int i=0;i<imgIds.size();i++){
|
||||
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||
// }
|
||||
switch (index){
|
||||
case 0:
|
||||
//装货
|
||||
if(imgIds!=null && imgIds.size()>0) {
|
||||
lub.setLatitude(lgdu.getLatitude() + "");
|
||||
lub.setLongitude(lgdu.getLongitude() + "");
|
||||
lub.setLocationAddress(lgdu.getAddress());
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--装货信息", gson.toJson(lub));
|
||||
if(locationKey){
|
||||
// hyr.loading(lub);
|
||||
if(keys){
|
||||
nfc();
|
||||
up_traffic_start();
|
||||
up_image_z();
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}else{
|
||||
Toast.makeText(con,"图片上传异常,请重新上传",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(imgIds!=null && imgIds.size()>0) {
|
||||
//卸货
|
||||
lub.setLatitude(lgdu.getLatitude() + "");
|
||||
lub.setLongitude(lgdu.getLongitude() + "");
|
||||
lub.setLocationAddress(lgdu.getAddress());
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--卸货信息", gson.toJson(lub));
|
||||
if(locationKey){
|
||||
if(keys){
|
||||
nfc();
|
||||
up_traffic_end();
|
||||
up_image();
|
||||
}
|
||||
// hyr.dischargeCargo(lub);
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}else{
|
||||
Toast.makeText(con,"图片上传异常,请重新上传",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(imgIds!=null && imgIds.size()>0){//卸货回单
|
||||
//上传回单
|
||||
urib.setLatitude(lgdu.getLatitude()+"");
|
||||
urib.setLongitude(lgdu.getLongitude()+"");
|
||||
urib.setLocationAddress(lgdu.getAddress());
|
||||
//装卸货类型
|
||||
urib.setType(h_type+1);
|
||||
//回单id 数组
|
||||
urib.setReceiptId(imgIds);
|
||||
//子运运单ID
|
||||
urib.setWaybillId(wid);
|
||||
Log.e("--回单信息",gson.toJson(urib));
|
||||
if(locationKey) {
|
||||
if (index == 2 && keys) {
|
||||
up_trafficSign();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
}
|
||||
// hyr.receipt(urib);
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(con,"图片上传异常,请重新上传",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
||||
private StartOrderBean sob;
|
||||
|
||||
//上传安联和交通厅-装货
|
||||
public void up_traffic_start(){
|
||||
//安联
|
||||
if(sob.getData().getReportAlct()==1) {
|
||||
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==1){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
l.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
l.setLocation(data.getAddress());
|
||||
l.setTime(data.getImageTakenDate());
|
||||
MDPLocationCollectionManager.pickup(con,sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货上传成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"装货上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货):", s + s1);
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,s + s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
//交通厅
|
||||
if(sob.getData().getReport()==1){
|
||||
JTTProcess.start(con,sob,"");
|
||||
}
|
||||
}
|
||||
|
||||
public void nfc(){
|
||||
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||
// }
|
||||
if("".equals(sob.getData().getNfcId()) || sob.getData().getNfcId()==null){
|
||||
return;
|
||||
}
|
||||
MDPLocationCollectionManager.checkNfc(con, sob.getData().getShippingNoteNumber(),
|
||||
sob.getData().getNfcId(), new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Toast.makeText(con,"nfcId匹配成功",Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("不匹配",""+s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//上传安联和交通厅-卸货
|
||||
public void up_traffic_end(){
|
||||
//安联
|
||||
if(sob.getData().getReportAlct()==1){
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==2){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
Location l=new Location();
|
||||
l.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
l.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
l.setLocation(data.getAddress());
|
||||
l.setTime(data.getImageTakenDate());
|
||||
Log.e("-安联卸货信息-",gson.toJson(l));
|
||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","卸货上传成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"卸货上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货):",s+s1);
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
//交通厅
|
||||
if(sob.getData().getReport()==1){
|
||||
JTTProcess.stop(con,sob,"");
|
||||
}
|
||||
}
|
||||
|
||||
//上传安联-签收
|
||||
public void up_trafficSign(){
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==2){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
//安联
|
||||
Location l=new Location();
|
||||
l.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
l.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
l.setLocation(data.getAddress());
|
||||
l.setTime(data.getImageTakenDate());
|
||||
List<Goods> gs=new ArrayList<>();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if(wid.equals(wayChild.getId()+"")){
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO.GoodsDTO good : wayChild.getGoods()) {
|
||||
Goods g=new Goods();
|
||||
g.setGoodsName(good.getGoodName());
|
||||
g.setUnit(good.getGoodUnit());
|
||||
g.setItemNo(good.getId());
|
||||
//实收
|
||||
g.setQuantity(1);
|
||||
//应收
|
||||
g.setReceivedQuantity(1);
|
||||
//破损
|
||||
g.setDamageQuantity(1);
|
||||
//丢失
|
||||
g.setQuantity(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l,gs, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","签收成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"签收成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,s+s1);
|
||||
Log.e("上报安联失败(签收):",s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//上传安联-回单
|
||||
public void up_trafficReceipt(){
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==2){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
//安联
|
||||
Location l=new Location();
|
||||
l.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
l.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
l.setLocation(data.getAddress());
|
||||
l.setTime(data.getImageTakenDate());
|
||||
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","回单上传成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"回单上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单):",s+s1);
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,s+s1);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void up_image_z(){
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==1){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
|
||||
File file=new File(path);
|
||||
Image image=new Image();
|
||||
String base= BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/"+ FileUtil.lastName(file) +";base64,"+base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(data.getImageTakenDate());
|
||||
image.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
image.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
image.setLocation(data.getAddress());
|
||||
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","装货照片上传成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"装货照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货照片):",s+s1);
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,s+s1);
|
||||
// SPUtil.insSP(con,"make","装货",sob.getData().getShippingNoteNumber());
|
||||
// SPUtil.insSP(con,"make","装货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
// startService(serviceIn);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void up_image(){
|
||||
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==2){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
|
||||
File file=new File(path);
|
||||
Image image=new Image();
|
||||
String base= BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/"+ FileUtil.lastName(file) +";base64,"+base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(data.getImageTakenDate());
|
||||
image.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
image.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
image.setLocation(data.getAddress());
|
||||
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","卸货照片上传成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"卸货照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货照片):",s+s1);
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,s+s1);
|
||||
// SPUtil.insSP(con,"make","卸货",sob.getData().getShippingNoteNumber());
|
||||
// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
// startService(serviceIn);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void receipt_image(){
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==2){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
|
||||
File file=new File(path);
|
||||
Image image=new Image();
|
||||
String base= BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/"+ FileUtil.lastName(file) +";base64,"+base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(data.getImageTakenDate());
|
||||
image.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
image.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
image.setLocation(data.getAddress());
|
||||
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","回单照片上传成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"回单照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单照片):",s+s1);
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,s+s1);
|
||||
// SPUtil.insSP(con,"make","回单",sob.getData().getShippingNoteNumber());
|
||||
//// SPUtil.insSP(con,"make","回单-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
//// startService(serviceIn);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
//开启前台调度系统
|
||||
//NfcUtils.mNfcAdapter.enableForegroundDispatch(this, NfcUtils.mPendingIntent, NfcUtils.mIntentFilter, NfcUtils.mTechList);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
//关闭前台调度系统
|
||||
//NfcUtils.mNfcAdapter.disableForegroundDispatch(this);
|
||||
}
|
||||
|
||||
String nfcStr="";
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
//当该Activity接收到NFC标签时,运行该方法
|
||||
//调用工具方法,读取NFC数据
|
||||
try {
|
||||
nfcStr = NfcUtils.readNFCId(intent);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.e("nfc",nfcStr);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -29,7 +29,6 @@ import androidx.cardview.widget.CardView;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.ImageConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
@@ -85,6 +84,9 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
System.out.println("csdf");
|
||||
System.out.println("csdf");
|
||||
System.out.println("csdf");
|
||||
switch (m.what) {
|
||||
case 200:
|
||||
if (CacheGroup.cacheList.get("getImage") != null) {
|
||||
@@ -308,12 +310,8 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
}, cd * 1000);
|
||||
}
|
||||
|
||||
// String keys = "f9d35b1133cff1f6e3960c89b249e03f";
|
||||
// String license = "eQQm7gCZPF58Cy4i9OGkqSdFdDnFF0VSUVpw92WcrNLx7zVbpGJwjQhnKL8b0piApIbOTog5log/S1ZIxoUQogueaG84BQlJfRwKjtvpVWImlmhthQyQd2ogRqGkm3rkVGeG9wK49fzP3g5AtghNF05je2rQWd/Tyy/wutXq0e0rvR/bEckFaZ4BesQaYd0MejFC3lA8BjxNWiuvCKs15e1aRUOU5vwN5wsaTsTHokBIYhioSxOoGgHn6NrX6K9Dsl9uTWZ2dOVK/jEzYsNt6E/1Ww2ck1XmIWdRCQNmCpgikuPT0ACAL/w7UaRoWzM/Pm+akWqyp+bEavHT1Vhug3HAHOSGfOghGw2NerNlyEg8h6cVneMx+TsidnQ0ZG29aqdcLBRsvi26BYJJCA8+0WXjT+73RhS8g97Rfb6h0/W//5Az8UNZ6dp6XvUi2EJXQRhY5hkHiuwWT2W1ik+6wiiURkkrBACKbO1kmZWbVpRIe3Y3pcr3Q/V+oAcyPHRXCxu+JIe/j40/epuRrCyf8yvKsZ2Dnkl4QQmlwNqlW1F/arS+19G6zOG+6VKwtbI01A1R9SU1TYOA5UL/Qpo6Gyi3Ec3/irgQlzkq1rZrOIS4oo6tghul/zcG8rjno3luqHYwIZf8vAVfpwBesIVcANCOIuTRPU3A8vdmUoK/twGIchPapmjlAzLhjZ4KoAbNeMsWu3sN6kF44xofLMghos2X8OtvUA9CMD37v2FpYoM75qavyoivsBAbb6mG0p5TmkZ37BxfaGGP6SYrCa9ygQ==";
|
||||
|
||||
String keys = "19ac0aa74338e487e45057faf7212401";
|
||||
String license = "HF41uGxM/1i3CtW98DimoA97BlNTAnQ+DiEAihYmZ2jR1jqC4be253joEJbOJgFDIzp5aIoeuXSWWHFaDVfaHL2Pksbq5f8M8EqsVhP9q/i1xGYSYf6MJVlHdMAVLWgR0Kra+n8dVzkSDuZeyJuDsskAmZaGFQN1CqnWYCI1tmV1Tk4A57e9LQMed0U11QWjdshdU2DGqBXKmGE419PdW3NmIxOR2u9iB1OKBmvzCUT8RAYyBzSn/yhU++YJ25g5a8Pb5kOvi+eOh+PEFEcQL6oOp/CF4Iw5nadlsLhc+XEnVJpwL2myZBoSlVcKxrJKbRn1/DIgXBueKKnqhyHKdJlpqI9eghAlRF0p2Q4f23m89mWRZf4nhKzTeXGIjCTFO4TNVucrlGU7tyJcrRCDVdfV24fziH+hB3QGckpuYzzjefr7hZalLRJ/w8dPw/8dCY1wnWq3AJ3zw2g1PzMxl51q7AgdKvwc1ERcGBns0zb8PK6vGKCnJq3uHiJEnslbTI0MEosje+h+OPO7hf2QofErewjI19wHEOv4dTvuFLh3VmGFMObAmov5kI47705fjSxCvAPGATBrfUSwim+5EQ1hanc5IcXe0/nOTiRUNEpZ+x65zVydqAs7490yqQiIUQvPazEwcal7vH2OD54lCcgpxKxqdmGc5/bp5UnqB45+n+iuInV/Q9DMOQVk15uaVZmhS8VaCqH21CmfH/ZGLb9wiEpaRLrPZLKX3bK7MT9Z0/OlDnb2QUKU8LMMIhLuQQntzsf0Wn4kA/0e9QAJJQ==";
|
||||
|
||||
String keys = "f9d35b1133cff1f6e3960c89b249e03f";
|
||||
String license = "eQQm7gCZPF58Cy4i9OGkqSdFdDnFF0VSUVpw92WcrNLx7zVbpGJwjQhnKL8b0piApIbOTog5log/S1ZIxoUQogueaG84BQlJfRwKjtvpVWImlmhthQyQd2ogRqGkm3rkVGeG9wK49fzP3g5AtghNF05je2rQWd/Tyy/wutXq0e0rvR/bEckFaZ4BesQaYd0MejFC3lA8BjxNWiuvCKs15e1aRUOU5vwN5wsaTsTHokBIYhioSxOoGgHn6NrX6K9Dsl9uTWZ2dOVK/jEzYsNt6E/1Ww2ck1XmIWdRCQNmCpgikuPT0ACAL/w7UaRoWzM/Pm+akWqyp+bEavHT1Vhug3HAHOSGfOghGw2NerNlyEg8h6cVneMx+TsidnQ0ZG29aqdcLBRsvi26BYJJCA8+0WXjT+73RhS8g97Rfb6h0/W//5Az8UNZ6dp6XvUi2EJXQRhY5hkHiuwWT2W1ik+6wiiURkkrBACKbO1kmZWbVpRIe3Y3pcr3Q/V+oAcyPHRXCxu+JIe/j40/epuRrCyf8yvKsZ2Dnkl4QQmlwNqlW1F/arS+19G6zOG+6VKwtbI01A1R9SU1TYOA5UL/Qpo6Gyi3Ec3/irgQlzkq1rZrOIS4oo6tghul/zcG8rjno3luqHYwIZf8vAVfpwBesIVcANCOIuTRPU3A8vdmUoK/twGIchPapmjlAzLhjZ4KoAbNeMsWu3sN6kF44xofLMghos2X8OtvUA9CMD37v2FpYoM75qavyoivsBAbb6mG0p5TmkZ37BxfaGGP6SYrCa9ygQ==";
|
||||
|
||||
public void init() {
|
||||
String state = SPUtil.getSP(con, "state_data", "authorization_state");
|
||||
@@ -327,7 +325,7 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
//安联初始化
|
||||
if (context.getPackageName().equals(getCurrentProcessName(context))) {
|
||||
//Log.e("--使用的测试环境--",BuildConfig.OPEN_API_URL);
|
||||
MDPLocationCollectionManager.initialize(getApplicationContext(), BuildConfig.OPEN_AL_URL);
|
||||
MDPLocationCollectionManager.initialize(getApplicationContext(), "https://oapi.alct56.com");
|
||||
}
|
||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||
// 路由初始化
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.my;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -16,6 +19,7 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||
@@ -23,6 +27,7 @@ import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.text.TextActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.gson.Gson;
|
||||
@@ -50,6 +55,7 @@ import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
@@ -232,24 +238,27 @@ public class MyFragment extends BaseFragment {
|
||||
});
|
||||
//联系我们
|
||||
onContact.setOnClickListener(v -> {
|
||||
String serviceMobile="";
|
||||
if(ConfigParts.getConfigParts(con)!=null){
|
||||
serviceMobile=ConfigParts.getConfigParts(con).getData().getServiceMobile();
|
||||
serviceMobile=StringUtil.isNull(serviceMobile,"");
|
||||
}
|
||||
String[] title={"平台客服:"+serviceMobile};
|
||||
String[] value={serviceMobile};
|
||||
new XPopup.Builder(con)
|
||||
.isDarkTheme(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.asCenterList("请选择",title,
|
||||
(position1, text) -> {
|
||||
Intent intent = new Intent(Intent.ACTION_DIAL);
|
||||
Uri data = Uri.parse("tel:" + value[position1]);
|
||||
intent.setData(data);
|
||||
startActivity(intent);
|
||||
})
|
||||
.show();
|
||||
getActivity().startActivity(new Intent(getActivity(), TextActivity.class));
|
||||
// isNotificationListenerEnabled(getActivity());
|
||||
// goHuaWeiMainager();
|
||||
// String serviceMobile="";
|
||||
// if(ConfigParts.getConfigParts(con)!=null){
|
||||
// serviceMobile=ConfigParts.getConfigParts(con).getData().getServiceMobile();
|
||||
// serviceMobile=StringUtil.isNull(serviceMobile,"");
|
||||
// }
|
||||
// String[] title={"平台客服:"+serviceMobile};
|
||||
// String[] value={serviceMobile};
|
||||
// new XPopup.Builder(con)
|
||||
// .isDarkTheme(false)
|
||||
// .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
// .asCenterList("请选择",title,
|
||||
// (position1, text) -> {
|
||||
// Intent intent = new Intent(Intent.ACTION_DIAL);
|
||||
// Uri data = Uri.parse("tel:" + value[position1]);
|
||||
// intent.setData(data);
|
||||
// startActivity(intent);
|
||||
// })
|
||||
// .show();
|
||||
});
|
||||
//咨询建议
|
||||
onOpinion.setOnClickListener(v -> {
|
||||
@@ -264,6 +273,47 @@ public class MyFragment extends BaseFragment {
|
||||
onSetUp.setOnClickListener(v -> startActivity(new Intent(con, SetupActivity.class)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否开启通知使用权限
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public void isNotificationListenerEnabled(Context context) {
|
||||
Set<String> packageNames = NotificationManagerCompat.getEnabledListenerPackages(context);
|
||||
if (!packageNames.contains(context.getPackageName())) {//没有开启使用权限,去开启
|
||||
Intent intent = new Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void goHuaWeiMainager() {
|
||||
try {
|
||||
Intent intent = new Intent(getActivity().getPackageName());
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// ComponentName comp = new ComponentName("com.huawei.systemmanager", "com.huawei.permissionmanager.ui.MainActivity");
|
||||
ComponentName comp = new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity");
|
||||
intent.setComponent(comp);
|
||||
getActivity().startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
Toast.makeText(getActivity(), "跳转失败", Toast.LENGTH_LONG).show();
|
||||
e.printStackTrace();
|
||||
goIntentSetting();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void goIntentSetting() {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getActivity().getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
try {
|
||||
getActivity().startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void initAuth(){
|
||||
if(userBean.getData()!=null){
|
||||
name.setText(StringUtil.isNull(userBean.getData().getUname(),"未实名"));
|
||||
|
||||
@@ -35,7 +35,6 @@ import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseFragment;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
import com.zhpan.bannerview.BannerViewPager;
|
||||
import com.zhpan.bannerview.constants.PageStyle;
|
||||
|
||||
@@ -177,11 +176,8 @@ public class WoDeFragment extends BaseFragment {
|
||||
headportraitUrl.setOnClickListener(v1 -> {
|
||||
if(ub.getData().getHeadportraitUrl()!=null && !ub.getData().getHeadportraitUrl().equals("")){
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(headportraitUrl,ub.getData().getHeadportraitUrl(),new SmartGlideImageLoader(R.mipmap.ic_launcher_round))
|
||||
.asImageViewer(headportraitUrl,ub.getData().getHeadportraitUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(headportraitUrl,ub.getData().getHeadportraitUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
}else{
|
||||
Intent in=new Intent(con, PersonalAuthActivity.class);
|
||||
startActivity(in);
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.text;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
|
||||
/**
|
||||
* @ClassName AutoStartAppUtil
|
||||
* @Author 用户
|
||||
* @Date 2022/10/9 9:56
|
||||
* @Description TODO
|
||||
*/
|
||||
public class AutoStartAppUtil {
|
||||
public static final Intent[] POWERMANAGER_INTENTS = {
|
||||
new Intent().setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.letv.android.letvsafe", "com.letv.android.letvsafe.AutobootManageActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity")),
|
||||
//new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.privacypermissionsentry.PermissionTopActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startup.StartupAppListActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.startupapp.StartupAppListActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.oppo.safe", "com.oppo.safe.permission.startup.StartupAppListActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.iqoo.secure", "com.iqoo.secure.ui.phoneoptimize.AddWhiteListActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.iqoo.secure", "com.iqoo.secure.ui.phoneoptimize.BgStartUpManager")),
|
||||
new Intent().setComponent(new ComponentName("com.vivo.permissionmanager", "com.vivo.permissionmanager.activity.BgStartUpManagerActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.samsung.android.lool", "com.samsung.android.sm.battery.ui.BatteryActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.samsung.android.lool", "com.samsung.android.sm.ui.battery.BatteryActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.htc.pitroad", "com.htc.pitroad.landingpage.activity.LandingPageActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.asus.mobilemanager", "com.asus.mobilemanager.MainActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.transsion.phonemanager", "com.itel.autobootmanager.activity.AutoBootMgrActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.meizu.safe", "com.meizu.safe.permission.SmartBGActivity")),
|
||||
new Intent().setComponent(new ComponentName("cn.nubia.security2", "cn.nubia.security.appmanage.selfstart.ui.SelfStartActivity")),
|
||||
new Intent().setComponent(new ComponentName("com.transsion.phonemaster", "com.cyin.himgr.applicationmanager.view.activities.AutoStartActivity")),
|
||||
};
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.text;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.service.notification.NotificationListenerService;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
|
||||
/**
|
||||
* @ClassName TestNotificationListenerService
|
||||
* @Author 用户
|
||||
* @Date 2022/10/9 9:53
|
||||
* @Description TODO
|
||||
*/
|
||||
public class TestNotificationListenerService extends NotificationListenerService {
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
return super.onStartCommand(intent, flags, startId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNotificationPosted(StatusBarNotification sbn) {
|
||||
super.onNotificationPosted(sbn);
|
||||
//Notification notification = sbn.getNotification();
|
||||
// Log.d(LiveTaskApplication.TAG, "sbn.getPackageName: " + sbn.getPackageName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.text;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||
|
||||
/**
|
||||
* @ClassName TestService
|
||||
* @Author 用户
|
||||
* @Date 2022/10/9 9:51
|
||||
* @Description TODO
|
||||
*/
|
||||
public class TestService extends Service {
|
||||
|
||||
private static final int VISIBILITY_PUBLIC = 1000;
|
||||
private static final int PRIORITY_HIGH = 1000;
|
||||
private final String CHANNEL_ONE_ID = "100";
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onUnbind(Intent intent) {
|
||||
return super.onUnbind(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
/****************第一点*******************/
|
||||
//创建通知栏常驻通知
|
||||
initNotif("title", "text");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
stopForeground(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
// return super.onStartCommand(intent, flags, startId);
|
||||
/****************第二点*******************/
|
||||
//返回START_STICKY,被系统或手动清理后可重启
|
||||
return START_STICKY;
|
||||
}
|
||||
|
||||
public void initNotif(String title, String context) {
|
||||
//RemoteViews remoteView = new RemoteViews(getPackageName(), R.layout.RemoteView);
|
||||
Drawable drawable = getResources().getDrawable(R.mipmap.ic_launcher, null);
|
||||
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
|
||||
Bitmap bitmapIcon = getBitmapFromDrawable(drawable);
|
||||
|
||||
Intent nfIntent = new Intent(this, MainActivity.class);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, nfIntent, 0);
|
||||
@SuppressLint("WrongConstant") NotificationCompat.Builder builder = new NotificationCompat.Builder(this.getApplicationContext(), CHANNEL_ONE_ID)
|
||||
.setContentIntent(pendingIntent) // 设置PendingIntent
|
||||
.setSmallIcon(R.mipmap.ic_launcher) // 设置状态栏内的小图标
|
||||
//.setLargeIcon(bitmapIcon)// 设置大图标
|
||||
.setContentTitle(title)
|
||||
.setContentText(context) // 设置内容
|
||||
.setWhen(System.currentTimeMillis())// 设置该通知发生的时间
|
||||
.setVisibility(VISIBILITY_PUBLIC)// 锁屏显示全部通知
|
||||
//.setDefaults(Notification.DEFAULT_ALL)// //使用默认的声音、振动、闪光
|
||||
.setPriority(PRIORITY_HIGH);// 通知的优先级
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
//修改安卓8.0以上系统报错
|
||||
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ONE_ID, "服务常驻通知", NotificationManager.IMPORTANCE_MIN);
|
||||
notificationChannel.enableLights(false);//如果使用中的设备支持通知灯,则说明此通知通道是否应显示灯
|
||||
notificationChannel.setShowBadge(false);//是否显示角标
|
||||
notificationChannel.enableVibration(false);//是否震动
|
||||
notificationChannel.setLockscreenVisibility(VISIBILITY_PUBLIC);//锁屏显示全部通知
|
||||
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||
manager.createNotificationChannel(notificationChannel);
|
||||
builder.setChannelId(CHANNEL_ONE_ID);
|
||||
}
|
||||
Notification notification = builder.build(); // 获取构建好的Notification
|
||||
notification.defaults = Notification.DEFAULT_SOUND; //设置为默认的声音
|
||||
|
||||
startForeground(1, notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* 把资源图片转换成Bitmap
|
||||
*
|
||||
* @param drawable 资源图片
|
||||
* @return 位图
|
||||
*/
|
||||
public static Bitmap getBitmapFromDrawable(Drawable drawable) {
|
||||
int width = drawable.getBounds().width();
|
||||
int height = drawable.getBounds().height();
|
||||
Bitmap bitmap = Bitmap.createBitmap(width, height, drawable
|
||||
.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888
|
||||
: Bitmap.Config.RGB_565);
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
drawable.setBounds(0, 0, width, height);
|
||||
drawable.draw(canvas);
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.text;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.PowerManager;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @ClassName TextActivity
|
||||
* @Author 用户
|
||||
* @Date 2022/10/9 10:05
|
||||
* @Description TODO
|
||||
*/
|
||||
public class TextActivity extends AppCompatActivity implements View.OnClickListener{
|
||||
|
||||
private TextView mLeft;
|
||||
private TextView mBandName;
|
||||
private TextView mAutoStart;
|
||||
private TextView mTutorials;
|
||||
private TextView mLockApp;
|
||||
private TextView mBatteryOptimization;
|
||||
private WebView mWebView1, mWebView2;
|
||||
|
||||
private boolean isWeb = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main1);
|
||||
//提示: 需要与服务共享数据自行绑定服务
|
||||
initView();
|
||||
/****************第四点*******************/
|
||||
//开启通知使用权限(有的手机需要开启才能重启进程)
|
||||
isNotificationListenerEnabled(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v == mLeft) {
|
||||
if (isWeb) {
|
||||
isWeb = false;
|
||||
mWebView1.setVisibility(View.GONE);
|
||||
mWebView2.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
finish();
|
||||
} else if (v == mTutorials) {
|
||||
isWeb = true;
|
||||
mWebView1.setVisibility(View.VISIBLE);
|
||||
String brand = getDeviceBrand();
|
||||
String htmlName = "";
|
||||
if (brand.equalsIgnoreCase("huawei")) {
|
||||
htmlName = "huawei";
|
||||
} else if (brand.equalsIgnoreCase("honor")) {
|
||||
htmlName = "honor";
|
||||
} else if (brand.equalsIgnoreCase("infinix")) {
|
||||
htmlName = "infinix";
|
||||
} else if (brand.equalsIgnoreCase("meizu")) {
|
||||
htmlName = "meizu";
|
||||
} else if (brand.equalsIgnoreCase("xiaomi")) {
|
||||
htmlName = "xiaomi";
|
||||
} else if (brand.equalsIgnoreCase("redmi")) {
|
||||
htmlName = "redmi";
|
||||
} else if (brand.equalsIgnoreCase("oppo")) {
|
||||
htmlName = "oppo";
|
||||
} else if (brand.equalsIgnoreCase("realme")) {
|
||||
htmlName = "realme";
|
||||
} else if (brand.equalsIgnoreCase("onePlus")) {
|
||||
htmlName = "onePlus";
|
||||
} else if (brand.equalsIgnoreCase("vivo")) {
|
||||
htmlName = "vivo";
|
||||
} else if (brand.equalsIgnoreCase("iqoo")) {
|
||||
htmlName = "iqoo";
|
||||
} else if (brand.equalsIgnoreCase("smartisan")) {
|
||||
htmlName = "smartisan";
|
||||
} else if (brand.equalsIgnoreCase("sumsang")) {
|
||||
htmlName = "sumsang";
|
||||
} else if (brand.equalsIgnoreCase("asus")) {
|
||||
htmlName = "asus";
|
||||
} else if (brand.equalsIgnoreCase("lenovo")) {
|
||||
htmlName = "lenovo";
|
||||
} else if (brand.equalsIgnoreCase("nubia")) {
|
||||
htmlName = "nubia";
|
||||
}
|
||||
if (!getSystemLanguage().contains("zh")) {// 非中文
|
||||
htmlName = htmlName + "_e";
|
||||
}
|
||||
mWebView1.loadUrl("http://服务器接口地址/autostart/autostart_" + htmlName + ".html");
|
||||
|
||||
} else if (v == mAutoStart) {
|
||||
Intent intents = null;
|
||||
for (Intent intent : AutoStartAppUtil.POWERMANAGER_INTENTS)
|
||||
if (getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY) != null) {
|
||||
intents = intent;
|
||||
break;
|
||||
}
|
||||
Log.e("gy", "手机品牌 device brand:" + getDeviceBrand());
|
||||
if (intents != null) {
|
||||
if (getDeviceBrand().equalsIgnoreCase("Infinix")) {
|
||||
Toast.makeText(this, "无权打开系统界面, 请点击查看教程手动设置", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (getDeviceBrand().equalsIgnoreCase("OPPO") || getDeviceBrand().equalsIgnoreCase("realme")) {
|
||||
if (ContextCompat.checkSelfPermission(TextActivity.this, "oppo.permission.OPPO_COMPONENT_SAFE") != PackageManager.PERMISSION_GRANTED) {
|
||||
// oppo 为系统权限不对外开放
|
||||
Toast.makeText(this, "无权打开系统界面, 请点击查看教程手动设置", Toast.LENGTH_SHORT).show();
|
||||
// ActivityCompat.requestPermissions(PermissionsDescriptionActivity.this, new
|
||||
// String[]{"oppo.permission.OPPO_COMPONENT_SAFE"}, 1);
|
||||
} else {
|
||||
startActivity(intents);
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
startActivity(intents);
|
||||
}catch (Exception e){
|
||||
System.out.println(e);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (getDeviceBrand().equalsIgnoreCase("OnePlus")) {
|
||||
intents = new Intent("com.android.settings.action.BACKGROUND_OPTIMIZE");
|
||||
startActivity(intents);
|
||||
return;
|
||||
}
|
||||
// if (SystemUtil.getDeviceBrand().equalsIgnoreCase("SMARTISAN")) {
|
||||
// intents = new Intent("com.smartisanos.security.action.SWITCHED_PERMISSIONS_NEW");//无效
|
||||
// startActivity(intents);
|
||||
// return;
|
||||
// }
|
||||
Toast.makeText(this, "无权打开系统界面, 请点击查看教程手动设置", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else if (v == mLockApp) {
|
||||
isWeb = true;
|
||||
mWebView2.setVisibility(View.VISIBLE);
|
||||
if (getSystemLanguage().contains("zh")) {// 中文
|
||||
mWebView2.loadUrl("http://服务器接口地址/locktask/lockApp.html");
|
||||
} else {
|
||||
mWebView2.loadUrl("http://服务器接口地址/locktask/lockApp_e.html");
|
||||
}
|
||||
} else if (v == mBatteryOptimization) {
|
||||
// 显示屏幕以控制哪些应用可以忽略电池优化
|
||||
// 您可以PowerManager.isIgnoringBatteryOptimizations()用来确定应用程序是否已经忽略优化。
|
||||
// 您可以 ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS用来要求用户将您放在此列表中。
|
||||
//android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setIcon(R.mipmap.ic_launcher)
|
||||
.setTitle("忽略电池优化")
|
||||
.setMessage("参考说明:\n在手机 设置 --> 电池 --> 耗电管理 中找到" + getString(R.string.app_name) + ", 设置 允许后台运行 或 允许后台启动 等")
|
||||
.setPositiveButton("设置忽略", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, final int which) {
|
||||
if (!isIgnoringBatteryOptimizations()) {
|
||||
try {
|
||||
Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
||||
intent.setData(Uri.parse("package:" + getPackageName()));
|
||||
//跳转之前判断intent是否存在,否则有的机型会报找不到activity
|
||||
if (intent.resolveActivity(getPackageManager()) == null) {
|
||||
intent = new Intent(Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS);
|
||||
intent.setData(Uri.parse("package:" + getPackageName()));
|
||||
if (intent.resolveActivity(getPackageManager()) == null) {
|
||||
// showToast("无法启动系统界面,请以参考说明操作");
|
||||
} else {
|
||||
startActivity(intent);
|
||||
}
|
||||
} else {
|
||||
startActivity(intent);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否开启通知使用权限
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public void isNotificationListenerEnabled(Context context) {
|
||||
Set<String> packageNames = NotificationManagerCompat.getEnabledListenerPackages(this);
|
||||
if (!packageNames.contains(context.getPackageName())) {//没有开启使用权限,去开启
|
||||
Intent intent = new Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
mBandName = (TextView) findViewById(R.id.bandName);
|
||||
mLeft = (TextView) findViewById(R.id.left);
|
||||
mLeft.setOnClickListener(this);
|
||||
mAutoStart = (TextView) findViewById(R.id.autoStart);
|
||||
mAutoStart.setOnClickListener(this);
|
||||
mTutorials = (TextView) findViewById(R.id.tutorials);
|
||||
mTutorials.setOnClickListener(this);
|
||||
mLockApp = (TextView) findViewById(R.id.lockApp);
|
||||
mLockApp.setOnClickListener(this);
|
||||
mBatteryOptimization = (TextView) findViewById(R.id.battery_optimization);
|
||||
mBatteryOptimization.setOnClickListener(this);
|
||||
mWebView1 = (WebView) findViewById(R.id.webView1);
|
||||
mWebView1.setOnClickListener(this);
|
||||
mWebView2 = (WebView) findViewById(R.id.webView2);
|
||||
mWebView2.setOnClickListener(this);
|
||||
|
||||
mBandName.setText(getDeviceBrand());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 确定应用程序是否已经忽略电池优化
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean isIgnoringBatteryOptimizations() {
|
||||
boolean isIgnoring = false;
|
||||
PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||
if (powerManager != null) {
|
||||
isIgnoring = powerManager.isIgnoringBatteryOptimizations(getPackageName());
|
||||
}
|
||||
return isIgnoring;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
//super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
switch (requestCode) {
|
||||
case 1:
|
||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
Intent intents = null;
|
||||
for (Intent intent : AutoStartAppUtil.POWERMANAGER_INTENTS)
|
||||
if (getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY) != null) {
|
||||
intents = intent;
|
||||
break;
|
||||
}
|
||||
if (intents != null) {
|
||||
startActivity(intents);
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, "无权打开系统界面, 请点击查看教程手动设置", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 原生Android系统 开启后台运行调用这里
|
||||
*/
|
||||
public void requestIgnoreBatteryOptimizations() {
|
||||
try {
|
||||
Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
||||
intent.setData(Uri.parse("package:" + getPackageName()));
|
||||
startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
moveTaskToBack(true);//按返回键,不 finish activity
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前手机系统语言。
|
||||
*
|
||||
* @return 返回当前系统语言。例如:当前设置的是“中文-中国”,则返回“zh-CN”
|
||||
*/
|
||||
public static String getSystemLanguage() {
|
||||
return Locale.getDefault().getLanguage();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前系统上的语言列表(Locale列表)
|
||||
*
|
||||
* @return 语言列表
|
||||
*/
|
||||
public static Locale[] getSystemLanguageList() {
|
||||
return Locale.getAvailableLocales();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前手机系统版本号
|
||||
*
|
||||
* @return 系统版本号
|
||||
*/
|
||||
public static String getSystemVersion() {
|
||||
return android.os.Build.VERSION.RELEASE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取手机型号
|
||||
*
|
||||
* @return 手机型号
|
||||
*/
|
||||
public static String getSystemModel() {
|
||||
return android.os.Build.MODEL;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取手机厂商
|
||||
*
|
||||
* @return 手机厂商
|
||||
*/
|
||||
public static String getDeviceBrand() {
|
||||
return android.os.Build.BRAND;
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,6 @@ import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
public class WalletFragment extends BaseFragment{
|
||||
|
||||
public static UserBean userBean;
|
||||
@@ -221,8 +220,8 @@ public class WalletFragment extends BaseFragment{
|
||||
}
|
||||
}
|
||||
|
||||
//初始化银行卡信息
|
||||
public void initBack(){
|
||||
//初始化银行卡信息
|
||||
public void initBack(){
|
||||
if(bcb.getData() !=null && bcb.getData().getRecords()!=null && bcb.getData().getRecords().size()>=1){
|
||||
bank_title_1.setText(bcb.getData().getRecords().get(0).getBankName());
|
||||
bank_number.setText(bcb.getData().getRecords().get(0).getCardNo());
|
||||
@@ -234,17 +233,17 @@ public class WalletFragment extends BaseFragment{
|
||||
bank_add.setVisibility(View.VISIBLE);
|
||||
bank_remove.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//初始化电子账户信息
|
||||
public void initContracts(){
|
||||
if(cb.getData()!=null && !StringUtil.isNull(cb.getData().getChildAcctNo(),"").equals("")) {
|
||||
bank_title_2.setText("浦发银行电子账户");
|
||||
bank2_number.setText(cb.getData().getChildAcctNo());
|
||||
bank2_number.setVisibility(View.VISIBLE);
|
||||
bank_add2.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
//初始化电子账户信息
|
||||
public void initContracts(){
|
||||
if(cb.getData()!=null && !StringUtil.isNull(cb.getData().getChildAcctNo(),"").equals("")) {
|
||||
bank_title_2.setText("浦发银行电子账户");
|
||||
bank2_number.setText(cb.getData().getChildAcctNo());
|
||||
bank2_number.setVisibility(View.VISIBLE);
|
||||
bank_add2.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isInsBank=false;
|
||||
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.constant.JTTConstant;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.service.TrackService;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.HuoYuanFragmengt;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.dahe.mylibrary.utils.SelectPhotoUtils5;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
/**
|
||||
* @ClassName BillLocationUtils
|
||||
* @Author 用户
|
||||
* @Date 2022/10/17 10:24
|
||||
* @Description TODO
|
||||
*/
|
||||
public class BillLocationUtils {
|
||||
|
||||
private Context con;
|
||||
|
||||
|
||||
private static class SingletonHolder {
|
||||
private static final BillLocationUtils INSTANCE = new BillLocationUtils();
|
||||
}
|
||||
|
||||
private BillLocationUtils() {
|
||||
}
|
||||
|
||||
public static final BillLocationUtils getInstance() {
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private HuoYuanRequset hyr;
|
||||
private UserRequset ur;
|
||||
public void getBillLocation(Context con) {
|
||||
this.con = con;
|
||||
hyr = new HuoYuanRequset(con, hd);
|
||||
ur = new UserRequset(con, hd);
|
||||
//获取执行中的运单
|
||||
hyr.startOrder(0);
|
||||
}
|
||||
|
||||
public Handler hd = new Handler(msg -> {
|
||||
msgMethod(msg);
|
||||
return false;
|
||||
});
|
||||
|
||||
public void msgMethod(Message m) {
|
||||
switch (m.what) {
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
Gson gson = new Gson();
|
||||
// Toast.makeText(con,RequsetCodeConstants.FEEDBACK_TEXT,Toast.LENGTH_SHORT).show();
|
||||
if (CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER) != null) {
|
||||
StartOrderBean sob = gson.fromJson(CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER), StartOrderBean.class);
|
||||
if (sob.getCode() == 200) {
|
||||
if (sob.getData() != null) {
|
||||
SPUtil.insSP(con, JTTConstant.JTT_DATA_NAME, JTTConstant.JTT_DATA_ORDER_KEY, gson.toJson(sob));
|
||||
initStart(sob);
|
||||
StartOrderParts.setStartOrder(con, sob);
|
||||
ur.getJtts(sob.getData().getShippingNoteNumber());
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, sob.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(HuoYuanFragmengt.START_ORDER);
|
||||
break;
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("jttRes") != null) {
|
||||
JTT jtt = gson.fromJson(CacheGroup.cacheList.get("jttRes"), JTT.class);
|
||||
if (jtt.getCode() == 200) {
|
||||
SPUtil.insSP(con, "data", "jtt", CacheGroup.cacheList.get("jttRes"));
|
||||
JTTProcess.auth(con);
|
||||
} else {
|
||||
Toast.makeText(con, StringUtil.isNull(jtt.getMsg(), "返回错误"), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("jttRes");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initStart(StartOrderBean sob) {
|
||||
if (sob.getData() != null) {
|
||||
if (sob != null && sob.getData() != null && 0 < sob.getData().getWayChildren().size()) {
|
||||
//order_start.setVisibility(View.VISIBLE);
|
||||
SPUtil.insSP(con, "order", "ShippingNoteNumber", sob.getData().getShippingNoteNumber());
|
||||
Log.e("开始轨迹上传服务", "-----");
|
||||
Intent serviceIn = new Intent(con, TrackService.class);
|
||||
con.startService(serviceIn);
|
||||
} else {
|
||||
SPUtil.insSP(con, "order", "ShippingNoteNumber", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.MessagePop
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity
|
||||
import com.lxj.xpopup.XPopup
|
||||
|
||||
/**
|
||||
* @ClassName MessageUtils
|
||||
* @Author 用户
|
||||
* @Date 2023/8/15 09:51
|
||||
* @Description TODO
|
||||
*/
|
||||
class MessageUtils {
|
||||
|
||||
companion object {
|
||||
fun getInstance() = InstanceHelper.sSingle
|
||||
}
|
||||
|
||||
object InstanceHelper {
|
||||
val sSingle = MessageUtils()
|
||||
}
|
||||
|
||||
fun showCenMessage(ctx: Context, message: String) {
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.asCustom(MessagePop(ctx, message).setOnMyItemClickListener(object : MessagePop.OnMyItemClickListener{
|
||||
override fun onItemClick(startTime: String, endTime: String) {
|
||||
}
|
||||
}))
|
||||
.show()
|
||||
}
|
||||
|
||||
fun showCenMessage(ctx: Context, message: String, message2: String) {
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.asCustom(MessagePop(ctx, message,message2).setOnMyItemClickListener(object : MessagePop.OnMyItemClickListener{
|
||||
override fun onItemClick(startTime: String, endTime: String) {
|
||||
}
|
||||
}))
|
||||
.show()
|
||||
}
|
||||
|
||||
fun showSimCenPop(ctx: Context, message: String,onMyItemClickListener: SimCenterPop.OnMyItemClickListener){
|
||||
|
||||
// XPopup.Builder(ctx) //
|
||||
// .hasNavigationBar(false)
|
||||
// .isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
// .asCustom(SimCenterPop(ctx,message).setOnMyItemClickListener(object : SimCenterPop.OnMyItemClickListener{
|
||||
// override fun onItemClick() {
|
||||
// val intent = Intent(ctx, CertificatesActivity::class.java)
|
||||
// intent.putExtra("index", type)
|
||||
// ctx.startActivity(intent)
|
||||
// }
|
||||
// }))
|
||||
// .show()
|
||||
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.asCustom(SimCenterPop(ctx,message).setOnMyItemClickListener(onMyItemClickListener))
|
||||
.show()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,6 @@ public class LocationUtil{
|
||||
|
||||
private double latitude;
|
||||
private double longitude;
|
||||
private int errorCode;
|
||||
private String address;
|
||||
private Context con;
|
||||
private Handler hd;
|
||||
@@ -40,10 +39,6 @@ public class LocationUtil{
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public double getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
@@ -67,7 +62,7 @@ public class LocationUtil{
|
||||
//LocationMode.Hight_Accuracy:高精度;
|
||||
//LocationMode. Battery_Saving:低功耗;
|
||||
//LocationMode. Device_Sensors:仅使用设备;
|
||||
option.setCoorType("BD09ll");
|
||||
option.setCoorType("GCJ02");
|
||||
//可选,设置返回经纬度坐标类型,默认GCJ02
|
||||
//GCJ02:国测局坐标;
|
||||
//BD09ll:百度经纬度坐标;
|
||||
@@ -117,8 +112,7 @@ public class LocationUtil{
|
||||
float radius = location.getRadius(); //获取定位精度,默认值为0.0f
|
||||
String coorType = location.getCoorType();
|
||||
//获取经纬度坐标类型,以LocationClientOption中设置过的坐标类型为准
|
||||
errorCode = location.getLocType();
|
||||
String locTypeDescription = location.getLocTypeDescription();
|
||||
int errorCode = location.getLocType();
|
||||
//获取定位类型、定位错误返回码,具体信息可参照类参考中BDLocation类中的说明
|
||||
Log.e("定位位置address",address+"");
|
||||
Log.e("定位坐标latitude",latitude+"");
|
||||
|
||||
@@ -12,12 +12,12 @@ import android.os.Message;
|
||||
public class MsgUtil {
|
||||
|
||||
public static void addHdMsgWat(Handler hd,int what){
|
||||
Message msg=Message.obtain();
|
||||
Message msg=new Message();
|
||||
msg.what=what;
|
||||
hd.sendMessage(msg);
|
||||
}
|
||||
public static void addHdMsgWatBody(Handler hd,int what,String body){
|
||||
Message msg=Message.obtain();
|
||||
Message msg=new Message();
|
||||
msg.what=what;
|
||||
msg.obj=body;
|
||||
hd.sendMessage(msg);
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorMatrix;
|
||||
import android.graphics.ColorMatrixColorFilter;
|
||||
import android.graphics.Paint;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
/**
|
||||
* @ClassName GrayFrameLayout
|
||||
* @Author 用户
|
||||
* @Date 2023/1/29 15:28
|
||||
* @Description TODO
|
||||
*/
|
||||
public class GrayFrameLayout extends FrameLayout {
|
||||
private Paint mPaint = new Paint();
|
||||
|
||||
public GrayFrameLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
ColorMatrix cm = new ColorMatrix();
|
||||
cm.setSaturation(0);
|
||||
mPaint.setColorFilter(new ColorMatrixColorFilter(cm));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatchDraw(Canvas canvas) {
|
||||
canvas.saveLayer(null, mPaint, Canvas.ALL_SAVE_FLAG);
|
||||
super.dispatchDraw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
canvas.saveLayer(null, mPaint, Canvas.ALL_SAVE_FLAG);
|
||||
super.draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -176,12 +176,10 @@
|
||||
android:layout_centerVertical="true"/>
|
||||
</RelativeLayout>
|
||||
<View
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_2"
|
||||
android:background="#F6F6F9"/>
|
||||
<RelativeLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/r6"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
@@ -204,12 +202,10 @@
|
||||
android:layout_centerVertical="true"/>
|
||||
</RelativeLayout>
|
||||
<View
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_2"
|
||||
android:background="#F6F6F9"/>
|
||||
<RelativeLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/r7"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
@@ -231,46 +227,6 @@
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_2"
|
||||
android:background="#F6F6F9"/>
|
||||
<RelativeLayout
|
||||
android:id="@+id/r4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="挂车行驶证信息"
|
||||
android:textColor="#ff000000"
|
||||
android:textSize="@dimen/sp_15"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="(如有挂车)"
|
||||
android:textColor="#C4C4CE"
|
||||
android:textSize="@dimen/sp_13"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_6"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:src="@mipmap/chevron"
|
||||
android:scaleType="fitXY"
|
||||
android:background="@null"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_2"
|
||||
@@ -309,6 +265,44 @@
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"/>
|
||||
</RelativeLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_2"
|
||||
android:background="#F6F6F9"/>
|
||||
<RelativeLayout
|
||||
android:id="@+id/r4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="挂车行驶证信息"
|
||||
android:textColor="#ff000000"
|
||||
android:textSize="@dimen/sp_15"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="(如有挂车)"
|
||||
android:textColor="#C4C4CE"
|
||||
android:textSize="@dimen/sp_13"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_6"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:src="@mipmap/chevron"
|
||||
android:scaleType="fitXY"
|
||||
android:background="@null"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"/>
|
||||
</RelativeLayout>
|
||||
<View
|
||||
android:id="@+id/vs1"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -55,11 +55,10 @@
|
||||
android:layout_width="@dimen/dp_90"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:background="#EEEEEE">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"/>
|
||||
</RelativeLayout>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/titleBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:clipToPadding="true"
|
||||
tools:context=".activity.BaseActivity">
|
||||
<!--android:fitsSystemWindows="true"-->
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:text="返回"
|
||||
android:textColor="@android:color/black"
|
||||
android:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:text="后台运行设置"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:text=""
|
||||
android:textColor="@android:color/black"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="?android:attr/listDivider"
|
||||
android:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="20dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:text="你的手机"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bandName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="HUAWEI"
|
||||
android:textColor="@android:color/holo_orange_dark"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="20dp"
|
||||
android:text="为什么要让应用程序在后台运行?"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingStart="40dp"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingEnd="40dp"
|
||||
android:paddingBottom="20dp"
|
||||
android:text="接收通知需要应用在后台持续运行,以避免进程被系统终止。 这可能会错过来电和信息。"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingStart="40dp"
|
||||
android:paddingEnd="40dp"
|
||||
android:text="注意:如果您的手机上安装了第三方安全管理应用,请将IMFitPro添加到它们的例外中, 不受其约束。"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tutorials"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:drawablePadding="20dp"
|
||||
android:gravity="center"
|
||||
android:text="查看自启动教程"
|
||||
android:textColor="@android:color/holo_orange_dark"
|
||||
android:textSize="18sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/autoStart"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:drawablePadding="20dp"
|
||||
android:gravity="center"
|
||||
android:text="设置自启动"
|
||||
android:textColor="@android:color/holo_orange_dark"
|
||||
android:textSize="18sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lockApp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:drawablePadding="20dp"
|
||||
android:gravity="center"
|
||||
android:text="在后台锁定应用程序"
|
||||
android:textColor="@android:color/holo_orange_dark"
|
||||
android:textSize="18sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/battery_optimization"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:drawablePadding="20dp"
|
||||
android:gravity="center"
|
||||
android:text="忽略电池优化"
|
||||
android:textColor="@android:color/holo_orange_dark"
|
||||
android:textSize="18sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webView1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/white"
|
||||
android:visibility="gone" />
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webView2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/white"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
@@ -477,7 +477,7 @@
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_40"/>
|
||||
android:layout_height="@dimen/dp_102"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/submit"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
android:layout_marginLeft="@dimen/dp_13"
|
||||
android:layout_width="@dimen/dp_290"
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:src="@drawable/icon_home_1"
|
||||
android:src="@mipmap/icon_home_1"
|
||||
android:scaleType="fitXY"/>
|
||||
|
||||
<ImageView
|
||||
@@ -20,7 +20,7 @@
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="@dimen/dp_13"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_home_2" />
|
||||
android:src="@mipmap/icon_home_2" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_7"
|
||||
@@ -38,11 +37,10 @@
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:layout_marginTop="@dimen/dp_7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
@@ -53,13 +51,12 @@
|
||||
android:text="店铺地址:"/>
|
||||
<TextView
|
||||
android:id="@+id/address"
|
||||
android:singleLine="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:layout_marginTop="@dimen/dp_7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
@@ -67,15 +64,13 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:text="联系方式:"/>
|
||||
android:text="口味:"/>
|
||||
<TextView
|
||||
android:id="@+id/taste"
|
||||
android:singleLine="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
<TextView
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_13"
|
||||
@@ -86,7 +81,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
<TextView
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_13"
|
||||
|
||||
@@ -1,68 +1,66 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/item_huoyuan_new"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:id="@+id/item_huoyuan_new"
|
||||
android:paddingBottom="@dimen/dp_78">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_200"
|
||||
android:background="@drawable/bg_banner"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_banner">
|
||||
|
||||
<com.youth.banner.Banner
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:id="@+id/banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="@dimen/dp_25"
|
||||
android:layout_marginTop="@dimen/dp_12" />
|
||||
android:layout_margin="@dimen/dp_25"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="@dimen/dp_m_12"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_m_12">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fun_left"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_width="@dimen/dp_176"
|
||||
android:layout_height="@dimen/dp_116"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/icon_home_3"
|
||||
android:scaleType="fitXY" />
|
||||
android:src="@mipmap/icon_home_3"
|
||||
android:scaleType="fitXY"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fun_right"
|
||||
android:layout_width="@dimen/dp_176"
|
||||
android:layout_height="@dimen/dp_116"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/icon_home_4"
|
||||
android:scaleType="fitXY" />
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/icon_home_4" />
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_23"
|
||||
android:visibility="gone">
|
||||
|
||||
<View
|
||||
android:layout_width="@dimen/dp_54"
|
||||
android:layout_height="@dimen/dp_3"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="#999999"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="#999999" />
|
||||
android:layout_centerHorizontal="true"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -71,187 +69,188 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView
|
||||
android:layout_marginBottom="@dimen/dp_14"
|
||||
android:id="@+id/brv_function"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_14"
|
||||
android:overScrollMode="never" />
|
||||
android:overScrollMode="never"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/auth_box"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:background="#fff"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_login"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="认证成功 开始接单"
|
||||
android:textColor="#ff666666"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_auth"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_7"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:background="@drawable/bg_btn"
|
||||
android:gravity="center"
|
||||
android:text="去认证"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/order_box"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:background="#fff"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/auth_box"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_marginRight="@dimen/dp_20">
|
||||
android:orientation="vertical"
|
||||
android:background="#fff"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_login"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="执行中运单"
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold" />
|
||||
android:text="认证成功 开始接单"
|
||||
android:textColor="#ff666666"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:layout_gravity="center"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/order_all"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:orientation="horizontal">
|
||||
<Button
|
||||
android:id="@+id/btn_auth"
|
||||
android:layout_marginTop="@dimen/dp_7"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:text="去认证"
|
||||
android:background="@drawable/bg_btn"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/order_box"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="#fff"
|
||||
android:visibility="gone">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="全部运单"
|
||||
android:textColor="#ff999999"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
android:text="执行中运单"
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_7"
|
||||
android:layout_height="@dimen/dp_12"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="@dimen/dp_4"
|
||||
android:src="@mipmap/chevron" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView
|
||||
android:id="@+id/brv_order"
|
||||
<LinearLayout
|
||||
android:id="@+id/order_all"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="全部运单"
|
||||
android:textColor="#ff999999"
|
||||
android:textSize="@dimen/sp_14"
|
||||
/>
|
||||
<ImageView
|
||||
android:layout_marginLeft="@dimen/dp_4"
|
||||
android:layout_width="@dimen/dp_7"
|
||||
android:layout_height="@dimen/dp_12"
|
||||
android:src="@mipmap/chevron"
|
||||
android:layout_gravity="center"/>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
<com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView
|
||||
android:layout_marginBottom="@dimen/dp_12"
|
||||
android:id="@+id/brv_order"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
<!-- <LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_12" />
|
||||
</LinearLayout>
|
||||
<!-- <LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="#fff">
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="司机之家"
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"/>
|
||||
</RelativeLayout>
|
||||
<com.oneclouds.wangluohuoyun.util.view.BaseRecyclerView
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginBottom="@dimen/dp_24"
|
||||
android:id="@+id/brv_driver_home"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="#fff"
|
||||
android:visibility="gone">
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="司机圈"
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:background="#fff">
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="司机之家"
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"/>
|
||||
</RelativeLayout>
|
||||
<com.oneclouds.wangluohuoyun.util.view.BaseRecyclerView
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginBottom="@dimen/dp_24"
|
||||
android:id="@+id/brv_driver_home"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="#fff"
|
||||
android:visibility="gone">
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="司机圈"
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<LinearLayout
|
||||
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="更多精彩"
|
||||
android:textColor="#ff999999"
|
||||
android:textSize="@dimen/sp_14"
|
||||
/>
|
||||
<ImageView
|
||||
android:layout_marginLeft="@dimen/dp_4"
|
||||
android:layout_width="@dimen/dp_7"
|
||||
android:layout_height="@dimen/dp_12"
|
||||
android:src="@mipmap/chevron"
|
||||
android:layout_gravity="center"/>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
<com.oneclouds.wangluohuoyun.util.view.BaseRecyclerView
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:id="@+id/brv_driver_circle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView
|
||||
android:id="@+id/version"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="——V2.0.7——"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:alpha="0.6"/>
|
||||
</LinearLayout>-->
|
||||
<include layout="@layout/item_order_recommend" />
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="更多精彩"
|
||||
android:textColor="#ff999999"
|
||||
android:textSize="@dimen/sp_14"
|
||||
/>
|
||||
<ImageView
|
||||
android:layout_marginLeft="@dimen/dp_4"
|
||||
android:layout_width="@dimen/dp_7"
|
||||
android:layout_height="@dimen/dp_12"
|
||||
android:src="@mipmap/chevron"
|
||||
android:layout_gravity="center"/>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
<com.oneclouds.wangluohuoyun.util.view.BaseRecyclerView
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:id="@+id/brv_driver_circle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView
|
||||
android:id="@+id/version"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="——V2.0.7——"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:alpha="0.6"/>
|
||||
</LinearLayout>-->
|
||||
<include
|
||||
layout="@layout/item_order_recommend"/>
|
||||
</LinearLayout>
|
||||
@@ -1,100 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_16"
|
||||
android:background="@color/white"
|
||||
android:elevation="@dimen/dp_5"
|
||||
|
||||
app:cardCornerRadius="@dimen/dp_10">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="提示"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="@dimen/sp_20"></TextView>
|
||||
|
||||
<TextView
|
||||
android:lineSpacingExtra="@dimen/dp_6"
|
||||
android:gravity="center"
|
||||
android:id="@+id/tvContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:textColor="#D86B6B"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="提示"></TextView>
|
||||
<TextView
|
||||
android:id="@+id/tvMessage2"
|
||||
android:lineSpacingExtra="@dimen/dp_6"
|
||||
android:gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:textColor="@color/color_9"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:text="请重新登录或联系管理员"></TextView>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="联系电话:"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_14"></TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPhone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="13783631930"
|
||||
android:textColor="#009688"
|
||||
android:textSize="@dimen/sp_16"></TextView>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingBottom="@dimen/dp_10">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="取消"
|
||||
android:textSize="@dimen/sp_16"></TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOk"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="确认拨打"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="@dimen/sp_16"></TextView>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
@@ -1,71 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_16"
|
||||
android:background="@color/white"
|
||||
android:elevation="@dimen/dp_5"
|
||||
|
||||
app:cardCornerRadius="@dimen/dp_10">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="提示"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_20"></TextView>
|
||||
|
||||
<TextView
|
||||
android:paddingLeft="@dimen/dp_10"
|
||||
android:paddingRight="@dimen/dp_10"
|
||||
android:lineSpacingExtra="@dimen/dp_6"
|
||||
android:gravity="center"
|
||||
android:id="@+id/tvContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:textColor="#333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="提示"></TextView>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingBottom="@dimen/dp_10">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="取消"
|
||||
android:textSize="@dimen/sp_16"></TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOk"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="去注册"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="@dimen/sp_16"></TextView>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,424 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<resources>
|
||||
<dimen name="common_margin">@dimen/dp_15</dimen>
|
||||
<dimen name="dp_m_60">-256.6667dp</dimen>
|
||||
<dimen name="dp_m_50">-213.8889dp</dimen>
|
||||
<dimen name="dp_m_30">-128.3333dp</dimen>
|
||||
<dimen name="dp_m_20">-85.5556dp</dimen>
|
||||
<dimen name="dp_m_12">-51.3333dp</dimen>
|
||||
<dimen name="dp_m_10">-42.7778dp</dimen>
|
||||
<dimen name="dp_m_8">-34.2222dp</dimen>
|
||||
<dimen name="dp_m_5">-21.3889dp</dimen>
|
||||
<dimen name="dp_m_2">-8.5556dp</dimen>
|
||||
<dimen name="dp_m_1">-4.2778dp</dimen>
|
||||
<dimen name="dp_0">0.0000dp</dimen>
|
||||
<dimen name="dp_0_1">0.4278dp</dimen>
|
||||
<dimen name="dp_0_5">2.1389dp</dimen>
|
||||
<dimen name="dp_1">4.2778dp</dimen>
|
||||
<dimen name="dp_1_5">6.4167dp</dimen>
|
||||
<dimen name="dp_2">8.5556dp</dimen>
|
||||
<dimen name="dp_2_5">10.6944dp</dimen>
|
||||
<dimen name="dp_3">12.8333dp</dimen>
|
||||
<dimen name="dp_3_5">14.9722dp</dimen>
|
||||
<dimen name="dp_4">17.1111dp</dimen>
|
||||
<dimen name="dp_4_5">19.2500dp</dimen>
|
||||
<dimen name="dp_5">21.3889dp</dimen>
|
||||
<dimen name="dp_6">25.6667dp</dimen>
|
||||
<dimen name="dp_7">29.9444dp</dimen>
|
||||
<dimen name="dp_8">34.2222dp</dimen>
|
||||
<dimen name="dp_9">38.5000dp</dimen>
|
||||
<dimen name="dp_10">42.7778dp</dimen>
|
||||
<dimen name="dp_11">47.0556dp</dimen>
|
||||
<dimen name="dp_12">51.3333dp</dimen>
|
||||
<dimen name="dp_13">55.6111dp</dimen>
|
||||
<dimen name="dp_14">59.8889dp</dimen>
|
||||
<dimen name="dp_15">64.1667dp</dimen>
|
||||
<dimen name="dp_16">68.4444dp</dimen>
|
||||
<dimen name="dp_17">72.7222dp</dimen>
|
||||
<dimen name="dp_18">77.0000dp</dimen>
|
||||
<dimen name="dp_19">81.2778dp</dimen>
|
||||
<dimen name="dp_20">85.5556dp</dimen>
|
||||
<dimen name="dp_21">89.8333dp</dimen>
|
||||
<dimen name="dp_22">94.1111dp</dimen>
|
||||
<dimen name="dp_23">98.3889dp</dimen>
|
||||
<dimen name="dp_24">102.6667dp</dimen>
|
||||
<dimen name="dp_25">106.9444dp</dimen>
|
||||
<dimen name="dp_26">111.2222dp</dimen>
|
||||
<dimen name="dp_27">115.5000dp</dimen>
|
||||
<dimen name="dp_28">119.7778dp</dimen>
|
||||
<dimen name="dp_29">124.0556dp</dimen>
|
||||
<dimen name="dp_30">128.3333dp</dimen>
|
||||
<dimen name="dp_31">132.6111dp</dimen>
|
||||
<dimen name="dp_32">136.8889dp</dimen>
|
||||
<dimen name="dp_33">141.1667dp</dimen>
|
||||
<dimen name="dp_34">145.4444dp</dimen>
|
||||
<dimen name="dp_35">149.7222dp</dimen>
|
||||
<dimen name="dp_36">154.0000dp</dimen>
|
||||
<dimen name="dp_37">158.2778dp</dimen>
|
||||
<dimen name="dp_38">162.5556dp</dimen>
|
||||
<dimen name="dp_39">166.8333dp</dimen>
|
||||
<dimen name="dp_40">171.1111dp</dimen>
|
||||
<dimen name="dp_41">175.3889dp</dimen>
|
||||
<dimen name="dp_42">179.6667dp</dimen>
|
||||
<dimen name="dp_43">183.9444dp</dimen>
|
||||
<dimen name="dp_44">188.2222dp</dimen>
|
||||
<dimen name="dp_45">192.5000dp</dimen>
|
||||
<dimen name="dp_46">196.7778dp</dimen>
|
||||
<dimen name="dp_47">201.0556dp</dimen>
|
||||
<dimen name="dp_48">205.3333dp</dimen>
|
||||
<dimen name="dp_49">209.6111dp</dimen>
|
||||
<dimen name="dp_50">213.8889dp</dimen>
|
||||
<dimen name="dp_51">218.1667dp</dimen>
|
||||
<dimen name="dp_52">222.4444dp</dimen>
|
||||
<dimen name="dp_53">226.7222dp</dimen>
|
||||
<dimen name="dp_54">231.0000dp</dimen>
|
||||
<dimen name="dp_55">235.2778dp</dimen>
|
||||
<dimen name="dp_56">239.5556dp</dimen>
|
||||
<dimen name="dp_57">243.8333dp</dimen>
|
||||
<dimen name="dp_58">248.1111dp</dimen>
|
||||
<dimen name="dp_59">252.3889dp</dimen>
|
||||
<dimen name="dp_60">256.6667dp</dimen>
|
||||
<dimen name="dp_61">260.9444dp</dimen>
|
||||
<dimen name="dp_62">265.2222dp</dimen>
|
||||
<dimen name="dp_63">269.5000dp</dimen>
|
||||
<dimen name="dp_64">273.7778dp</dimen>
|
||||
<dimen name="dp_65">278.0556dp</dimen>
|
||||
<dimen name="dp_66">282.3333dp</dimen>
|
||||
<dimen name="dp_67">286.6111dp</dimen>
|
||||
<dimen name="dp_68">290.8889dp</dimen>
|
||||
<dimen name="dp_69">295.1667dp</dimen>
|
||||
<dimen name="dp_70">299.4444dp</dimen>
|
||||
<dimen name="dp_71">303.7222dp</dimen>
|
||||
<dimen name="dp_72">308.0000dp</dimen>
|
||||
<dimen name="dp_73">312.2778dp</dimen>
|
||||
<dimen name="dp_74">316.5556dp</dimen>
|
||||
<dimen name="dp_75">320.8333dp</dimen>
|
||||
<dimen name="dp_76">325.1111dp</dimen>
|
||||
<dimen name="dp_77">329.3889dp</dimen>
|
||||
<dimen name="dp_78">333.6667dp</dimen>
|
||||
<dimen name="dp_79">337.9444dp</dimen>
|
||||
<dimen name="dp_80">342.2222dp</dimen>
|
||||
<dimen name="dp_81">346.5000dp</dimen>
|
||||
<dimen name="dp_82">350.7778dp</dimen>
|
||||
<dimen name="dp_83">355.0556dp</dimen>
|
||||
<dimen name="dp_84">359.3333dp</dimen>
|
||||
<dimen name="dp_85">363.6111dp</dimen>
|
||||
<dimen name="dp_86">367.8889dp</dimen>
|
||||
<dimen name="dp_87">372.1667dp</dimen>
|
||||
<dimen name="dp_88">376.4444dp</dimen>
|
||||
<dimen name="dp_89">380.7222dp</dimen>
|
||||
<dimen name="dp_90">385.0000dp</dimen>
|
||||
<dimen name="dp_91">389.2778dp</dimen>
|
||||
<dimen name="dp_92">393.5556dp</dimen>
|
||||
<dimen name="dp_93">397.8333dp</dimen>
|
||||
<dimen name="dp_94">402.1111dp</dimen>
|
||||
<dimen name="dp_95">406.3889dp</dimen>
|
||||
<dimen name="dp_96">410.6667dp</dimen>
|
||||
<dimen name="dp_97">414.9444dp</dimen>
|
||||
<dimen name="dp_98">419.2222dp</dimen>
|
||||
<dimen name="dp_99">423.5000dp</dimen>
|
||||
<dimen name="dp_100">427.7778dp</dimen>
|
||||
<dimen name="dp_101">432.0556dp</dimen>
|
||||
<dimen name="dp_102">436.3333dp</dimen>
|
||||
<dimen name="dp_103">440.6111dp</dimen>
|
||||
<dimen name="dp_104">444.8889dp</dimen>
|
||||
<dimen name="dp_105">449.1667dp</dimen>
|
||||
<dimen name="dp_106">453.4444dp</dimen>
|
||||
<dimen name="dp_107">457.7222dp</dimen>
|
||||
<dimen name="dp_108">462.0000dp</dimen>
|
||||
<dimen name="dp_109">466.2778dp</dimen>
|
||||
<dimen name="dp_110">470.5556dp</dimen>
|
||||
<dimen name="dp_111">474.8333dp</dimen>
|
||||
<dimen name="dp_112">479.1111dp</dimen>
|
||||
<dimen name="dp_113">483.3889dp</dimen>
|
||||
<dimen name="dp_114">487.6667dp</dimen>
|
||||
<dimen name="dp_115">491.9444dp</dimen>
|
||||
<dimen name="dp_116">496.2222dp</dimen>
|
||||
<dimen name="dp_117">500.5000dp</dimen>
|
||||
<dimen name="dp_118">504.7778dp</dimen>
|
||||
<dimen name="dp_119">509.0556dp</dimen>
|
||||
<dimen name="dp_120">513.3333dp</dimen>
|
||||
<dimen name="dp_121">517.6111dp</dimen>
|
||||
<dimen name="dp_122">521.8889dp</dimen>
|
||||
<dimen name="dp_123">526.1667dp</dimen>
|
||||
<dimen name="dp_124">530.4444dp</dimen>
|
||||
<dimen name="dp_125">534.7222dp</dimen>
|
||||
<dimen name="dp_126">539.0000dp</dimen>
|
||||
<dimen name="dp_127">543.2778dp</dimen>
|
||||
<dimen name="dp_128">547.5556dp</dimen>
|
||||
<dimen name="dp_129">551.8333dp</dimen>
|
||||
<dimen name="dp_130">556.1111dp</dimen>
|
||||
<dimen name="dp_131">560.3889dp</dimen>
|
||||
<dimen name="dp_132">564.6667dp</dimen>
|
||||
<dimen name="dp_133">568.9444dp</dimen>
|
||||
<dimen name="dp_134">573.2222dp</dimen>
|
||||
<dimen name="dp_135">577.5000dp</dimen>
|
||||
<dimen name="dp_136">581.7778dp</dimen>
|
||||
<dimen name="dp_137">586.0556dp</dimen>
|
||||
<dimen name="dp_138">590.3333dp</dimen>
|
||||
<dimen name="dp_139">594.6111dp</dimen>
|
||||
<dimen name="dp_140">598.8889dp</dimen>
|
||||
<dimen name="dp_141">603.1667dp</dimen>
|
||||
<dimen name="dp_142">607.4444dp</dimen>
|
||||
<dimen name="dp_143">611.7222dp</dimen>
|
||||
<dimen name="dp_144">616.0000dp</dimen>
|
||||
<dimen name="dp_145">620.2778dp</dimen>
|
||||
<dimen name="dp_146">624.5556dp</dimen>
|
||||
<dimen name="dp_147">628.8333dp</dimen>
|
||||
<dimen name="dp_148">633.1111dp</dimen>
|
||||
<dimen name="dp_149">637.3889dp</dimen>
|
||||
<dimen name="dp_150">641.6667dp</dimen>
|
||||
<dimen name="dp_151">645.9444dp</dimen>
|
||||
<dimen name="dp_152">650.2222dp</dimen>
|
||||
<dimen name="dp_153">654.5000dp</dimen>
|
||||
<dimen name="dp_154">658.7778dp</dimen>
|
||||
<dimen name="dp_155">663.0556dp</dimen>
|
||||
<dimen name="dp_156">667.3333dp</dimen>
|
||||
<dimen name="dp_157">671.6111dp</dimen>
|
||||
<dimen name="dp_158">675.8889dp</dimen>
|
||||
<dimen name="dp_159">680.1667dp</dimen>
|
||||
<dimen name="dp_160">684.4444dp</dimen>
|
||||
<dimen name="dp_161">688.7222dp</dimen>
|
||||
<dimen name="dp_162">693.0000dp</dimen>
|
||||
<dimen name="dp_163">697.2778dp</dimen>
|
||||
<dimen name="dp_164">701.5556dp</dimen>
|
||||
<dimen name="dp_165">705.8333dp</dimen>
|
||||
<dimen name="dp_166">710.1111dp</dimen>
|
||||
<dimen name="dp_167">714.3889dp</dimen>
|
||||
<dimen name="dp_168">718.6667dp</dimen>
|
||||
<dimen name="dp_169">722.9444dp</dimen>
|
||||
<dimen name="dp_170">727.2222dp</dimen>
|
||||
<dimen name="dp_171">731.5000dp</dimen>
|
||||
<dimen name="dp_172">735.7778dp</dimen>
|
||||
<dimen name="dp_173">740.0556dp</dimen>
|
||||
<dimen name="dp_174">744.3333dp</dimen>
|
||||
<dimen name="dp_175">748.6111dp</dimen>
|
||||
<dimen name="dp_176">752.8889dp</dimen>
|
||||
<dimen name="dp_177">757.1667dp</dimen>
|
||||
<dimen name="dp_178">761.4444dp</dimen>
|
||||
<dimen name="dp_179">765.7222dp</dimen>
|
||||
<dimen name="dp_180">770.0000dp</dimen>
|
||||
<dimen name="dp_181">774.2778dp</dimen>
|
||||
<dimen name="dp_182">778.5556dp</dimen>
|
||||
<dimen name="dp_183">782.8333dp</dimen>
|
||||
<dimen name="dp_184">787.1111dp</dimen>
|
||||
<dimen name="dp_185">791.3889dp</dimen>
|
||||
<dimen name="dp_186">795.6667dp</dimen>
|
||||
<dimen name="dp_187">799.9444dp</dimen>
|
||||
<dimen name="dp_188">804.2222dp</dimen>
|
||||
<dimen name="dp_189">808.5000dp</dimen>
|
||||
<dimen name="dp_190">812.7778dp</dimen>
|
||||
<dimen name="dp_191">817.0556dp</dimen>
|
||||
<dimen name="dp_192">821.3333dp</dimen>
|
||||
<dimen name="dp_193">825.6111dp</dimen>
|
||||
<dimen name="dp_194">829.8889dp</dimen>
|
||||
<dimen name="dp_195">834.1667dp</dimen>
|
||||
<dimen name="dp_196">838.4444dp</dimen>
|
||||
<dimen name="dp_197">842.7222dp</dimen>
|
||||
<dimen name="dp_198">847.0000dp</dimen>
|
||||
<dimen name="dp_199">851.2778dp</dimen>
|
||||
<dimen name="dp_200">855.5556dp</dimen>
|
||||
<dimen name="dp_201">859.8333dp</dimen>
|
||||
<dimen name="dp_202">864.1111dp</dimen>
|
||||
<dimen name="dp_203">868.3889dp</dimen>
|
||||
<dimen name="dp_204">872.6667dp</dimen>
|
||||
<dimen name="dp_205">876.9444dp</dimen>
|
||||
<dimen name="dp_206">881.2222dp</dimen>
|
||||
<dimen name="dp_207">885.5000dp</dimen>
|
||||
<dimen name="dp_208">889.7778dp</dimen>
|
||||
<dimen name="dp_209">894.0556dp</dimen>
|
||||
<dimen name="dp_210">898.3333dp</dimen>
|
||||
<dimen name="dp_211">902.6111dp</dimen>
|
||||
<dimen name="dp_212">906.8889dp</dimen>
|
||||
<dimen name="dp_213">911.1667dp</dimen>
|
||||
<dimen name="dp_214">915.4444dp</dimen>
|
||||
<dimen name="dp_215">919.7222dp</dimen>
|
||||
<dimen name="dp_216">924.0000dp</dimen>
|
||||
<dimen name="dp_217">928.2778dp</dimen>
|
||||
<dimen name="dp_218">932.5556dp</dimen>
|
||||
<dimen name="dp_219">936.8333dp</dimen>
|
||||
<dimen name="dp_220">941.1111dp</dimen>
|
||||
<dimen name="dp_221">945.3889dp</dimen>
|
||||
<dimen name="dp_222">949.6667dp</dimen>
|
||||
<dimen name="dp_223">953.9444dp</dimen>
|
||||
<dimen name="dp_224">958.2222dp</dimen>
|
||||
<dimen name="dp_225">962.5000dp</dimen>
|
||||
<dimen name="dp_226">966.7778dp</dimen>
|
||||
<dimen name="dp_227">971.0556dp</dimen>
|
||||
<dimen name="dp_228">975.3333dp</dimen>
|
||||
<dimen name="dp_229">979.6111dp</dimen>
|
||||
<dimen name="dp_230">983.8889dp</dimen>
|
||||
<dimen name="dp_231">988.1667dp</dimen>
|
||||
<dimen name="dp_232">992.4444dp</dimen>
|
||||
<dimen name="dp_233">996.7222dp</dimen>
|
||||
<dimen name="dp_234">1001.0000dp</dimen>
|
||||
<dimen name="dp_235">1005.2778dp</dimen>
|
||||
<dimen name="dp_236">1009.5556dp</dimen>
|
||||
<dimen name="dp_237">1013.8333dp</dimen>
|
||||
<dimen name="dp_238">1018.1111dp</dimen>
|
||||
<dimen name="dp_239">1022.3889dp</dimen>
|
||||
<dimen name="dp_240">1026.6667dp</dimen>
|
||||
<dimen name="dp_241">1030.9444dp</dimen>
|
||||
<dimen name="dp_242">1035.2222dp</dimen>
|
||||
<dimen name="dp_243">1039.5000dp</dimen>
|
||||
<dimen name="dp_244">1043.7778dp</dimen>
|
||||
<dimen name="dp_245">1048.0556dp</dimen>
|
||||
<dimen name="dp_246">1052.3333dp</dimen>
|
||||
<dimen name="dp_247">1056.6111dp</dimen>
|
||||
<dimen name="dp_248">1060.8889dp</dimen>
|
||||
<dimen name="dp_249">1065.1667dp</dimen>
|
||||
<dimen name="dp_250">1069.4444dp</dimen>
|
||||
<dimen name="dp_251">1073.7222dp</dimen>
|
||||
<dimen name="dp_252">1078.0000dp</dimen>
|
||||
<dimen name="dp_253">1082.2778dp</dimen>
|
||||
<dimen name="dp_254">1086.5556dp</dimen>
|
||||
<dimen name="dp_255">1090.8333dp</dimen>
|
||||
<dimen name="dp_256">1095.1111dp</dimen>
|
||||
<dimen name="dp_257">1099.3889dp</dimen>
|
||||
<dimen name="dp_258">1103.6667dp</dimen>
|
||||
<dimen name="dp_259">1107.9444dp</dimen>
|
||||
<dimen name="dp_260">1112.2222dp</dimen>
|
||||
<dimen name="dp_261">1116.5000dp</dimen>
|
||||
<dimen name="dp_262">1120.7778dp</dimen>
|
||||
<dimen name="dp_263">1125.0556dp</dimen>
|
||||
<dimen name="dp_264">1129.3333dp</dimen>
|
||||
<dimen name="dp_265">1133.6111dp</dimen>
|
||||
<dimen name="dp_266">1137.8889dp</dimen>
|
||||
<dimen name="dp_267">1142.1667dp</dimen>
|
||||
<dimen name="dp_268">1146.4444dp</dimen>
|
||||
<dimen name="dp_269">1150.7222dp</dimen>
|
||||
<dimen name="dp_270">1155.0000dp</dimen>
|
||||
<dimen name="dp_271">1159.2778dp</dimen>
|
||||
<dimen name="dp_272">1163.5556dp</dimen>
|
||||
<dimen name="dp_273">1167.8333dp</dimen>
|
||||
<dimen name="dp_274">1172.1111dp</dimen>
|
||||
<dimen name="dp_275">1176.3889dp</dimen>
|
||||
<dimen name="dp_276">1180.6667dp</dimen>
|
||||
<dimen name="dp_277">1184.9444dp</dimen>
|
||||
<dimen name="dp_278">1189.2222dp</dimen>
|
||||
<dimen name="dp_279">1193.5000dp</dimen>
|
||||
<dimen name="dp_280">1197.7778dp</dimen>
|
||||
<dimen name="dp_281">1202.0556dp</dimen>
|
||||
<dimen name="dp_282">1206.3333dp</dimen>
|
||||
<dimen name="dp_283">1210.6111dp</dimen>
|
||||
<dimen name="dp_284">1214.8889dp</dimen>
|
||||
<dimen name="dp_285">1219.1667dp</dimen>
|
||||
<dimen name="dp_286">1223.4444dp</dimen>
|
||||
<dimen name="dp_287">1227.7222dp</dimen>
|
||||
<dimen name="dp_288">1232.0000dp</dimen>
|
||||
<dimen name="dp_289">1236.2778dp</dimen>
|
||||
<dimen name="dp_290">1240.5556dp</dimen>
|
||||
<dimen name="dp_291">1244.8333dp</dimen>
|
||||
<dimen name="dp_292">1249.1111dp</dimen>
|
||||
<dimen name="dp_293">1253.3889dp</dimen>
|
||||
<dimen name="dp_294">1257.6667dp</dimen>
|
||||
<dimen name="dp_295">1261.9444dp</dimen>
|
||||
<dimen name="dp_296">1266.2222dp</dimen>
|
||||
<dimen name="dp_297">1270.5000dp</dimen>
|
||||
<dimen name="dp_298">1274.7778dp</dimen>
|
||||
<dimen name="dp_299">1279.0556dp</dimen>
|
||||
<dimen name="dp_300">1283.3333dp</dimen>
|
||||
<dimen name="dp_301">1287.6111dp</dimen>
|
||||
<dimen name="dp_302">1291.8889dp</dimen>
|
||||
<dimen name="dp_303">1296.1667dp</dimen>
|
||||
<dimen name="dp_304">1300.4444dp</dimen>
|
||||
<dimen name="dp_305">1304.7222dp</dimen>
|
||||
<dimen name="dp_306">1309.0000dp</dimen>
|
||||
<dimen name="dp_307">1313.2778dp</dimen>
|
||||
<dimen name="dp_308">1317.5556dp</dimen>
|
||||
<dimen name="dp_309">1321.8333dp</dimen>
|
||||
<dimen name="dp_310">1326.1111dp</dimen>
|
||||
<dimen name="dp_311">1330.3889dp</dimen>
|
||||
<dimen name="dp_312">1334.6667dp</dimen>
|
||||
<dimen name="dp_313">1338.9444dp</dimen>
|
||||
<dimen name="dp_314">1343.2222dp</dimen>
|
||||
<dimen name="dp_315">1347.5000dp</dimen>
|
||||
<dimen name="dp_316">1351.7778dp</dimen>
|
||||
<dimen name="dp_317">1356.0556dp</dimen>
|
||||
<dimen name="dp_318">1360.3333dp</dimen>
|
||||
<dimen name="dp_319">1364.6111dp</dimen>
|
||||
<dimen name="dp_320">1368.8889dp</dimen>
|
||||
<dimen name="dp_321">1373.1667dp</dimen>
|
||||
<dimen name="dp_322">1377.4444dp</dimen>
|
||||
<dimen name="dp_323">1381.7222dp</dimen>
|
||||
<dimen name="dp_324">1386.0000dp</dimen>
|
||||
<dimen name="dp_325">1390.2778dp</dimen>
|
||||
<dimen name="dp_326">1394.5556dp</dimen>
|
||||
<dimen name="dp_327">1398.8333dp</dimen>
|
||||
<dimen name="dp_328">1403.1111dp</dimen>
|
||||
<dimen name="dp_329">1407.3889dp</dimen>
|
||||
<dimen name="dp_330">1411.6667dp</dimen>
|
||||
<dimen name="dp_331">1415.9444dp</dimen>
|
||||
<dimen name="dp_332">1420.2222dp</dimen>
|
||||
<dimen name="dp_333">1424.5000dp</dimen>
|
||||
<dimen name="dp_334">1428.7778dp</dimen>
|
||||
<dimen name="dp_335">1433.0556dp</dimen>
|
||||
<dimen name="dp_336">1437.3333dp</dimen>
|
||||
<dimen name="dp_337">1441.6111dp</dimen>
|
||||
<dimen name="dp_338">1445.8889dp</dimen>
|
||||
<dimen name="dp_339">1450.1667dp</dimen>
|
||||
<dimen name="dp_340">1454.4444dp</dimen>
|
||||
<dimen name="dp_341">1458.7222dp</dimen>
|
||||
<dimen name="dp_342">1463.0000dp</dimen>
|
||||
<dimen name="dp_343">1467.2778dp</dimen>
|
||||
<dimen name="dp_344">1471.5556dp</dimen>
|
||||
<dimen name="dp_345">1475.8333dp</dimen>
|
||||
<dimen name="dp_346">1480.1111dp</dimen>
|
||||
<dimen name="dp_347">1484.3889dp</dimen>
|
||||
<dimen name="dp_348">1488.6667dp</dimen>
|
||||
<dimen name="dp_349">1492.9444dp</dimen>
|
||||
<dimen name="dp_350">1497.2222dp</dimen>
|
||||
<dimen name="dp_351">1501.5000dp</dimen>
|
||||
<dimen name="dp_352">1505.7778dp</dimen>
|
||||
<dimen name="dp_353">1510.0556dp</dimen>
|
||||
<dimen name="dp_354">1514.3333dp</dimen>
|
||||
<dimen name="dp_355">1518.6111dp</dimen>
|
||||
<dimen name="dp_356">1522.8889dp</dimen>
|
||||
<dimen name="dp_357">1527.1667dp</dimen>
|
||||
<dimen name="dp_358">1531.4444dp</dimen>
|
||||
<dimen name="dp_359">1535.7222dp</dimen>
|
||||
<dimen name="dp_360">1540.0000dp</dimen>
|
||||
<dimen name="dp_365">1561.3889dp</dimen>
|
||||
<dimen name="dp_370">1582.7778dp</dimen>
|
||||
<dimen name="dp_380">1625.5556dp</dimen>
|
||||
<dimen name="dp_385">1646.9444dp</dimen>
|
||||
<dimen name="dp_400">1711.1111dp</dimen>
|
||||
<dimen name="dp_410">1753.8889dp</dimen>
|
||||
<dimen name="dp_422">1805.2222dp</dimen>
|
||||
<dimen name="dp_472">2019.1111dp</dimen>
|
||||
<dimen name="dp_500">2138.8889dp</dimen>
|
||||
<dimen name="dp_600">2566.6667dp</dimen>
|
||||
<dimen name="dp_640">2737.7778dp</dimen>
|
||||
<dimen name="dp_720">3080.0000dp</dimen>
|
||||
<dimen name="sp_6">25.6667dp</dimen>
|
||||
<dimen name="sp_7">29.9444dp</dimen>
|
||||
<dimen name="sp_8">34.2222dp</dimen>
|
||||
<dimen name="sp_9">38.5000dp</dimen>
|
||||
<dimen name="sp_10">42.7778dp</dimen>
|
||||
<dimen name="sp_11">47.0556dp</dimen>
|
||||
<dimen name="sp_12">51.3333dp</dimen>
|
||||
<dimen name="sp_13">55.6111dp</dimen>
|
||||
<dimen name="sp_14">59.8889dp</dimen>
|
||||
<dimen name="sp_15">64.1667dp</dimen>
|
||||
<dimen name="sp_16">68.4444dp</dimen>
|
||||
<dimen name="sp_17">72.7222dp</dimen>
|
||||
<dimen name="sp_18">77.0000dp</dimen>
|
||||
<dimen name="sp_19">81.2778dp</dimen>
|
||||
<dimen name="sp_20">85.5556dp</dimen>
|
||||
<dimen name="sp_21">89.8333dp</dimen>
|
||||
<dimen name="sp_22">94.1111dp</dimen>
|
||||
<dimen name="sp_23">98.3889dp</dimen>
|
||||
<dimen name="sp_24">102.6667dp</dimen>
|
||||
<dimen name="sp_25">106.9444dp</dimen>
|
||||
<dimen name="sp_28">119.7778dp</dimen>
|
||||
<dimen name="sp_30">128.3333dp</dimen>
|
||||
<dimen name="sp_32">136.8889dp</dimen>
|
||||
<dimen name="sp_34">145.4444dp</dimen>
|
||||
<dimen name="sp_36">154.0000dp</dimen>
|
||||
<dimen name="sp_38">162.5556dp</dimen>
|
||||
<dimen name="sp_40">171.1111dp</dimen>
|
||||
<dimen name="sp_42">179.6667dp</dimen>
|
||||
<dimen name="sp_48">205.3333dp</dimen>
|
||||
<dimen name="sp_58">248.1111dp</dimen>
|
||||
<dimen name="sp_115">491.9444dp</dimen>
|
||||
</resources>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
<resources>
|
||||
<!-- <string name="appName">大河好运司机</string>-->
|
||||
<string name="app_name">大河好运司机</string>
|
||||
<!--设置界面-->
|
||||
<string name="alivc_recorder_setting_min_record_duration">最小时长</string>
|
||||
<string name="alivc_recorder_setting_max_record_duration">最大时长</string>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
apply from: "compile.gradle"
|
||||
buildscript {
|
||||
ext.kotlin_version = "1.5.0"
|
||||
// ext.kotlin_version = "1.6.10"
|
||||
repositories {
|
||||
google()
|
||||
jcenter() // 这个
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ def MagicIndicator = '1.7.0'
|
||||
def PickerView = '4.1.9'
|
||||
def NiceSpinner = '1.4.4'
|
||||
def Countdownview = '2.1.6'
|
||||
def Xpopup = '2.9.19'
|
||||
def Xpopup = '2.2.8'
|
||||
def CheckVersionLib = '2.4.1_androidx'
|
||||
def GooglePlayVersion = '15.0.1'
|
||||
def Streamsupport = '1.7.3'
|
||||
@@ -79,7 +79,7 @@ project.ext {
|
||||
"MagicIndicator" :"com.github.hackware1993:MagicIndicator:${MagicIndicator}",
|
||||
"NiceSpinner" :"com.github.arcadefire:nice-spinner:${NiceSpinner}",
|
||||
"Countdownview" :"com.github.iwgang:countdownview:${Countdownview}",
|
||||
"Xpopup" :"com.github.li-xiaojun:XPopup:${Xpopup}",
|
||||
"Xpopup" :"com.lxj:xpopup:${Xpopup}",
|
||||
"CheckVersionLib" :"com.github.AlexLiuSheng:CheckVersionLib:${CheckVersionLib}",
|
||||
"Bugly" :"com.tencent.bugly:crashreport:${BuglyVersion}",
|
||||
"Streamsupport" :"net.sourceforge.streamsupport:streamsupport:${Streamsupport}",
|
||||
|
||||
@@ -58,7 +58,7 @@ dependencies {
|
||||
api rootProject.ext.dependencies["okhttp"]
|
||||
api rootProject.ext.dependencies["logging-interceptor"]
|
||||
api rootProject.ext.dependencies["recyclerview"]
|
||||
// api rootProject.ext.dependencies["AutoSize"]
|
||||
api rootProject.ext.dependencies["AutoSize"]
|
||||
api rootProject.ext.dependencies["statusbaruitl"]
|
||||
api rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"]
|
||||
api rootProject.ext.dependencies["PhotoPicker"]
|
||||
@@ -79,6 +79,7 @@ dependencies {
|
||||
api rootProject.ext.dependencies["Search"]
|
||||
api 'com.gyf.cactus:cactus:1.1.3-beta13'
|
||||
|
||||
|
||||
//友盟基础库(必须)
|
||||
// api 'com.umeng.umsdk:common:9.4.4'
|
||||
// api 'com.umeng.umsdk:asms:1.4.1'
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
android:supportsRtl="true">
|
||||
|
||||
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="design_width_in_dp"-->
|
||||
<!-- android:value="360" />-->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="design_height_in_dp"-->
|
||||
<!-- android:value="640" />-->
|
||||
<meta-data
|
||||
android:name="design_width_in_dp"
|
||||
android:value="360" />
|
||||
<meta-data
|
||||
android:name="design_height_in_dp"
|
||||
android:value="640" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.dahe.mylibrary.glide.AppGlideModule"
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
package com.dahe.mylibrary.utils;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.dahe.mylibrary.R;
|
||||
|
||||
/**
|
||||
* @ClassName MobileInfoUtils
|
||||
* @Author 用户
|
||||
* @Date 2022/10/8 10:18
|
||||
* @Description TODO
|
||||
*/
|
||||
public class MobileInfoUtils {
|
||||
|
||||
// private SettingDialogPermision dialog_per;
|
||||
|
||||
//获取手机类型
|
||||
|
||||
private static String getMobileType() {
|
||||
|
||||
return Build.MANUFACTURER;
|
||||
|
||||
}
|
||||
|
||||
//跳转至授权页面
|
||||
|
||||
public void jumpStartInterface(Context context) {
|
||||
|
||||
Intent intent = new Intent();
|
||||
|
||||
try {
|
||||
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
Log.e("HLQ_Struggle", "******************当前手机型号为:" + getMobileType());
|
||||
|
||||
ComponentName componentName = null;
|
||||
|
||||
if (getMobileType().equals("Xiaomi")) { // 红米Note4测试通过
|
||||
|
||||
componentName = new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity");
|
||||
|
||||
} else if (getMobileType().equals("Letv")) { // 乐视2测试通过
|
||||
|
||||
intent.setAction("com.letv.android.permissionautoboot");
|
||||
|
||||
} else if (getMobileType().equals("samsung")) { // 三星Note5测试通过
|
||||
|
||||
//componentName = new ComponentName("com.samsung.android.sm_cn", "com.samsung.android.sm.ui.ram.AutoRunActivity");
|
||||
|
||||
//componentName = ComponentName.unflattenFromString("com.samsung.android.sm/.ui.ram.RamActivity");// Permission Denial not exported from uid 1000,不允许被其他程序调用
|
||||
|
||||
componentName = ComponentName.unflattenFromString("com.samsung.android.sm/.app.dashboard.SmartManagerDashBoardActivity");
|
||||
|
||||
} else if (getMobileType().equals("HUAWEI")) { // 华为测试通过
|
||||
|
||||
//componentName = new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity");//锁屏清理
|
||||
|
||||
componentName = ComponentName.unflattenFromString("com.huawei.systemmanager/.startupmgr.ui.StartupNormalAppListActivity");//跳自启动管理
|
||||
|
||||
//SettingOverlayView.show(context);
|
||||
|
||||
} else if (getMobileType().equals("vivo")) { // VIVO测试通过
|
||||
|
||||
componentName = ComponentName.unflattenFromString("com.iqoo.secure/.safeguard.PurviewTabActivity");
|
||||
|
||||
} else if (getMobileType().equals("Meizu")) { //万恶的魅族
|
||||
|
||||
//componentName = ComponentName.unflattenFromString("com.meizu.safe/.permission.PermissionMainActivity");//跳转到手机管家
|
||||
|
||||
componentName = ComponentName.unflattenFromString("com.meizu.safe/.permission.SmartBGActivity");//跳转到后台管理页面
|
||||
|
||||
} else if (getMobileType().equals("OPPO")) { // OPPO R8205测试通过
|
||||
|
||||
componentName = ComponentName.unflattenFromString("com.oppo.safe/.permission.startup.StartupAppListActivity");
|
||||
|
||||
} else if (getMobileType().equals("ulong")) { // 360手机 未测试
|
||||
|
||||
componentName = new ComponentName("com.yulong.android.coolsafe", ".ui.activity.autorun.AutoRunListActivity");
|
||||
|
||||
} else {
|
||||
|
||||
// 将用户引导到系统设置页面
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 9) {
|
||||
|
||||
Log.e("HLQ_Struggle", "APPLICATION_DETAILS_SETTINGS");
|
||||
|
||||
intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
|
||||
|
||||
intent.setData(Uri.fromParts("package", context.getPackageName(), null));
|
||||
|
||||
} else if (Build.VERSION.SDK_INT <= 8) {
|
||||
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
|
||||
intent.setClassName("com.android.settings", "com.android.settings.InstalledAppDetails");
|
||||
|
||||
intent.putExtra("com.android.settings.ApplicationPkgName", context.getPackageName());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
intent.setComponent(componentName);
|
||||
|
||||
context.startActivity(intent);
|
||||
|
||||
// if (getMobileType().equals("Xiaomi")) {
|
||||
//
|
||||
// showtip();//显示弹窗(**特别注意**)
|
||||
//
|
||||
// }
|
||||
//
|
||||
// if (getMobileType().equals("samsung")){
|
||||
//
|
||||
// new SettingOverlayView().show(context);//
|
||||
//
|
||||
// }
|
||||
|
||||
} catch (Exception e) {//抛出异常就直接打开设置页面
|
||||
|
||||
Log.e("HLQ_Struggle", e.getLocalizedMessage());
|
||||
|
||||
intent = new Intent(Settings.ACTION_SETTINGS);
|
||||
|
||||
context.startActivity(intent);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//小米手机显示弹窗
|
||||
|
||||
// private void showtip() {
|
||||
//
|
||||
// try {
|
||||
//
|
||||
// dialog_per=new SettingDialogPermision(context, R.style.CustomDialog4);
|
||||
//
|
||||
// dialog_per.getWindow().setType(WindowManager.LayoutParams.TYPE_TOAST);//注意这里改成吐司类型
|
||||
//
|
||||
// dialog_per.show();
|
||||
//
|
||||
// Log.e("HLQ_Struggle","显示弹窗");
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
//
|
||||
// e.printStackTrace();
|
||||
//
|
||||
// Log.e("HLQ_Struggle", "没有显示弹窗"+e.getMessage());
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -179,7 +179,6 @@ public final class TimeUtil {
|
||||
private static final DateFormat DEFAULT_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
|
||||
private static final DateFormat DEFAULT_FORMAT2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZSS:SS", Locale.getDefault());
|
||||
private static final DateFormat DEFAULT_FORMAT3 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault());
|
||||
public static final DateFormat DEFAULT_FORMAT4 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault());
|
||||
|
||||
private TimeUtil() {
|
||||
throw new UnsupportedOperationException("u can't instantiate me...");
|
||||
@@ -216,7 +215,7 @@ public final class TimeUtil {
|
||||
* @return 毫秒时间戳
|
||||
*/
|
||||
public static long string2Millis(final String time) {
|
||||
if (TextUtils.isEmpty(time)) {
|
||||
if (TextUtils.isEmpty(time)){
|
||||
return -1;
|
||||
}
|
||||
return string2Millis(time, DEFAULT_FORMAT);
|
||||
@@ -243,10 +242,10 @@ public final class TimeUtil {
|
||||
* 将时间字符串转为时间戳
|
||||
* <p>time格式为format</p>
|
||||
*
|
||||
* @param time 时间字符串
|
||||
* @param time 时间字符串
|
||||
* @return 毫秒时间戳
|
||||
*/
|
||||
public static String string2String(final String time, final SimpleDateFormat format) {
|
||||
public static String string2String(final String time,final SimpleDateFormat format) {
|
||||
try {
|
||||
return date2String(format.parse(time));
|
||||
// return DEFAULT_FORMAT.format(DEFAULT_FORMAT2.parse(time).getTime());
|
||||
@@ -422,7 +421,7 @@ public final class TimeUtil {
|
||||
* @return 合适型两个时间差
|
||||
*/
|
||||
public static String getFitTimeSpan(final String time0, final String time1, final int precision) {
|
||||
if (TextUtils.isEmpty(time0) || TextUtils.isEmpty(time1)) {
|
||||
if (TextUtils.isEmpty(time0)||TextUtils.isEmpty(time1)){
|
||||
return "";
|
||||
}
|
||||
return millis2FitTimeSpan(Math.abs(string2Millis(time0, DEFAULT_FORMAT) - string2Millis(time1, DEFAULT_FORMAT)), precision);
|
||||
@@ -1686,7 +1685,7 @@ public final class TimeUtil {
|
||||
* @param compareDate
|
||||
* @return
|
||||
*/
|
||||
public static boolean compareDate(String nowDate, String compareDate, DateFormat format) {
|
||||
public static boolean compareDate(String nowDate, String compareDate,DateFormat format) {
|
||||
DateFormat df = format;
|
||||
try {
|
||||
Date now = df.parse(nowDate);
|
||||
@@ -1701,22 +1700,4 @@ public final class TimeUtil {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 得到二个日期间的间隔天数
|
||||
*
|
||||
* @return 间格的天数(null表示时间格式不正确)
|
||||
*/
|
||||
public static int compareNowDate(long comTime) {
|
||||
int min;
|
||||
try {
|
||||
min = (int) ((getNowMills() - comTime) / (60 * 1000));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return min;
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/build
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
|
||||
*/
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.3"
|
||||
defaultConfig {
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
compile 'com.android.support:appcompat-v7:27.1.1'
|
||||
testCompile 'junit:junit:4.12'
|
||||
compile files('libs/license.jar')
|
||||
}
|
||||
Binary file not shown.
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in /Users/baidu/IDE/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# 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 *;
|
||||
#}
|
||||
-dontwarn com.baidu.ocr.**
|
||||
@@ -1,32 +0,0 @@
|
||||
<!--
|
||||
~ Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.baidu.ocr.ui">
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
|
||||
<uses-feature android:name="android.hardware.camera2.full" />
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:vmSafeMode="true"
|
||||
tools:replace="android:allowBackup,android:icon">
|
||||
|
||||
<activity
|
||||
android:name="com.baidu.ocr.ui.camera.CameraActivity"
|
||||
android:configChanges="screenSize|orientation"
|
||||
android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,128 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
|
||||
*/
|
||||
package com.baidu.idcardquality;
|
||||
|
||||
import android.content.res.AssetManager;
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
import com.baidu.idl.authority.AlgorithmOnMainThreadException;
|
||||
import com.baidu.idl.authority.IDLAuthorityException;
|
||||
import com.baidu.idl.license.License;
|
||||
import com.baidu.idl.util.UIThread;
|
||||
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
public class IDcardQualityProcess {
|
||||
final ReentrantReadWriteLock nativeModelLock = new ReentrantReadWriteLock();
|
||||
private static IDcardQualityProcess mInstance;
|
||||
private static String tokenString;
|
||||
private static int mAuthorityStatus;
|
||||
private static Throwable loadNativeException = null;
|
||||
private static volatile boolean hasReleased;
|
||||
|
||||
public IDcardQualityProcess() {
|
||||
}
|
||||
|
||||
public static synchronized IDcardQualityProcess getInstance() {
|
||||
if (null == mInstance) {
|
||||
mInstance = new IDcardQualityProcess();
|
||||
}
|
||||
|
||||
return mInstance;
|
||||
}
|
||||
|
||||
public native byte[] convertRGBImage(int[] colors, int width, int height);
|
||||
|
||||
public native int idcardQualityModelInit(AssetManager var1, String var2);
|
||||
|
||||
public native int idcardQualityCaptchaRelease();
|
||||
|
||||
public native int idcardQualityProcess(byte[] var1, int var2, int var3, boolean var4, int var5);
|
||||
|
||||
public static synchronized int init(String token) throws AlgorithmOnMainThreadException, IDLAuthorityException {
|
||||
if (UIThread.isUITread()) {
|
||||
throw new AlgorithmOnMainThreadException();
|
||||
} else {
|
||||
tokenString = token;
|
||||
|
||||
try {
|
||||
mAuthorityStatus = License.getInstance().init(tokenString);
|
||||
} catch (Exception var2) {
|
||||
var2.printStackTrace();
|
||||
}
|
||||
|
||||
return mAuthorityStatus;
|
||||
}
|
||||
}
|
||||
|
||||
public int idcardQualityInit(AssetManager assetManager, String modelPath) {
|
||||
if (mAuthorityStatus == 0) {
|
||||
hasReleased = false;
|
||||
nativeModelLock.writeLock().lock();
|
||||
int status = this.idcardQualityModelInit(assetManager, modelPath);
|
||||
nativeModelLock.writeLock().unlock();
|
||||
return status;
|
||||
} else {
|
||||
return mAuthorityStatus;
|
||||
}
|
||||
}
|
||||
|
||||
public int idcardQualityRelease() {
|
||||
if (mAuthorityStatus == 0) {
|
||||
hasReleased = true;
|
||||
nativeModelLock.writeLock().lock();
|
||||
this.idcardQualityCaptchaRelease();
|
||||
nativeModelLock.writeLock().unlock();
|
||||
return 0;
|
||||
} else {
|
||||
return mAuthorityStatus;
|
||||
}
|
||||
}
|
||||
|
||||
public int idcardQualityDetectionImg(Bitmap img, boolean isfont) {
|
||||
int status;
|
||||
if (mAuthorityStatus == 0) {
|
||||
if (hasReleased) {
|
||||
return -1;
|
||||
}
|
||||
int imgHeight = img.getHeight();
|
||||
int imgWidth = img.getWidth();
|
||||
byte[] imageData = this.getRGBImageData(img);
|
||||
nativeModelLock.readLock().lock();
|
||||
status = this.idcardQualityProcess(imageData, imgHeight, imgWidth, isfont, 3);
|
||||
nativeModelLock.readLock().unlock();
|
||||
return status;
|
||||
} else {
|
||||
return mAuthorityStatus;
|
||||
}
|
||||
}
|
||||
|
||||
public static Throwable getLoadSoException() {
|
||||
return loadNativeException;
|
||||
}
|
||||
|
||||
public byte[] getRGBImageData(Bitmap img) {
|
||||
int imgWidth = img.getWidth();
|
||||
int imgHeight = img.getHeight();
|
||||
int[] pixels = new int[imgWidth * imgHeight];
|
||||
img.getPixels(pixels, 0, imgWidth, 0, 0, imgWidth, imgHeight);
|
||||
byte[] imageData = convertRGBImage(pixels, imgWidth, imgHeight);
|
||||
return imageData;
|
||||
}
|
||||
|
||||
public void releaseModel() {
|
||||
this.idcardQualityRelease();
|
||||
}
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("idl_license");
|
||||
System.loadLibrary("idcard_quality.1.1.1");
|
||||
} catch (Throwable e) {
|
||||
loadNativeException = e;
|
||||
}
|
||||
mInstance = null;
|
||||
mAuthorityStatus = 256;
|
||||
}
|
||||
}
|
||||
@@ -1,573 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
|
||||
*/
|
||||
package com.baidu.ocr.ui.camera;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.ImageFormat;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.SurfaceTexture;
|
||||
import android.graphics.YuvImage;
|
||||
import android.hardware.Camera;
|
||||
import android.view.TextureView;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
|
||||
/**
|
||||
* 5.0以下相机API的封装。
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class Camera1Control implements ICameraControl {
|
||||
|
||||
private int displayOrientation = 0;
|
||||
private int cameraId = 0;
|
||||
private int flashMode;
|
||||
private AtomicBoolean takingPicture = new AtomicBoolean(false);
|
||||
private AtomicBoolean abortingScan = new AtomicBoolean(false);
|
||||
private Context context;
|
||||
private Camera camera;
|
||||
|
||||
private Camera.Parameters parameters;
|
||||
private PermissionCallback permissionCallback;
|
||||
private Rect previewFrame = new Rect();
|
||||
|
||||
private PreviewView previewView;
|
||||
private View displayView;
|
||||
private int rotation = 0;
|
||||
private OnDetectPictureCallback detectCallback;
|
||||
private int previewFrameCount = 0;
|
||||
private Camera.Size optSize;
|
||||
|
||||
/*
|
||||
* 非扫描模式
|
||||
*/
|
||||
private final int MODEL_NOSCAN = 0;
|
||||
|
||||
/*
|
||||
* 本地质量控制扫描模式
|
||||
*/
|
||||
private final int MODEL_SCAN = 1;
|
||||
|
||||
private int detectType = MODEL_NOSCAN;
|
||||
|
||||
public int getCameraRotation() {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
public AtomicBoolean getAbortingScan() {
|
||||
return abortingScan;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDetectCallback(OnDetectPictureCallback callback) {
|
||||
detectType = MODEL_SCAN;
|
||||
detectCallback = callback;
|
||||
}
|
||||
|
||||
private void onRequestDetect(byte[] data) {
|
||||
// 相机已经关闭
|
||||
if (camera == null || data == null || optSize == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
YuvImage img = new YuvImage(data, ImageFormat.NV21, optSize.width, optSize.height, null);
|
||||
ByteArrayOutputStream os = null;
|
||||
try {
|
||||
os = new ByteArrayOutputStream(data.length);
|
||||
img.compressToJpeg(new Rect(0, 0, optSize.width, optSize.height), 80, os);
|
||||
byte[] jpeg = os.toByteArray();
|
||||
int status = detectCallback.onDetect(jpeg, getCameraRotation());
|
||||
|
||||
if (status == 0) {
|
||||
clearPreviewCallback();
|
||||
}
|
||||
} catch (OutOfMemoryError e) {
|
||||
// 内存溢出则取消当次操作
|
||||
} finally {
|
||||
try {
|
||||
os.close();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDisplayOrientation(@CameraView.Orientation int displayOrientation) {
|
||||
this.displayOrientation = displayOrientation;
|
||||
switch (displayOrientation) {
|
||||
case CameraView.ORIENTATION_PORTRAIT:
|
||||
rotation = 90;
|
||||
break;
|
||||
case CameraView.ORIENTATION_HORIZONTAL:
|
||||
rotation = 0;
|
||||
break;
|
||||
case CameraView.ORIENTATION_INVERT:
|
||||
rotation = 180;
|
||||
break;
|
||||
default:
|
||||
rotation = 0;
|
||||
}
|
||||
previewView.requestLayout();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void refreshPermission() {
|
||||
startPreview(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setFlashMode(@FlashMode int flashMode) {
|
||||
if (this.flashMode == flashMode) {
|
||||
return;
|
||||
}
|
||||
this.flashMode = flashMode;
|
||||
updateFlashMode(flashMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlashMode() {
|
||||
return flashMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
startPreview(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
if (camera != null) {
|
||||
camera.setPreviewCallback(null);
|
||||
stopPreview();
|
||||
// 避免同步代码,为了先设置null后release
|
||||
Camera tempC = camera;
|
||||
camera = null;
|
||||
tempC.release();
|
||||
camera = null;
|
||||
buffer = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void stopPreview() {
|
||||
if (camera != null) {
|
||||
camera.stopPreview();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pause() {
|
||||
if (camera != null) {
|
||||
stopPreview();
|
||||
}
|
||||
setFlashMode(FLASH_MODE_OFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resume() {
|
||||
takingPicture.set(false);
|
||||
if (camera == null) {
|
||||
openCamera();
|
||||
} else {
|
||||
previewView.textureView.setSurfaceTextureListener(surfaceTextureListener);
|
||||
if (previewView.textureView.isAvailable()) {
|
||||
startPreview(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getDisplayView() {
|
||||
return displayView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void takePicture(final OnTakePictureCallback onTakePictureCallback) {
|
||||
if (takingPicture.get()) {
|
||||
return;
|
||||
}
|
||||
switch (displayOrientation) {
|
||||
case CameraView.ORIENTATION_PORTRAIT:
|
||||
parameters.setRotation(90);
|
||||
break;
|
||||
case CameraView.ORIENTATION_HORIZONTAL:
|
||||
parameters.setRotation(0);
|
||||
break;
|
||||
case CameraView.ORIENTATION_INVERT:
|
||||
parameters.setRotation(180);
|
||||
break;
|
||||
}
|
||||
try {
|
||||
Camera.Size picSize = getOptimalSize(camera.getParameters().getSupportedPictureSizes());
|
||||
parameters.setPictureSize(picSize.width, picSize.height);
|
||||
camera.setParameters(parameters);
|
||||
takingPicture.set(true);
|
||||
cancelAutoFocus();
|
||||
CameraThreadPool.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
camera.takePicture(null, null, new Camera.PictureCallback() {
|
||||
@Override
|
||||
public void onPictureTaken(byte[] data, Camera camera) {
|
||||
startPreview(false);
|
||||
takingPicture.set(false);
|
||||
if (onTakePictureCallback != null) {
|
||||
onTakePictureCallback.onPictureTaken(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
startPreview(false);;
|
||||
takingPicture.set(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPermissionCallback(PermissionCallback callback) {
|
||||
this.permissionCallback = callback;
|
||||
}
|
||||
|
||||
public Camera1Control(Context context) {
|
||||
this.context = context;
|
||||
previewView = new PreviewView(context);
|
||||
openCamera();
|
||||
}
|
||||
|
||||
private void openCamera() {
|
||||
setupDisplayView();
|
||||
}
|
||||
|
||||
private void setupDisplayView() {
|
||||
final TextureView textureView = new TextureView(context);
|
||||
previewView.textureView = textureView;
|
||||
previewView.setTextureView(textureView);
|
||||
displayView = previewView;
|
||||
textureView.setSurfaceTextureListener(surfaceTextureListener);
|
||||
}
|
||||
|
||||
private SurfaceTexture surfaceCache;
|
||||
|
||||
private byte[] buffer = null;
|
||||
|
||||
private void setPreviewCallbackImpl() {
|
||||
if (buffer == null) {
|
||||
buffer = new byte[displayView.getWidth()
|
||||
* displayView.getHeight() * ImageFormat.getBitsPerPixel(ImageFormat.NV21) / 8];
|
||||
}
|
||||
if (camera != null && detectType == MODEL_SCAN) {
|
||||
camera.addCallbackBuffer(buffer);
|
||||
camera.setPreviewCallback(previewCallback);
|
||||
}
|
||||
}
|
||||
|
||||
private void clearPreviewCallback() {
|
||||
if (camera != null && detectType == MODEL_SCAN) {
|
||||
camera.setPreviewCallback(null);
|
||||
stopPreview();
|
||||
}
|
||||
}
|
||||
|
||||
Camera.PreviewCallback previewCallback = new Camera.PreviewCallback() {
|
||||
@Override
|
||||
public void onPreviewFrame(final byte[] data, Camera camera) {
|
||||
// 扫描成功阻止打开新线程处理
|
||||
if (abortingScan.get()) {
|
||||
return;
|
||||
}
|
||||
// 节流
|
||||
if (previewFrameCount++ % 5 != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 在某些机型和某项项目中,某些帧的data的数据不符合nv21的格式,需要过滤,否则后续处理会导致crash
|
||||
if (data.length != parameters.getPreviewSize().width * parameters.getPreviewSize().height * 1.5) {
|
||||
return;
|
||||
}
|
||||
|
||||
camera.addCallbackBuffer(buffer);
|
||||
|
||||
CameraThreadPool.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Camera1Control.this.onRequestDetect(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private void initCamera() {
|
||||
try {
|
||||
if (camera == null) {
|
||||
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
|
||||
for (int i = 0; i < Camera.getNumberOfCameras(); i++) {
|
||||
Camera.getCameraInfo(i, cameraInfo);
|
||||
if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {
|
||||
cameraId = i;
|
||||
}
|
||||
}
|
||||
try {
|
||||
camera = Camera.open(cameraId);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
startPreview(true);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
if (parameters == null) {
|
||||
parameters = camera.getParameters();
|
||||
parameters.setPreviewFormat(ImageFormat.NV21);
|
||||
}
|
||||
opPreviewSize(previewView.getWidth(), previewView.getHeight());
|
||||
camera.setPreviewTexture(surfaceCache);
|
||||
setPreviewCallbackImpl();
|
||||
startPreview(false);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private TextureView.SurfaceTextureListener surfaceTextureListener = new TextureView.SurfaceTextureListener() {
|
||||
@Override
|
||||
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
|
||||
surfaceCache = surface;
|
||||
initCamera();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {
|
||||
opPreviewSize(previewView.getWidth(), previewView.getHeight());
|
||||
startPreview(false);
|
||||
setPreviewCallbackImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSurfaceTextureUpdated(SurfaceTexture surface) {
|
||||
setPreviewCallbackImpl();
|
||||
}
|
||||
};
|
||||
|
||||
// 开启预览
|
||||
private void startPreview(boolean checkPermission) {
|
||||
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.CAMERA)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
if (checkPermission && permissionCallback != null) {
|
||||
permissionCallback.onRequestPermission();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (camera == null) {
|
||||
initCamera();
|
||||
} else {
|
||||
camera.startPreview();
|
||||
startAutoFocus();
|
||||
}
|
||||
}
|
||||
|
||||
private void cancelAutoFocus() {
|
||||
camera.cancelAutoFocus();
|
||||
CameraThreadPool.cancelAutoFocusTimer();
|
||||
}
|
||||
|
||||
private void startAutoFocus() {
|
||||
CameraThreadPool.createAutoFocusTimerTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (Camera1Control.this) {
|
||||
if (camera != null && !takingPicture.get()) {
|
||||
try {
|
||||
camera.autoFocus(new Camera.AutoFocusCallback() {
|
||||
@Override
|
||||
public void onAutoFocus(boolean success, Camera camera) {
|
||||
}
|
||||
});
|
||||
} catch (Throwable e) {
|
||||
// startPreview是异步实现,可能在某些机器上前几次调用会autofocus failß
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void opPreviewSize(int width, @SuppressWarnings("unused") int height) {
|
||||
|
||||
if (parameters != null && camera != null && width > 0) {
|
||||
optSize = getOptimalSize(camera.getParameters().getSupportedPreviewSizes());
|
||||
parameters.setPreviewSize(optSize.width, optSize.height);
|
||||
previewView.setRatio(1.0f * optSize.width / optSize.height);
|
||||
|
||||
camera.setDisplayOrientation(getSurfaceOrientation());
|
||||
stopPreview();
|
||||
try {
|
||||
camera.setParameters(parameters);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Camera.Size getOptimalSize(List<Camera.Size> sizes) {
|
||||
int width = previewView.textureView.getWidth();
|
||||
int height = previewView.textureView.getHeight();
|
||||
Camera.Size pictureSize = sizes.get(0);
|
||||
|
||||
List<Camera.Size> candidates = new ArrayList<>();
|
||||
|
||||
for (Camera.Size size : sizes) {
|
||||
if (size.width >= width && size.height >= height && size.width * height == size.height * width) {
|
||||
// 比例相同
|
||||
candidates.add(size);
|
||||
} else if (size.height >= width && size.width >= height && size.width * width == size.height * height) {
|
||||
// 反比例
|
||||
candidates.add(size);
|
||||
}
|
||||
}
|
||||
if (!candidates.isEmpty()) {
|
||||
return Collections.min(candidates, sizeComparator);
|
||||
}
|
||||
|
||||
for (Camera.Size size : sizes) {
|
||||
if (size.width > width && size.height > height) {
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
return pictureSize;
|
||||
}
|
||||
|
||||
private Comparator<Camera.Size> sizeComparator = new Comparator<Camera.Size>() {
|
||||
@Override
|
||||
public int compare(Camera.Size lhs, Camera.Size rhs) {
|
||||
return Long.signum((long) lhs.width * lhs.height - (long) rhs.width * rhs.height);
|
||||
}
|
||||
};
|
||||
|
||||
private void updateFlashMode(int flashMode) {
|
||||
switch (flashMode) {
|
||||
case FLASH_MODE_TORCH:
|
||||
parameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
|
||||
break;
|
||||
case FLASH_MODE_OFF:
|
||||
parameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
|
||||
break;
|
||||
case ICameraControl.FLASH_MODE_AUTO:
|
||||
parameters.setFlashMode(Camera.Parameters.FLASH_MODE_AUTO);
|
||||
break;
|
||||
default:
|
||||
parameters.setFlashMode(Camera.Parameters.FLASH_MODE_AUTO);
|
||||
break;
|
||||
}
|
||||
camera.setParameters(parameters);
|
||||
}
|
||||
|
||||
private int getSurfaceOrientation() {
|
||||
@CameraView.Orientation
|
||||
int orientation = displayOrientation;
|
||||
switch (orientation) {
|
||||
case CameraView.ORIENTATION_PORTRAIT:
|
||||
return 90;
|
||||
case CameraView.ORIENTATION_HORIZONTAL:
|
||||
return 0;
|
||||
case CameraView.ORIENTATION_INVERT:
|
||||
return 180;
|
||||
default:
|
||||
return 90;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 有些相机匹配不到完美的比例。比如。我们的layout是4:3的。预览只有16:9
|
||||
* 的,如果直接显示图片会拉伸,变形。缩放的话,又有黑边。所以我们采取的策略
|
||||
* 是,等比例放大。这样预览的有一部分会超出屏幕。拍照后再进行裁剪处理。
|
||||
*/
|
||||
private class PreviewView extends FrameLayout {
|
||||
|
||||
private TextureView textureView;
|
||||
|
||||
private float ratio = 0.75f;
|
||||
|
||||
void setTextureView(TextureView textureView) {
|
||||
this.textureView = textureView;
|
||||
removeAllViews();
|
||||
addView(textureView);
|
||||
}
|
||||
|
||||
void setRatio(float ratio) {
|
||||
this.ratio = ratio;
|
||||
requestLayout();
|
||||
relayout(getWidth(), getHeight());
|
||||
}
|
||||
|
||||
public PreviewView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||
super.onSizeChanged(w, h, oldw, oldh);
|
||||
relayout(w, h);
|
||||
}
|
||||
|
||||
private void relayout(int w, int h) {
|
||||
int width = w;
|
||||
int height = h;
|
||||
if (w < h) {
|
||||
// 垂直模式,高度固定。
|
||||
height = (int) (width * ratio);
|
||||
} else {
|
||||
// 水平模式,宽度固定。
|
||||
width = (int) (height * ratio);
|
||||
}
|
||||
|
||||
int l = (getWidth() - width) / 2;
|
||||
int t = (getHeight() - height) / 2;
|
||||
|
||||
previewFrame.left = l;
|
||||
previewFrame.top = t;
|
||||
previewFrame.right = l + width;
|
||||
previewFrame.bottom = t + height;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
textureView.layout(previewFrame.left, previewFrame.top, previewFrame.right, previewFrame.bottom);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rect getPreviewFrame() {
|
||||
return previewFrame;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user