Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
400d4d18f1 | ||
|
|
fce593a1b6 | ||
|
|
212d12db47 | ||
|
|
9db4b16e24 | ||
|
|
361ad6111c | ||
|
|
8ba586c204 | ||
|
|
c45e623a58 | ||
|
|
b6d43b53e5 | ||
|
|
553dbeed41 | ||
|
|
3e67b50097 | ||
|
|
c6a5363cfe | ||
|
|
ba031f075c | ||
|
|
ef6247fc22 | ||
|
|
9766690957 |
+5
-4
@@ -37,8 +37,8 @@ android {
|
|||||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 65
|
versionCode 67
|
||||||
versionName "3.3.5"
|
versionName "3.3.7"
|
||||||
flavorDimensions "CHANNEL_VALUE"
|
flavorDimensions "CHANNEL_VALUE"
|
||||||
flavorDimensions "app_icon"
|
flavorDimensions "app_icon"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
@@ -105,7 +105,7 @@ android {
|
|||||||
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||||
]
|
]
|
||||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
||||||
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
|
buildConfigField("String", "BASE_URL", "\"https://app.test.dahehuoyun.com/api/\"")
|
||||||
buildConfigField "boolean", "isTest", "true"
|
buildConfigField "boolean", "isTest", "true"
|
||||||
//APP名称,可以在androidMainfest中引用
|
//APP名称,可以在androidMainfest中引用
|
||||||
resValue "string", "appName", "司机测试"
|
resValue "string", "appName", "司机测试"
|
||||||
@@ -114,7 +114,7 @@ android {
|
|||||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机",
|
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机",
|
||||||
app_icon : "@drawable/diver_logo",
|
app_icon : "@drawable/diver_logo",
|
||||||
GAODEKEY : "c68051b43e79e47a1556fc695371c902",
|
GAODEKEY : "9480fd96746922630e9bf6c75a101059",
|
||||||
JPUSH_PKGNAME: applicationId,
|
JPUSH_PKGNAME: applicationId,
|
||||||
JPUSH_APPKEY : "fba6f55621c670d8c1fe9191", //JPush 上注册的包名对应的 Appkey.
|
JPUSH_APPKEY : "fba6f55621c670d8c1fe9191", //JPush 上注册的包名对应的 Appkey.
|
||||||
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||||
@@ -228,5 +228,6 @@ dependencies {
|
|||||||
implementation 'com.github.getActivity:XToast:8.2'
|
implementation 'com.github.getActivity:XToast:8.2'
|
||||||
|
|
||||||
implementation project(path: ':mylibrary')
|
implementation project(path: ':mylibrary')
|
||||||
|
implementation 'com.lk.mapsdk:sdk-full:2.3.7'
|
||||||
|
|
||||||
}
|
}
|
||||||
Binary file not shown.
@@ -2,6 +2,7 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.arpa.hndahesudintocctmsdriver">
|
package="com.arpa.hndahesudintocctmsdriver">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||||
<!-- 白名单 -->
|
<!-- 白名单 -->
|
||||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||||
@@ -14,6 +15,8 @@
|
|||||||
<!--播音-->
|
<!--播音-->
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
<!-- 地图截屏图片保存等 -->
|
||||||
|
<uses-permission android:name="android.permission.READ_MEDIA_PERMISSION" />
|
||||||
<!-- 极光 -->
|
<!-- 极光 -->
|
||||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||||
<uses-permission android:name="android.permission.READ_PROFILE" />
|
<uses-permission android:name="android.permission.READ_PROFILE" />
|
||||||
@@ -66,6 +69,11 @@
|
|||||||
android:name="com/alct/mdp"
|
android:name="com/alct/mdp"
|
||||||
android:required="false" />
|
android:required="false" />
|
||||||
|
|
||||||
|
<meta-data
|
||||||
|
android:name="com.lk.lbsapi.API_KEY"
|
||||||
|
android:value="EE1721986040968235494A762772C95410D9881BB10790FC0BCRFNPFKW4K6697" />
|
||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.MainActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.MainActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||||
@@ -93,8 +101,8 @@
|
|||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.PhotoCarActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.PhotoCarActivity"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden"
|
android:screenOrientation="portrait"
|
||||||
android:screenOrientation="portrait" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.VehicleAuthActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.VehicleAuthActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
@@ -161,8 +169,8 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden"
|
android:screenOrientation="portrait"
|
||||||
android:screenOrientation="portrait"/>
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AddCarSuccActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AddCarSuccActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
@@ -362,10 +370,11 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".H5Activity"
|
android:name=".H5Activity"
|
||||||
android:screenOrientation="portrait"
|
android:launchMode="singleTask"
|
||||||
android:launchMode="singleTask">
|
android:screenOrientation="portrait">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
|||||||
import com.gyf.cactus.Cactus;
|
import com.gyf.cactus.Cactus;
|
||||||
import com.gyf.cactus.callback.CactusBackgroundCallback;
|
import com.gyf.cactus.callback.CactusBackgroundCallback;
|
||||||
import com.gyf.cactus.callback.CactusCallback;
|
import com.gyf.cactus.callback.CactusCallback;
|
||||||
|
import com.lk.mapsdk.base.mapapi.initializer.InitializerOptions;
|
||||||
|
import com.lk.mapsdk.base.mapapi.initializer.SDKInitializer;
|
||||||
|
import com.lk.mapsdk.base.mapapi.model.CoordType;
|
||||||
import com.tencent.bugly.crashreport.CrashReport;
|
import com.tencent.bugly.crashreport.CrashReport;
|
||||||
import com.umeng.commonsdk.UMConfigure;
|
import com.umeng.commonsdk.UMConfigure;
|
||||||
|
|
||||||
@@ -49,6 +52,18 @@ public class App extends Application {
|
|||||||
CommonBaseLibrary.getInstance().init(this, Api.BASE_URL);
|
CommonBaseLibrary.getInstance().init(this, Api.BASE_URL);
|
||||||
CrashReport.initCrashReport(getApplicationContext(), "0fa55ffad8", false);
|
CrashReport.initCrashReport(getApplicationContext(), "0fa55ffad8", false);
|
||||||
String state = SPUtil.getSP(con, "state_data", "authorization_state");
|
String state = SPUtil.getSP(con, "state_data", "authorization_state");
|
||||||
|
|
||||||
|
InitializerOptions options = new InitializerOptions();
|
||||||
|
// 设置是否使用Https网络请求,默认使用
|
||||||
|
options.setHttpsEnable(true);
|
||||||
|
// 设置坐标系,默认GCJ02
|
||||||
|
options.setCoordType(CoordType.GCJ02);
|
||||||
|
// SDK 初始化
|
||||||
|
SDKInitializer.initialization(getApplicationContext(), options);
|
||||||
|
|
||||||
|
// Log 开关使能
|
||||||
|
SDKInitializer.setLogEnable(true);
|
||||||
|
|
||||||
if ("1".equals(state)) {
|
if ("1".equals(state)) {
|
||||||
try {
|
try {
|
||||||
Context context = getApplicationContext();
|
Context context = getApplicationContext();
|
||||||
|
|||||||
@@ -0,0 +1,157 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||||
|
|
||||||
|
import android.os.Build;
|
||||||
|
import android.provider.Settings;
|
||||||
|
|
||||||
|
import androidx.activity.result.contract.ActivityResultContracts;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.App;
|
||||||
|
import com.dahe.mylibrary.utils.AppUtils;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName AppInfoBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/7/22 15:31
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class AppInfoBean {
|
||||||
|
private String userPhone;
|
||||||
|
private String macIpaddr = Settings.Secure.getString(App.getApp().getContentResolver(),Settings.Secure.ANDROID_ID);
|
||||||
|
// private String macIpaddr = android.os.Build.ID;
|
||||||
|
private String clientSource = "driver";
|
||||||
|
private String status = "";
|
||||||
|
private String mobilePhoneManufacturerName = android.os.Build.BRAND;
|
||||||
|
private String mobilePhoneProductName = android.os.Build.MODEL;
|
||||||
|
private String mobilePhoneMotherboardName = android.os.Build.BOARD;
|
||||||
|
private String mobilePhoneHardwareName = android.os.Build.DEVICE;
|
||||||
|
private String mobilePhoneMachineSystemLanguage = Locale.getDefault().getLanguage();
|
||||||
|
private String androidVersion=android.os.Build.VERSION.RELEASE;
|
||||||
|
private String androidSystemSdk = android.os.Build.VERSION.SDK_INT+"";
|
||||||
|
private String appVersionName = AppUtils.getAppVersionName();
|
||||||
|
private String appVersionNumber = AppUtils.getAppVersionCode()+"";
|
||||||
|
|
||||||
|
public String getUserPhone() {
|
||||||
|
return userPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserPhone(String userPhone) {
|
||||||
|
this.userPhone = userPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMacIpaddr() {
|
||||||
|
return macIpaddr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMacIpaddr(String macIpaddr) {
|
||||||
|
this.macIpaddr = macIpaddr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClientSource() {
|
||||||
|
return clientSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClientSource(String clientSource) {
|
||||||
|
this.clientSource = clientSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMobilePhoneManufacturerName() {
|
||||||
|
return mobilePhoneManufacturerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMobilePhoneManufacturerName(String mobilePhoneManufacturerName) {
|
||||||
|
this.mobilePhoneManufacturerName = mobilePhoneManufacturerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMobilePhoneProductName() {
|
||||||
|
return mobilePhoneProductName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMobilePhoneProductName(String mobilePhoneProductName) {
|
||||||
|
this.mobilePhoneProductName = mobilePhoneProductName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMobilePhoneMotherboardName() {
|
||||||
|
return mobilePhoneMotherboardName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMobilePhoneMotherboardName(String mobilePhoneMotherboardName) {
|
||||||
|
this.mobilePhoneMotherboardName = mobilePhoneMotherboardName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMobilePhoneHardwareName() {
|
||||||
|
return mobilePhoneHardwareName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMobilePhoneHardwareName(String mobilePhoneHardwareName) {
|
||||||
|
this.mobilePhoneHardwareName = mobilePhoneHardwareName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMobilePhoneMachineSystemLanguage() {
|
||||||
|
return mobilePhoneMachineSystemLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMobilePhoneMachineSystemLanguage(String mobilePhoneMachineSystemLanguage) {
|
||||||
|
this.mobilePhoneMachineSystemLanguage = mobilePhoneMachineSystemLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAndroidVersion() {
|
||||||
|
return androidVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAndroidVersion(String androidVersion) {
|
||||||
|
this.androidVersion = androidVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAndroidSystemSdk() {
|
||||||
|
return androidSystemSdk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAndroidSystemSdk(String androidSystemSdk) {
|
||||||
|
this.androidSystemSdk = androidSystemSdk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppVersionName() {
|
||||||
|
return appVersionName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppVersionName(String appVersionName) {
|
||||||
|
this.appVersionName = appVersionName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppVersionNumber() {
|
||||||
|
return appVersionNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppVersionNumber(String appVersionNumber) {
|
||||||
|
this.appVersionNumber = appVersionNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "AppInfoBean{" +
|
||||||
|
"userPhone='" + userPhone + '\'' +
|
||||||
|
", macIpaddr='" + macIpaddr + '\'' +
|
||||||
|
", clientSource='" + clientSource + '\'' +
|
||||||
|
", status='" + status + '\'' +
|
||||||
|
", mobilePhoneManufacturerName='" + mobilePhoneManufacturerName + '\'' +
|
||||||
|
", mobilePhoneProductName='" + mobilePhoneProductName + '\'' +
|
||||||
|
", mobilePhoneMotherboardName='" + mobilePhoneMotherboardName + '\'' +
|
||||||
|
", mobilePhoneHardwareName='" + mobilePhoneHardwareName + '\'' +
|
||||||
|
", mobilePhoneMachineSystemLanguage='" + mobilePhoneMachineSystemLanguage + '\'' +
|
||||||
|
", androidVersion='" + androidVersion + '\'' +
|
||||||
|
", androidSystemSdk='" + androidSystemSdk + '\'' +
|
||||||
|
", appVersionName='" + appVersionName + '\'' +
|
||||||
|
", appVersionNumber='" + appVersionNumber + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -162,11 +162,16 @@ public class RequestConstant {
|
|||||||
|
|
||||||
//车辆自动审核触发器
|
//车辆自动审核触发器
|
||||||
private static final String CAR_AUDIT = "/app/carDriver/carAutomaticAudit";
|
private static final String CAR_AUDIT = "/app/carDriver/carAutomaticAudit";
|
||||||
|
private static final String APP_INFO = "/common/app/logininfor";
|
||||||
|
|
||||||
public static String getCarAudit() {
|
public static String getCarAudit() {
|
||||||
return BASE_URL + CAR_AUDIT;
|
return BASE_URL + CAR_AUDIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String postAppInfo() {
|
||||||
|
return BASE_URL + APP_INFO;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getCarColor() {
|
public static String getCarColor() {
|
||||||
return BASE_URL + CAR_COLOR;
|
return BASE_URL + CAR_COLOR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import android.provider.Settings;
|
|||||||
|
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.AppInfoBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.business.Md5Util;
|
import com.arpa.hndahesudintocctmsdriver.ui.business.Md5Util;
|
||||||
@@ -118,6 +119,14 @@ public class UserRequset {
|
|||||||
RequestUtil.start(1, WoDeFragment.VEHICLE_DEL, re, con, hd);
|
RequestUtil.start(1, WoDeFragment.VEHICLE_DEL, re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//车辆详情
|
||||||
|
public void vehicleDelTwo(String id) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("carId", id);
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getGetCarDel(), MapUtil.mapJson(map)), getToken(con), con);
|
||||||
|
RequestUtil.start(1, "onlyGetDetail", re, con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
//司机身份证认证
|
//司机身份证认证
|
||||||
public void driverIDAuth() {
|
public void driverIDAuth() {
|
||||||
String url = RequestConstant.BASE_URL + "/app/driver/auth/authInfo";
|
String url = RequestConstant.BASE_URL + "/app/driver/auth/authInfo";
|
||||||
@@ -224,4 +233,15 @@ public class UserRequset {
|
|||||||
Request re = OkHttpUtil.get(new OkDate(RequestConstant.getCarAudit(), "get", Md5Util.resNoUrl(map)), getToken(con));
|
Request re = OkHttpUtil.get(new OkDate(RequestConstant.getCarAudit(), "get", Md5Util.resNoUrl(map)), getToken(con));
|
||||||
RequestUtil.start(1, VehicleAuthActivity.CAR_AUDIO, re, con, hd);
|
RequestUtil.start(1, VehicleAuthActivity.CAR_AUDIO, re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void postAppInfo(AppInfoBean appInfoBean, String type) {
|
||||||
|
// Request re = OkHttpUtil.get(new OkDate(RequestConstant.getCarAudit(),"get", gson.toJson(appInfoBean)),getToken(con));
|
||||||
|
Request re;
|
||||||
|
if ("put".equals(type)) {
|
||||||
|
re = OkHttpUtil.put(new OkDate(RequestConstant.postAppInfo(), type, gson.toJson(appInfoBean)), con);
|
||||||
|
} else {
|
||||||
|
re = OkHttpUtil.post(new OkDate(RequestConstant.postAppInfo(), type, gson.toJson(appInfoBean)), con);
|
||||||
|
}
|
||||||
|
RequestUtil.start(1, VehicleAuthActivity.APP_INFO, re, con, hd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,11 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(WoDeFragment.VEHICLE_DEL);
|
CacheGroup.cacheList.remove(WoDeFragment.VEHICLE_DEL);
|
||||||
}
|
}
|
||||||
|
if (CacheGroup.cacheList.get("onlyGetDetail") != null) {
|
||||||
|
Log.e("--res--", CacheGroup.cacheList.get("onlyGetDetail"));
|
||||||
|
cdb = gson.fromJson(CacheGroup.cacheList.get("onlyGetDetail"), CarDelBean.class);
|
||||||
|
CacheGroup.cacheList.remove("onlyGetDetail");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("upload") != null) {
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
@@ -142,6 +147,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
Toast.makeText(con, "上传车辆登记证书照片", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "上传车辆登记证书照片", Toast.LENGTH_SHORT).show();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
ur.vehicleDelTwo(carId);
|
||||||
Toast.makeText(con, "上传道路运输证成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "上传道路运输证成功", Toast.LENGTH_SHORT).show();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
@@ -360,7 +366,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
* 展示大图片
|
* 展示大图片
|
||||||
*/
|
*/
|
||||||
private void showBigImg() {
|
private void showBigImg() {
|
||||||
if ((type == 0 && TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) || (type == 4 && TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl()))) {
|
if ((type == 3 && TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) || (type == 4 && TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl()))) {
|
||||||
choicePhoto();
|
choicePhoto();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -405,8 +411,8 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||||
// .show();
|
// .show();
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
if (cdb.getData().getPolicyPhotoUrl() != null && !"".equals(cdb.getData().getPolicyPhotoUrl())) {
|
if (cdb.getData().getPolicyPhotoUrl() != null && !"".equals(cdb.getData().getPolicyPhotoUrl())) {
|
||||||
@@ -418,8 +424,8 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||||
// .show();
|
// .show();
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
|||||||
public String carId="";
|
public String carId="";
|
||||||
public static final String DEL_CAR="delete_che";
|
public static final String DEL_CAR="delete_che";
|
||||||
public static final String CAR_AUDIO="CAR_AUDIO";
|
public static final String CAR_AUDIO="CAR_AUDIO";
|
||||||
|
public static final String APP_INFO="APP_INFO";
|
||||||
private int submitIndex=0;
|
private int submitIndex=0;
|
||||||
private BaseBean bb;
|
private BaseBean bb;
|
||||||
private ImageView show_img;
|
private ImageView show_img;
|
||||||
|
|||||||
+363
-206
@@ -17,30 +17,14 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.widget.NestedScrollView;
|
import androidx.core.widget.NestedScrollView;
|
||||||
|
|
||||||
|
|
||||||
import com.amap.api.location.AMapLocation;
|
import com.amap.api.location.AMapLocation;
|
||||||
import com.amap.api.location.AMapLocationClient;
|
import com.amap.api.location.AMapLocationClient;
|
||||||
import com.amap.api.location.AMapLocationClientOption;
|
import com.amap.api.location.AMapLocationClientOption;
|
||||||
import com.amap.api.location.AMapLocationListener;
|
import com.amap.api.location.AMapLocationListener;
|
||||||
import com.amap.api.maps.AMap;
|
|
||||||
import com.amap.api.maps.CameraUpdateFactory;
|
|
||||||
import com.amap.api.maps.LocationSource;
|
import com.amap.api.maps.LocationSource;
|
||||||
import com.amap.api.maps.MapView;
|
|
||||||
import com.amap.api.maps.model.BitmapDescriptorFactory;
|
|
||||||
import com.amap.api.maps.model.LatLng;
|
|
||||||
import com.amap.api.maps.model.LatLngBounds;
|
|
||||||
import com.amap.api.maps.model.MarkerOptions;
|
|
||||||
import com.amap.api.maps.model.PolylineOptions;
|
|
||||||
|
|
||||||
import com.amap.api.services.core.AMapException;
|
|
||||||
import com.amap.api.services.core.LatLonPoint;
|
import com.amap.api.services.core.LatLonPoint;
|
||||||
import com.amap.api.services.route.BusRouteResult;
|
|
||||||
import com.amap.api.services.route.DrivePath;
|
|
||||||
import com.amap.api.services.route.DriveRouteResult;
|
|
||||||
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.RouteSearch;
|
||||||
import com.amap.api.services.route.WalkRouteResult;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.dahe.mylibrary.utils.TimeUtil;
|
import com.dahe.mylibrary.utils.TimeUtil;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
@@ -67,6 +51,27 @@ import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.ScoreView;
|
import com.arpa.hndahesudintocctmsdriver.util.view.ScoreView;
|
||||||
|
import com.lk.mapsdk.base.mapapi.initializer.InitializerOptions;
|
||||||
|
import com.lk.mapsdk.base.mapapi.initializer.SDKInitializer;
|
||||||
|
import com.lk.mapsdk.base.mapapi.model.CoordType;
|
||||||
|
import com.lk.mapsdk.base.mapapi.model.LatLng;
|
||||||
|
import com.lk.mapsdk.base.mapapi.model.LatLngBounds;
|
||||||
|
import com.lk.mapsdk.map.mapapi.annotation.Marker;
|
||||||
|
import com.lk.mapsdk.map.mapapi.annotation.Polyline;
|
||||||
|
import com.lk.mapsdk.map.mapapi.annotation.options.MarkerOptions;
|
||||||
|
import com.lk.mapsdk.map.mapapi.annotation.options.PolylineOptions;
|
||||||
|
import com.lk.mapsdk.map.mapapi.annotation.util.BitmapDescriptorFactory;
|
||||||
|
import com.lk.mapsdk.map.mapapi.camera.MapStatusUpdateFactory;
|
||||||
|
import com.lk.mapsdk.map.mapapi.map.LKMap;
|
||||||
|
import com.lk.mapsdk.map.mapapi.map.MapView;
|
||||||
|
import com.lk.mapsdk.map.platform.style.layers.Property;
|
||||||
|
import com.lk.mapsdk.route.mapapi.base.AutoInfo;
|
||||||
|
import com.lk.mapsdk.route.mapapi.base.DrivingCostingOptionsInfo;
|
||||||
|
import com.lk.mapsdk.route.mapapi.base.LocationsInfo;
|
||||||
|
import com.lk.mapsdk.route.mapapi.driving.DrivingRoutePlan;
|
||||||
|
import com.lk.mapsdk.route.mapapi.driving.DrivingRoutePlanOptions;
|
||||||
|
import com.lk.mapsdk.route.mapapi.driving.DrivingRoutePlanResult;
|
||||||
|
import com.lk.mapsdk.route.mapapi.driving.OnDrivingRoutePlanListener;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@@ -82,7 +87,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
|
|
||||||
private String TAG = "StartYunDanActivity";
|
private String TAG = "StartYunDanActivity";
|
||||||
private NestedScrollView bottomSheet;
|
private NestedScrollView bottomSheet;
|
||||||
private MapView map;
|
private MapView mapView;
|
||||||
private BaseRecyclerView brv;
|
private BaseRecyclerView brv;
|
||||||
private AlphaAnimation mShowAnim, mHiddenAmin;//控件的显示和隐藏动画
|
private AlphaAnimation mShowAnim, mHiddenAmin;//控件的显示和隐藏动画
|
||||||
private LinearLayout protect;
|
private LinearLayout protect;
|
||||||
@@ -144,7 +149,6 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private UserBean ub;
|
private UserBean ub;
|
||||||
private AMap aMap;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
@@ -152,6 +156,10 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
StateStyleUtil.stateTextColor(this);
|
StateStyleUtil.stateTextColor(this);
|
||||||
setContentView(R.layout.activity_yundan_start);
|
setContentView(R.layout.activity_yundan_start);
|
||||||
con = this;
|
con = this;
|
||||||
|
mapView = findViewById(R.id.map);
|
||||||
|
mapView.onCreate(savedInstanceState);
|
||||||
|
mLKMap = mapView.getMap();
|
||||||
|
initMap();
|
||||||
id = getIntent().getExtras().getInt("id");
|
id = getIntent().getExtras().getInt("id");
|
||||||
brv = findViewById(R.id.brv);
|
brv = findViewById(R.id.brv);
|
||||||
protect = findViewById(R.id.protect);
|
protect = findViewById(R.id.protect);
|
||||||
@@ -161,12 +169,10 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
mBottomSheetBehavior.setHideable(false);
|
mBottomSheetBehavior.setHideable(false);
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||||
//mBottomSheetBehavior.set
|
//mBottomSheetBehavior.set
|
||||||
map = findViewById(R.id.map);
|
|
||||||
map.onCreate(savedInstanceState);
|
|
||||||
if (aMap == null) {
|
// initLoaction();
|
||||||
aMap = map.getMap();
|
|
||||||
initLoaction();
|
|
||||||
}
|
|
||||||
Log.e("--id--", "" + id);
|
Log.e("--id--", "" + id);
|
||||||
String userdata = SPUtil.getSP(con, "data", "userdata");
|
String userdata = SPUtil.getSP(con, "data", "userdata");
|
||||||
if (!userdata.equals("")) {
|
if (!userdata.equals("")) {
|
||||||
@@ -315,7 +321,8 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
initZX(upkey, v15, position, o, 1);
|
initZX(upkey, v15, position, o, 1);
|
||||||
});
|
});
|
||||||
search();
|
// search();
|
||||||
|
doSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initZX(boolean key, View v, int position, Object o, int type) {
|
public void initZX(boolean key, View v, int position, Object o, int type) {
|
||||||
@@ -449,8 +456,8 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
if (map != null) {
|
if (mapView != null) {
|
||||||
map.onResume();
|
mapView.onResume();
|
||||||
}
|
}
|
||||||
hyr.startOrder(id);
|
hyr.startOrder(id);
|
||||||
hyr.getEvaluate(id);
|
hyr.getEvaluate(id);
|
||||||
@@ -459,223 +466,352 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
if (map != null) {
|
if (mapView != null) {
|
||||||
map.onPause();
|
mapView.onPause();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
if (map != null) {
|
if (mapView != null) {
|
||||||
map.onDestroy();
|
mapView.onDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(@NonNull @NotNull Bundle outState) {
|
protected void onSaveInstanceState(@NonNull @NotNull Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
map.onSaveInstanceState(outState);
|
mapView.onSaveInstanceState(outState);
|
||||||
}
|
}
|
||||||
|
|
||||||
LocationSource.OnLocationChangedListener mListener;
|
LocationSource.OnLocationChangedListener mListener;
|
||||||
AMapLocationClient mlocationClient;
|
AMapLocationClient mlocationClient;
|
||||||
AMapLocationClientOption mLocationOption;
|
AMapLocationClientOption mLocationOption;
|
||||||
|
|
||||||
public void initLoaction() {
|
// public void initLoaction() {
|
||||||
// 设置定位监听
|
// // 设置定位监听
|
||||||
aMap.setLocationSource(new LocationSource() {
|
// aMap.setLocationSource(new LocationSource() {
|
||||||
@Override
|
// @Override
|
||||||
public void activate(OnLocationChangedListener onLocationChangedListener) {
|
// public void activate(OnLocationChangedListener onLocationChangedListener) {
|
||||||
mListener = onLocationChangedListener;
|
// mListener = onLocationChangedListener;
|
||||||
if (mlocationClient == null) {
|
// if (mlocationClient == null) {
|
||||||
//初始化定位
|
// //初始化定位
|
||||||
try {
|
|
||||||
mlocationClient = new AMapLocationClient(con);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
//初始化定位参数
|
|
||||||
mLocationOption = new AMapLocationClientOption();
|
|
||||||
//设置定位回调监听
|
|
||||||
mlocationClient.setLocationListener(new AMapLocationListener() {
|
|
||||||
@Override
|
|
||||||
public void onLocationChanged(AMapLocation aMapLocation) {
|
|
||||||
if (mListener != null && aMapLocation != null) {
|
|
||||||
if (aMapLocation != null
|
|
||||||
&& aMapLocation.getErrorCode() == 0) {
|
|
||||||
mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
|
|
||||||
} else {
|
|
||||||
String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo();
|
|
||||||
Log.e("AmapErr", errText);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//设置为高精度定位模式
|
|
||||||
mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
|
|
||||||
// mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Battery_Saving);
|
|
||||||
//设置定位模式为AMapLocationMode.Device_Sensors,仅设备模式。
|
|
||||||
//mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Device_Sensors);
|
|
||||||
//获取一次定位结果:
|
|
||||||
//该方法默认为false。
|
|
||||||
mLocationOption.setOnceLocation(true);
|
|
||||||
//获取最近3s内精度最高的一次定位结果:
|
|
||||||
//设置setOnceLocationLatest(boolean b)接口为true,启动定位时SDK会返回最近3s内精度最高的一次定位结果。如果设置其为true,setOnceLocation(boolean b)接口也会被设置为true,反之不会,默认为false。
|
|
||||||
mLocationOption.setOnceLocationLatest(true);
|
|
||||||
//设置是否返回地址信息(默认返回地址信息)
|
|
||||||
mLocationOption.setNeedAddress(true);
|
|
||||||
//设置是否允许模拟位置,默认为true,允许模拟位置
|
|
||||||
mLocationOption.setMockEnable(true);
|
|
||||||
//单位是毫秒,默认30000毫秒,建议超时时间不要低于8000毫秒。
|
|
||||||
mLocationOption.setHttpTimeOut(20000);
|
|
||||||
//关闭缓存机制
|
|
||||||
mLocationOption.setLocationCacheEnable(false);
|
|
||||||
//设置定位参数
|
|
||||||
mlocationClient.setLocationOption(mLocationOption);
|
|
||||||
// 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
|
|
||||||
// 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
|
|
||||||
// 在定位结束后,在合适的生命周期调用onDestroy()方法
|
|
||||||
// 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
|
|
||||||
mlocationClient.startLocation();//启动定位
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deactivate() {
|
|
||||||
mListener = null;
|
|
||||||
if (mlocationClient != null) {
|
|
||||||
mlocationClient.stopLocation();
|
|
||||||
mlocationClient.onDestroy();
|
|
||||||
}
|
|
||||||
mlocationClient = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false
|
|
||||||
aMap.setMyLocationEnabled(true);
|
|
||||||
// ld=new LocationGDUtil(con,hd);
|
|
||||||
// ld.onCreate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private RouteSearch mRouteSearch;//路线查询器
|
|
||||||
private List<LatLonPoint> lists = new ArrayList<>();
|
|
||||||
|
|
||||||
|
|
||||||
public void search() {
|
|
||||||
// try {
|
// try {
|
||||||
// AMapLocationClient.updatePrivacyShow(con,true,true);
|
// mlocationClient = new AMapLocationClient(con);
|
||||||
// AMapLocationClient.updatePrivacyAgree(con,true);
|
// } catch (Exception e) {
|
||||||
mRouteSearch = new RouteSearch(this);
|
|
||||||
// } catch (AMapException e) {
|
|
||||||
// e.printStackTrace();
|
// e.printStackTrace();
|
||||||
// }
|
// }
|
||||||
//设置数据回调监听器
|
// //初始化定位参数
|
||||||
mRouteSearch.setRouteSearchListener(new OnRouteSearchListener());
|
// mLocationOption = new AMapLocationClientOption();
|
||||||
//设置开始位置坐标点(注意经纬度不能写反,会报错1800(只能规划到中国区域里的地图路线))
|
// //设置定位回调监听
|
||||||
LatLonPoint startPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
// mlocationClient.setLocationListener(new AMapLocationListener() {
|
||||||
Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));
|
// @Override
|
||||||
//设置目的地坐标点
|
// public void onLocationChanged(AMapLocation aMapLocation) {
|
||||||
LatLonPoint endPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()),
|
// if (mListener != null && aMapLocation != null) {
|
||||||
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()));
|
// if (aMapLocation != null
|
||||||
//查询信息对象
|
// && aMapLocation.getErrorCode() == 0) {
|
||||||
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
// mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
|
||||||
if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
|
// } else {
|
||||||
LatLonPoint sp = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(i).getLatitude()),
|
// String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo();
|
||||||
Double.parseDouble(sob.getData().getWayChildren().get((i)).getLongitude()));
|
// Log.e("AmapErr", errText);
|
||||||
lists.add(sp);
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(startPoint, endPoint);
|
// });
|
||||||
//设置搜索参数 1.fromAndTo 路径的起点终点 2.路径规划的策略(这里是驾车模式,具体看高德API) 3.途
|
// //设置为高精度定位模式
|
||||||
//经点,可选 4.避让区域,可选, 5.避让道路 ,可选
|
// mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
|
||||||
RouteSearch.DriveRouteQuery query = new
|
// // mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Battery_Saving);
|
||||||
RouteSearch.DriveRouteQuery(fromAndTo, RouteSearch.DRIVING_SINGLE_DEFAULT, lists, null, "");
|
// //设置定位模式为AMapLocationMode.Device_Sensors,仅设备模式。
|
||||||
//开始异步查询
|
// //mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Device_Sensors);
|
||||||
mRouteSearch.calculateDriveRouteAsyn(query);
|
// //获取一次定位结果:
|
||||||
|
// //该方法默认为false。
|
||||||
|
// mLocationOption.setOnceLocation(true);
|
||||||
|
// //获取最近3s内精度最高的一次定位结果:
|
||||||
|
// //设置setOnceLocationLatest(boolean b)接口为true,启动定位时SDK会返回最近3s内精度最高的一次定位结果。如果设置其为true,setOnceLocation(boolean b)接口也会被设置为true,反之不会,默认为false。
|
||||||
|
// mLocationOption.setOnceLocationLatest(true);
|
||||||
|
// //设置是否返回地址信息(默认返回地址信息)
|
||||||
|
// mLocationOption.setNeedAddress(true);
|
||||||
|
// //设置是否允许模拟位置,默认为true,允许模拟位置
|
||||||
|
// mLocationOption.setMockEnable(true);
|
||||||
|
// //单位是毫秒,默认30000毫秒,建议超时时间不要低于8000毫秒。
|
||||||
|
// mLocationOption.setHttpTimeOut(20000);
|
||||||
|
// //关闭缓存机制
|
||||||
|
// mLocationOption.setLocationCacheEnable(false);
|
||||||
|
// //设置定位参数
|
||||||
|
// mlocationClient.setLocationOption(mLocationOption);
|
||||||
|
// // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
|
||||||
|
// // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
|
||||||
|
// // 在定位结束后,在合适的生命周期调用onDestroy()方法
|
||||||
|
// // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
|
||||||
|
// mlocationClient.startLocation();//启动定位
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void deactivate() {
|
||||||
|
// mListener = null;
|
||||||
|
// if (mlocationClient != null) {
|
||||||
|
// mlocationClient.stopLocation();
|
||||||
|
// mlocationClient.onDestroy();
|
||||||
|
// }
|
||||||
|
// mlocationClient = null;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// // 设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false
|
||||||
|
//// aMap.setMyLocationEnabled(true);
|
||||||
|
//// ld=new LocationGDUtil(con,hd);
|
||||||
|
//// ld.onCreate();
|
||||||
|
// }
|
||||||
|
|
||||||
|
private void initMap(){
|
||||||
|
// 通过InitializerOptions指定初始化配置参数
|
||||||
|
InitializerOptions options = new InitializerOptions();
|
||||||
|
// 设置是否使用Https网络请求,默认使用
|
||||||
|
// options.setIsHttpsEnable(true);
|
||||||
|
// 设置坐标系,默认GCJ02
|
||||||
|
// options.setCoorType(CoordType.GCJ02);
|
||||||
|
|
||||||
|
SDKInitializer.initialization(getApplicationContext(),options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private DrivingRoutePlanOptions drivingRoutePlanOptions;
|
||||||
|
private List<LocationsInfo> locationsInfos;
|
||||||
|
|
||||||
class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener {
|
private List<Polyline> polylines = new ArrayList<>();
|
||||||
|
private List<Marker> markers = new ArrayList<>();
|
||||||
|
|
||||||
|
private LKMap mLKMap;
|
||||||
|
|
||||||
|
private void doSearch() {
|
||||||
|
DrivingRoutePlan search = new DrivingRoutePlan();
|
||||||
|
|
||||||
|
drivingRoutePlanOptions = new DrivingRoutePlanOptions();
|
||||||
|
locationsInfos = new ArrayList<>();
|
||||||
|
// 设置开始坐标
|
||||||
|
LocationsInfo origin = new LocationsInfo();
|
||||||
|
origin.setLat(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()));
|
||||||
|
origin.setLon(Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));
|
||||||
|
// 设置结束坐标
|
||||||
|
LocationsInfo dest = new LocationsInfo();
|
||||||
|
dest.setLat(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()));
|
||||||
|
dest.setLon(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()));
|
||||||
|
locationsInfos.add(origin);
|
||||||
|
locationsInfos.add(dest);
|
||||||
|
drivingRoutePlanOptions.setLocations(locationsInfos);
|
||||||
|
AutoInfo autoInfo = new AutoInfo();
|
||||||
|
DrivingCostingOptionsInfo drivingCostingOptionsInfo = new DrivingCostingOptionsInfo();
|
||||||
|
drivingCostingOptionsInfo.setAuto(autoInfo);
|
||||||
|
drivingRoutePlanOptions.setDrivingCostingOptions(drivingCostingOptionsInfo);
|
||||||
|
|
||||||
|
search.drivingRoutePlanRequest(drivingRoutePlanOptions, new OnDrivingRoutePlanListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBusRouteSearched(BusRouteResult busRouteResult, int i) {
|
public void onGetDrivingRoutePlanResult(DrivingRoutePlanResult routePlanResult) {
|
||||||
|
addRoutePlanLine(routePlanResult);
|
||||||
|
addRouteMarker();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加线路规划路线
|
||||||
|
*
|
||||||
|
* @param routePlanResult
|
||||||
|
*/
|
||||||
|
private void addRoutePlanLine(DrivingRoutePlanResult routePlanResult) {
|
||||||
|
if (routePlanResult == null) {
|
||||||
|
Toast.makeText(this, "没有检索到结果", Toast.LENGTH_LONG).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (routePlanResult.getRouteInfos() == null || routePlanResult.getRouteInfos().isEmpty()) {
|
||||||
|
Toast.makeText(this, "没有检索到结果", Toast.LENGTH_LONG).show();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDriveRouteSearched(DriveRouteResult driveRouteResult, int rCode) {
|
|
||||||
if (rCode == 1000) {//获取规划路线成功,获取到的是了,路线坐标点的集合
|
|
||||||
List<DrivePath> paths = driveRouteResult.getPaths();
|
|
||||||
//创建存储坐标点的集合
|
|
||||||
List<LatLng> latLngs = new ArrayList<>();
|
List<LatLng> latLngs = new ArrayList<>();
|
||||||
//遍历获取规划的所有路线坐标点
|
List<LatLng> all = new ArrayList<>();
|
||||||
for (DrivePath mDrivePath : paths) {
|
mLKMap.removeOverlay(polylines);
|
||||||
for (DriveStep mDriveStep : mDrivePath.getSteps()) {
|
polylines.clear();
|
||||||
for (LatLonPoint mLatLonPoint : mDriveStep.getPolyline()) {
|
|
||||||
latLngs.add(new
|
if (routePlanResult.getRouteInfos().size()>0){
|
||||||
LatLng(mLatLonPoint.getLatitude(), mLatLonPoint.getLongitude()));
|
latLngs.clear();
|
||||||
|
latLngs.addAll(routePlanResult.getRouteInfos().get(0).getGeometry());
|
||||||
|
PolylineOptions options = new PolylineOptions();
|
||||||
|
options.width(8f)
|
||||||
|
.joinStyle(Property.LINE_JOIN_ROUND)
|
||||||
|
.points(latLngs)
|
||||||
|
.color(getResources().getColor(R.color.theme_color));
|
||||||
|
all.addAll(latLngs);
|
||||||
|
polylines.add((Polyline) mLKMap.addOverlay(options));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// for (int i = 0;i < routePlanResult.getRouteInfos().size();i ++){
|
||||||
|
// latLngs.clear();
|
||||||
|
// latLngs.addAll(routePlanResult.getRouteInfos().get(i).getGeometry());
|
||||||
|
// PolylineOptions options = new PolylineOptions();
|
||||||
|
// if(i == routePlanResult.getRouteInfos().size() - 1){
|
||||||
|
// options.width(8f)
|
||||||
|
//// .pattern(BitmapDescriptorFactory.fromResource(R.drawable.icon_roud_type))
|
||||||
|
// .joinStyle(Property.LINE_JOIN_ROUND)
|
||||||
|
// .points(latLngs)
|
||||||
|
// .color(getResources().getColor(R.color.theme_color));
|
||||||
|
// }else{
|
||||||
|
// options.width(8f)
|
||||||
|
//// .joinStyle(Property.LINE_JOIN_ROUND)
|
||||||
|
// .points(latLngs)
|
||||||
|
// .color(getResources().getColor(R.color.theme_color));
|
||||||
|
// }
|
||||||
|
// all.addAll(latLngs);
|
||||||
|
// polylines.add((Polyline) mLKMap.addOverlay(options));
|
||||||
|
// }
|
||||||
|
mLKMap.setMapStatus(MapStatusUpdateFactory.buildUpdateByLatLngBounds(new LatLngBounds(all),100,100,100,100));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//先清除一下,避免重复显示
|
/**
|
||||||
aMap.clear();
|
* 添加起始点标记
|
||||||
//绘制起始位置和目的地marker
|
*/
|
||||||
aMap.addMarker(new MarkerOptions()
|
private void addRouteMarker() {
|
||||||
|
mLKMap.removeOverlay(markers);
|
||||||
|
markers.clear();
|
||||||
|
MarkerOptions originOptions = new MarkerOptions()
|
||||||
|
.position(new LatLng(locationsInfos.get(0).getLat(),locationsInfos.get(0).getLon()))
|
||||||
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.qi))
|
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.qi))
|
||||||
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
.iconGravity(Property.ICON_ANCHOR_BOTTOM)
|
||||||
Double.parseDouble(sob.getData().getWayChildren().get(0).getLongitude()))));
|
.iconScale(0.5f);
|
||||||
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
markers.add((Marker) mLKMap.addOverlay(originOptions));
|
||||||
if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
|
|
||||||
StartOrderBean.DataDTO.WayChildrenDTO sdw = sob.getData().getWayChildren().get(i);
|
MarkerOptions destinationOptions = new MarkerOptions()
|
||||||
int icon = 0;
|
.position(new LatLng(locationsInfos.get(1).getLat(),locationsInfos.get(1).getLon()))
|
||||||
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()))));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
aMap.addMarker(new MarkerOptions()
|
|
||||||
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.zhong))
|
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.zhong))
|
||||||
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()),
|
.iconGravity(Property.ICON_ANCHOR_BOTTOM)
|
||||||
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()))));
|
.iconScale(0.5f);
|
||||||
//绘制规划路径路线
|
markers.add((Marker) mLKMap.addOverlay(destinationOptions));
|
||||||
aMap.addPolyline(new PolylineOptions()
|
|
||||||
//路线坐标点的集合
|
|
||||||
.addAll(latLngs)
|
|
||||||
//线的宽度
|
|
||||||
.width(8)
|
|
||||||
.color(getResources().getColor(R.color.theme_color)));
|
|
||||||
//设置画线的颜色
|
|
||||||
|
|
||||||
//显示完整包含所有marker地图路线
|
|
||||||
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));
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onWalkRouteSearched(WalkRouteResult walkRouteResult, int i) {
|
|
||||||
|
|
||||||
}
|
// private RouteSearch mRouteSearch;//路线查询器
|
||||||
|
// private List<LatLonPoint> lists = new ArrayList<>();
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRideRouteSearched(RideRouteResult rideRouteResult, int i) {
|
|
||||||
|
|
||||||
}
|
// public void search() {
|
||||||
|
//// try {
|
||||||
|
//// AMapLocationClient.updatePrivacyShow(con,true,true);
|
||||||
|
//// AMapLocationClient.updatePrivacyAgree(con,true);
|
||||||
|
// 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()),
|
||||||
|
// 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()));
|
||||||
|
// //查询信息对象
|
||||||
|
// 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);
|
||||||
|
// //设置搜索参数 1.fromAndTo 路径的起点终点 2.路径规划的策略(这里是驾车模式,具体看高德API) 3.途
|
||||||
|
// //经点,可选 4.避让区域,可选, 5.避让道路 ,可选
|
||||||
|
// RouteSearch.DriveRouteQuery query = new
|
||||||
|
// RouteSearch.DriveRouteQuery(fromAndTo, RouteSearch.DRIVING_SINGLE_DEFAULT, lists, null, "");
|
||||||
|
// //开始异步查询
|
||||||
|
// mRouteSearch.calculateDriveRouteAsyn(query);
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
|
||||||
|
// class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onBusRouteSearched(BusRouteResult busRouteResult, int i) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onDriveRouteSearched(DriveRouteResult driveRouteResult, int rCode) {
|
||||||
|
// if (rCode == 1000) {//获取规划路线成功,获取到的是了,路线坐标点的集合
|
||||||
|
// List<DrivePath> paths = driveRouteResult.getPaths();
|
||||||
|
// //创建存储坐标点的集合
|
||||||
|
// List<LatLng> latLngs = new ArrayList<>();
|
||||||
|
// //遍历获取规划的所有路线坐标点
|
||||||
|
// for (DrivePath mDrivePath : paths) {
|
||||||
|
// for (DriveStep mDriveStep : mDrivePath.getSteps()) {
|
||||||
|
// for (LatLonPoint mLatLonPoint : mDriveStep.getPolyline()) {
|
||||||
|
// latLngs.add(new
|
||||||
|
// LatLng(mLatLonPoint.getLatitude(), mLatLonPoint.getLongitude()));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// //先清除一下,避免重复显示
|
||||||
|
// aMap.clear();
|
||||||
|
// //绘制起始位置和目的地marker
|
||||||
|
// aMap.addMarker(new MarkerOptions()
|
||||||
|
// .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;
|
||||||
|
// }
|
||||||
|
// aMap.addMarker(new MarkerOptions()
|
||||||
|
// .icon(BitmapDescriptorFactory.fromResource(icon))
|
||||||
|
// .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()))));
|
||||||
|
// //绘制规划路径路线
|
||||||
|
// aMap.addPolyline(new PolylineOptions()
|
||||||
|
// //路线坐标点的集合
|
||||||
|
// .addAll(latLngs)
|
||||||
|
// //线的宽度
|
||||||
|
// .width(8)
|
||||||
|
// .color(getResources().getColor(R.color.theme_color)));
|
||||||
|
// //设置画线的颜色
|
||||||
|
//
|
||||||
|
// //显示完整包含所有marker地图路线
|
||||||
|
// 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));
|
||||||
|
// 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));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onWalkRouteSearched(WalkRouteResult walkRouteResult, int i) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onRideRouteSearched(RideRouteResult rideRouteResult, int i) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
public void up_traffic() {
|
public void up_traffic() {
|
||||||
// ShippingNoteInfo[] snis=new ShippingNoteInfo[1];
|
// ShippingNoteInfo[] snis=new ShippingNoteInfo[1];
|
||||||
@@ -697,4 +833,25 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
mapView.onStart();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
mapView.onStop();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLowMemory() {
|
||||||
|
super.onLowMemory();
|
||||||
|
mapView.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-7
@@ -115,12 +115,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
for (int i = 0; i < TYPE_NAME.length; i++) {
|
for (int i = 0; i < TYPE_NAME.length; i++) {
|
||||||
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||||
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
if (index == 2) {
|
if (index == 2) {
|
||||||
if (!keys) {//装货回单
|
if (!keys) {//装货回单
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@@ -211,6 +211,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private LatLng latLng;
|
private LatLng latLng;
|
||||||
|
|
||||||
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
||||||
@@ -376,12 +377,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
// for(int i=0;i<imgIds.size();i++){
|
// for(int i=0;i<imgIds.size();i++){
|
||||||
// Log.e("--imgIds--",imgIds.get(i)+"");
|
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||||
// }
|
// }
|
||||||
switch (index) {
|
|
||||||
case 0:
|
|
||||||
if (customDialog != null && !customDialog.isShowing()) {
|
if (customDialog != null && !customDialog.isShowing()) {
|
||||||
customDialog = new CustomDialog(con, "网络请求中...");
|
customDialog = new CustomDialog(con, "网络请求中...");
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
}
|
}
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
//装货
|
//装货
|
||||||
if (imgIds != null && imgIds.size() > 0) {
|
if (imgIds != null && imgIds.size() > 0) {
|
||||||
lub.setLatitude(lgdu.getLatitude() + "");
|
lub.setLatitude(lgdu.getLatitude() + "");
|
||||||
@@ -609,6 +610,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String s, String s1) {
|
||||||
Log.e("上报安联失败(卸货照片):", s + s1);
|
Log.e("上报安联失败(卸货照片):", s + s1);
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
// SPUtil.insSP(con,"make","卸货",sob.getData().getShippingNoteNumber());
|
// SPUtil.insSP(con,"make","卸货",sob.getData().getShippingNoteNumber());
|
||||||
// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||||
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||||
@@ -684,8 +688,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传安联和交通厅,平台-装货
|
* 上传安联和交通厅,平台-装货
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ import android.text.style.ClickableSpan;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@@ -24,6 +26,7 @@ import android.widget.Toast;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.cardview.widget.CardView;
|
import androidx.cardview.widget.CardView;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.AppInfoBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
||||||
@@ -71,8 +74,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
private LoginBean loginBean;
|
private LoginBean loginBean;
|
||||||
private TimerTask tt;
|
private TimerTask tt;
|
||||||
private int timer_sum = 60;
|
private int timer_sum = 60;
|
||||||
private ImageButton agree_btn;
|
private CheckBox cb;
|
||||||
private CardView no_btn;
|
|
||||||
private UserRequset ur;
|
private UserRequset ur;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -95,15 +97,22 @@ public class LoginActivity extends BaseActivity {
|
|||||||
//存储登录记录
|
//存储登录记录
|
||||||
loginBean = new Gson().fromJson(CacheGroup.cacheList.get(LOGIN_RESULT), LoginBean.class);
|
loginBean = new Gson().fromJson(CacheGroup.cacheList.get(LOGIN_RESULT), LoginBean.class);
|
||||||
Log.e("--登录信息--", new Gson().toJson(loginBean));
|
Log.e("--登录信息--", new Gson().toJson(loginBean));
|
||||||
|
AppInfoBean appInfoBean = new AppInfoBean();
|
||||||
if (loginBean.getCode() == 200) {
|
if (loginBean.getCode() == 200) {
|
||||||
SPUtil.insSP(con, USER, USER_TOKEN, loginBean.getData().getToken());
|
SPUtil.insSP(con, USER, USER_TOKEN, loginBean.getData().getToken());
|
||||||
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
||||||
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
||||||
SPUtil.insSP(con, USER, USER_ID, loginBean.getData().getId() + "");
|
SPUtil.insSP(con, USER, USER_ID, loginBean.getData().getId() + "");
|
||||||
JPushInterface.setAlias(con, 0, loginBean.getData().getUname());
|
JPushInterface.setAlias(con, 0, loginBean.getData().getUname());
|
||||||
|
appInfoBean.setStatus("0");
|
||||||
|
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
||||||
|
ur.postAppInfo(appInfoBean,"post");
|
||||||
UiAuxiliary.homeRequest("登录成功");
|
UiAuxiliary.homeRequest("登录成功");
|
||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
|
appInfoBean.setStatus("1");
|
||||||
|
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
||||||
|
ur.postAppInfo(appInfoBean,"post");
|
||||||
Toast.makeText(con, loginBean.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, loginBean.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(LOGIN_RESULT);
|
CacheGroup.cacheList.remove(LOGIN_RESULT);
|
||||||
@@ -125,8 +134,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
input_phone = findViewById(R.id.input_phone);
|
input_phone = findViewById(R.id.input_phone);
|
||||||
input_code = findViewById(R.id.input_code);
|
input_code = findViewById(R.id.input_code);
|
||||||
getCode = findViewById(R.id.getCode);
|
getCode = findViewById(R.id.getCode);
|
||||||
agree_btn = findViewById(R.id.agree_btn);
|
cb = findViewById(R.id.cb);
|
||||||
no_btn = findViewById(R.id.no_btn);
|
|
||||||
ur = new UserRequset(con, hd);
|
ur = new UserRequset(con, hd);
|
||||||
initView(null);
|
initView(null);
|
||||||
}
|
}
|
||||||
@@ -139,21 +147,18 @@ public class LoginActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void initView(Object obj) {
|
public void initView(Object obj) {
|
||||||
super.initView(obj);
|
super.initView(obj);
|
||||||
agree_btn.setOnClickListener(v -> {
|
cb.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
agree_btn.setVisibility(View.GONE);
|
if (isChecked) {
|
||||||
no_btn.setVisibility(View.VISIBLE);
|
|
||||||
key = false;
|
|
||||||
});
|
|
||||||
no_btn.setOnClickListener(v -> {
|
|
||||||
agree_btn.setVisibility(View.VISIBLE);
|
|
||||||
no_btn.setVisibility(View.GONE);
|
|
||||||
key = true;
|
key = true;
|
||||||
|
} else {
|
||||||
|
key = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ConfigBean cb = ConfigParts.getConfigParts(con);
|
ConfigBean cb = ConfigParts.getConfigParts(con);
|
||||||
if (cb != null) {
|
if (cb != null) {
|
||||||
url1 = cb.getData().getUserUrl();
|
url1 = cb.getData().getUserUrl();
|
||||||
url2 = "http://agreement.dahehuoyun.com/currency/#/";
|
url2 = "https://agreement.dahehuoyun.com/currency/#/";
|
||||||
}
|
}
|
||||||
TextView tv_content = findViewById(R.id.tv_content);
|
TextView tv_content = findViewById(R.id.tv_content);
|
||||||
String str = "我已阅读并同意相关服务条款和隐私政策《用户服务协议》和《隐私政策》";
|
String str = "我已阅读并同意相关服务条款和隐私政策《用户服务协议》和《隐私政策》";
|
||||||
|
|||||||
@@ -30,10 +30,12 @@ import androidx.core.app.ActivityCompat;
|
|||||||
|
|
||||||
import com.alct.mdp.MDPLocationCollectionManager;
|
import com.alct.mdp.MDPLocationCollectionManager;
|
||||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.AppInfoBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.ImageConfig;
|
import com.arpa.hndahesudintocctmsdriver.bean.ImageConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
@@ -138,8 +140,8 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
|||||||
new XPopup.Builder(con)
|
new XPopup.Builder(con)
|
||||||
.dismissOnBackPressed(false)
|
.dismissOnBackPressed(false)
|
||||||
.dismissOnTouchOutside(false)
|
.dismissOnTouchOutside(false)
|
||||||
.asCustom(new AgreementAlert(con, "http://agreement.dahehuoyun.com/currency/#/",
|
.asCustom(new AgreementAlert(con, "https://agreement.dahehuoyun.com/currency/#/",
|
||||||
"http://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/", hd))
|
"https://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/", hd))
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
Glide.with(con)
|
Glide.with(con)
|
||||||
@@ -159,6 +161,16 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
|||||||
initRequest();
|
initRequest();
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
AppInfoBean appInfoBean = new AppInfoBean();
|
||||||
|
|
||||||
|
if (!UiAuxiliary.isLogin(con)) {
|
||||||
|
ur.postAppInfo(appInfoBean, "post");
|
||||||
|
}else{
|
||||||
|
String sp = SPUtil.getSP(con, LoginActivity.USER, LoginActivity.USER_UNAME);
|
||||||
|
appInfoBean.setUserPhone(sp);
|
||||||
|
appInfoBean.setStatus("0");
|
||||||
|
ur.postAppInfo(appInfoBean, "post");
|
||||||
|
}
|
||||||
|
|
||||||
// String[] permissions=new String[]{
|
// String[] permissions=new String[]{
|
||||||
// Manifest.permission.ACCESS_FINE_LOCATION,
|
// Manifest.permission.ACCESS_FINE_LOCATION,
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
|
|||||||
@@ -73,9 +73,9 @@ public class SetupActivity extends BaseActivity {
|
|||||||
ConfigBean cb= ConfigParts.getConfigParts(con);
|
ConfigBean cb= ConfigParts.getConfigParts(con);
|
||||||
if(cb!=null){
|
if(cb!=null){
|
||||||
// url1=cb.getData().getUserUrl();
|
// url1=cb.getData().getUserUrl();
|
||||||
url1="http://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
|
url1="https://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
|
||||||
// url2=cb.getData().getPrivateUrl();
|
// url2=cb.getData().getPrivateUrl();
|
||||||
url2="http://agreement.dahehuoyun.com/currency/#/";
|
url2="https://agreement.dahehuoyun.com/currency/#/";
|
||||||
kefu=cb.getData().getServiceMobile();
|
kefu=cb.getData().getServiceMobile();
|
||||||
url3=cb.getData().getSecurityUrl();
|
url3=cb.getData().getSecurityUrl();
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class SetupActivity extends BaseActivity {
|
|||||||
r8.setOnClickListener(v12 -> {
|
r8.setOnClickListener(v12 -> {
|
||||||
Intent in=new Intent(con,WebActivity.class);
|
Intent in=new Intent(con,WebActivity.class);
|
||||||
in.putExtra("title","交易规则");
|
in.putExtra("title","交易规则");
|
||||||
in.putExtra("url","http://agreement.dahehuoyun.com/rule/transactionRules/dist/index.html#/");
|
in.putExtra("url","https://agreement.dahehuoyun.com/rule/transactionRules/dist/index.html#/");
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
r6.setOnClickListener(v12 -> {
|
r6.setOnClickListener(v12 -> {
|
||||||
|
|||||||
@@ -231,6 +231,7 @@ public class WalletFragment extends BaseFragment{
|
|||||||
bank_remove.setVisibility(View.VISIBLE);
|
bank_remove.setVisibility(View.VISIBLE);
|
||||||
} else{
|
} else{
|
||||||
bank_number.setVisibility(View.GONE);
|
bank_number.setVisibility(View.GONE);
|
||||||
|
bank_title_1.setText("未添加银行卡");
|
||||||
bank_add.setVisibility(View.VISIBLE);
|
bank_add.setVisibility(View.VISIBLE);
|
||||||
bank_remove.setVisibility(View.GONE);
|
bank_remove.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,12 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
import android.net.http.SslError;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.webkit.JavascriptInterface;
|
import android.webkit.JavascriptInterface;
|
||||||
|
import android.webkit.SslErrorHandler;
|
||||||
import android.webkit.WebResourceRequest;
|
import android.webkit.WebResourceRequest;
|
||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
@@ -81,6 +84,11 @@ public class WebActivity extends BaseActivity {
|
|||||||
webSettings.setJavaScriptEnabled(true);
|
webSettings.setJavaScriptEnabled(true);
|
||||||
webSettings.setDomStorageEnabled(true);
|
webSettings.setDomStorageEnabled(true);
|
||||||
webSettings.setDefaultTextEncodingName("utf-8");
|
webSettings.setDefaultTextEncodingName("utf-8");
|
||||||
|
// 特别注意:5.1以上默认禁止了https和http混用,以下方式是开启
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||||
|
}
|
||||||
|
|
||||||
wv.addJavascriptInterface(new JavaScriptObject(con), "webObj");
|
wv.addJavascriptInterface(new JavaScriptObject(con), "webObj");
|
||||||
//PaxWebChromeClient chromeClient=new PaxWebChromeClient();
|
//PaxWebChromeClient chromeClient=new PaxWebChromeClient();
|
||||||
//WebView加载web资源
|
//WebView加载web资源
|
||||||
@@ -111,6 +119,12 @@ public class WebActivity extends BaseActivity {
|
|||||||
wv.loadUrl(url);
|
wv.loadUrl(url);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||||
|
super.onReceivedSslError(view, handler, error);
|
||||||
|
handler.proceed();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
wv.setWebChromeClient(chromeClient);
|
wv.setWebChromeClient(chromeClient);
|
||||||
wv.loadUrl(url);
|
wv.loadUrl(url);
|
||||||
@@ -149,6 +163,12 @@ public class WebActivity extends BaseActivity {
|
|||||||
view.loadUrl(url);
|
view.loadUrl(url);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||||
|
super.onReceivedSslError(view, handler, error);
|
||||||
|
handler.proceed();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,39 @@ public class OkHttpUtil {
|
|||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Request put(OkDate od, Context con){
|
||||||
|
MediaType mediaType = MediaType.parse("application/json");
|
||||||
|
if(od.getMadiaType()!=null && od.getMadiaType().equals("")){
|
||||||
|
od.setMadiaType("{}");
|
||||||
|
}
|
||||||
|
// JSONObject jsonObject = JSON.parseObject(od.getMadiaType());
|
||||||
|
// jsonObject.put("timestamp", DateUtil.current());
|
||||||
|
// jsonObject.put("deviceId", GetUtil.getDeviceId(con));
|
||||||
|
// String sign = SecureUtil.signParamsSha1(jsonObject,SIGN_PASSWORD);
|
||||||
|
// Log.e("jsonObject",jsonObject.toString());
|
||||||
|
// Log.e("sign",sign);
|
||||||
|
// Map<String,Object> map=new HashMap<>();
|
||||||
|
// map.put("data",SecurityUtil.encrypt(jsonObject.toString()));
|
||||||
|
// Log.e("参数1",od.getMadiaType());
|
||||||
|
// Log.e("参数2",MapUtil.mapJson(map));
|
||||||
|
//MapUtil.mapJson(map)
|
||||||
|
RequestBody body = RequestBody.create(mediaType,od.getMadiaType());
|
||||||
|
Headers.Builder hb=new Headers.Builder();
|
||||||
|
hb.add("Content-Type","application/json");
|
||||||
|
hb.add("Cache-Control","no-cache");
|
||||||
|
Request request = new Request.Builder()
|
||||||
|
.url(od.getUrl())
|
||||||
|
.put(body)
|
||||||
|
.headers(hb.build())
|
||||||
|
.addHeader("Version", VersionUtil.getVersion(con))
|
||||||
|
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
||||||
|
//.addHeader("sign",sign)
|
||||||
|
.removeHeader("User-Agent")
|
||||||
|
.addHeader("User-Agent",GetUtil.getUserAgent(con))
|
||||||
|
.build();
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
public static Request get(OkDate od){
|
public static Request get(OkDate od){
|
||||||
Headers.Builder hb=new Headers.Builder();
|
Headers.Builder hb=new Headers.Builder();
|
||||||
hb.add("Content-Type","application/json");
|
hb.add("Content-Type","application/json");
|
||||||
|
|||||||
+101
@@ -0,0 +1,101 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.util.location;
|
||||||
|
|
||||||
|
import static com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil.RES;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.location.Address;
|
||||||
|
import android.location.Criteria;
|
||||||
|
import android.location.Geocoder;
|
||||||
|
import android.location.Location;
|
||||||
|
import android.location.LocationListener;
|
||||||
|
import android.location.LocationManager;
|
||||||
|
import android.os.Handler;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName LocationManagerUtil
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/7/25 15:21
|
||||||
|
* @Description LocationManager本地定位
|
||||||
|
*/
|
||||||
|
public class LocationManagerUtil {
|
||||||
|
|
||||||
|
public static LocationManagerUtil mInstance = null;
|
||||||
|
|
||||||
|
public static LocationManagerUtil getInstance() {
|
||||||
|
if (null == mInstance) {
|
||||||
|
synchronized (LocationManagerUtil.class) {
|
||||||
|
if (null == mInstance) {
|
||||||
|
mInstance = new LocationManagerUtil();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private LocationManagerUtil() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getLocation(Context ctx, Handler hd) {
|
||||||
|
LocationManager locationManager = (LocationManager) ctx.getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
|
||||||
|
//创建定位条件器
|
||||||
|
Criteria criteria = new Criteria();
|
||||||
|
//设置精度,Criteria.ACCURACY_FINE表示精确,Criteria.ACCURACY_COARSE表示粗略
|
||||||
|
criteria.setAccuracy(Criteria.ACCURACY_FINE);
|
||||||
|
//设置是否需要海拔信息
|
||||||
|
criteria.setAltitudeRequired(true);
|
||||||
|
//设置是否需要方位信息
|
||||||
|
criteria.setBearingRequired(true);
|
||||||
|
//设置是否允许运营商扣费
|
||||||
|
criteria.setCostAllowed(true);
|
||||||
|
//设置对电源的需求
|
||||||
|
criteria.setPowerRequirement(Criteria.POWER_LOW);
|
||||||
|
|
||||||
|
String bestProvider = locationManager.getBestProvider(criteria, true);
|
||||||
|
if (bestProvider != null) {
|
||||||
|
if (ActivityCompat.checkSelfPermission(ctx, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(ctx, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
ToastUtils.showToast(ctx, "请查看定位权限");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
locationManager.requestLocationUpdates(bestProvider, 300, 0, new LocationListener() {
|
||||||
|
@Override
|
||||||
|
public void onLocationChanged(@NonNull Location location) {
|
||||||
|
try {
|
||||||
|
Geocoder geocoder = new Geocoder(ctx, Locale.getDefault());
|
||||||
|
List<Address> fromLocation = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);
|
||||||
|
if (fromLocation != null && !fromLocation.isEmpty()) {
|
||||||
|
Address address = fromLocation.get(0);
|
||||||
|
String addressLine = address.getAddressLine(0);
|
||||||
|
String adminArea = address.getAdminArea();//省
|
||||||
|
String locality = address.getLocality();//市
|
||||||
|
String subLocality = address.getSubLocality();//县
|
||||||
|
String featureName = address.getFeatureName();//详细地址
|
||||||
|
CacheGroup.cacheList.put("getLocation", new Gson().toJson(address));
|
||||||
|
MsgUtil.addHdMsgWat(hd, RES);
|
||||||
|
locationManager.removeUpdates(this);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ToastUtils.showToast(ctx, "定位失败,请查看定位权限");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@drawable/read_select" android:state_checked="true"></item>
|
||||||
|
<item android:drawable="@drawable/read_nor" android:state_checked="false"></item>
|
||||||
|
<item android:drawable="@drawable/read_nor"></item>
|
||||||
|
</selector>
|
||||||
@@ -104,35 +104,15 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:padding="@dimen/dp_7"
|
<CheckBox
|
||||||
android:layout_marginTop="@dimen/dp_2"
|
android:layout_marginTop="@dimen/dp_3"
|
||||||
android:layout_width="@dimen/dp_14"
|
android:id="@+id/cb"
|
||||||
android:layout_height="@dimen/dp_14"
|
android:layout_width="@dimen/dp_28"
|
||||||
app:cardCornerRadius="@dimen/dp_7"
|
android:layout_height="@dimen/dp_34"
|
||||||
app:cardBackgroundColor="@color/theme_color"
|
android:button="@null"
|
||||||
app:cardElevation="@dimen/dp_0">
|
android:checked="false"
|
||||||
<androidx.cardview.widget.CardView
|
android:drawableStart="@drawable/select_read"/>
|
||||||
android:padding="@dimen/dp_7"
|
|
||||||
android:id="@+id/no_btn"
|
|
||||||
android:layout_width="@dimen/dp_12"
|
|
||||||
android:layout_height="@dimen/dp_12"
|
|
||||||
app:cardCornerRadius="@dimen/dp_6"
|
|
||||||
app:cardBackgroundColor="#fff"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
app:cardElevation="@dimen/dp_0">
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/agree_btn"
|
|
||||||
android:layout_width="@dimen/dp_14"
|
|
||||||
android:layout_height="@dimen/dp_14"
|
|
||||||
android:src="@mipmap/choice"
|
|
||||||
android:scaleType="fitXY"
|
|
||||||
android:background="#fff"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:visibility="gone"
|
|
||||||
/>
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_content"
|
android:id="@+id/tv_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -4,7 +4,12 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<com.amap.api.maps.MapView
|
<!-- <com.amap.api.maps.MapView-->
|
||||||
|
<!-- android:id="@+id/map"-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="match_parent"/>-->
|
||||||
|
|
||||||
|
<com.lk.mapsdk.map.mapapi.map.MapView
|
||||||
android:id="@+id/map"
|
android:id="@+id/map"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ buildscript {
|
|||||||
maven {
|
maven {
|
||||||
url 'https://maven.aliyun.com/repository/releases'
|
url 'https://maven.aliyun.com/repository/releases'
|
||||||
}
|
}
|
||||||
|
maven { url 'http://lbs-sdk.luokuang.com/repository/maven-releases/' }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.2.2'
|
classpath 'com.android.tools.build:gradle:4.2.2'
|
||||||
@@ -31,6 +32,7 @@ allprojects {
|
|||||||
maven {
|
maven {
|
||||||
url 'https://maven.aliyun.com/repository/releases'
|
url 'https://maven.aliyun.com/repository/releases'
|
||||||
}
|
}
|
||||||
|
maven { url 'http://lbs-sdk.luokuang.com/repository/maven-releases/' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user