Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
d5d21b154f |
@ -38,8 +38,8 @@ android {
|
||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 30
|
||||
versionCode 76
|
||||
versionName "3.4.6"
|
||||
versionCode 73
|
||||
versionName "3.4.3"
|
||||
flavorDimensions "CHANNEL_VALUE"
|
||||
flavorDimensions "app_icon"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
@ -63,8 +63,8 @@ public class App extends Application {
|
||||
}
|
||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||
// 路由初始化
|
||||
// JVerificationInterface.setDebugMode(true);
|
||||
// JVerificationInterface.init(this, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||
JVerificationInterface.setDebugMode(true);
|
||||
JVerificationInterface.init(this, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||
//友盟
|
||||
//设置非debug版本开启
|
||||
if (!isDebugVersion(con)) {
|
||||
|
@ -232,10 +232,6 @@ public class H5Activity extends AppCompatActivity {
|
||||
|
||||
} else {
|
||||
String url = intent.getStringExtra("url");
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||
return;
|
||||
}
|
||||
viewFile = intent.getBooleanExtra("view_file", false);
|
||||
if (url.startsWith("alipay")) {
|
||||
try {
|
||||
@ -246,7 +242,7 @@ public class H5Activity extends AppCompatActivity {
|
||||
} catch (Exception e) {
|
||||
}
|
||||
// }else if (url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")) {
|
||||
} else if (url.startsWith("https://agreement.dahehuoyun.com")) {
|
||||
} else if (url.startsWith("https://agreement.dahehuoyun.com/goApp")) {
|
||||
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
||||
startActivity(in);
|
||||
if (isGoCar) {
|
||||
@ -275,7 +271,7 @@ public class H5Activity extends AppCompatActivity {
|
||||
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
||||
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
||||
// if (url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")) {
|
||||
if (url.startsWith("https://agreement.dahehuoyun.com")) {
|
||||
if (url.startsWith("https://agreement.dahehuoyun.com/goApp")) {
|
||||
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
||||
in.putExtra("isGoCar", isGoCar);
|
||||
startActivity(in);
|
||||
@ -358,11 +354,11 @@ public class H5Activity extends AppCompatActivity {
|
||||
if (status) {
|
||||
//认证成功返回
|
||||
//认证成功返回
|
||||
// new Handler().postDelayed(() -> {
|
||||
// FaceEvent he = new FaceEvent("刷脸成功");
|
||||
// EventBus.getDefault().post(he);
|
||||
// finish();
|
||||
// }, 800);
|
||||
new Handler().postDelayed(() -> {
|
||||
FaceEvent he = new FaceEvent("刷脸成功");
|
||||
EventBus.getDefault().post(he);
|
||||
finish();
|
||||
}, 800);
|
||||
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
|
@ -83,8 +83,6 @@ public class HuoYuanDelBean {
|
||||
private String vehicleTypeName;
|
||||
private int vehicleLength;
|
||||
private String vehicleLengthName;
|
||||
private String carNumber;
|
||||
private String carId;
|
||||
private String namedDrivers;
|
||||
private String requirement;
|
||||
private String totalFreight;
|
||||
@ -99,23 +97,6 @@ public class HuoYuanDelBean {
|
||||
private Object contactName;
|
||||
private Object contactPhone;
|
||||
|
||||
|
||||
public String getCarNumber() {
|
||||
return carNumber == null ? "" : carNumber;
|
||||
}
|
||||
|
||||
public void setCarNumber(String carNumber) {
|
||||
this.carNumber = carNumber;
|
||||
}
|
||||
|
||||
public String getCarId() {
|
||||
return carId == null ? "" : carId;
|
||||
}
|
||||
|
||||
public void setCarId(String carId) {
|
||||
this.carId = carId;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -119,9 +119,6 @@ public class JTTProcess {
|
||||
//参数 ShippingNoteInfo 和 start 接口中的参数 ShippingNoteInfo 相
|
||||
//同,这里 shippingNoteInfo 信息只需传入运单号和分单号即可
|
||||
public static void send(Context con,StartOrderBean sob,String remark){
|
||||
if (sob.getData()==null){
|
||||
return;
|
||||
}
|
||||
ShippingNoteInfo[] snis=new ShippingNoteInfo[1];
|
||||
ShippingNoteInfo sni=new ShippingNoteInfo();
|
||||
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
||||
|
@ -80,12 +80,6 @@ public class UserRequset {
|
||||
RequestUtil.start(1, "userdata", re, con, hd);
|
||||
}
|
||||
|
||||
//账户信息
|
||||
public void User2() {
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getUserUrl(), ""), getToken(con), con);
|
||||
RequestUtil.start(1, "userdata2", re, con, hd);
|
||||
}
|
||||
|
||||
//司机认证信息
|
||||
public void driverAuthData() {
|
||||
String mt = "{}";
|
||||
|
@ -39,7 +39,7 @@ public class UiAuxiliary {
|
||||
}
|
||||
|
||||
public static void delLogin(Context con){
|
||||
// JPushInterface.deleteAlias(con,0);
|
||||
JPushInterface.deleteAlias(con,0);
|
||||
SPUtils.remove(con,"curWaybillId");
|
||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_TOKEN,"");
|
||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_UNAME,"");
|
||||
|
@ -8,14 +8,11 @@ import android.widget.Button;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
* @ClassName FaceSuccActivity
|
||||
* @Author john
|
||||
@ -34,17 +31,15 @@ public class FaceSuccActivity extends BaseAppCompatActivity {
|
||||
Button btnHome = findViewById(R.id.btnHome);
|
||||
Button btnAddCar = findViewById(R.id.btnAddCar);
|
||||
boolean isGoCar = getIntent().getBooleanExtra("isGoCar", false);
|
||||
if (isGoCar) {
|
||||
if (isGoCar){
|
||||
btnHome.setText("返回首页");
|
||||
btnAddCar.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
}else{
|
||||
btnHome.setText("返回");
|
||||
btnAddCar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
btnHome.setOnClickListener(v -> {
|
||||
finish();
|
||||
});
|
||||
btnHome.setOnClickListener(v -> finish());
|
||||
btnAddCar.setOnClickListener(v -> {
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 2);
|
||||
@ -53,10 +48,4 @@ public class FaceSuccActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
EventBus.getDefault().post(new PersonEvent("刷脸成功"));
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
||||
|
||||
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
@ -77,15 +75,15 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
super.msgMethod(m);
|
||||
switch (m.what) {
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("userdata2") != null) {
|
||||
ub = gson.fromJson(CacheGroup.cacheList.get("userdata2"), UserBean.class);
|
||||
if (CacheGroup.cacheList.get("userdata") != null) {
|
||||
ub = gson.fromJson(CacheGroup.cacheList.get("userdata"), UserBean.class);
|
||||
if (ub.getCode() == 200) {
|
||||
initView(ub);
|
||||
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata2"));
|
||||
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata"));
|
||||
} else {
|
||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("userdata2");
|
||||
CacheGroup.cacheList.remove("userdata");
|
||||
}
|
||||
if (CacheGroup.cacheList.get("upload") != null) {
|
||||
upb = gson.fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
||||
@ -210,22 +208,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
//头像
|
||||
up_img.setOnClickListener(v -> {
|
||||
PermissionUtils.Companion.getInstance().showPermissionMessage(this, "拍摄,媒体查询权限使用说明", "用于拍照或者选择图片用于上传头像功能",
|
||||
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.CAMERA},
|
||||
(allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
gia.showPopueWindow(this);
|
||||
} else {
|
||||
new MessageUtils().showSimCenPop(con, "缺少拍摄,媒体查询权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
startActivity(intent);
|
||||
});
|
||||
// Toast.makeText(act.getBaseContext(), "请先开启定位权限", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
|
||||
gia.showPopueWindow(this);
|
||||
});
|
||||
up_head.setOnClickListener(v -> {
|
||||
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||
@ -239,15 +222,10 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
hyr = new HuoYuanRequset(con, hd);
|
||||
ur = new UserRequset(con, hd);
|
||||
ur.User();
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
ur.User2();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
@ -271,7 +249,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
public void personResult(PersonEvent home) {
|
||||
Log.e("-res-", home.getMessage());
|
||||
if (ur != null) {
|
||||
ur.User2();
|
||||
ur.User();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -315,11 +315,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
//
|
||||
ImageButton xuanze = v.findViewById(R.id.xuanze);
|
||||
|
||||
if (hyd!=null&&hyd.getData()!=null&& !TextUtils.isEmpty(hyd.getData().getCarNumber())){
|
||||
cid = hyd.getData().getCarId();
|
||||
car.setText("选择车辆:" + hyd.getData().getCarNumber());
|
||||
}else if (clb != null && clb.getData().size() == 1) {
|
||||
if (clb != null && clb.getData().size() == 1) {
|
||||
cid = clb.getData().get(0).getCarId();
|
||||
car.setText("选择车辆:" + clb.getData().get(0).getCarNumber());
|
||||
}
|
||||
@ -412,7 +408,6 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
|
||||
UiAuxiliary.homeRequest("接单");
|
||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
in.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
in.putExtra("id", "0");
|
||||
startActivity(in);
|
||||
finish();
|
||||
@ -539,9 +534,4 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
// ALProcess.verification(con, hd);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public class WebPDFActivity extends BaseActivity {
|
||||
protected void onPostExecute(Void aVoid) {
|
||||
super.onPostExecute(aVoid);
|
||||
pdf_view.fromStream(input[0])
|
||||
// .pages(0,1,2,3,4,5,6,7) // all pages are displayed by default
|
||||
.pages(0,1) // all pages are displayed by default
|
||||
.enableAnnotationRendering(true)
|
||||
.load();
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public class LoginActivity extends BaseActivity {
|
||||
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
||||
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
||||
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");
|
||||
|
@ -346,8 +346,8 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||
// 路由初始化
|
||||
// JVerificationInterface.setDebugMode(true);
|
||||
// JVerificationInterface.init(con, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||
JVerificationInterface.setDebugMode(true);
|
||||
JVerificationInterface.init(con, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||
//友盟
|
||||
//设置非debug版本开启
|
||||
if (!isDebugVersion(con)) {
|
||||
|
@ -29,7 +29,6 @@ import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.ImageLoader;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
|
||||
@ -52,7 +51,6 @@ import com.permissionx.guolindev.PermissionX;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -346,19 +344,11 @@ public class MyFragment extends BaseFragment {
|
||||
ur.vehicleList("1");
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@Subscribe
|
||||
public void personResult(PersonEvent home) {
|
||||
Log.e("-res-", home.getMessage());
|
||||
if (ur != null) {
|
||||
ur.User();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (ur != null) {
|
||||
ur.User();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,9 +74,9 @@ public class SetupActivity extends BaseActivity {
|
||||
ConfigBean cb= ConfigParts.getConfigParts(con);
|
||||
if(cb!=null){
|
||||
// url1=cb.getData().getUserUrl();
|
||||
url1="https://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
|
||||
url1="http://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
|
||||
// url2=cb.getData().getPrivateUrl();
|
||||
url2="https://agreement.dahehuoyun.com/currency/#/";
|
||||
url2="http://agreement.dahehuoyun.com/currency/#/";
|
||||
kefu=cb.getData().getServiceMobile();
|
||||
url3=cb.getData().getSecurityUrl();
|
||||
}
|
||||
|
@ -1,33 +0,0 @@
|
||||
package com.dahe.mylibrary.utils;
|
||||
|
||||
/**
|
||||
* @ClassName Gps
|
||||
* @Author john
|
||||
* @Date 2024/12/13 17:25
|
||||
* @Description TODO
|
||||
*/
|
||||
public class Gps {
|
||||
private double wgLon;
|
||||
private double wgLat;
|
||||
|
||||
public Gps(double wgLat,double wgLon) {
|
||||
this.wgLat = wgLat;
|
||||
this.wgLon = wgLon;
|
||||
}
|
||||
|
||||
public double getWgLon() {
|
||||
return wgLon;
|
||||
}
|
||||
|
||||
public void setWgLon(double wgLon) {
|
||||
this.wgLon = wgLon;
|
||||
}
|
||||
|
||||
public double getWgLat() {
|
||||
return wgLat;
|
||||
}
|
||||
|
||||
public void setWgLat(double wgLat) {
|
||||
this.wgLat = wgLat;
|
||||
}
|
||||
}
|
@ -1,112 +0,0 @@
|
||||
package com.dahe.mylibrary.utils;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
|
||||
/**
|
||||
* @ClassName PermissionUtils
|
||||
* @Author john
|
||||
* @Date 2024/12/19 14:59
|
||||
* @Description TODO
|
||||
*/
|
||||
public class PermissionUtils {
|
||||
|
||||
// 私有静态实例,防止被外部实例化
|
||||
private static PermissionUtils instance;
|
||||
|
||||
// 私有构造方法,防止通过 new 关键字创建实例
|
||||
private PermissionUtils() {
|
||||
}
|
||||
|
||||
// 获取单例实例
|
||||
public static PermissionUtils getInstance() {
|
||||
if (instance == null) {
|
||||
synchronized (PermissionUtils.class) {
|
||||
if (instance == null) {
|
||||
instance = new PermissionUtils();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据不同手机机型跳转到权限设置页面
|
||||
*
|
||||
* @param context 上下文
|
||||
*/
|
||||
public void goToAppPermissionSettings(Context context) {
|
||||
Intent intent = new Intent();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (Build.FINGERPRINT.startsWith("Huawei") || Build.BRAND.startsWith("Huawei")) {
|
||||
// 华为手机
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
} else if (Build.FINGERPRINT.startsWith("Xiaomi") || Build.BRAND.startsWith("Xiaomi")) {
|
||||
// 小米手机
|
||||
intent.setAction(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
|
||||
Uri uri = Uri.parse("package:" + context.getPackageName());
|
||||
intent.setData(uri);
|
||||
} else if (Build.BRAND.equals("Meizu")) {
|
||||
// 魅族手机
|
||||
intent.setAction("com.meizu.safe.security.SHOW_APPSEC");
|
||||
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||
intent.putExtra("packageName", context.getPackageName());
|
||||
} else if (Build.FINGERPRINT.startsWith("OPPO") || Build.BRAND.startsWith("OPPO")) {
|
||||
// OPPO手机
|
||||
try {
|
||||
String pkgName = context.getPackageName();
|
||||
String className = "com.coloros.safecenter.permission.PermissionManagerActivity";
|
||||
intent.setClassName("com.coloros.safecenter", className);
|
||||
intent.putExtra("packageName", pkgName);
|
||||
intent.putExtra("appName", context.getResources().getString(context.getApplicationInfo().labelRes));
|
||||
intent.putExtra("opType", "4"); // 4 表示权限管理页面
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
} catch (Exception e) {
|
||||
// 如果找不到OPPO的特定页面,则使用通用页面
|
||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
}
|
||||
} else if (Build.FINGERPRINT.startsWith("vivo") || Build.BRAND.startsWith("vivo")) {
|
||||
// vivo手机
|
||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
|
||||
} else if (Build.BRAND.equals("samsung")) {
|
||||
// 三星手机
|
||||
try {
|
||||
String pkgName = context.getPackageName();
|
||||
Intent intent2 = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
|
||||
intent2.addCategory(Intent.CATEGORY_DEFAULT);
|
||||
intent2.setData(Uri.parse("package:" + pkgName));
|
||||
intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent2.putExtra("com.android.providers.media.EXTRA_APP_PACKAGE", pkgName);
|
||||
context.startActivity(intent2);
|
||||
return; // 使用三星特定的页面,不需要继续执行通用代码
|
||||
} catch (Exception e) {
|
||||
// 如果三星特定页面失败,则使用通用页面
|
||||
}
|
||||
} else {
|
||||
// 其他手机使用通用页面
|
||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
|
||||
}
|
||||
} else {
|
||||
// 低于Android 6.0(M)的版本,使用通用页面
|
||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
}
|
||||
context.startActivity(intent);
|
||||
}
|
||||
}
|
@ -1,539 +0,0 @@
|
||||
package com.dahe.mylibrary.utils;
|
||||
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
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.location.LocationProvider;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* @author ondear
|
||||
* time : 16/11/13
|
||||
* desc : 定位相关工具类
|
||||
*/
|
||||
public class RxLocationUtils {
|
||||
|
||||
public static double pi = 3.1415926535897932384626;
|
||||
public static double a = 6378245.0;
|
||||
public static double ee = 0.00669342162296594323;
|
||||
private static OnLocationChangeListener mListener;
|
||||
private static MyLocationListener myLocationListener;
|
||||
private static LocationManager mLocationManager;
|
||||
|
||||
/**
|
||||
* 判断Gps是否可用
|
||||
*
|
||||
* @return {@code true}: 是<br>{@code false}: 否
|
||||
*/
|
||||
public static boolean isGpsEnabled(Context context) {
|
||||
LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||
return lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断定位是否可用
|
||||
*
|
||||
* @return {@code true}: 是<br>{@code false}: 否
|
||||
*/
|
||||
public static boolean isLocationEnabled(Context context) {
|
||||
LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||
return lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER) || lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开Gps设置界面
|
||||
*/
|
||||
public static void openGpsSettings(Context context) {
|
||||
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册
|
||||
* <p>使用完记得调用{@link #unregister()}</p>
|
||||
* <p>需添加权限 {@code <uses-permission android:name="android.permission.INTERNET"/>}</p>
|
||||
* <p>需添加权限 {@code <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>}</p>
|
||||
* <p>需添加权限 {@code <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>}</p>
|
||||
* <p>如果{@code minDistance}为0,则通过{@code minTime}来定时更新;</p>
|
||||
* <p>{@code minDistance}不为0,则以{@code minDistance}为准;</p>
|
||||
* <p>两者都为0,则随时刷新。</p>
|
||||
*
|
||||
* @param minTime 位置信息更新周期(单位:毫秒)
|
||||
* @param minDistance 位置变化最小距离:当位置距离变化超过此值时,将更新位置信息(单位:米)
|
||||
* @param listener 位置刷新的回调接口
|
||||
* @return {@code true}: 初始化成功<br>{@code false}: 初始化失败
|
||||
*/
|
||||
public static boolean register(Context context, long minTime, long minDistance, OnLocationChangeListener listener) {
|
||||
if (listener == null) return false;
|
||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1);
|
||||
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, 1);
|
||||
return false;
|
||||
}
|
||||
mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||
mListener = listener;
|
||||
if (!isLocationEnabled(context)) {
|
||||
ToastUtils.showToast(context, "无法定位,请打开定位服务");
|
||||
return false;
|
||||
}
|
||||
String provider = mLocationManager.getBestProvider(getCriteria(), true);
|
||||
|
||||
Location location = mLocationManager.getLastKnownLocation(provider);
|
||||
if (location != null) listener.getLastKnownLocation(location);
|
||||
if (myLocationListener == null) myLocationListener = new MyLocationListener();
|
||||
mLocationManager.requestLocationUpdates(provider, minTime, minDistance, myLocationListener);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 注销
|
||||
*/
|
||||
public static void unregister() {
|
||||
if (mLocationManager != null) {
|
||||
if (myLocationListener != null) {
|
||||
mLocationManager.removeUpdates(myLocationListener);
|
||||
myLocationListener = null;
|
||||
}
|
||||
mLocationManager = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置定位参数
|
||||
*
|
||||
* @return {@link Criteria}
|
||||
*/
|
||||
private static Criteria getCriteria() {
|
||||
Criteria criteria = new Criteria();
|
||||
//设置定位精确度 Criteria.ACCURACY_COARSE比较粗略,Criteria.ACCURACY_FINE则比较精细
|
||||
criteria.setAccuracy(Criteria.ACCURACY_FINE);
|
||||
//设置是否要求速度
|
||||
criteria.setSpeedRequired(false);
|
||||
// 设置是否允许运营商收费
|
||||
criteria.setCostAllowed(false);
|
||||
//设置是否需要方位信息
|
||||
criteria.setBearingRequired(false);
|
||||
//设置是否需要海拔信息
|
||||
criteria.setAltitudeRequired(false);
|
||||
// 设置对电源的需求
|
||||
criteria.setPowerRequirement(Criteria.POWER_LOW);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据经纬度获取地理位置
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param latitude 纬度
|
||||
* @param longitude 经度
|
||||
* @return {@link Address}
|
||||
*/
|
||||
public static Address getAddress(Context context, double latitude, double longitude) {
|
||||
Geocoder geocoder = new Geocoder(context, Locale.getDefault());
|
||||
try {
|
||||
List<Address> addresses = geocoder.getFromLocation(latitude, longitude, 1);
|
||||
if (addresses.size() > 0) return addresses.get(0);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据经纬度获取所在国家
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param latitude 纬度
|
||||
* @param longitude 经度
|
||||
* @return 所在国家
|
||||
*/
|
||||
public static String getCountryName(Context context, double latitude, double longitude) {
|
||||
Address address = getAddress(context, latitude, longitude);
|
||||
return address == null ? "unknown" : address.getCountryName();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据经纬度获取所在地
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param latitude 纬度
|
||||
* @param longitude 经度
|
||||
* @return 所在地
|
||||
*/
|
||||
public static String getLocality(Context context, double latitude, double longitude) {
|
||||
Address address = getAddress(context, latitude, longitude);
|
||||
return address == null ? "unknown" : address.getLocality();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据经纬度获取所在街道
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param latitude 纬度
|
||||
* @param longitude 经度
|
||||
* @return 所在街道
|
||||
*/
|
||||
public static String getStreet(Context context, double latitude, double longitude) {
|
||||
Address address = getAddress(context, latitude, longitude);
|
||||
return address == null ? "unknown" : address.getAddressLine(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据经纬度获取详细地址
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param latitude 纬度
|
||||
* @param longitude 经度
|
||||
* @return 所在街道
|
||||
*/
|
||||
public static String getFeature(Context context, double latitude, double longitude) {
|
||||
Address address = getAddress(context, latitude, longitude);
|
||||
return address == null ? "未知地点" : address.getFeatureName();
|
||||
}
|
||||
|
||||
//------------------------------------------坐标转换工具start--------------------------------------
|
||||
|
||||
/**
|
||||
* GPS坐标 转换成 角度
|
||||
* 例如 113.202222 转换成 113°12′8″
|
||||
*
|
||||
* @param location
|
||||
* @return
|
||||
*/
|
||||
public static String gpsToDegree(double location) {
|
||||
double degree = Math.floor(location);
|
||||
double minute_temp = (location - degree) * 60;
|
||||
double minute = Math.floor(minute_temp);
|
||||
// double second = Math.floor((minute_temp - minute)*60);
|
||||
String second = new DecimalFormat("#.##").format((minute_temp - minute) * 60);
|
||||
return (int) degree + "°" + (int) minute + "′" + second + "″";
|
||||
}
|
||||
|
||||
/**
|
||||
* 国际 GPS84 坐标系
|
||||
* 转换成
|
||||
* [国测局坐标系] 火星坐标系 (GCJ-02)
|
||||
* <p>
|
||||
* World Geodetic System ==> Mars Geodetic System
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @return GPS实体类
|
||||
*/
|
||||
public static Gps GPS84ToGCJ02(double lat, double lon) {
|
||||
if (outOfChina(lat, lon)) {
|
||||
return null;
|
||||
}
|
||||
double dLat = transformLat(lon - 105.0, lat - 35.0);
|
||||
double dLon = transformLon(lon - 105.0, lat - 35.0);
|
||||
double radLat = lat / 180.0 * pi;
|
||||
double magic = Math.sin(radLat);
|
||||
magic = 1 - ee * magic * magic;
|
||||
double sqrtMagic = Math.sqrt(magic);
|
||||
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
|
||||
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
|
||||
double mgLat = lat + dLat;
|
||||
double mgLon = lon + dLon;
|
||||
return new Gps(mgLat, mgLon);
|
||||
}
|
||||
|
||||
/**
|
||||
* [国测局坐标系] 火星坐标系 (GCJ-02)
|
||||
* 转换成
|
||||
* 国际 GPS84 坐标系
|
||||
*
|
||||
* @param lon 火星经度
|
||||
* @param lat 火星纬度
|
||||
*/
|
||||
public static Gps GCJ02ToGPS84(double lat, double lon) {
|
||||
Gps gps = transform(lat, lon);
|
||||
double lontitude = lon * 2 - gps.getWgLon();
|
||||
double latitude = lat * 2 - gps.getWgLat();
|
||||
return new Gps(latitude, lontitude);
|
||||
}
|
||||
|
||||
/**
|
||||
* 火星坐标系 (GCJ-02)
|
||||
* 转换成
|
||||
* 百度坐标系 (BD-09)
|
||||
*
|
||||
* @param gg_lon 经度
|
||||
* @param gg_lat 纬度
|
||||
*/
|
||||
public static Gps GCJ02ToBD09(double gg_lat, double gg_lon) {
|
||||
double x = gg_lon, y = gg_lat;
|
||||
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * pi);
|
||||
double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * pi);
|
||||
double bd_lon = z * Math.cos(theta) + 0.0065;
|
||||
double bd_lat = z * Math.sin(theta) + 0.006;
|
||||
return new Gps(bd_lat, bd_lon);
|
||||
}
|
||||
|
||||
/**
|
||||
* 国际 GPS84 坐标系
|
||||
* 转换成
|
||||
* 百度坐标系 (BD-09)
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
*/
|
||||
public static Gps GPS84ToBD09(double lat, double lon) {
|
||||
Gps gps = GPS84ToGCJ02(lat,lon);
|
||||
if (gps == null) {
|
||||
return new Gps(lat,lon);
|
||||
}
|
||||
//GCJ-02 转 BD-09
|
||||
return GCJ02ToBD09(gps.getWgLat(), gps.getWgLon());
|
||||
}
|
||||
|
||||
/**
|
||||
* 百度坐标系 (BD-09)
|
||||
* 转换成
|
||||
* 火星坐标系 (GCJ-02)
|
||||
*
|
||||
* @param bd_lon 百度*经度
|
||||
* @param bd_lat 百度*纬度
|
||||
* @return GPS实体类
|
||||
*/
|
||||
public static Gps BD09ToGCJ02(double bd_lat, double bd_lon) {
|
||||
double x = bd_lon - 0.0065, y = bd_lat - 0.006;
|
||||
double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * pi);
|
||||
double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * pi);
|
||||
double gg_lon = z * Math.cos(theta);
|
||||
double gg_lat = z * Math.sin(theta);
|
||||
return new Gps(gg_lat, gg_lon);
|
||||
}
|
||||
|
||||
/**
|
||||
* 百度坐标系 (BD-09)
|
||||
* 转换成
|
||||
* 国际 GPS84 坐标系
|
||||
*
|
||||
* @param bd_lon 百度*经度
|
||||
* @param bd_lat 百度*纬度
|
||||
* @return GPS实体类
|
||||
*/
|
||||
public static Gps BD09ToGPS84(double bd_lat, double bd_lon) {
|
||||
Gps gcj02 = BD09ToGCJ02(bd_lat, bd_lon);
|
||||
Gps map84 = GCJ02ToGPS84(gcj02.getWgLat(),
|
||||
gcj02.getWgLon());
|
||||
return map84;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 不在中国范围内
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @return boolean值
|
||||
*/
|
||||
public static boolean outOfChina(double lat, double lon) {
|
||||
if (lon < 72.004 || lon > 137.8347)
|
||||
return true;
|
||||
return lat < 0.8293 || lat > 55.8271;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转化算法
|
||||
*
|
||||
* @param lon
|
||||
* @param lat
|
||||
* @return
|
||||
*/
|
||||
public static Gps transform(double lat, double lon) {
|
||||
if (outOfChina(lat, lon)) {
|
||||
return new Gps(lat, lon);
|
||||
}
|
||||
double dLat = transformLat(lon - 105.0, lat - 35.0);
|
||||
double dLon = transformLon(lon - 105.0, lat - 35.0);
|
||||
double radLat = lat / 180.0 * pi;
|
||||
double magic = Math.sin(radLat);
|
||||
magic = 1 - ee * magic * magic;
|
||||
double sqrtMagic = Math.sqrt(magic);
|
||||
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
|
||||
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
|
||||
double mgLat = lat + dLat;
|
||||
double mgLon = lon + dLon;
|
||||
return new Gps(mgLat, mgLon);
|
||||
}
|
||||
|
||||
/**
|
||||
* 纬度转化算法
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @return
|
||||
*/
|
||||
public static double transformLat(double x, double y) {
|
||||
double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y
|
||||
+ 0.2 * Math.sqrt(Math.abs(x));
|
||||
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
|
||||
ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0;
|
||||
ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 经度转化算法
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @return
|
||||
*/
|
||||
public static double transformLon(double x, double y) {
|
||||
double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1
|
||||
* Math.sqrt(Math.abs(x));
|
||||
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
|
||||
ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0;
|
||||
ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0
|
||||
* pi)) * 2.0 / 3.0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public interface OnLocationChangeListener {
|
||||
|
||||
/**
|
||||
* 获取最后一次保留的坐标
|
||||
*
|
||||
* @param location 坐标
|
||||
*/
|
||||
void getLastKnownLocation(Location location);
|
||||
|
||||
/**
|
||||
* 当坐标改变时触发此函数,如果Provider传进相同的坐标,它就不会被触发
|
||||
*
|
||||
* @param location 坐标
|
||||
*/
|
||||
void onLocationChanged(Location location);
|
||||
|
||||
/**
|
||||
* provider的在可用、暂时不可用和无服务三个状态直接切换时触发此函数
|
||||
*
|
||||
* @param provider 提供者
|
||||
* @param status 状态
|
||||
* @param extras provider可选包
|
||||
*/
|
||||
void onStatusChanged(String provider, int status, Bundle extras);//位置状态发生改变
|
||||
|
||||
void onProviderEnabled(String provider);
|
||||
|
||||
void onProviderDisabled(String provider);
|
||||
}
|
||||
|
||||
private static class MyLocationListener
|
||||
implements LocationListener {
|
||||
/**
|
||||
* 当坐标改变时触发此函数,如果Provider传进相同的坐标,它就不会被触发
|
||||
*
|
||||
* @param location 坐标
|
||||
*/
|
||||
@Override
|
||||
public void onLocationChanged(Location location) {
|
||||
if (mListener != null) {
|
||||
mListener.onLocationChanged(location);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* provider的在可用、暂时不可用和无服务三个状态直接切换时触发此函数
|
||||
*
|
||||
* @param provider 提供者
|
||||
* @param status 状态
|
||||
* @param extras provider可选包
|
||||
*/
|
||||
@Override
|
||||
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||
if (mListener != null) {
|
||||
mListener.onStatusChanged(provider, status, extras);
|
||||
}
|
||||
switch (status) {
|
||||
case LocationProvider.AVAILABLE:
|
||||
Log.d("onStatusChanged", "当前GPS状态为可见状态");
|
||||
break;
|
||||
case LocationProvider.OUT_OF_SERVICE:
|
||||
Log.d("onStatusChanged", "当前GPS状态为服务区外状态");
|
||||
break;
|
||||
case LocationProvider.TEMPORARILY_UNAVAILABLE:
|
||||
Log.d("onStatusChanged", "当前GPS状态为暂停服务状态");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* provider被enable时触发此函数,比如GPS被打开
|
||||
*/
|
||||
@Override
|
||||
public void onProviderEnabled(String provider) {
|
||||
if (mListener != null) {
|
||||
mListener.onProviderEnabled(provider);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* provider被disable时触发此函数,比如GPS被关闭
|
||||
*/
|
||||
@Override
|
||||
public void onProviderDisabled(String provider) {
|
||||
if (mListener != null) {
|
||||
mListener.onProviderDisabled(provider);
|
||||
}
|
||||
}
|
||||
}
|
||||
//===========================================坐标转换工具end====================================
|
||||
|
||||
|
||||
|
||||
private static final double EARTH_RADIUS = 6378137.0; //地球半径
|
||||
|
||||
|
||||
/**
|
||||
* 计算两个经纬度之间的距离
|
||||
*
|
||||
* @param longitude
|
||||
* @param latitude
|
||||
* @param longitude2
|
||||
* @param latitude2
|
||||
* @return 单位米
|
||||
*/
|
||||
public static double getDistance(double longitude, double latitude, double longitude2, double latitude2) {
|
||||
double lat1 = rad(latitude);
|
||||
double lat2 = rad(latitude2);
|
||||
double a = lat1 - lat2;
|
||||
double b = rad(longitude) - rad(longitude2);
|
||||
double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(b / 2), 2)));
|
||||
s = s * EARTH_RADIUS;
|
||||
s = Math.round(s * 10000) / 10000; //四舍五入
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* 弧度换为角度
|
||||
* @param d
|
||||
* @return
|
||||
*/
|
||||
private static double rad(double d) {
|
||||
return d * Math.PI / 180.0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user